/* =============================================================================
   AI Patient Online, staff app: the shared stylesheet.
   Synthetic data only. Every page loads this file and Inter from Google Fonts.

   PAGE HEAD (every page):
     <meta name="viewport" content="width=device-width, initial-scale=1" />
     <meta name="theme-color" content="#0f6b5f" />
     <link rel="icon" href="/favicon.svg" type="image/svg+xml" />
     <link rel="alternate icon" href="/favicon.ico" />
     <link rel="preconnect" href="https://fonts.googleapis.com" />
     <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
     <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" />
     <link rel="stylesheet" href="app.css" />

   PAGE LAYOUT (signed-in pages):
     <header class="bar"></header>        common.js renderNav() fills it (logo, nav tabs, user area).
     <main>
       <div class="page-head"><div><h1>Title</h1><p class="page-sub">One line.</p></div></div>
       ... cards ...
     </main>

   REUSABLE CLASSES (the login and admin pages use these):
     .card                 White rounded box: 1px border, radius 12px, 20px padding.
     .card-header          Row at the top of a card: title (h2) on the left, actions on the right.
     .kpi-row              Responsive grid of KPI tiles.
     .kpi                  KPI tile (a card). Children:
       .kpi-label          Small muted label.
       .kpi-value          Big number (30px, 600). Add .good (green), .bad (red) or .warn (amber).
       .kpi-caption        Small muted caption under the number.
     .btn                  Base button (white, gray border, radius 8px).
     .btn-primary          Solid teal, white text.
     .btn-secondary        White, 1px teal border, teal text.
     .btn-danger           Solid red, white text.
     .btn-link             Text-only button (teal text, no box).
     .btn-sm               Smaller button.  :disabled buttons turn gray.
     .badge                Small rounded pill. Colors:
       .badge-red .badge-amber .badge-blue .badge-green .badge-gray .badge-solid-red
     .field                Label + input stack:  <div class="field"><label>..</label><input>..<span class="hint">..</span></div>
     .form-error           Red tinted message box (empty = hidden).
     .form-ok              Green tinted message box (empty = hidden).
     .alert                Tinted banner. Add .alert-red, .alert-amber or .alert-green.
     .muted                Muted gray text.
     .small                13px text.
     .mono                 Monospace text (due times, ids, numbers).
     .auth-shell           Full-height centered layout for a narrow sign-in card (max-width 420px).
                           <div class="auth-shell"><div class="auth-brand">..</div><div class="card">..</div></div>
     .table                Styled table: uppercase small muted headers, roomy rows, 1px row lines.
     .table-wrap           Wrap a wide table: it scrolls inside its card, never the page.
     .toolbar              Flex row with a gap that wraps. Add .toolbar-end to push items right.
     .empty                Muted empty-state text.
   ============================================================================= */

:root {
  color-scheme: light;
  /* surfaces and text */
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --surface-3: #f2f4f7;
  --text: #1f2933;
  --text-2: #52606d;
  --text-3: #7b8794;
  --border: #e5e7eb;
  --border-strong: #d0d5dd;
  /* accent */
  --accent: #0f6b5f;
  --accent-hover: #0b574d;
  --accent-tint: #e6f2ef;
  --accent-text: #0f6b5f;
  --on-accent: #ffffff;
  --focus-ring: rgba(15, 107, 95, 0.28);
  /* status tints */
  --red-bg: #fde8e8;   --red: #b42318;   --red-solid: #b42318;
  --amber-bg: #fef3c7; --amber: #92400e;
  --blue-bg: #e8f0fe;  --blue: #1d4ed8;
  --green-bg: #e7f6ec; --green: #166534; --green-strong: #15803d;
  --gray-bg: #f2f4f7;  --gray: #475467;
  /* type and shape */
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04);

  /* Older names, kept so page-local rules still resolve. */
  --paper: var(--bg);
  --panel: var(--surface);
  --ink: var(--text);
  --steel: var(--text-2);
  --line: var(--border);
  --care: var(--accent);
  --care-tint: var(--accent-tint);
  --urgent: var(--red);
  --urgent-tint: var(--red-bg);
  --wait: var(--amber);
  --wait-tint: var(--amber-bg);
  --sign: var(--font);
  --read: var(--font);
}

/* Dark palette: the OS setting, unless the page forces light with data-theme="light". */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #0f1418; --surface: #171d23; --surface-2: #1c232a; --surface-3: #222a32;
    --text: #e4e7eb; --text-2: #a3adb8; --text-3: #7f8a96;
    --border: #2a333c; --border-strong: #3a4550;
    --accent: #14806f; --accent-hover: #189a86; --accent-tint: #133b35; --accent-text: #5fd0bd; --on-accent: #ffffff;
    --focus-ring: rgba(95, 208, 189, 0.35);
    --red-bg: #3d1717; --red: #fca5a5; --red-solid: #c2362b;
    --amber-bg: #3a2b0b; --amber: #fcd34d;
    --blue-bg: #172449; --blue: #9dbdff;
    --green-bg: #11301e; --green: #86efac; --green-strong: #4ade80;
    --gray-bg: #242c35; --gray: #c3cad3;
    --shadow: none;
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0f1418; --surface: #171d23; --surface-2: #1c232a; --surface-3: #222a32;
  --text: #e4e7eb; --text-2: #a3adb8; --text-3: #7f8a96;
  --border: #2a333c; --border-strong: #3a4550;
  --accent: #14806f; --accent-hover: #189a86; --accent-tint: #133b35; --accent-text: #5fd0bd; --on-accent: #ffffff;
  --focus-ring: rgba(95, 208, 189, 0.35);
  --red-bg: #3d1717; --red: #fca5a5; --red-solid: #c2362b;
  --amber-bg: #3a2b0b; --amber: #fcd34d;
  --blue-bg: #172449; --blue: #9dbdff;
  --green-bg: #11301e; --green: #86efac; --green-strong: #4ade80;
  --gray-bg: #242c35; --gray: #c3cad3;
  --shadow: none;
}

/* ---- base ----------------------------------------------------------------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.5 var(--font);
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-text); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

h1 { font-size: 26px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; margin: 0; }
h2 { font-size: 16px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 12px; }
h3 { font-size: 14px; line-height: 1.3; font-weight: 600; margin: 0 0 8px; color: var(--text); }
p { margin: 0 0 12px; }

.muted { color: var(--text-2); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 0.92em; font-variant-numeric: tabular-nums; }
.hint { font-size: 13px; color: var(--text-2); }
.empty { padding: 24px 4px; color: var(--text-2); text-align: center; }

main { padding: 28px 32px 48px; max-width: 1360px; margin: 0 auto; }

/* ---- the main menu: a left sidebar (built by common.js renderNav) ------------------------------
   Nov 10, Shawn: "is it maybe time to move the menu to the left side and make it collapsible?". Full width shows
   the groups with icons and names; .nav-mini on <html> shrinks it to an icon rail (tooltips from common.js). At
   900px or less it is a drawer behind the .mbar top bar. Selectors say header.bar: some pages use .bar for their
   own bars. */
:root { --side-w: 244px; --side-mini: 72px; --bar-h: 0px; }
body:has(> header.bar) { padding-left: var(--side-w); transition: padding-left 0.2s ease; }
html.nav-mini body:has(> header.bar) { padding-left: var(--side-mini); }
header.bar {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 40; width: var(--side-w); height: auto; min-height: 0;
  display: flex; flex-direction: column; gap: 6px; padding: 16px 12px 12px; box-sizing: border-box; overflow: visible;
  background: var(--surface); border: 0; border-right: 1px solid var(--border); border-radius: 0;
  transition: width 0.2s ease, transform 0.22s ease;
}
html.nav-mini header.bar { width: var(--side-mini); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); flex: none; min-width: 0; }
.brand:hover { color: var(--text); }
header.bar > .brand { padding: 2px 6px 12px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #6366f1));
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 35%, transparent);
}
.brand-mark svg { width: 18px; height: 18px; }
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; white-space: nowrap; }
.brand-sub { font-size: 11px; color: var(--accent-text); background: var(--accent-tint); font-weight: 700; padding: 2px 7px; border-radius: 999px; letter-spacing: 0.02em; }

header.bar nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; display: grid; align-content: start; gap: 14px; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; }
.ngroup { display: grid; gap: 2px; }
.ng-title { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); padding: 0 10px 4px; white-space: nowrap; }
header.bar nav a, .side-toggle {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px; border: 0; background: none;
  color: var(--text-2); text-decoration: none; font: inherit; font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer; text-align: left;
  transition: background 0.12s, color 0.12s, transform 0.12s;
}
header.bar nav a:hover, .side-toggle:hover { color: var(--text); background: var(--surface-3); }
header.bar nav a:active { transform: scale(0.98); }
header.bar nav a:focus-visible, .side-toggle:focus-visible, .nav-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
header.bar nav a[aria-current] { background: var(--accent-tint); color: var(--accent-text); font-weight: 650; position: relative; }
header.bar nav a[aria-current]::before { content: ''; position: absolute; left: -4px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--accent); }
.ni { width: 20px; height: 20px; flex: none; display: grid; place-items: center; }
.ni svg { width: 19px; height: 19px; }
/* A menu name is never cut: a long one takes a second line (QA, Nov 14, R16: "Questions for Dr. Kheterp" when the menu
   shows its scroll bar). */
.nl { white-space: normal; overflow-wrap: break-word; min-width: 0; line-height: 1.3; }
.side-foot { flex: none; display: grid; gap: 6px; padding-top: 8px; border-top: 1px solid var(--border); }
.side-toggle { width: 100%; font-size: 13px; color: var(--text-3); }
.side-toggle .ni svg { transition: transform 0.2s ease; }
html.nav-mini .side-toggle .ni svg { transform: scaleX(-1); }

/* The practice switch (common.js drawScope, src/practiceScope.ts): which practice this browser works in. */
.pswitch { margin: 0 0 4px; }
.pswitch[hidden] { display: none; }
.pswitch > summary {
  gap: 10px; padding: 7px 8px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2, var(--surface)); color: var(--text);
}
.pswitch > summary:hover { background: var(--surface-3); }
.ps-mono {
  width: 28px; height: 28px; border-radius: 8px; flex: none; display: grid; place-items: center; font-size: 11.5px; font-weight: 750;
  background: var(--accent-tint); color: var(--accent-text); letter-spacing: 0.02em;
}
.ps-mono.test { background: var(--amber-bg); color: var(--amber); }
.ps-t { display: grid; min-width: 0; flex: 1 1 auto; text-align: left; line-height: 1.25; }
.ps-t b { font-size: 13.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-t span { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pswitch .menu-pop { left: 0; right: 0; min-width: 240px; }
.ps-head { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); padding: 6px 10px 4px; }
.menu-item.ps-item { display: flex; align-items: center; gap: 10px; }
.menu-item.ps-item[aria-current] { background: var(--accent-tint); }
.pswitch .ps-all { margin-top: 4px; border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; font-size: 13px; color: var(--accent-text); }
.ps-err { margin: 6px 10px 2px; font-size: 12.5px; color: var(--red); white-space: normal; }
html.in-test-practice .pswitch > summary { border-color: color-mix(in srgb, var(--amber) 55%, var(--border)); background: var(--amber-bg); }

/* The icon rail. */
html.nav-mini header.bar > .brand { justify-content: center; padding: 2px 0 12px; }
html.nav-mini header.bar .brand-name, html.nav-mini header.bar .brand-sub, html.nav-mini header.bar .nl,
html.nav-mini header.bar .acct-name, html.nav-mini header.bar .acct .chev,
html.nav-mini header.bar .pswitch > summary .ps-t, html.nav-mini header.bar .pswitch > summary .chev { display: none; }
html.nav-mini header.bar .pswitch > summary { justify-content: center; padding: 5px 0; }
html.nav-mini header.bar .pswitch .menu-pop { left: calc(100% + 10px); right: auto; top: 0; }
html.nav-mini .ng-title { height: 1px; padding: 0; margin: 2px 12px 6px; overflow: hidden; color: transparent; background: var(--border); }
html.nav-mini header.bar nav a, html.nav-mini .side-toggle { justify-content: center; padding: 10px 0; }
html.nav-mini header.bar .acct > summary { justify-content: center; border-color: transparent; padding: 4px; }
html.nav-mini header.bar .acct .menu-pop { left: calc(100% + 10px); bottom: 0; }
.nav-tip {
  position: fixed; z-index: 60; transform: translateY(-50%); pointer-events: none; white-space: nowrap;
  padding: 5px 10px; border-radius: 8px; font-size: 13px; font-weight: 600;
  background: var(--text); color: var(--surface); box-shadow: 0 6px 18px rgb(0 0 0 / 0.2);
}
.nav-tip[hidden] { display: none; }

/* The phone: a top bar with the menu button; the sidebar is a drawer. */
.mbar, .nav-scrim { display: none; }
@media (max-width: 900px) {
  :root { --bar-h: 56px; }
  body:has(> header.bar), html.nav-mini body:has(> header.bar) { padding-left: 0; }
  .mbar {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; height: var(--bar-h); padding: 0 12px;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
  }
  .mbar .brand-sub { display: none; }
  .nav-btn { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 10px; background: none; color: var(--text); cursor: pointer; }
  .nav-btn:hover { background: var(--surface-3); }
  .nav-btn svg { width: 22px; height: 22px; }
  header.bar, html.nav-mini header.bar { width: min(300px, 86vw); transform: translateX(-102%); box-shadow: 0 0 40px rgb(0 0 0 / 0.25); }
  html.nav-open header.bar { transform: none; }
  .nav-scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgb(0 0 0 / 0.35); opacity: 0; pointer-events: none; transition: opacity 0.2s; }
  html.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }
  /* The drawer always shows the names; the collapse button is for wide screens. */
  html.nav-mini header.bar > .brand { justify-content: flex-start; padding: 2px 6px 12px; }
  html.nav-mini header.bar .brand-name, html.nav-mini header.bar .nl, html.nav-mini header.bar .acct-name, html.nav-mini header.bar .acct .chev { display: revert; }
  html.nav-mini .ng-title { height: auto; padding: 0 10px 4px; margin: 0; color: var(--text-3); background: none; }
  html.nav-mini header.bar nav a { justify-content: flex-start; padding: 8px 10px; }
  html.nav-mini header.bar .acct > summary { justify-content: flex-start; border-color: var(--border); padding: 4px 8px 4px 4px; }
  html.nav-mini header.bar .acct .menu-pop { left: 0; bottom: calc(100% + 8px); }
  .side-toggle { display: none; }
}

/* Drop-down menus in the header (<details>): "More" and the account menu. */
.menu { position: relative; flex: none; }
.menu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; user-select: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.menu .chev { width: 14px; height: 14px; flex: none; transition: transform 0.15s; }
.menu[open] .chev { transform: rotate(180deg); }
.menu-pop {
  position: absolute; top: calc(100% + 8px); z-index: 30; min-width: 220px; max-width: min(320px, calc(100vw - 24px));
  display: grid; padding: 6px; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 12px; box-shadow: 0 10px 30px rgb(0 0 0 / 0.18);
}
.acct .menu-pop { left: 0; top: auto; bottom: calc(100% + 8px); }
.menu-pop a, .menu-item {
  display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; border: 0; background: none;
  color: var(--text); text-decoration: none; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.menu-pop a:hover, .menu-item:hover { background: var(--surface-3); color: var(--text); }
.menu-pop a[aria-current] { background: var(--accent-tint); color: var(--accent-text); font-weight: 600; }

.acct > summary { padding: 4px 8px 4px 4px; border-radius: 999px; border: 1px solid var(--border); color: var(--text); }
.acct-name { flex: 1 1 auto; }
.acct > summary:hover { background: var(--surface-3); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 700; letter-spacing: 0.02em;
}
.acct-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.acct-head { display: grid; gap: 1px; padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.acct-head b { font-size: 14px; overflow-wrap: anywhere; }
.acct-head span { font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere; }
.acct-head span:empty { display: none; }
.acct .menu-item { color: var(--red); margin-top: 4px; }

/* ---- Act as (Nov 11): an admin sees the app as one person sees it (common.js). Look only. -------------------- */
.acct .menu-item.act-item { color: var(--text); margin-top: 0; }
.acct .menu-item.act-stop { color: var(--amber); background: var(--amber-bg); font-weight: 650; margin-top: 2px; white-space: normal; }
.acct .menu-item.act-stop:hover { background: color-mix(in srgb, var(--amber-bg) 80%, var(--amber)); color: var(--amber); }
html.acting header.bar .acct > summary { border-color: var(--amber); background: var(--amber-bg); box-shadow: 0 0 0 2px color-mix(in srgb, var(--amber) 25%, transparent); }
html.acting header.bar .acct .avatar { background: var(--amber); color: var(--amber-bg); }
.acting-label { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--amber); line-height: 1.2; }
.acting-chip {
  position: fixed; right: 16px; bottom: 16px; z-index: 50; display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px);
  padding: 8px 8px 8px 12px; border-radius: 999px; background: var(--amber-bg); color: var(--amber);
  border: 1px solid var(--amber); box-shadow: 0 8px 24px rgb(0 0 0 / 0.18); font-size: 13px;
}
.acting-chip .ac-icon { display: grid; place-items: center; flex: none; }
.acting-chip .ac-icon svg { width: 18px; height: 18px; }
.acting-chip .ac-text { display: grid; line-height: 1.25; min-width: 0; }
.acting-chip .ac-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acting-chip .ac-sub { font-size: 11.5px; opacity: 0.85; }
.acting-chip .ac-stop {
  flex: none; border: 0; border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 13px;
  background: var(--amber); color: var(--amber-bg); cursor: pointer;
}
.acting-chip .ac-stop:hover { filter: brightness(1.1); }
.acting-chip .ac-stop:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
html.nav-open .acting-chip { display: none; }
/* The "Act as" submenu: beside the account menu on wide screens, under the item in the phone drawer. */
.act-wrap { position: relative; }
.acct .menu-item.act-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.act-item .sub-chev { width: 15px; height: 15px; flex: none; color: var(--text-2); transition: transform 0.15s; }
.act-wrap.open > .act-item { background: var(--surface-3); }
.act-item:focus-visible, .act-person:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.act-sub {
  position: absolute; left: calc(100% + 10px); bottom: -6px; z-index: 31; display: grid; align-content: start; gap: 1px;
  min-width: 240px; max-width: min(320px, calc(100vw - 24px)); max-height: min(420px, calc(100vh - 24px)); overflow-y: auto;
  padding: 6px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: 0 10px 30px rgb(0 0 0 / 0.18);
}
.act-sub[hidden] { display: none; }
/* Keeps the hover alive while the pointer crosses the gap from the item to the submenu. */
.act-sub::before { content: ''; position: absolute; right: 100%; top: 0; bottom: 0; width: 12px; }
.act-person {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px;
  background: none; text-align: left; color: var(--text); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
}
.act-person:hover, .act-person:focus { background: var(--accent-tint); color: var(--accent-text); }
.act-person:disabled { cursor: wait; opacity: 0.6; }
.act-person.starting { opacity: 1; background: var(--amber-bg); color: var(--amber); }
.act-person .ap-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-person .ap-role { flex: none; font-size: 12px; font-weight: 600; color: var(--text-2); }
.act-note { margin: 0; padding: 8px 10px; font-size: 13px; color: var(--text-2); white-space: normal; }
.act-note[role=alert] { color: var(--red); }
@media (max-width: 900px) {
  .act-sub { position: static; min-width: 0; max-width: none; max-height: 260px; margin: 2px 0 4px 10px; padding: 2px 0 2px 8px; border: 0; border-left: 2px solid var(--border); border-radius: 0; box-shadow: none; }
  .act-sub::before { display: none; }
  .act-wrap.open .sub-chev { transform: rotate(90deg); }
}

/* ---- page heading ------------------------------------------------------------ */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head-sticky { position: sticky; top: 0; z-index: 15; background: var(--bg); margin: -12px -4px 16px; padding: 12px 4px; border-bottom: 1px solid var(--border); }
main:has(.page-head-sticky) .crp { top: 88px; }
@media (max-width: 900px) {
  .page-head-sticky { top: var(--bar-h); }
  main:has(.page-head-sticky) .crp { top: calc(var(--bar-h) + 88px); }
}
.page-head > div { min-width: 0; }
.eyebrow { font-size: 13px; color: var(--text-2); margin: 0 0 4px; font-weight: 500; }
.page-sub { margin: 6px 0 0; color: var(--text-2); font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.page-sub .sep { color: var(--border-strong); }

/* ---- card ------------------------------------------------------------------ */
.card, .panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 24px; min-width: 0; box-shadow: var(--shadow);
}
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-header h2 { margin: 0; }
.card-sub { color: var(--text-2); font-size: 13px; margin: 0 0 16px; }
.card-header:has(+ .card-sub) { margin-bottom: 4px; }
.card > h2:first-child, .panel > h2:first-child { margin-bottom: 4px; }
.stack { display: grid; gap: 20px; }

/* ---- KPI tiles ---------------------------------------------------------------- */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; min-width: 0; box-shadow: var(--shadow); }
.kpi-label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.kpi-value { font-size: 30px; line-height: 1.15; font-weight: 600; letter-spacing: -0.02em; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.kpi-value.good { color: var(--green-strong); }
.kpi-value.bad { color: var(--red); }
.kpi-value.warn { color: var(--amber); }
.kpi-caption { font-size: 12.5px; color: var(--text-2); }
a.kpi { text-decoration: none; color: inherit; display: block; }
a.kpi:hover { border-color: var(--border-strong); }

/* ---- buttons -------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  border-radius: var(--radius-sm); padding: 8px 14px; font-size: 14px; font-weight: 600; line-height: 1.3;
  white-space: nowrap; text-decoration: none; transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-3); color: var(--text); }
.btn-primary, .btn.care { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover, .btn.care:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.btn-secondary { background: var(--surface); border-color: var(--accent); color: var(--accent-text); }
.btn-secondary:hover { background: var(--accent-tint); border-color: var(--accent); color: var(--accent-text); }
.btn-danger, .btn.stop { background: var(--red-solid); border-color: var(--red-solid); color: #fff; }
.btn-danger:hover, .btn.stop:hover { background: #912018; border-color: #912018; color: #fff; }
.btn-link { background: none; border: 0; padding: 4px 2px; color: var(--accent-text); font-weight: 600; font-size: 14px; }
.btn-link:hover { color: var(--accent-hover); text-decoration: underline; background: none; }
.btn-sm, .btn.small { padding: 5px 10px; font-size: 13px; }
.btn:disabled, .btn[aria-disabled='true'], .btn-link:disabled {
  background: var(--surface-3); border-color: var(--border); color: var(--text-3); cursor: not-allowed;
}
.mic[aria-pressed='true'] { background: var(--red-solid); color: #fff; border-color: var(--red-solid); }

/* ---- badges ------------------------------------------------------------------------- */
.badge, .prio, .state, .pill, .status, .sev {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 600; line-height: 1; letter-spacing: 0.03em;
  padding: 5px 9px; border-radius: 999px; white-space: nowrap; text-transform: uppercase;
  background: var(--gray-bg); color: var(--gray);
}
.badge { text-transform: none; letter-spacing: 0; font-size: 12.5px; padding: 4px 10px; }
.page-sub .badge { white-space: normal; line-height: 1.3; }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-solid-red { background: var(--red-solid); color: #fff; }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-gray { background: var(--gray-bg); color: var(--gray); }
.badge-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* task priority (the practitioner's Part 8): class is the first word of the priority */
.prio.EMERGENT, .prio.HOSPITAL { background: var(--red-solid); color: #fff; }
.prio.URGENT { background: var(--red-bg); color: var(--red); }
.prio.SAME { background: var(--amber-bg); color: var(--amber); }
.prio.ROUTINE { background: var(--blue-bg); color: var(--blue); }

/* call / presence state */
.state.connected, .state.available { background: var(--green-bg); color: var(--green); }
.state.holding, .state.ringing, .state.waiting, .state.callback_offer, .state.hold_or_callback, .state.checking, .state.busy, .state.break { background: var(--amber-bg); color: var(--amber); }
.state.agent, .state.on-call { background: var(--blue-bg); color: var(--blue); }
.state.urgent, .state.emergency { background: var(--red-bg); color: var(--red); }
.state.ended, .state.offline { background: var(--gray-bg); color: var(--text-2); }
.state:empty { display: none; }

/* urgency pill (call logs) */
.pill.urgent { background: var(--red-bg); color: var(--red); }
.pill.emergent { background: var(--red-solid); color: #fff; }
.pill.conn { background: var(--blue-bg); color: var(--blue); }
/* a test call (site test run or local offline run) in Call logs */
.pill.test { background: var(--amber-bg); color: var(--amber); }
/* Co-pilot demo calls in Call logs (public/calls-copilot.js). */
.pill.copilot { background: var(--blue-bg); color: var(--blue); }
.pill.cp-followed { background: var(--green-bg); color: var(--green); }
.pill.cp-partly, .pill.cp-went_away, .pill.cp-not_needed, .pill.cp-no_check { background: var(--surface-3); color: var(--text-2); }
.pill.cp-not_followed { background: var(--red-bg); color: var(--red); }
.cp-card { border: 1px solid var(--border); border-left: 4px solid var(--blue); border-radius: var(--radius-sm); padding: 8px 10px; background: var(--surface); font-size: 14px; }
.cp-card.cp-red { border-left-color: var(--red); }
.cp-card.cp-unseen { border-style: dashed; }
.cp-card details > summary { cursor: pointer; }
/* A call's tasks and actions in its transcript, one color a kind (public/call-actions.js; Shawn, Nov 13). */
.act-copilot { --act: var(--blue); }
.act-er { --act: var(--red); }
.act-page { --act: var(--amber); }
.act-alert { --act: var(--amber); }
.act-task { --act: var(--green); }
.act-text { --act: var(--gray); }
.act-transfer { --act: var(--accent); }
.act-review { --act: #8b5cf6; }
.act { align-self: stretch; border: 1px solid var(--border); border-left: 4px solid var(--act); border-radius: var(--radius-sm); background: var(--surface); padding: 6px 10px; font-size: 13px; overflow-wrap: anywhere; }
.cp-card[class*='act-'] { border-left-color: var(--act); }
.act-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 2px 0 8px; color: var(--text-2); }
.act-key { display: inline-flex; align-items: center; gap: 6px; }
.act-key i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--act); }
.tr-ev[data-act] > summary { border-left: 4px solid var(--act); padding-left: 6px; }
.tr-ev[data-act='task'] { --act: var(--green); }
.tr-ev[data-act='er'] { --act: var(--red); }
.tr-ev[data-act='page'] { --act: var(--amber); }
.tr-ev[data-act='text'] { --act: var(--gray); }
.tr-ev[data-act='transfer'] { --act: var(--accent); }
.cp-list { list-style: none; padding: 0; margin: 6px 0; }
.cp-list li { margin: 4px 0; }
.cp-compare { border-collapse: collapse; margin: 6px 0; font-size: 14px; }
.cp-compare th, .cp-compare td { border: 1px solid var(--border); padding: 4px 8px; text-align: left; vertical-align: top; }

/* queue status and check severity */
.status.held, .status.pending { background: var(--blue-bg); color: var(--blue); }
.status.confirmed, .status.approved, .status.bridged { background: var(--green-bg); color: var(--green); }
.status.to_doctor { background: var(--amber-bg); color: var(--amber); }
.status.expired, .status.denied, .status.released { background: var(--red-bg); color: var(--red); }
.sev { margin-right: 8px; }
.sev.contraindicated, .sev.allergy { background: var(--red-solid); color: #fff; }
.sev.caution, .sev.duplicate { background: var(--amber-bg); color: var(--amber); }

/* Claude grade */
.gr {
  display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px;
  font-size: 12.5px; font-weight: 700; border-radius: 7px; text-decoration: none;
  background: var(--green-bg); color: var(--green);
}
.gr.C, .gr.D { background: var(--amber-bg); color: var(--amber); }
.gr.F { background: var(--red-solid); color: #fff; }

/* ---- forms ------------------------------------------------------------------------- */
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=search], input[type=number], input:not([type]), select, textarea {
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 9px 12px;
  background: var(--surface); color: var(--text); font-size: 14px; line-height: 1.4; max-width: 100%;
  transition: border-color 0.12s, box-shadow 0.12s;
}
select { padding-right: 32px; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-3); color: var(--text-3); cursor: not-allowed; }
input::placeholder, textarea::placeholder { color: var(--text-3); }
label { font-size: 14px; font-weight: 500; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; min-width: 0; }
.field > label { font-size: 13.5px; font-weight: 600; color: var(--text); }
.field > input, .field > select, .field > textarea { width: 100%; }
.field .hint { margin: 0; }
.form-error, .form-ok { border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13.5px; margin: 0 0 14px; }
.form-error { background: var(--red-bg); color: var(--red); }
.form-ok { background: var(--green-bg); color: var(--green); }
.form-error:empty, .form-ok:empty { display: none; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.toolbar-end { margin-left: auto; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* ---- alerts ------------------------------------------------------------------------- */
.alert {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 16px; font-size: 14px;
  background: var(--red-bg); color: var(--red); border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
}
.alert b { font-weight: 700; letter-spacing: 0.02em; }
.alert .btn { margin-left: auto; }
.alert-red { background: var(--red-bg); color: var(--red); }
.alert-amber { background: var(--amber-bg); color: var(--amber); }
.alert-green { background: var(--green-bg); color: var(--green); }
.alert-blue { background: var(--blue-bg); color: var(--blue); }
.flag { display: block; background: var(--red-bg); color: var(--red); border-radius: var(--radius-sm); padding: 10px 14px; margin: 0 0 8px; font-weight: 600; font-size: 14px; }
.tflag { display: block; font-size: 12.5px; color: var(--amber); margin-top: 2px; }

/* ---- tables ----------------------------------------------------------------------- */
.table, .card table, .panel table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .card th, .panel th {
  text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-3); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td, .card td, .panel td { padding: 14px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr:last-child td, .card tbody tr:last-child td, .panel tbody tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child, .card th:first-child, .card td:first-child { padding-left: 0; }
.table th:last-child, .table td:last-child, .card th:last-child, .card td:last-child { padding-right: 0; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -24px; padding: 0 24px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.open-row, tr.callrow { cursor: pointer; }
tr.open-row:hover td, tr.callrow:hover td { background: var(--surface-2); }
tr.open-row[data-open] td { background: var(--accent-tint); }
tr.detail-row > td { background: var(--surface-2); padding: 16px 16px !important; }
.cell-title { font-weight: 600; }
.cell-sub { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.due { font-family: var(--mono); font-size: 12px; color: var(--text-2); margin-top: 6px; white-space: nowrap; }
.due.late { color: var(--red); font-weight: 600; }

/* ---- timelines and transcripts --------------------------------------------------- */
.timeline, .tl { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13.5px; }
.timeline li, .tl li { display: grid; grid-template-columns: 64px 1fr; gap: 10px; padding: 3px 0; }
.timeline .t, .tl time { font-family: var(--mono); font-size: 12px; color: var(--text-3); text-align: right; padding-top: 1px; }
.tl .safety { color: var(--red); font-weight: 600; }
.tl.graded .k-caller > span > span, .tl.graded .k-ai > span > span { color: var(--text-2); }
.tl.graded .k-step > span > span { font-weight: 600; }
.tlturn { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.tlnote { font-size: 12.5px; margin-top: 2px; }
.tlnote.pass { color: var(--green, #2e7d32); }
.tlnote.fail { color: var(--red); }
.tlnote.minor { color: var(--amber, #b26a00); }
.tlnote .mono { font-family: var(--mono); font-size: 11px; opacity: .8; }

.convo { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; padding: 4px; }
.line { max-width: 86%; padding: 9px 13px; border-radius: 12px; background: var(--surface-3); font-size: 14px; overflow-wrap: anywhere; }
.line .who { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 2px; }
.line.agent { background: var(--blue-bg); border-bottom-left-radius: 4px; }
.line.caller { align-self: flex-end; background: var(--accent-tint); border-bottom-right-radius: 4px; }
.line.staff { background: var(--amber-bg); }
.line.system { align-self: center; background: none; color: var(--text-2); font-size: 13px; padding: 2px 8px; }
.say { display: flex; gap: 8px; margin-top: 12px; }
.say input { flex: 1; min-width: 0; }

/* ---- call board ------------------------------------------------------------------------ */
.board { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; align-items: start; }
.board-top { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; margin-bottom: 20px; align-items: stretch; }
.staffrow { display: flex; gap: 10px; flex-wrap: wrap; }
.staffrow .who {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 12px; display: flex; gap: 10px; align-items: center; min-width: 0;
}
.staffrow .who b { font-size: 14px; font-weight: 600; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--accent-tint); color: var(--accent-text); font-size: 11.5px; font-weight: 700;
}
#oncallPhone { width: 12em; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.say-line { font-size: 13.5px; margin: 0 0 6px; }

/* ---- staff app ------------------------------------------------------------------------- */
.me { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.me .name { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
/* A tab bar wraps onto a second line on a narrow screen; no tab is cut off (QA, Nov 14, R7; test/layoutCheck.ts). */
.seg { display: inline-flex; flex-wrap: wrap; max-width: 100%; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 8px 14px; font-weight: 600; font-size: 13.5px; color: var(--text-2); }
.seg button + button { border-left: 1px solid var(--border); }
.seg button:hover { background: var(--surface-2); color: var(--text); }
.seg button[aria-pressed='true'] { background: var(--accent); color: var(--on-accent); }

/* The one bold moment: an incoming transfer. */
.incoming { border: 2px solid var(--accent); border-radius: 16px; background: var(--surface); padding: 28px 32px; margin-bottom: 24px; }
.incoming.urgent { border-color: var(--red-solid); }
.incoming .kicker { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-text); }
.incoming.urgent .kicker { color: var(--red); }
.incoming .brief { font-size: 24px; line-height: 1.4; margin: 12px 0 20px; max-width: 60ch; letter-spacing: -0.01em; }
.incoming .timer { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; margin-bottom: 20px; }
.incoming .timer > i { display: block; height: 100%; background: var(--accent); transform-origin: left; }
.incoming.urgent .timer > i { background: var(--red-solid); }
.incoming .actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.incoming .actions .btn { font-size: 17px; padding: 12px 26px; }

.oncall { display: grid; grid-template-columns: minmax(300px, 2fr) 3fr; gap: 20px; align-items: start; }
.card dl { margin: 0; display: grid; grid-template-columns: 120px 1fr; gap: 8px 14px; font-size: 14px; }
.card dt { color: var(--text-2); font-size: 13px; }
.card dd { margin: 0; overflow-wrap: anywhere; }
.card .src { display: block; color: var(--text-3); font-size: 12px; }
.card .verified { color: var(--green); font-weight: 600; }
.card .unverified { color: var(--amber); font-weight: 600; }
.card section + section { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.qs { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 14px; }
.qs li { padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.qs li.done { background: var(--green-bg); border-color: transparent; }
.qs li.done::before { content: '✓ '; color: var(--green); font-weight: 700; }
.qs li .ev { display: block; font-size: 12.5px; color: var(--text-2); }
.talk .convo { height: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.talk .tools { display: flex; gap: 8px; justify-content: space-between; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.mood { font-size: 13px; color: var(--text-2); }
.draft label { display: block; font-weight: 600; font-size: 13.5px; margin: 14px 0 6px; }
.draft textarea { width: 100%; min-height: 80px; }
.idle { text-align: center; padding: 56px 24px; }
.idle p { font-size: 18px; font-weight: 600; margin: 0 0 6px; }
.idle-icon { width: 48px; height: 48px; border-radius: 14px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--accent-tint); color: var(--accent-text); }

/* ---- caller phone ------------------------------------------------------------------------ */
.phone { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.phone .convo { height: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.phone-status { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.phone-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.phone.live .phone-status::before { background: var(--green-strong); box-shadow: 0 0 0 4px var(--green-bg); }
.phone .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.phone select { flex: 1; min-width: 0; }
.phone .convo.sms { height: auto; min-height: 64px; max-height: 240px; border: 0; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button {
  border: 1px solid var(--border); background: var(--surface-2); border-radius: 999px;
  padding: 5px 11px; font-size: 13px; color: var(--text); text-align: left;
}
.chips button:hover { border-color: var(--accent); color: var(--accent-text); background: var(--accent-tint); }

/* ---- call logs ------------------------------------------------------------------------- */
.logs { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 20px; align-items: start; }
.list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); max-height: calc(100vh - 200px); overflow: auto; position: sticky; top: 84px; }
.list .tools { position: sticky; top: 0; z-index: 1; background: var(--surface); padding: 12px; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* The filter box takes its own line, so its words are never cut (QA, Nov 14, R15). */
.list .tools input[type="search"] { flex: 1 1 100%; min-width: 0; }
.item { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--border); background: none; padding: 12px 16px; }
.item:last-child { border-bottom: 0; }
.item:hover { background: var(--surface-2); }
.item[aria-current="true"] { background: var(--accent-tint); box-shadow: inset 3px 0 0 var(--accent); }
.item .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.item .top > span:last-child { display: inline-flex; gap: 6px; align-items: center; font-weight: 500; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.item .sub { display: block; color: var(--text-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-detail h2 { margin: 0; font-size: 22px; letter-spacing: -0.02em; }
.call-detail h3 { margin: 24px 0 10px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.call-detail .convo { overflow: visible; padding: 0; }
.call-detail > .line { margin-bottom: 8px; }
/* The call page's trace (public/call-trace.js): each turn, then each step as a <details> that opens its record. */
.trace { font-size: 14px; }
.tr-turn { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; margin: 10px 0; background: var(--surface); }
.tr-turn.tr-after { background: var(--surface-2); border-style: dashed; }
.tr-turn-head { margin-bottom: 4px; }
/* The pinned call record (public/call-trace.js recordPanel; Shawn, Nov 18): the record as of the turn in view. Own
   class names only (crp-*), so no other rule of the page shapes it. */
.crp { position: sticky; top: 0; z-index: 5; margin: 8px 0 12px; height: clamp(160px, 26vh, 230px); display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius-sm); box-shadow: 0 4px 12px rgba(0,0,0,.08); padding: 8px 12px; font-size: 13px; line-height: 1.45; }
.crp.crp-hidden { height: auto; }
.crp-head { flex: 0 0 auto; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.crp.crp-hidden .crp-head { margin-bottom: 0; }
.crp-title { font-weight: 600; font-size: 14px; }
.crp-when { color: var(--text-2); }
.crp-count { color: var(--accent-text, var(--accent)); font-weight: 500; }
.crp-toggle { margin-left: auto; font-size: 12px; background: none; border: 1px solid var(--border); border-radius: 4px; padding: 1px 8px; color: var(--text-2); cursor: pointer; }
.crp.crp-hidden .crp-body { display: none; }
.crp-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.crp-row { display: flex; gap: 12px; padding: 3px 0; border-top: 1px solid var(--border); }
.crp-row:first-child { border-top: 0; }
.crp-k { flex: 0 0 150px; color: var(--text-2); }
.crp-v { flex: 1 1 auto; min-width: 0; }
.crp-strong { font-weight: 600; }
.crp-muted { color: var(--text-3); }
.crp-tag { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 8px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.step-chart { font-size: 11px; padding: 2px 8px; margin-right: 2px; }
.crp-fromchart { margin-top: 2px; font-size: 12.5px; }
.crp-tag.ok { color: var(--green, #1a7f37); border-color: currentColor; background: transparent; }
.crp-quote { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--text); }
.crp-chips { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-bottom: 2px; }
.crp-chip { display: inline-flex; align-items: baseline; gap: 4px; padding: 1px 8px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); }
.crp-chip-k { color: var(--text-2); }
.crp-chip-w { color: var(--text-3); font-size: 12px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crp-chip b { color: var(--text); }
.crp-route { font-weight: 500; }
.crp-urg { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; padding: 0 6px; border-radius: 8px; background: var(--amber-bg, #fff4e5); color: var(--amber, #8a5a00); }
.crp-urg-emergent { background: var(--red-solid, #c62828); color: #fff; }
.crp-task { display: inline-block; margin-right: 8px; }
.crp-flag { color: var(--red, #c62828); }
.crp-new { background: var(--accent-tint, #e6f2ef); border-radius: 4px; box-shadow: 0 0 0 2px var(--accent-tint, #e6f2ef); transition: background .4s; }
.crp-chip.crp-new { border-color: var(--accent); }
.crp-delta { margin: 4px 0 2px; padding: 3px 8px; border-left: 3px solid var(--accent); background: var(--surface-2); font-size: 12px; color: var(--text-2); border-radius: 0 4px 4px 0; }
.crp-delta b { color: var(--text); font-weight: 600; }
.crp-delta-k { font-weight: 600; color: var(--accent-text, var(--accent)); margin-right: 4px; }
.tr-ev, .tr-rule, .tr-gaps, .tr-log, .tr-hist { margin: 2px 0; }
.tr-ev > summary, .tr-rule > summary, .tr-gaps > summary, .tr-log > summary, .tr-hist > summary, .tr-tech > summary { cursor: pointer; overflow-wrap: anywhere; padding: 2px 0; }
.tr-ev > .tr-body, .tr-rule > .tr-body { margin: 2px 0 8px 14px; padding-left: 10px; border-left: 2px solid var(--border); }
.tr-k { font-weight: 600; color: var(--text-2); margin-right: 4px; }
.tr-heard > summary .tr-k { color: var(--accent-text); }
.tr-said > summary .tr-k { color: var(--blue); }
.tr-int { font-weight: 600; color: var(--amber); background: var(--amber-bg); border-radius: 4px; padding: 0 4px; margin-right: 4px; }
.tr-tag { font-size: 12px; color: var(--text-3); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }
.tr-warn { color: var(--amber); }
.tr-status { font-size: 12px; color: var(--text-2); background: var(--gray-bg); border-radius: 4px; padding: 0 5px; margin-left: 4px; }
.tr-status[data-status="inferred"], .tr-status[data-status="disambiguation"] { color: var(--amber); background: var(--amber-bg); }
.tr-words, .tr-src { margin: 6px 0; overflow-wrap: anywhere; }
.tr-lbl { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); }
.tr-src[data-who="draft"] .tr-lbl { color: var(--amber); }
.tr-where { display: block; font-size: 12px; color: var(--text-3); }
.tr-quote { display: block; padding: 2px 0 2px 10px; border-left: 3px solid var(--border-strong); white-space: pre-wrap; }
.tr-none { color: var(--amber); font-size: 13px; }
.tr-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0; }
.tr-tool ul, .tr-gaps ul, .tr-hist ul { margin: 2px 0; padding-left: 18px; }
.tr-rests { margin: 6px 0; }
.tr-tech { margin-top: 4px; font-size: 12px; color: var(--text-3); }
.tr-tech dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; margin: 4px 0; }
.tr-tech dd { margin: 0; overflow-wrap: anywhere; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.meta { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 16px 0; font-size: 14px; }
.meta dt { color: var(--text-2); }
.meta dd { margin: 0; overflow-wrap: anywhere; }
.task { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px; font-size: 14px; }
.issue { border-left: 3px solid var(--border-strong); padding: 6px 12px; margin: 8px 0; background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 14px; }
.issue.critical { border-color: var(--red-solid); }
.issue.major { border-color: #d97706; }
.review { border: 1px solid var(--border); border-radius: var(--radius); margin: 16px 0 4px; background: var(--surface-2); }
.review > summary { display: flex; gap: 12px; align-items: center; padding: 12px 14px; cursor: pointer; list-style: none; }
.review > summary::-webkit-details-marker { display: none; }
.review > summary::after { content: '▸'; margin-left: auto; color: var(--text-3); transition: transform 0.15s; }
.review[open] > summary::after { transform: rotate(90deg); }
.review > summary .gr { font-size: 16px; min-width: 36px; height: 36px; border-radius: 10px; }
.review .rv-head { line-height: 1.4; }
.review .rv-body { padding: 4px 14px 14px; border-top: 1px solid var(--border); }
.review .rv-body .dims { margin: 12px 0; }
.review.empty { padding: 12px 14px; display: flex; gap: 12px; align-items: center; justify-content: flex-start; text-align: left; }
.dims { display: flex; gap: 8px 16px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }

/* ---- queues ------------------------------------------------------------------------------ */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 20px; padding: 4px; background: var(--surface-3); border-radius: 10px; width: fit-content; max-width: 100%; }
.tabs button { border: 0; background: none; padding: 7px 14px; font-size: 14px; font-weight: 600; color: var(--text-2); border-radius: 7px; display: inline-flex; align-items: center; gap: 6px; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08); }
.tabs .n { display: inline-block; min-width: 20px; padding: 2px 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11.5px; text-align: center; }
.tabs .n:empty { display: none; }
.qitem { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px; background: var(--surface); }
.qitem h3 { font-size: 15px; margin: 0 0 6px; }
.qitem .row { margin-top: 12px; }
.qitem input[type=text] { flex: 1 1 200px; min-width: 0; }
.qmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; color: var(--text-2); }
.checks { list-style: none; padding: 0; margin: 12px 0 0; font-size: 13.5px; display: grid; gap: 6px; }
.reasons { margin: 10px 0 0; padding-left: 18px; font-size: 13px; color: var(--text-2); }
.err { color: var(--red); font-size: 13px; }
.qitem .err { width: 100%; }
.err:empty { display: none; }
.rec { font-weight: 600; color: var(--text); }

/* ---- synthetic tests ---------------------------------------------------------------------- */
.prog { height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden; flex: 1; min-width: 120px; }
.prog > i { display: block; height: 100%; background: var(--accent); transition: width 0.4s; }
.dist { display: grid; grid-template-columns: 2em 1fr 3em; gap: 8px 12px; align-items: center; max-width: 560px; }
.dist .b { height: 12px; border-radius: 6px; background: var(--accent); min-width: 2px; }
.dist .b.C, .dist .b.D { background: #d97706; }
.dist .b.F { background: var(--red-solid); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.tline { margin: 0 0 6px; font-size: 13px; }

/* ---- web call ------------------------------------------------------------------------------ */
.wc { max-width: 560px; margin: 0 auto; display: grid; gap: 16px; }
.wc select { width: 100%; }
.wc-status { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.wc-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.wc-status.live { color: var(--accent-text); }
.wc-status.live::before { background: var(--green-strong); box-shadow: 0 0 0 4px var(--green-bg); }
.wc-status.err { color: var(--red); }
.wc-status.err::before { background: var(--red-solid); }

/* ---- sign-in shell (login.html) ------------------------------------------------------------ */
.auth-shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 32px 16px; }
.auth-shell > .card { width: 100%; max-width: 420px; padding: 32px; }
.auth-shell h1 { font-size: 22px; margin-bottom: 6px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.auth-shell .btn-primary { width: 100%; padding: 11px 14px; }
.auth-foot { font-size: 12.5px; color: var(--text-3); text-align: center; max-width: 420px; }

/* ---- responsive ------------------------------------------------------------------------------ */
@media (max-width: 1024px) {
  .board, .board-top, .oncall, .logs { grid-template-columns: minmax(0, 1fr); }
  .list { position: static; max-height: 420px; }
}
@media (max-width: 900px) {
  main { padding: 20px 16px 40px; }
  .card, .panel { padding: 18px 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .detail-grid, .two { grid-template-columns: 1fr; }
  .incoming { padding: 22px 20px; }
  .incoming .brief { font-size: 20px; }
}
@media (max-width: 560px) {
  h1 { font-size: 22px; }
  .page-head { margin-bottom: 18px; }
  .kpi-row { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kpi { padding: 14px 16px; }
  .kpi-value { font-size: 26px; }
  .card dl { grid-template-columns: 1fr; gap: 2px; }
  .card dl dd { margin-bottom: 8px; }
  .meta { grid-template-columns: 1fr; gap: 2px; }
  .meta dd { margin-bottom: 8px; }
  .alert .btn { margin-left: 0; }
  .page-sub .sep { display: none; }
  /* task table: priority and action on one line, the task under them */
  .tasks-table thead { display: none; }
  .tasks-table tr { display: grid; grid-template-columns: 1fr auto; border-bottom: 1px solid var(--border); padding: 12px 0; }
  .tasks-table tbody tr:last-child { border-bottom: 0; }
  .tasks-table td { border: 0 !important; padding: 0 !important; }
  .tasks-table td:nth-child(2) { grid-column: 1 / -1; order: 3; margin-top: 8px; }
  .tasks-table td .due { display: inline; margin-left: 8px; }
  .tasks-table td.empty { grid-column: 1 / -1; padding: 24px 0 !important; }
  .me .name { font-size: 20px; }
  .auth-shell > .card { padding: 24px 20px; }
}

/* ---- Admin console and account page ---- */
.invite-grid { display: grid; grid-template-columns: 2fr 1.5fr 1fr auto; gap: 12px; align-items: end; }
.invite-grid .field { margin: 0; }
.invite-go { align-self: end; }
.table td.actions { white-space: nowrap; text-align: right; }
.table td.actions .btn-link + .btn-link { margin-left: 12px; }
.btn-link.danger { color: var(--red); }
.account-card { max-width: 520px; }
.auth-title { font-size: 22px; margin: 0 0 4px; }
.auth-alt { margin-top: 16px; text-align: center; }
.btn-block { width: 100%; justify-content: center; }
@media (max-width: 720px) { .invite-grid { grid-template-columns: 1fr; } }
.auth-brand { color: var(--text); text-decoration: none; }

/* Nurse task card (the practitioner, Nov 7: "summary of the call, checklist of how the nurse completes the task"). */
.tcards { display: grid; gap: 12px; }
.tcard { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--surface); min-width: 0; overflow-wrap: anywhere; }
.tc-top { font-size: 15px; }
.tc-status { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; }
.tc-status .due { margin-top: 0; }
.tc-chips { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.tchip { font-size: 12.5px; color: var(--amber); background: var(--amber-bg); border-radius: 999px; padding: 2px 10px; }
.tc-what { margin: 10px 0 0; font-size: 14px; line-height: 1.5; }
.tc-list { margin-top: 10px; font-size: 14px; }
.tc-list ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.tc-list label { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.tc-list input[type=checkbox] { margin-top: 3px; flex: none; }
.tc-list input:checked + span { color: var(--text-2); text-decoration: line-through; }
.tc-close { display: grid; gap: 6px; padding-top: 4px; }
.tc-close textarea { width: 100%; font: inherit; font-size: 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 6px 8px; background: var(--surface); color: var(--text); }
.tc-close .btn { justify-self: start; }
.tcard details { margin-top: 10px; }
.tcard summary { cursor: pointer; color: var(--text-2); }
.tc-details p { margin: 6px 0; }
.tc-details .pre { white-space: pre-wrap; }

/* Staff call feedback (common.js coachingHtml): the safety box, then the sandwich. */
.safety-box { border: 1px solid var(--red-solid); background: var(--red-bg); color: var(--text); border-radius: var(--radius-sm); padding: 10px 14px; margin: 10px 0; }
.safety-box p { margin: 6px 0 0; }
.sandwich { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 8px; }
.sandwich li { border-left: 4px solid var(--border-strong); padding: 6px 12px; background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.sandwich li.sw-good { border-color: var(--green); }
.sandwich li.sw-improve { border-color: var(--accent); }
.sandwich .sw-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 2px; }
.sandwich .sw-label .mono { font-weight: 400; margin-left: 4px; }
.sandwich .try { display: block; margin-top: 4px; padding: 6px 10px; background: var(--accent-tint); border-radius: var(--radius-sm); font-style: italic; }
.sandwich .small { display: block; margin-top: 4px; }

.crp-await { background: #fff7e0; border-left: 3px solid #d89b00; padding: 4px 8px; border-radius: 4px; }

/* The Performance page (performance.html, performance.js). */
.cap-tl-card { margin-bottom: 14px; }
.cap-tl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.cap-tl-tools { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.cap-tl-tools select { margin-left: 4px; max-width: 260px; }
.cap-all { display: flex; gap: 6px; align-items: center; color: var(--text-2); font-size: 13px; }
.cap-tl { width: 100%; display: block; }
.tl-grid { stroke: var(--border); stroke-width: 1; }
.tl-day { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 3; }
.tl-ax { fill: var(--text-3); font-size: 11px; }
.tl-target { stroke: var(--text-3); stroke-width: 1.5; stroke-dasharray: 6 4; }
.tl-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.tl-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 1.5; pointer-events: none; }
.tl-dot.stale { fill: var(--surface); stroke: var(--accent); }
.tl-dot.up { fill: var(--green-strong); }
.tl-dot.down { fill: var(--red); }
.tl-bar { fill: var(--border-strong); pointer-events: none; }
.tl-bar.on { fill: var(--accent); }
.tl-hit { fill: transparent; cursor: pointer; }
.tl-col:hover .tl-hit { fill: var(--accent-tint); fill-opacity: 0.6; }
.tl-sel { stroke: var(--accent); stroke-width: 2; }
.tl-cmp { stroke: #6b7584; stroke-width: 1.5; stroke-dasharray: 4 3; }
.cap-tl-nav { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.cap-tl-nav input[type=range] { flex: 1; accent-color: var(--accent); }
.cap-row.focus td { background: var(--accent-tint); }
.cap-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(220px, 3fr); gap: 14px; margin-bottom: 14px; }
@media (max-width: 900px) { .cap-grid { grid-template-columns: 1fr; } }
.cap-radar { width: 100%; max-width: 860px; display: block; margin: 0 auto; }
.cap-ring { fill: none; stroke: var(--border); stroke-width: 1; }
.cap-ring-l { fill: var(--text-3); font-size: 12px; }
.cap-spoke { stroke: var(--border); stroke-width: 1; }
.cap-spoke.asp { stroke-dasharray: 2 3; }
.cap-target { fill: none; stroke: var(--text-3); stroke-width: 1.5; stroke-dasharray: 6 4; }
.cap-prev { fill: none; stroke: #6b7584; stroke-width: 2; stroke-dasharray: 4 3; }
.cap-cur { fill: var(--accent); fill-opacity: 0.14; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.cap-hit { fill: transparent; cursor: pointer; }
.cap-dot { stroke: var(--surface); stroke-width: 2; cursor: pointer; }
.cap-dot.met { fill: var(--green-strong); }
.cap-dot.near { fill: #b7791f; }
.cap-dot.below { fill: var(--red); }
.cap-dot.stale { fill: var(--surface); stroke-width: 2.5; }
.cap-dot.thin { fill-opacity: 0.45; }
.cap-dot.stale.met { stroke: var(--green-strong); }
.cap-dot.stale.near { stroke: #b7791f; }
.cap-dot.stale.below { stroke: var(--red); }
.cap-dot.typ { fill: var(--accent); }
.cap-dot.stale.typ { fill: var(--surface); stroke: var(--accent); }
.cap-type-card { margin-bottom: 14px; }
.cap-type-card .cap-table { margin-top: 10px; }
.cap-lab { fill: var(--text); font-size: 15px; font-weight: 500; cursor: pointer; }
.cap-lab.asp { font-style: italic; fill: var(--text-2); }
.cap-lab-v { fill: var(--text-2); font-weight: 600; }
.cap-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--text-2); margin-top: 8px; justify-content: center; }
.cap-legend .lg { display: inline-block; width: 18px; height: 0; vertical-align: middle; margin-right: 5px; border-top: 2px solid; }
.cap-legend .lg.cur { border-color: var(--accent); }
.cap-legend .lg.prev { border-color: #6b7584; border-top-style: dashed; }
.cap-legend .lg.tgt { border-color: var(--text-3); border-top-style: dashed; }
.cap-legend .lg.dot { width: 9px; height: 9px; border: 0; border-radius: 50%; background: var(--text-2); }
.cap-legend .lg.dot.faded { opacity: 0.45; }
.cap-legend .lg.dot.hollow { background: none; border: 2px solid var(--text-2); width: 6px; height: 6px; }
.cap-rel-h { font-size: 15px; margin-bottom: 4px; }
.cap-notes { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }
.cap-notes li { margin: 3px 0; }
.cap-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cap-table th { text-align: left; color: var(--text-2); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.cap-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cap-table .num { text-align: right; }
.cap-row { cursor: pointer; }
.cap-row:hover td { background: var(--surface-2); }
.cap-name { font-weight: 600; }
.cap-chip { font-size: 11px; padding: 1px 7px; border-radius: 10px; background: var(--gray-bg); color: var(--gray); }
.cap-chip.claimed { background: var(--accent-tint); color: var(--accent-text); }
.cap-chip.aspirational { font-style: italic; }
.cap-st.met { color: var(--green); }
.cap-st.near { color: var(--amber); }
.cap-st.below { color: var(--red); }
.cap-st.none { color: var(--text-3); }
.cap-d.up { color: var(--green); font-weight: 600; }
.cap-d.down { color: var(--red); font-weight: 600; }
.cap-d.same { color: var(--text-3); }
.cap-spark polyline { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.cap-spark circle { fill: var(--accent); }
.cap-more td { background: var(--surface-2); }
.cap-claim { margin: 2px 0 6px; font-style: italic; }
.cap-parts { margin: 0 0 6px; padding-left: 18px; }
/* Performance: the two views (System, Clinical) as tabs that stay in sight under the phone's top bar. */
.perf-tabs { position: sticky; top: var(--bar-h); z-index: 20; margin-bottom: 14px; box-shadow: 0 0 0 6px var(--bg, var(--surface-2)); }
.perf-tabs button { cursor: pointer; }
.perf-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cl-sum-card { margin-bottom: 14px; }
.cap-type-card #typeFoot { margin-top: 10px; }
.cl-sum { margin: 0; font-size: 14px; }
.cl-score { font-size: 18px; }
@media (max-width: 560px) {
  /* A wide table scrolls sideways inside its card on a phone instead of being cut off: its cells do not wrap. */
  .table-wrap > .cap-table th, .table-wrap > .cap-table td { white-space: nowrap; }
  /* On a phone the views come first: the long intro gives way, the timeline's tools sit on one line. */
  .perf-page .page-sub { display: none; }
  .perf-page .page-head { margin-bottom: 10px; }
  .cap-tl-tools label.small { display: flex; align-items: center; gap: 6px; }
  .cap-tl-tools select { max-width: 190px; }
  .cl-sum-card { padding: 12px 16px; }
  .perf-tabs { width: 100%; }
  .perf-tabs button { flex: 1; justify-content: center; padding: 8px 6px; }
}
