/* Mobile polish layered onto the current release; no clinical logic changes. */
body[data-app-shell] [data-onboarding="submit"] .prechart-midnight {
  min-height: 48px;
  height: auto;
  padding: 10px 16px;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1.25;
}
body[data-app-shell] [data-onboarding="submit"] .prechart-midnight__content {
  display: flex;
  flex: 0 1 auto;
  width: auto;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
body[data-app-shell] [data-onboarding="submit"] .prechart-midnight__mark,
body[data-app-shell] [data-onboarding="submit"] .prechart-midnight__content > svg {
  width: 32px;
  height: 20px;
  flex: 0 0 32px;
}
body[data-app-shell] [data-onboarding="submit"] .prechart-midnight__label {
  width: auto;
  flex: 0 1 auto;
  white-space: nowrap;
  overflow-wrap: normal;
  line-height: 1.25;
}
/* The existing status component mounts/unmounts within this persistent slot.
   Reserve both dimensions so neither the action row nor the title rewraps. */
body[data-app-shell] .clinical-workflow-heading > div:first-child > div.relative > div.whitespace-nowrap {
  flex: 0 0 12ch;
  width: 12ch;
  min-width: 12ch;
  min-height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
body[data-app-shell] .clinical-workflow-heading > div:first-child > div.relative > div.whitespace-nowrap > div {
  animation: none;
}
/* Safari samples the page canvas behind its controls. Match the app canvas,
   including overscroll; override the older inline boot background on html. */
html:has(body[data-app-shell]) {
  background-color: hsl(198 35% 96%) !important;
}
html.dark:has(body[data-app-shell]),
html:has(body[data-app-shell].dark) {
  background-color: hsl(211 57% 7%) !important;
}
body[data-app-shell] {
  background-color: hsl(var(--background));
  min-height: 100svh;
}

/* Keep autosave inside its own permanent bordered status capsule. */
body[data-app-shell] .clinical-workflow-heading > div:first-child > div.relative {
  margin-left: auto;
  max-width: 100%;
}
body[data-app-shell] .clinical-workflow-heading > div:first-child > div.relative > div.whitespace-nowrap {
  box-sizing: border-box;
  flex: 0 0 7.5rem;
  width: 7.5rem;
  min-width: 7.5rem;
  height: 2.75rem;
  min-height: 2.75rem;
  padding: 0 .5rem;
  border: 1px solid hsl(var(--border));
  border-radius: .75rem;
  background: hsl(var(--card));
  color: hsl(var(--muted-foreground));
  justify-content: center;
  overflow: hidden;
}
body[data-app-shell] .clinical-workflow-heading > div:first-child > div.relative > div.whitespace-nowrap:empty::after {
  content: "Autosave";
  font-size: .75rem;
  line-height: 1;
}
body[data-app-shell] .clinical-workflow-heading > div:first-child > div.relative > div.whitespace-nowrap > div {
  width: 100%;
  min-width: 0;
  justify-content: center;
  font-size: .75rem;
  line-height: 1;
}
body[data-app-shell] .clinical-workflow-heading > div:first-child > div.relative > div.whitespace-nowrap svg {
  display: block;
  width: 1rem;
  height: 1rem;
  flex: 0 0 1rem;
}
