/* ORAMA design foundation
   The look of every screen: colour tokens, elevation, type weights and the
   shared components (cards, task lists, section titles, status, buttons).
   Decisions and reasons: design-system/orama/MASTER.md.
   Loaded after the app's own styles, so it refines them without changing
   any screen's content, order or behaviour. Class prefix: ds- */

/* 1. Tokens ------------------------------------------------------------- */
:root {
  --surface: #f5f7fa;
  --surface-raised: #ffffff;
  --surface-sunken: #eef2f6;
  --line: #e2e8f0;
  --line-soft: #edf1f5;
  --line-strong: #cbd5e1;
  --radius-item: 12px;
  --radius-container: 16px;
  --shadow-xs: 0 1px 2px #0e17290a;
  --shadow-sm: 0 1px 2px #0e17290a, 0 6px 16px -8px #0e17291f;
  --shadow-lg: 0 2px 4px #0e17290d, 0 18px 40px -12px #0e172938;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --surface: #0a0a0b;
    --surface-raised: #121214;
    --surface-sunken: #060607;
    --line: #26262a;
    --line-soft: #1c1c1f;
    --line-strong: #3f3f46;
    --shadow-xs: 0 0 0 1px #ffffff08;
    --shadow-sm: inset 0 1px 0 #ffffff0a, 0 1px 2px #000000cc;
    --shadow-lg: inset 0 1px 0 #ffffff0f, 0 0 0 1px #ffffff14, 0 16px 40px -8px #000000;
  }
}
:root[data-theme=dark] {
  --surface: #0a0a0b;
  --surface-raised: #121214;
  --surface-sunken: #060607;
  --line: #26262a;
  --line-soft: #1c1c1f;
  --line-strong: #3f3f46;
  --shadow-xs: 0 0 0 1px #ffffff08;
  --shadow-sm: inset 0 1px 0 #ffffff0a, 0 1px 2px #000000cc;
  --shadow-lg: inset 0 1px 0 #ffffff0f, 0 0 0 1px #ffffff14, 0 16px 40px -8px #000000;
}

/* 2. Type: calmer, tighter headings ------------------------------------- */
.text-display { font-weight: 650; letter-spacing: -0.02em; }
.text-title { letter-spacing: -0.01em; }
.ds-page-head h1 { text-wrap: balance; }

/* 3. Containers ------------------------------------------------------------ */
.rounded-lg { border-radius: var(--radius-container); }
.ds-card { box-shadow: var(--shadow-xs); }

/* 4. Section titles: ink, with the count in a quiet pill ------------------- */
.ds-section-title { color: var(--ink); font-weight: 650; }
.ds-count {
  display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 7px; margin-left: 8px;
  border-radius: 999px; background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink-muted);
  font-size: 12px; line-height: 20px; font-weight: 600; vertical-align: 1px;
}
.ds-section > .ds-section-head + * { margin-top: 0; }

/* 5. Task lists: consecutive task rows form one grouped list -------------- */
:where(div, section, ul, ol):has(> .ds-task):not([class*="grid-cols-2"], [class*="grid-cols-3"]) { row-gap: 0; }
.ds-task {
  position: relative; border-radius: 0; box-shadow: none; border-color: var(--line);
  background: var(--surface-raised); padding: 14px 20px;
}
.ds-task--later { background: var(--surface-raised); }
:not(.ds-task) + .ds-task { margin-top: 12px; }
.ds-task + .ds-task { margin-top: -1px; border-top-color: var(--line-soft); }
.ds-task:first-child, :not(.ds-task) + .ds-task {
  border-top-left-radius: var(--radius-container); border-top-right-radius: var(--radius-container);
}
.ds-task:not(:has(+ .ds-task)) {
  border-bottom-left-radius: var(--radius-container); border-bottom-right-radius: var(--radius-container);
  box-shadow: var(--shadow-xs);
}
.ds-task + :not(.ds-task) { margin-top: 12px; }
/* Tasks laid out side by side stay separate cards */
:is([class*="grid-cols-2"], [class*="grid-cols-3"]) > .ds-task {
  margin-top: 0; border-radius: var(--radius-item); border-top-color: var(--line); box-shadow: var(--shadow-xs);
}
/* Option A rows: time on the left, an icon tile, the task, the patient, one action.
   Lateness is said in the time column and the tile colour, never by a bar. */
.oa-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 14px; }
.oa-when { width: 68px; flex: none; font-size: 13px; line-height: 17px; font-weight: 600; color: var(--ink); padding-top: 2px; font-variant-numeric: tabular-nums; }
.oa-when small { display: block; font-size: 12px; font-weight: 500; color: var(--ink-muted); }
.oa-when--late, .oa-when--late small { color: var(--due-ink); }
.oa-when--risk, .oa-when--risk small { color: var(--bad-ink); }
.oa-tile { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-sunken); color: var(--ink-muted); }
.oa-tile--bad { background: var(--bad-soft); color: var(--bad-ink); }
.oa-tile--due { background: var(--due-soft); color: var(--due-ink); }
.oa-tile--acc { background: var(--accent-soft); color: var(--accent-ink); }
.oa-i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.oa-main { flex: 1 1 320px; min-width: 0; display: grid; gap: 4px; justify-items: start; }
.oa-kick { font-size: 12px; font-weight: 600; line-height: 16px; color: var(--ink-muted); }
.oa-kick--bad { color: var(--bad-ink); }
.oa-kick--due { color: var(--due-ink); }
.oa-title { font-size: 16px; font-weight: 600; line-height: 21px; color: var(--ink); }
.oa-meta { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.oa-id { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.oa-id__name { font: inherit; font-weight: 600; color: var(--accent-ink); background: none; border: 0; padding: 0; cursor: pointer; border-radius: 4px; }
.oa-id__name:hover { text-decoration: underline; }
.oa-id__name:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.oa-flags { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.oa-flag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; line-height: 16px; padding: 2px 7px; border-radius: 6px; border: 1px solid; background: var(--surface-raised); white-space: nowrap; }
.oa-flag .oa-i { width: 13px; height: 13px; stroke-width: 2.2; }
.oa-flag--bad { border-color: color-mix(in srgb, var(--bad) 45%, transparent); color: var(--bad-ink); }
.oa-flag--warn { border-color: color-mix(in srgb, var(--warn) 55%, transparent); color: var(--warn-ink); }
.oa-flag--more { border-color: var(--line-strong); color: var(--ink-muted); }
.oa-act { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.oa-row--risk { background: color-mix(in srgb, var(--bad-soft) 35%, var(--surface-raised)); }
/* Summary tiles share the row evenly, whatever their number */
.oa-tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); }
.oa-tiles .oa-stat .text-figure { font-size: clamp(24px, 2.3vw, 32px); line-height: 1.15; }
/* One list, grouped: rows sit inside a single card with quiet group heads */
.oa-list { border: 1px solid var(--line); border-radius: var(--radius-container); background: var(--surface-raised); box-shadow: var(--shadow-xs); overflow: hidden; }
.oa-list .ds-task { border: 0; border-top: 1px solid var(--line-soft); border-radius: 0 !important; margin: 0 !important; box-shadow: none !important; }
.oa-list > .ds-task:first-child, .oa-list > .oa-grp:first-child, .oa-list > .oa-nowline:first-child { border-top: 0; }
.oa-grp { display: flex; align-items: center; gap: 4px; padding: 14px 20px 6px; border-top: 1px solid var(--line-soft); font-size: 12px; font-weight: 600; line-height: 16px; color: var(--ink-muted); }
.oa-grp span { font-weight: 500; }
.oa-grp--risk { color: var(--bad-ink); }
.oa-pgroup { border-top: 1px solid var(--line-soft); }
.oa-pgroup .ds-task { border-top: 0; padding-top: 10px; }
.oa-pgroup__head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 14px 20px 0 152px; }
.oa-pgroup__head .oa-id__name { font-size: 15px; }
.oa-pgroup__n { font-size: 12px; font-weight: 600; color: var(--ink-muted); }
.oa-nowline { display: flex; align-items: center; gap: 8px; padding: 10px 20px; font-size: 12px; font-weight: 600; color: var(--accent-ink); }
.oa-nowline::after { content: ""; flex: 1; height: 2px; border-radius: 2px; background: var(--accent-ink); opacity: .55; }
.oa-fchips { display: flex; flex-wrap: wrap; gap: 6px; }
.oa-fchip { font: inherit; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; font-size: 13px; font-weight: 600; line-height: 18px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-raised); color: var(--ink); cursor: pointer; white-space: nowrap; }
.oa-fchip span { color: var(--ink-muted); font-weight: 500; }
.oa-fchip:hover { border-color: var(--line-control); }
.oa-fchip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface-raised); }
.oa-fchip[aria-pressed="true"] span { color: inherit; opacity: .75; }
.oa-fchip:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
/* Patient cells carry their safety flags on a line of their own */
:where(button, div) > .oa-flags { margin-top: 3px; }
/* Summary tiles: the icon and label first, then the number, then the detail */
.oa-tilehead { display: flex; min-width: 0; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; line-height: 18px; color: var(--ink-muted); }
@media (max-width: 639px) {
  .oa-pgroup__head { padding-left: 20px; }
  .oa-when { width: auto; flex-basis: 100%; display: flex; gap: 6px; align-items: baseline; padding-top: 0; }
  .oa-when small { display: inline; }
  .oa-row { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 8px 12px; }
  .oa-row > .oa-when { grid-column: 1 / -1; }
  .oa-row > .oa-tile { grid-column: 1; }
  .oa-row > .oa-main { grid-column: 2; }
  .oa-row > .oa-act { grid-column: 2; margin-left: 0; justify-content: flex-start; }
}

/* 6. Status: routine timing is coloured text and an icon, not a pill ------- */
.ds-due--late { height: auto; padding: 0; background: transparent; border-radius: 0; }

/* 7. Buttons --------------------------------------------------------------- */
.ds-btn--primary { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--surface-raised); }
.ds-btn--primary:hover { filter: none; background: color-mix(in srgb, var(--accent-ink) 86%, var(--ink)); }
.ds-btn--primary:active { filter: none; background: color-mix(in srgb, var(--accent-ink) 76%, var(--ink)); }
.ds-btn--secondary { border-color: var(--line-strong); }
.ds-btn--secondary:hover { border-color: var(--line-control); }
.ds-task .ds-btn { min-height: 0; }

/* 8. Search fields: wide enough to show their whole hint ----------------- */
@media (min-width: 640px) { .ds-search { flex-basis: 380px; } }

/* 9. Demo bar: below 1280px its tools move into the "More demo tools" menu,
      so the bar never makes the page scroll sideways */
@media (min-width: 1280px) { .ds-xl-hide { display: none; } }

/* 10. Option A page kit -------------------------------------------------- */
.oa-box { border: 1px solid var(--line); border-radius: var(--radius-container); background: var(--surface-raised); box-shadow: var(--shadow-xs); overflow: hidden; min-width: 0; }
.oa-st { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; line-height: 16px; padding: 3px 8px; border-radius: 6px; white-space: nowrap; width: fit-content; background: var(--surface-sunken); color: var(--ink-muted); }
.oa-st .oa-i { width: 13px; height: 13px; stroke-width: 2.2; }
.oa-st--bad { background: var(--bad-soft); color: var(--bad-ink); }
.oa-st--due { background: var(--due-soft); color: var(--due-ink); }
.oa-st--warn { background: var(--warn-soft); color: var(--warn-ink); }
.oa-st--ok { background: var(--ok-soft); color: var(--ok-ink); }
.oa-st--acc { background: var(--accent-soft); color: var(--accent-ink); }
.oa-st--ai { background: var(--ai-soft, var(--accent-soft)); color: var(--ai-ink); }
.oa-link { font: inherit; display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 4px 2px; color: var(--accent-ink); font-weight: 600; font-size: 14px; cursor: pointer; border-radius: 6px; white-space: nowrap; }
.oa-link:hover { text-decoration: underline; }
.oa-link:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.oa-link .oa-i { width: 16px; height: 16px; }
.ds-btn .oa-i { width: 16px; height: 16px; }
.oa-meta { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.oa-meta b { font-weight: 600; }
.oa-foot { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line-soft); font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.oa-foot .oa-i { width: 16px; height: 16px; }
.oa-grp .oa-i { width: 14px; height: 14px; }
/* Day card: head, strip, table */
.oa-dayhead { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; padding: 16px 20px 12px; }
.oa-dayhead__t { flex: 1 1 280px; min-width: 0; }
.oa-dayhead h2 { margin: 0; font-size: 17px; line-height: 22px; font-weight: 650; color: var(--ink); }
.oa-dayhead h2 span { font-weight: 500; color: var(--ink-muted); }
.oa-dayhead p { margin: 2px 0 0; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.oa-strip { padding: 0 20px 12px; }
.oa-strip__bar { position: relative; height: 34px; border-radius: 10px; background: var(--surface-sunken); }
.oa-sblk { font: inherit; position: absolute; top: 4px; bottom: 4px; display: flex; align-items: center; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 1px solid transparent; text-align: left; }
button.oa-sblk { cursor: pointer; }
button.oa-sblk:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 1px; }
.oa-sblk--ok { background: var(--ok-soft); color: var(--ok-ink); border-color: color-mix(in srgb, var(--ok-ink) 30%, transparent); }
.oa-sblk--due { background: var(--due-soft); color: var(--due-ink); border-color: color-mix(in srgb, var(--due) 45%, transparent); }
.oa-sblk--bad { background: var(--bad-soft); color: var(--bad-ink); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.oa-sblk--neutral { background: var(--surface-raised); color: var(--ink); border-color: var(--line-strong); }
.oa-sblk--booked { background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink-muted); }
.oa-sblk--free { background: var(--surface-raised); color: var(--accent-ink); border: 1px dashed var(--accent-ink); }
.oa-strip__axis { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; font-size: 12px; line-height: 16px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.oa-strip__foot { text-align: center; }
.oa-thead { font-size: 12px; font-weight: 600; line-height: 16px; color: var(--ink-muted); background: var(--surface-sunken); border-top: 1px solid var(--line-soft); padding-top: 9px !important; padding-bottom: 9px !important; }
.oa-thead > span { min-width: 0; }
.oa-thead__tgt { display: flex; justify-content: space-between; gap: 8px; }
.oa-thead__tgt span { font-weight: 500; }
/* Case rows */
.oa-crow { display: grid; grid-template-columns: 72px minmax(0, 1.25fr) minmax(0, 1.45fr) minmax(0, 1.1fr) 150px; gap: 8px 20px; align-items: start; padding: 16px 20px; border-top: 1px solid var(--line-soft); }
.oa-cpt { display: grid; gap: 4px; justify-items: start; min-width: 0; }
.oa-cpt__name { font-size: 16px; line-height: 21px; }
.oa-cjr, .oa-crd { display: grid; gap: 6px; justify-items: start; min-width: 0; }
.oa-crd__h { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink); }
.oa-crow > .oa-act, .oa-wrow > .oa-act { margin-left: 0; justify-content: flex-end; }
.oa-trk { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; width: 100%; max-width: 520px; }
.oa-trk li { display: grid; gap: 5px; font-size: 12px; line-height: 16px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oa-trk li::before { content: ""; height: 4px; border-radius: 2px; background: var(--line); }
.oa-trk li.ok::before { background: var(--ok-ink); }
.oa-trk li.now { color: var(--ink); font-weight: 700; }
.oa-trk li.now::before { background: var(--accent-ink); }
.oa-trk li.bad { color: var(--bad-ink); font-weight: 700; }
.oa-trk li.bad::before { background: var(--bad-ink); }
/* Waiting rows against the 90-day target */
.oa-wrow { display: grid; grid-template-columns: 82px minmax(0, 1.3fr) minmax(0, 1.2fr) minmax(0, 1fr) 160px; gap: 8px 20px; align-items: start; padding: 16px 20px; border-top: 1px solid var(--line-soft); }
.oa-wrow--sur { grid-template-columns: 82px minmax(0, 1.25fr) minmax(0, .8fr) minmax(0, 1.1fr) minmax(0, 1fr) 160px; }
.oa-wsur { display: grid; gap: 2px; font-size: 14px; line-height: 20px; color: var(--ink); }
.oa-wsur small { font-size: 13px; color: var(--ink-muted); }
.oa-tgt { display: grid; gap: 8px; min-width: 0; padding-top: 6px; }
.oa-bar { position: relative; height: 8px; border-radius: 4px; background: var(--line-soft); }
.oa-bar__fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--accent-ink); }
.oa-bar__fill--late { background: var(--bad-ink); }
.oa-bar__mark { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 1px; }
.oa-wslot { display: grid; gap: 6px; justify-items: start; min-width: 0; }
@media (max-width: 1100px) {
  .oa-crow { grid-template-columns: 64px minmax(0, 1fr) auto; }
  .oa-crow > .oa-cjr, .oa-crow > .oa-crd, .oa-crow > .oa-act { grid-column: 2 / -1; }
  .oa-crow > .oa-act, .oa-wrow > .oa-act { justify-content: flex-start; }
  .oa-crow.oa-thead { display: none; }
  .oa-wrow, .oa-wrow--sur { grid-template-columns: 72px minmax(0, 1fr) auto; }
  .oa-wrow > .oa-tgt, .oa-wrow > .oa-wslot, .oa-wrow > .oa-wsur, .oa-wrow > .oa-act { grid-column: 2 / -1; }
  .oa-wrow.oa-thead { display: none; }
}
@media (max-width: 639px) {
  .oa-crow, .oa-wrow, .oa-wrow--sur { grid-template-columns: minmax(0, 1fr); padding: 14px 16px; }
  .oa-crow > *, .oa-wrow > * { grid-column: 1 / -1 !important; }
  .oa-crow > .oa-act, .oa-wrow > .oa-act { justify-content: flex-start; }
  .oa-strip { padding: 0 16px 12px; }
  .oa-dayhead { padding: 14px 16px 10px; }
}
/* Segmented control */
.oa-seg2 { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface-sunken); gap: 2px; }
.oa-seg2 button { font: inherit; font-size: 13px; font-weight: 600; line-height: 18px; min-height: 32px; padding: 6px 12px; border-radius: 9px; border: 0; background: transparent; color: var(--ink-muted); cursor: pointer; white-space: nowrap; }
.oa-seg2 button span { font-weight: 500; }
.oa-seg2 button[aria-pressed="true"] { background: var(--surface-raised); color: var(--ink); box-shadow: 0 1px 2px #0e17291f; }
.oa-seg2 button:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 1px; }
/* Free slot cards */
.oa-slots { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.oa-slot { display: grid; gap: 8px; align-content: start; justify-items: start; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-container); background: var(--surface-raised); box-shadow: var(--shadow-xs); min-width: 0; }
.oa-slot h3 { margin: 0; display: flex; gap: 8px; font-size: 16px; line-height: 21px; font-weight: 650; color: var(--ink); }
.oa-slot h3 span { font-weight: 600; }
.oa-slot p { margin: 0; font-size: 13px; line-height: 18px; }
.oa-slot__pt { display: flex; gap: 8px; align-items: flex-start; width: 100%; padding: 8px 10px; border-radius: 10px; background: var(--surface-sunken); font-size: 14px; line-height: 19px; color: var(--ink); }
.oa-slot__pt .oa-i { width: 16px; height: 16px; margin-top: 2px; color: var(--ink-muted); }
.oa-slot__pt span { display: grid; }
.oa-slot__pt b { font-weight: 600; }
.oa-slot__pt small { font-size: 13px; color: var(--ink-muted); }
.oa-slot__pt--none { color: var(--ink-muted); }
/* Theatre lists */
.oa-h1rel { font-weight: 500; color: var(--ink-muted); font-size: .72em; }
.oa-flip { transform: scaleX(-1); }
.oa-daysel { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-raised); font-weight: 600; font-size: 14px; color: var(--ink); }
.oa-daysel .oa-i { width: 16px; height: 16px; color: var(--ink-muted); }
.oa-daysel select { font: inherit; border: 0; background: transparent; color: inherit; padding: 8px 0; cursor: pointer; }
.oa-daysel:focus-within { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.oa-split { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1200px) { .oa-split { grid-template-columns: minmax(0, 1fr) 380px; } }
.oa-ps { display: grid; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--line-soft); justify-items: start; }
.oa-ps:first-child { border-top: 0; }
.oa-ps__h { margin: 0; display: flex; align-items: baseline; gap: 8px; font-size: 15px; line-height: 20px; font-weight: 650; color: var(--ink); }
.oa-ps__h span { font-size: 13px; font-weight: 500; color: var(--ink-muted); }
.oa-dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 16px; font-size: 14px; line-height: 20px; width: 100%; }
.oa-dl dt { color: var(--ink-muted); }
.oa-dl dd { margin: 0; color: var(--ink); }
.oa-ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.oa-ul b { color: var(--ink); font-weight: 600; }
.oa-id > .oa-id { display: contents; }
.oa-quote { display: block; margin: 2px 0; padding: 8px 12px; border-radius: 10px; background: var(--surface-sunken); font-size: 14px; line-height: 20px; color: var(--ink); quotes: "“" "”"; }
.oa-row .oa-act > .oa-st { align-self: center; }
/* Ward round */
.oa-wardrow { display: grid; grid-template-columns: 28px 52px minmax(0, 1.5fr) 120px minmax(0, .8fr) minmax(0, 1.3fr) 96px; gap: 8px 18px; align-items: start; padding: 16px 20px; border-top: 1px solid var(--line-soft); }
.oa-wardrow--cur { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent-ink); }
.oa-wardrow__bed { font-size: 16px; line-height: 22px; color: var(--ink); }
.oa-num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 999px; background: var(--surface-sunken); font-size: 12px; font-weight: 600; color: var(--ink-muted); }
.oa-roundbar { position: sticky; top: 8px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 16px; border-radius: 14px; background: var(--surface-raised); border: 1px solid var(--accent-ink); color: var(--ink); box-shadow: var(--shadow-lg); }
.oa-roundbar b { font-weight: 650; }
@media (max-width: 1100px) {
  .oa-wardrow { grid-template-columns: 28px 52px minmax(0, 1fr) auto; }
  .oa-wardrow > :nth-child(4), .oa-wardrow > :nth-child(5), .oa-wardrow > :nth-child(6), .oa-wardrow > :nth-child(7) { grid-column: 3 / -1; }
  .oa-wardrow > .oa-act { justify-content: flex-start; }
  .oa-wardrow.oa-thead { display: none; }
}
/* Values in words */
.oa-val { display: inline-flex; align-items: baseline; gap: 5px; font-size: 12px; font-weight: 600; line-height: 16px; padding: 3px 8px; border-radius: 6px; background: var(--bad-soft); color: var(--ink); white-space: nowrap; }
.oa-val b { color: var(--bad-ink); font-weight: 700; }
.oa-val--ok { background: var(--surface-sunken); color: var(--ink-muted); }
.oa-trk--lab { max-width: 560px; }
.oa-alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-item); border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent); background: var(--bad-soft); color: var(--ink); }
.oa-alert b { font-weight: 650; color: var(--bad-ink); }

/* Act first (Today): one box beside the summary tiles */
.oa-top { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }
.oa-top > .oa-tiles { flex: 1 1 520px; min-width: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: start; }
.oa-top > .oa-tiles > :last-child:nth-child(3n+2) { grid-column: span 2; }
@media (max-width: 640px) { .oa-top > .oa-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.oa-af { flex: 1.25 1 520px; min-width: 0; display: flex; flex-direction: column; border: 1px solid color-mix(in srgb, var(--bad) 35%, var(--line)); border-radius: var(--radius-container); background: var(--surface-raised); box-shadow: var(--shadow-xs); }
.oa-af__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; }
.oa-af__ico { width: 28px; height: 28px; border-radius: 8px; }
.oa-af__ico .oa-i { width: 16px; height: 16px; }
.oa-af__title { margin: 0; font-size: 15px; font-weight: 650; line-height: 20px; color: var(--ink); }
.oa-af__count { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px; background: var(--surface-sunken); color: var(--ink-muted); font-size: 12px; font-weight: 600; }
.oa-af__late { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--due-ink); }
.oa-af__list { list-style: none; margin: 0; padding: 0; }
.oa-af__row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line-soft); }
.oa-af__row:last-child { border-radius: 0 0 var(--radius-container) var(--radius-container); }
.oa-af__row--late { background: color-mix(in srgb, var(--bad-soft) 55%, var(--surface-raised)); }
.oa-af__when { width: 64px; flex: none; align-self: flex-start; padding-top: 1px; font-size: 13px; line-height: 17px; font-weight: 600; color: var(--ink); }
.oa-af__when small { display: block; font-size: 12px; font-weight: 500; color: var(--ink-muted); }
.oa-af__when.is-late, .oa-af__when.is-late small { color: var(--due-ink); }
.oa-af__when.is-bad, .oa-af__when.is-bad small { color: var(--bad-ink); }
.oa-af__main { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.oa-af__kick { font-size: 12px; font-weight: 600; line-height: 16px; color: var(--bad-ink); }
.oa-af__kick.is-warn { color: var(--warn-ink); }
.oa-af__ttl { font: inherit; display: block; justify-self: start; max-width: 100%; font-size: 15px; font-weight: 600; line-height: 20px; color: var(--ink); text-align: left; background: none; border: 0; padding: 0; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 4px; }
.oa-af__ttl:hover { text-decoration: underline; }
.oa-af__ttl:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.oa-af__main .oa-id { font-size: 13px; line-height: 18px; }
.oa-af__meta { font-size: 13px; line-height: 18px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oa-af__act { display: flex; align-items: center; gap: 6px; flex: none; }
.oa-af__more { font: inherit; width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-raised); color: var(--ink-muted); cursor: pointer; }
.oa-af__more:hover { border-color: var(--line-control); color: var(--ink); }
.oa-af__more:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.oa-af__more[data-state="open"] { background: var(--ink); border-color: var(--ink); color: var(--surface-raised); }
@media (max-width: 640px) { .oa-af__row { flex-wrap: wrap; } .oa-af__main { flex-basis: calc(100% - 76px); } .oa-af__act { width: 100%; justify-content: flex-end; } .oa-af__ttl { white-space: normal; } }

/* Activity lists in side panels: folded to the latest entries */
.oa-fold { font: inherit; display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 0; background: none; border: 0; cursor: pointer; color: var(--ink-muted); text-align: left; border-radius: 6px; }
.oa-fold:hover { color: var(--ink); }
.oa-fold:focus-visible, .oa-fold__more:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.oa-fold__n { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px; background: var(--surface-sunken); color: var(--ink-muted); font-size: 12px; font-weight: 600; }
.oa-fold__chev { width: 16px; height: 16px; margin-left: auto; transition: transform .15s ease; }
.oa-fold__chev.is-open { transform: rotate(90deg); }
.oa-fold__more { font: inherit; justify-self: start; min-height: 32px; padding: 4px 0; background: none; border: 0; cursor: pointer; color: var(--accent-ink); font-size: 14px; font-weight: 600; border-radius: 6px; }
.oa-fold__more:hover { text-decoration: underline; }
@media (prefers-reduced-motion: reduce) { .oa-fold__chev { transition: none; } }
