/* AU-RAD: the logo's charcoal, gold and cream. Dark by default; light by choice or by the system's. Every page fits one
   screen: only marked regions (.scroll) scroll, and below 900 px wide or 600 px tall the page scrolls as usual. */
:root {
  color-scheme: dark;
  --bg: #121110;
  --surface: #1a1917;
  --surface-2: #232220;
  --surface-3: #2c2a27;
  --line: #34312d;
  --text: #f3efe5;
  --muted: #a8a296;
  --faint: #6f6a61;
  --gold: #d4a72c;
  --gold-strong: #e8bf4a;
  --gold-soft: rgba(212, 167, 44, 0.14);
  --on-gold: #1c1606;
  --ok: #67b885;
  --ok-soft: rgba(103, 184, 133, 0.14);
  --warn: #e3a646;
  --warn-soft: rgba(227, 166, 70, 0.14);
  --bad: #e2675f;
  --bad-soft: rgba(226, 103, 95, 0.14);
  --info: #74a9dc;
  --info-soft: rgba(116, 169, 220, 0.14);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 10px;
  --radius-sm: 7px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
/* The patient's pages in the dark: the same red, yellow and green, quieter, so they tell without glaring. */
:root[data-theme="dark"] body.patient {
  --ok: #86a893;
  --ok-soft: rgba(134, 168, 147, 0.12);
  --warn: #c9a061;
  --warn-soft: rgba(201, 160, 97, 0.12);
  --bad: #c4847b;
  --bad-soft: rgba(196, 132, 123, 0.12);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f2ea;
  --surface: #ffffff;
  --surface-2: #f7f4ec;
  --surface-3: #eeeae0;
  --line: #e1dbcd;
  --text: #1c1a16;
  --muted: #4f493e;
  --faint: #a29b8c;
  --gold: #a87c0c;
  --gold-strong: #8a6506;
  --gold-soft: rgba(168, 124, 12, 0.12);
  --on-gold: #ffffff;
  --ok: #2f8a52;
  --ok-soft: rgba(47, 138, 82, 0.12);
  --warn: #a8670b;
  --warn-soft: rgba(168, 103, 11, 0.12);
  --bad: #b8392f;
  --bad-soft: rgba(184, 57, 47, 0.1);
  --info: #2d6aa8;
  --info-soft: rgba(45, 106, 168, 0.1);
  --shadow: 0 10px 30px rgba(60, 48, 20, 0.12);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --bg: #f5f2ea;
    --surface: #ffffff;
    --surface-2: #f7f4ec;
    --surface-3: #eeeae0;
    --line: #e1dbcd;
    --text: #1c1a16;
    --muted: #4f493e;
    --faint: #a29b8c;
    --gold: #a87c0c;
    --gold-strong: #8a6506;
    --gold-soft: rgba(168, 124, 12, 0.12);
    --on-gold: #ffffff;
    --ok: #2f8a52;
    --ok-soft: rgba(47, 138, 82, 0.12);
    --warn: #a8670b;
    --warn-soft: rgba(168, 103, 11, 0.12);
    --bad: #b8392f;
    --bad-soft: rgba(184, 57, 47, 0.1);
    --info: #2d6aa8;
    --info-soft: rgba(45, 106, 168, 0.1);
    --shadow: 0 10px 30px rgba(60, 48, 20, 0.12);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.mono { font-family: var(--mono); font-size: 0.92em; letter-spacing: 0.01em; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }

/* ---- Shell: top bar, side menu, page ------------------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: 232px 1fr; grid-template-rows: 60px 1fr; height: 100vh; }
.topbar {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; padding: 0 20px;
  border-bottom: 1px solid var(--line); background: var(--surface);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important; }
.brand svg { display: block; }
.brand-word { font: 800 21px/1 var(--font-display); letter-spacing: -0.02em; }
.brand-word b { color: var(--gold); font-weight: 800; }
.topbar .spacer { flex: 1; }
.who { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.who strong { font-weight: 600; }
.role-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px;
  background: var(--gold-soft); color: var(--gold-strong); font-size: 12px; font-weight: 600;
}
.side { border-right: 1px solid var(--line); background: var(--surface); padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.side a {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--muted); font-weight: 500; text-decoration: none;
}
.side a:hover { background: var(--surface-2); color: var(--text); }
.side a.active { background: var(--gold-soft); color: var(--gold-strong); }
.side a svg { flex: none; }
.side .grow { flex: 1; }
.side .foot { padding: 10px 12px; color: var(--faint); font-size: 12px; }
main { min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 22px 26px 18px; gap: 16px; }

/* ---- Page head: what the page is, in one sentence, and its main action -------------------------------------- */
.page-head { display: flex; align-items: flex-end; gap: 16px; flex: none; }
.page-head .titles { flex: 1; min-width: 0; }
.page-head h1 { margin: 0; font: 700 24px/1.15 var(--font-display); letter-spacing: -0.015em; }
.page-head p { margin: 5px 0 0; color: var(--muted); max-width: 760px; }
.page-head .actions { display: flex; gap: 8px; flex: none; }
.crumb { color: var(--muted); font-size: 12.5px; margin-bottom: 4px; display: flex; gap: 6px; align-items: center; }
.crumb a { color: var(--muted); }

/* ---- Building blocks -------------------------------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; min-height: 0; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; }
.card-head h2, .card-head h3 { margin: 0; font-size: 15px; font-weight: 650; }
.card-head .spacer { flex: 1; }
.card-body { padding: 0 16px 16px; }
.fill { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.scroll { overflow: auto; min-height: 0; }
.row { display: flex; gap: 12px; align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.split { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(300px, 360px) 1fr; grid-template-rows: minmax(0, 1fr); gap: 16px; }
.split > * { min-height: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; min-height: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none !important;
}
.btn:hover:not(:disabled) { background: var(--surface-3); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.btn.primary:hover:not(:disabled) { background: var(--gold-strong); border-color: var(--gold-strong); }
.btn.danger { color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover:not(:disabled) { color: var(--text); background: var(--surface-2); }
.btn.small { height: 30px; padding: 0 11px; font-size: 13px; }
.btn.big { height: 48px; padding: 0 24px; font-size: 15.5px; }
.icon-btn { width: 38px; padding: 0; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field .hint { font-size: 12px; color: var(--faint); }
.field .error { font-size: 12px; color: var(--bad); min-height: 0; }
.input, select.input, textarea.input {
  height: 38px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); width: 100%;
}
textarea.input { height: auto; min-height: 76px; padding: 9px 12px; resize: vertical; }
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.field.invalid .input { border-color: var(--bad); }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.segmented button { border: 0; background: var(--surface-2); padding: 0 14px; height: 36px; cursor: pointer; color: var(--muted); font-weight: 600; }
.segmented button.on { background: var(--gold-soft); color: var(--gold-strong); }
.search { position: relative; width: 300px; max-width: 100%; }
.search .input { padding-left: 36px; }
.search svg { position: absolute; left: 11px; top: 11px; color: var(--faint); }

/* ---- Status ----------------------------------------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px;
  font-weight: 600; background: var(--surface-3); color: var(--muted); white-space: nowrap; cursor: help;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.gold { background: var(--gold-soft); color: var(--gold-strong); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }

/* ---- Tables that fit their card: the page asks for as many rows as there is room for ------------------------- */
.table-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.table-rows { flex: 1; min-height: 0; overflow: hidden; }
/* A list that pages itself fits exactly; one marked .scroll (every row at once) scrolls inside its card. */
.table-rows.scroll { overflow: auto; }
.scroll table.list th { position: sticky; top: 0; z-index: 1; background: var(--surface); padding-top: 8px; }
table.list { width: 100%; border-collapse: collapse; table-layout: fixed; }
table.list th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: 0.04em;
  padding: 0 14px 8px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.list td { padding: 0 14px; height: 52px; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.list tr.click { cursor: pointer; }
table.list tr.click:hover td { background: var(--surface-2); }
table.list td .sub { display: block; color: var(--faint); font-size: 12px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; }
table.list td .sub.bad { color: var(--bad); font-weight: 600; }
.pager { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; flex: none; }
.pager .spacer { flex: 1; }

/* ---- Empty states: what to do next ------------------------------------------------------------------------------ */
.empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px; gap: 10px; }
.empty .glyph { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); }
.empty h3 { margin: 4px 0 0; font-size: 17px; }
.empty p { margin: 0; color: var(--muted); max-width: 420px; }

/* ---- Steps of a case: where it is, and what comes next ---------------------------------------------------------- */
.steps { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; flex: none; list-style: none; margin: 0; padding: 0; }
.step { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.step .num { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; background: var(--surface-3); color: var(--muted); }
.step .label { min-width: 0; }
.step .label strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step .label span { display: block; font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step.done .num { background: var(--ok-soft); color: var(--ok); }
.step.now { border-color: var(--gold); background: var(--gold-soft); }
.step.now .num { background: var(--gold); color: var(--on-gold); }

/* ---- Case page ------------------------------------------------------------------------------------------------- */
.facts { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; margin: 0; font-size: 13.5px; }
.facts dt { color: var(--faint); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.next {
  border: 1px solid var(--gold); background: var(--gold-soft); border-radius: var(--radius); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.next .eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold-strong); }
.next p { margin: 0; }
.tabs { display: flex; gap: 2px; padding: 0 10px; border-bottom: 1px solid var(--line); flex: none; }
.tabs button { border: 0; background: none; padding: 12px 12px 10px; color: var(--muted); font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--text); border-bottom-color: var(--gold); }
.stage { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.stage iframe { flex: 1; width: 100%; border: 0; background: var(--surface); border-radius: 0 0 var(--radius) var(--radius); }
.report-frame { background: #fff !important; }
.timeline { list-style: none; margin: 0; padding: 4px 16px 16px; }
.timeline li { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.timeline time { color: var(--faint); }
.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; padding: 0 16px 16px; }
.pick button {
  text-align: left; border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius); padding: 14px;
  cursor: pointer; display: flex; gap: 12px; align-items: center;
}
.pick button:hover { border-color: var(--gold); }
.pick button.on { border-color: var(--gold); background: var(--gold-soft); }
.avatar {
  flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  background: var(--surface-3); color: var(--gold-strong);
}

/* ---- Numbers ---------------------------------------------------------------------------------------------------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; flex: none; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .label { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.kpi .value { font: 700 26px/1.2 var(--font-display); margin-top: 4px; letter-spacing: -0.01em; }
.kpi .value small { font-size: 14px; color: var(--muted); font-weight: 600; margin-left: 4px; }
.kpi .note { color: var(--faint); font-size: 12px; margin-top: 2px; }
.kpi.gold { border-color: var(--gold); background: linear-gradient(0deg, var(--gold-soft), var(--gold-soft)), var(--surface); }
.bars { display: flex; flex-direction: column; gap: 9px; padding: 0 16px 16px; }
.bar { display: grid; grid-template-columns: 130px 1fr 44px; gap: 10px; align-items: center; font-size: 13px; }
.bar .track { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar .track i { display: block; height: 100%; border-radius: 99px; background: var(--gold); }
.bar .n { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- Sign-in ---------------------------------------------------------------------------------------------------- */
.auth { position: relative; height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
/* The language, in the corner: the browser's until the person picks another. */
.input.auth-lang { position: absolute; top: 16px; right: 16px; z-index: 1; width: auto; min-width: 0; height: 42px; font-size: 15px; }
.auth-art { position: relative; overflow: hidden; background: #141311; display: flex; align-items: center; justify-content: center; }
/* The logo is a picture: not selected, copied or dragged as the letters it is drawn with. */
.auth-art, .brand { -webkit-user-select: none; user-select: none; cursor: default; }
.brand { cursor: pointer; }
.auth-art svg.rings { position: absolute; inset: 0; width: 100%; height: 100%; }
.auth-art .lockup { position: relative; display: flex; flex-direction: column; align-items: center; gap: 18px; color: #f3efe5; }
.auth-art .lockup .tag { font-family: var(--mono); letter-spacing: 0.22em; color: #c9c2b3; font-size: 13px; }
.auth-art .lockup .claim { max-width: 360px; text-align: center; color: #a8a296; }
/* Beside the staff sign-in, the way for patients: their code sign-in, one big press away; the first thing one sees. */
.auth-patient { margin-top: 22px; width: min(440px, calc(100vw - 32px)); padding: 26px 28px; border: 2px solid var(--gold); border-radius: 18px;
  background: rgba(20, 19, 17, 0.82); box-shadow: 0 0 0 6px rgba(212, 167, 44, 0.12), 0 18px 48px rgba(0, 0, 0, 0.45);
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.auth-patient strong { font: 700 27px/1.2 var(--font-display); color: #f3efe5; }
.auth-patient p { margin: 0 0 8px; color: #c9c2b3; font-size: 16px; }
.auth-patient .btn { width: 100%; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 30px; background: var(--bg); }
.auth-form form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }
.auth-form h1 { margin: 0; font: 700 26px/1.2 var(--font-display); }
.auth-form p { margin: 0 0 6px; color: var(--muted); }
.notice { padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice.info { background: var(--info-soft); color: var(--info); }

/* ---- Dialogs and toasts ----------------------------------------------------------------------------------------- */
dialog {
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); padding: 0;
  width: min(560px, calc(100vw - 32px)); box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(10, 9, 8, 0.6); }
dialog .dialog-head { padding: 18px 20px 6px; }
dialog .dialog-head h2 { margin: 0; font-size: 18px; }
dialog .dialog-head p { margin: 6px 0 0; color: var(--muted); }
dialog .dialog-body { padding: 12px 20px; display: flex; flex-direction: column; gap: 12px; }
dialog .dialog-foot { padding: 12px 20px 18px; display: flex; justify-content: flex-end; gap: 8px; }
.secret { font-family: var(--mono); font-size: 18px; padding: 12px; text-align: center; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px dashed var(--gold); letter-spacing: 0.06em; user-select: all; }
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--gold); padding: 11px 14px; border-radius: var(--radius-sm); box-shadow: var(--shadow); max-width: 380px; }
.toast.bad { border-left-color: var(--bad); }
.toast.ok { border-left-color: var(--ok); }

.loading { flex: 1; display: grid; place-items: center; color: var(--faint); }

@media (max-width: 900px), (max-height: 600px) {
  body { overflow: auto; }
  .shell { height: auto; min-height: 100vh; grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; }
  .side { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; }
  .side .grow, .side .foot { display: none; }
  main { padding: 16px; }
  .split, .grid-2, .kpis { grid-template-columns: 1fr; }
  .steps { grid-auto-flow: row; }
  .auth { grid-template-columns: 1fr; height: auto; min-height: 100vh; }
  .auth-art { min-height: 220px; padding: 72px 16px 32px; }
  .table-rows, .table-rows.scroll { overflow: visible; }
  .stage iframe { min-height: 560px; }
}

/* ---- The patient's pages: larger type, one question per screen, one main button at the bottom ------------------ */
.patient { font-size: 17px; }
.p-shell { height: 100vh; display: grid; grid-template-rows: 64px 1fr; grid-template-columns: minmax(0, 1fr); }
.p-top { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; padding: 0 22px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(12px); }
.p-top .spacer { flex: 1; }
/* Until the health profile is full: how much is missing, on every page, a tap away from it */
.p-nudge { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--gold);
  background: var(--gold-soft); color: var(--gold-strong); font-size: 15px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.p-nudge:hover { border-color: var(--gold-strong); }
.p-nudge .bar { display: block; width: 64px; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.p-nudge .bar i { display: block; height: 100%; border-radius: 99px; background: var(--warn); }
.p-nudge b { font-variant-numeric: tabular-nums; color: var(--warn); }
.p-nudge.low { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.p-nudge.low .bar i { background: var(--bad); }
.p-nudge.low b { color: var(--bad); }
@media (max-width: 640px) { .p-nudge > span:not(.bar) { display: none; } .p-nudge { padding: 0 10px; } }
.p-top select.input { width: auto; height: 42px; font-size: 16px; }
/* The column sits in the middle; auto margins centre it vertically while it fits and let it scroll from the top when not. */
.p-main { position: relative; z-index: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; align-items: center;
  justify-content: flex-start; padding: 26px 20px; }
/* Behind every patient page: the logo's rings at two corners, a faint dot grid fading down, and warm light from the top. */
.p-backdrop { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background: radial-gradient(900px 420px at 50% -160px, var(--gold-soft), transparent 70%),
    radial-gradient(700px 500px at 110% 110%, var(--gold-soft), transparent 70%); }
.p-backdrop::before { content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(color-mix(in srgb, var(--gold) 22%, transparent) 1px, transparent 1.4px); background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 65%); mask-image: linear-gradient(to bottom, #000, transparent 65%); }
.p-backdrop svg.rings { position: absolute; width: 900px; height: 900px; opacity: 0.55; }
.p-backdrop svg.rings:first-child { right: -360px; top: -320px; }
.p-backdrop svg.rings:last-child { left: -560px; bottom: -420px; opacity: 0.35; transform: scaleX(-1); }
.p-column { width: 100%; max-width: 760px; display: flex; flex-direction: column; gap: 18px; min-height: 0; margin-block: auto; }
/* Every patient page is one sheet, like a ruled notebook: the same width, from the top; the title and its line of help
   on the same left edge; then the page's content; and its buttons at the foot, always in the same place. Content that
   needs less room (one question, a form, a card) keeps the left edge rather than moving to the middle. */
.p-shell .p-column { flex: 1; max-width: 1180px; margin-block: 0; }
.p-shell .p-column > .p-actions { margin-top: auto; }
.p-shell .p-column > :not(.p-steps, .p-cancel, .p-actions, .p-question, .p-help, .p-story, .p-review, .p-quality, .p-chart-box, .p-chart-also, .p-years, .doc-cards, .doc-page, .p-link-form, .p-frame, .bm, .p-grid, .p-profile,
  .p-hero, .p-tiles, .p-list, .p-meters, .p-wait) { width: 100%; max-width: 760px; }
/* Never squeezed to fit the screen (the page scrolls instead): squeezed, a box would slide under the buttons after it. */
.p-column > * { flex-shrink: 0; }
/* The story once something is told: what we understood on the left, scrolling in itself as it grows; the box to tell more on
   the right, always in view. One column on a narrow screen, the understood part shorter. */
.p-story { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: stretch; }
/* The two columns end on one line: the card on the left and the box to tell more on the right, which takes the room left. */
.p-story-heard { display: flex; flex-direction: column; }
.p-story-heard > .p-card { flex: 1; }
.p-story-talk .p-speak { flex: 1; }
/* The scene shown while the assistant reads takes no room until then. */
.p-story-talk > [role="status"]:empty { display: none; }
/* "Is this right?": one thing to answer on the left, the story on the right. A list longer than the screen shows what fits
   and "+3 more · see all", which opens it whole in a window over the page (fit.js); nothing scrolls. */
.p-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.p-line > .p-heard-part { padding-top: 12px; }
.p-more { list-style: none; padding-top: 8px; }
/* A list closed up so its last item need not hide behind "+1 more" (fit.js): smaller pictures, no notes, tighter lines. */
.p-dense > .p-line-item { padding-block: 1px; }
.p-dense .p-line-pic { width: 36px; height: 36px; }
.p-dense .p-line-pic svg { width: 22px; height: 22px; }
.p-dense .p-line-body .muted { display: none; }
.p-dense.p-told li, .p-dense > .p-heard-part { padding-block: 0; }
/* "Help me tell it": the choices on one screen, two by two, and the offer of it beside the story box. */
.p-shell .p-column > .p-build { max-width: none; }
.p-build { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 28px; align-items: start; }
.p-build-field { display: grid; gap: 8px; }
.p-build-field.wide { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.p-build-field.wide h3 { grid-column: 1 / -1; }
.p-build-field h3 { margin: 0; font-size: 16px; }
.p-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.p-chips button { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.p-build .input { min-height: 42px; }
.p-build .p-suggest button { padding: 5px 12px; font-size: 14px; }
.p-chips button:hover { border-color: var(--gold); }
.p-chips button.on { background: var(--gold); border-color: var(--gold); color: var(--on-gold); font-weight: 700; }
.p-build-offer { flex-direction: row; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; }
.p-build-offer p { margin: 0; font-size: 15px; }
@media (max-width: 1100px) { .p-build { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .p-build { grid-template-columns: minmax(0, 1fr); } }
/* The health profile on one screen: how full it is and the box to tell it on the left, the parts as tiles on the right. */
.p-profile { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 18px; align-items: start; }
.p-parts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.p-part { position: relative; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; min-height: 128px; padding: 14px 16px; text-align: left;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; box-shadow: var(--shadow);
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease; }
/* A tile is a button: it rises under the pointer, and its foot says what pressing it does. */
.p-part:hover, .p-part:focus-visible { border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12); }
.p-part:focus-visible { outline: 3px solid var(--gold-soft); outline-offset: 2px; }
.p-part.blank .p-part-text .muted { font-style: italic; }
.p-part-go { margin-top: auto; align-self: flex-end; display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 99px;
  border: 1px solid var(--line); font-size: 14px; font-weight: 700; color: var(--gold-strong); background: var(--surface); }
.p-part.blank .p-part-go { background: var(--gold); border-color: var(--gold); color: var(--on-gold, #1c1606); }
.p-part:hover .p-part-go { border-color: var(--gold); }
@media (prefers-reduced-motion: reduce) { .p-part, .p-part:hover { transition: none; transform: none; } }
.p-part .p-line-pic { width: 40px; height: 40px; }
.p-part .p-line-pic svg { width: 24px; height: 24px; }
.p-part-text { display: grid; gap: 2px; min-width: 0; }
.p-part-text strong { font-size: 16px; }
.p-part-text .muted { font-size: 14px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.p-part .badge { position: absolute; top: 12px; right: 12px; }
.p-notice-line { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
/* The body map beside the tiles (a third column where the screen is wide enough, under them otherwise). */
.p-profile:has(> .p-bodymap) { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.35fr) minmax(210px, 0.55fr); }
.p-bodymap { display: grid; gap: 10px; }
.p-bodymap h3, .p-bodymap p { margin: 0; }
.bm-minis { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.bm-mini { margin: 0; display: grid; justify-items: center; gap: 2px; }
.bm-mini-svg { width: 100%; height: auto; max-height: 300px; }
.bm-mini-body path { fill: color-mix(in srgb, var(--gold) 10%, var(--surface-3)); }
.bm-mark { fill-opacity: 0.85; }
.bm-mark.operation, .bm-key.operation { fill: #3f7fc4; background: #3f7fc4; }
.bm-mark.implant, .bm-key.implant { fill: #8e5cc4; background: #8e5cc4; }
.p-bodymap-key { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); }
.p-bodymap-key span { display: inline-flex; align-items: center; gap: 6px; }
.bm-key { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
@media (max-width: 1200px) {
  .p-profile:has(> .p-bodymap) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); }
  .p-profile > .p-bodymap { grid-column: 1 / -1; }
  .p-bodymap .bm-minis { max-width: 360px; }
}
@media (max-width: 900px) { .p-profile, .p-profile:has(> .p-bodymap) { grid-template-columns: minmax(0, 1fr); } .p-parts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* The whole story in one glance (storyline.js storyStrip): every moment as its picture on a line, the year under it. */
.p-strip-box { display: grid; gap: 6px; padding: 10px 0 12px; border-bottom: 1px solid var(--line); }
.p-strip { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 0; position: relative; }
.p-strip li { position: relative; display: flex; }
.p-strip-moment { display: grid; justify-items: center; gap: 3px; width: 52px; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; font: inherit; }
.p-strip-moment .p-line-pic { width: 40px; height: 40px; }
.p-strip-moment .p-line-pic svg { width: 24px; height: 24px; }
.p-strip-moment:hover .p-line-pic, .p-strip-moment:focus-visible .p-line-pic { box-shadow: 0 0 0 2px var(--gold); }
.p-strip-date { font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.p-strip-moment.kind-complaint .p-line-pic, .p-strip-moment.kind-symptom .p-line-pic { background: var(--bad-soft); color: var(--bad); }
.p-strip-moment.kind-surgery .p-line-pic { background: rgba(120, 160, 230, 0.16); color: #7ba5da; }
/* Always two lines high, whatever moment it tells, so pointing along the strip never moves what is under it. */
.p-strip-caption { margin: 0; font-size: 15px; line-height: 1.4; height: 2.8em; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.p-window { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: rgba(0, 0, 0, 0.6); }
.p-window-box { width: min(1180px, 100%); max-height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 14px; padding: 20px 24px;
  border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
/* Side by side in columns, so a long list still fits the window. */
.p-window-list { display: block; columns: 2 420px; column-gap: 28px; margin: 0; overflow: auto; }
.p-window-list > * { break-inside: avoid; }
div.p-window-list > * + * { margin-top: 14px; }
.p-review { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: stretch; }
/* The two cards side by side end on the same line. */
.p-review > .stack > .p-card:last-child { flex: 1; }
.p-review > .stack:only-child { grid-column: 1 / -1; }
.p-review .p-card h3 { font-size: 17px; }
.p-review .p-card > .muted { font-size: 14px; margin: 0; }
.p-review .p-more .btn { min-height: 34px; padding: 0 12px; font-size: 14px; }
.p-review-left { margin-left: 14px; color: var(--muted); font: 700 15px/1 var(--font); vertical-align: middle; }
@media (max-width: 900px) {
  .p-review { grid-template-columns: minmax(0, 1fr); }
  .p-story { grid-template-columns: minmax(0, 1fr); }
}
/* A step that shows a page of its own (the upload, the report) takes the whole rest of the screen, wider. */
.p-column:has(.p-frame) { flex: 1; max-width: 1180px; margin-block: 0; }
/* While a page asks the server: a turning ring and a word, never an empty screen. */
.p-wait { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 40px 0; color: var(--muted); font-size: 18px; }
.p-wait::before { content: ""; width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--gold); animation: p-turn 0.9s linear infinite; }
@keyframes p-turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .p-wait::before { animation-duration: 3s; } }
.p-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.p-progress { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 15px; font-weight: 600; }
.p-progress .bar { flex: 1; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.p-progress .bar i { display: block; height: 100%; background: var(--gold); border-radius: 99px; }
/* How full the story, the scans or the profile is (shell.js fullness) */
.p-meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.p-meter { display: grid; gap: 8px; align-content: start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.p-meter-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.p-meter-value { font-size: 20px; font-weight: 800; color: var(--gold-strong); font-variant-numeric: tabular-nums; }
.p-meter .bar { display: block; height: 10px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.p-meter .bar i { display: block; height: 100%; background: var(--gold); border-radius: 99px; transition: width 400ms ease; }
.p-meter .p-help { margin: 0; font-size: 15px; }
.p-meter > .btn { justify-self: start; }
.p-meter.mid .p-meter-value { color: var(--warn); }
.p-meter.mid .bar i { background: var(--warn); }
.p-meter.low .p-meter-value { color: var(--bad); }
.p-meter.low .bar i { background: var(--bad); }
.p-meter.full .p-meter-value { color: var(--ok); }
.p-meter.full .bar i { background: var(--ok); }
.p-question { font: 700 30px/1.25 var(--font-display); letter-spacing: -0.015em; margin: 4px 0 0; }
/* Help is read, not glanced at: in the text colour, a little lighter in weight than it. */
.p-help { color: var(--text); opacity: 0.86; margin: 0; font-size: 17px; line-height: 1.5; }
.p-field textarea.input, .p-field input.input, .p-field select.input { font-size: 19px; min-height: 56px; padding: 12px 16px; }
.p-field textarea.input { min-height: 150px; }
.p-actions { display: flex; gap: 12px; align-items: center; margin-top: 6px; }
.p-actions .spacer { flex: 1; }
.btn.huge { height: 58px; padding: 0 30px; font-size: 18px; border-radius: 12px; }
.p-hero { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 10px; padding: 26px 28px; border-radius: 20px;
  background: linear-gradient(135deg, var(--surface), var(--surface-2)); border: 1px solid var(--line); box-shadow: var(--shadow); }
.p-hero svg.rings { position: absolute; right: -180px; top: -150px; width: 520px; height: 520px; pointer-events: none; }
.p-hero > :not(svg) { position: relative; }
.p-promises { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 6px; }
.p-promise { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 14px; font-weight: 600; }
.p-promise svg { color: var(--gold); flex-shrink: 0; }

/* The request's five steps: done ones and open ones can be clicked, the current one shines, the rest wait. */
.p-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.p-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 0 2px; border: 0; background: none;
  color: var(--muted); font: 600 13px/1.25 var(--font); text-align: center; }
.p-step + .p-step::before { content: ""; position: absolute; top: 17px; right: calc(50% + 22px); left: calc(-50% + 22px); height: 2px;
  border-radius: 2px; background: var(--line); }
.p-step.done + .p-step::before { background: var(--gold); }
.p-step .dot { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--muted);
  font-weight: 700; border: 2px solid transparent; transition: border-color 120ms; }
.p-step.done .dot { background: var(--gold-soft); color: var(--gold); }
.p-step.now { color: var(--text); }
.p-step.now .dot { background: var(--gold); color: var(--on-gold); box-shadow: 0 0 0 6px var(--gold-soft); }
.p-step.locked { opacity: 0.5; }
button.p-step { cursor: pointer; }
button.p-step:hover .dot { border-color: var(--gold); }
button.p-step:focus-visible { outline: 3px solid var(--gold-soft); outline-offset: 4px; border-radius: 10px; }
.p-cancel { display: flex; justify-content: flex-end; font-size: 13px; margin-top: -6px; }
/* On a wide screen "cancel this request" takes no line of its own: it sits under the step bar's end, by the title. */
@media (min-width: 901px) {
  .p-shell .p-column { position: relative; }
  .p-shell .p-column > .p-cancel { position: absolute; right: 0; top: 74px; margin: 0; }
}
.p-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.p-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 22px; min-height: 150px; text-align: left;
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text); cursor: pointer; font: inherit;
}
.p-tile { box-shadow: var(--shadow); transition: transform 140ms, border-color 140ms; }
.p-tile:hover { border-color: var(--gold); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .p-tile { transition: none; } .p-tile:hover { transform: none; } }
.p-tile.main { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.p-tile .tile-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-strong); }
.p-tile.main .tile-icon { background: rgba(0, 0, 0, 0.12); color: var(--on-gold); }
.p-tile strong { font-size: 21px; }
.p-tile span { color: var(--muted); font-size: 15px; }
.p-tile.main span { color: var(--on-gold); opacity: 0.8; }
.p-choice { display: grid; gap: 10px; }
.p-choice button {
  display: flex; align-items: center; gap: 14px; text-align: left; padding: 16px 18px; border-radius: 14px; font: inherit; font-size: 18px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; min-height: 62px;
}
.p-choice button:hover { border-color: var(--gold); }
.p-choice button.on { border-color: var(--gold); background: var(--gold-soft); }
/* The regions that serve a patient: big flags to touch, two to a row even on a phone; the chosen one lit. */
.p-regions { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.p-regions button {
  display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px 16px; border-radius: 16px; font: inherit; font-size: 19px;
  font-weight: 600; border: 2px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer;
}
.p-regions button:hover { border-color: var(--gold); }
.p-regions button.on { border-color: var(--gold); background: var(--gold-soft); box-shadow: 0 0 0 3px var(--gold-soft); }
.p-flag { width: 120px; height: 80px; border-radius: 8px; box-shadow: 0 0 0 1px var(--line), 0 4px 12px rgba(0, 0, 0, 0.18); }
.p-flag-blank { fill: var(--surface-3); }
.p-flag-code { font: 700 8px var(--mono); fill: var(--muted); letter-spacing: 0.06em; }
.p-card { border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
/* Something stands in the way (the payment waits for it): warm, not alarming, with what to do. */
.p-notice { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: color-mix(in srgb, var(--warn-soft) 60%, var(--surface)); border-left: 4px solid var(--warn); }
.p-notice h3 { color: var(--warn); }
/* Good news (help with the cost given, or being looked at): the same card in green. */
.p-notice.ok { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); background: color-mix(in srgb, var(--ok-soft) 60%, var(--surface)); border-left-color: var(--ok); }
.p-card .row { gap: 10px; flex-wrap: wrap; }
.p-card h3 { margin: 0; font-size: 19px; }
.p-card p { margin: 0; }
.p-ribbon { align-self: flex-start; padding: 4px 12px; border-radius: 99px; background: var(--gold); color: var(--on-gold); font-size: 13px; font-weight: 700; }
.p-price { font: 700 24px/1 var(--font-display); }
/* The fee, what lowers it (a coupon, help with the cost) and what is left to pay, under the specialist's card. */
.p-bill { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line); }
.p-bill dt { color: var(--muted); }
.p-bill dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.p-bill dt:last-of-type, .p-bill dd:last-of-type { color: var(--text); font-weight: 700; }
.p-frame { flex: 1; min-height: 0; border-radius: 16px; overflow: hidden; display: flex; }
.p-frame iframe { flex: 1; border: 0; width: 100%; }
.p-status { display: grid; grid-template-columns: auto 1fr; gap: 12px 14px; align-items: center; }
.p-status .dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); }
.p-status .dot.done { background: var(--ok-soft); color: var(--ok); }
.p-status .dot.now { background: var(--gold); color: var(--on-gold); }
.p-code input.input { font: 700 32px/1 var(--mono); letter-spacing: 0.4em; text-align: center; height: 70px; }
/* The story: what was understood, the assistant's one question, the microphone. */
.p-heard ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.p-heard-part { display: grid; gap: 8px; }
/* The story as a line of moments (storyline.js): date, picture on the line, words */
.p-line { list-style: none; margin: 4px 0 0; padding: 0; display: grid; }
.p-line-item { position: relative; display: grid; grid-template-columns: 96px 48px minmax(0, 1fr); gap: 14px; align-items: center; padding: 6px 0; }
.p-line-item::before { content: ""; position: absolute; left: 133px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.p-line-item:first-child::before { top: 50%; }
.p-line-item:last-child::before { bottom: 50%; }
.p-line-date { text-align: right; font-size: 15px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.p-line-pic { position: relative; z-index: 1; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-strong); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.kind-complaint .p-line-pic, .kind-symptom .p-line-pic { background: var(--bad-soft, rgba(226, 103, 95, 0.14)); color: var(--bad, #e2675f); }
.kind-surgery .p-line-pic { background: rgba(120, 160, 230, 0.16); color: #7ba5da; }
.p-line-body { display: grid; gap: 2px; min-width: 0; }
.p-line-body strong { font-size: 17px; font-weight: 650; overflow-wrap: anywhere; }
.p-line-body .muted { font-size: 15px; }
.p-line-gap { padding: 10px 0 4px 158px; font-size: 14px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
@media (max-width: 560px) {
  .p-line-item { grid-template-columns: 40px minmax(0, 1fr); grid-template-areas: "pic date" "pic body"; row-gap: 0; }
  .p-line-item::before { left: 19px; }
  .p-line-date { grid-area: date; text-align: left; font-size: 13px; }
  .p-line-pic { grid-area: pic; width: 40px; height: 40px; }
  .p-line-pic svg { width: 24px; height: 24px; }
  .p-line-body { grid-area: body; }
  .p-line-gap { padding-left: 54px; }
}
.p-heard-part + .p-heard-part { border-top: 1px solid var(--line); padding-top: 12px; }
.p-heard-part h4 { margin: 0; font-size: 14px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.p-example summary { cursor: pointer; font-size: 19px; font-weight: 700; }
.p-example ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 15px; }
.p-example li { display: flex; gap: 10px; align-items: flex-start; }
.p-example li svg { color: var(--gold); flex-shrink: 0; margin-top: 4px; }
.p-example blockquote { margin: 0; padding: 10px 14px; border-left: 4px solid var(--gold); background: var(--gold-soft); border-radius: 8px; font-size: 15px; font-style: italic; }
.p-example > .muted { font-size: 14px; }
.p-heard-part li { display: flex; gap: 10px; align-items: flex-start; font-size: 17px; }
.p-heard-part li svg { color: var(--ok); flex-shrink: 0; margin-top: 4px; }
.p-hint { margin: 0; padding: 12px 16px; border-radius: 12px; background: var(--gold-soft); font-size: 17px; }
/* The box to tell it, a field like any other: the words on top, on its foot the microphone and Send. */
.p-speak { display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.p-speak:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.p-speak textarea.input { flex: 1; min-height: 96px; border: 0; border-radius: 14px 14px 0 0; background: transparent; box-shadow: none; resize: none; font-size: 18px; line-height: 1.5; padding: 14px 16px; }
.p-speak textarea.input:focus { box-shadow: none; }
.p-speak-bar { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-top: 1px solid var(--line); }
.p-speak-bar .spacer { flex: 1; }
.p-speak-bar .p-mic { height: 44px; padding: 0 18px; font-size: 16px; }
.p-speak-bar [role="status"] { font-size: 14px; }
.p-mic { height: 52px; padding: 0 22px; border-radius: 99px; font-size: 17px; gap: 10px; }
.p-mic.on { background: var(--bad); border-color: var(--bad); color: #fff; animation: p-listening 1.4s ease-in-out infinite; }
@keyframes p-listening { 50% { box-shadow: 0 0 0 8px var(--bad-soft); } }
@media (prefers-reduced-motion: reduce) { .p-mic.on { animation: none; } }
/* A study told of but not uploaded: said in red. */
/* Every scan on one card (case.js scansCard): green uploaded and matched, yellow uploaded but not told of, red told of but missing. */
/* Every scan at once, red and green: two columns side by side when the card is wide enough. */
/* "Go on" pressed with lines still unanswered: the card says where. */
.p-scans.attention { outline: 2px solid var(--bad); outline-offset: 2px; }
.p-scan-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 500px), 1fr)); gap: 8px; align-content: start; }
.p-scan { display: grid; grid-template-columns: 22px minmax(0, 1fr) 222px; gap: 4px 10px; align-items: center; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line); }
.p-scan-mark { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; }
.p-scan-text { display: grid; min-width: 0; }
.p-scan-text > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A scan's name on up to two lines, so it is read whole. */
.p-scan-text > strong { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
.p-scan-text strong { font-size: 14px; }
.p-scan-text .muted { font-size: 13px; }
/* The buttons: a column of the same width on every line, two of the same size side by side, the main one first. */
.p-scan-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.p-scan-actions .btn { width: 100%; justify-content: center; padding: 0 8px; }
.p-scan-actions .btn:only-child { grid-column: 2; }
/* An answer given stays in its place, marked chosen. */
.p-scan-actions .btn.chosen:disabled { opacity: 1; cursor: default; font-weight: 700; }
.p-scan.bad .btn.chosen:disabled { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.p-scan.ok .btn.chosen:disabled { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); border-color: var(--ok); color: var(--ok); }
.p-scan.warn .btn.chosen:disabled { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-strong); }
/* Closed up, to keep the last lines on the screen: the words under each title give way. */
.p-scan-list.p-dense .p-scan { padding: 4px 10px; }
.p-scan-list.p-dense .p-scan:not(.lacking) .p-scan-text > .muted { display: none; }
.p-scan-text .input { margin-top: 4px; min-height: 32px; padding: 4px 10px; font-size: 14px; }
.p-scan.ok { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); background: color-mix(in srgb, var(--ok) 8%, var(--surface)); }
.p-scan.ok .p-scan-mark { background: var(--ok); color: #fff; }
.p-scan.bad { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); background: color-mix(in srgb, var(--bad-soft) 70%, var(--surface)); }
.p-scan.bad .p-scan-mark { background: var(--bad); color: #fff; }
.p-scan.warn { border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); background: color-mix(in srgb, var(--gold-soft) 70%, var(--surface)); }
.p-scan.warn .p-scan-mark { background: var(--gold); color: var(--on-gold); }
/* On "Is this right?" the meters are short, beside the story: what they lack is said on pointing at them. */
/* How much the specialist will have, above the review: the two shares and what they mean for the report, in plain sight. */
.p-quality { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 10px 16px; margin-bottom: 14px; padding: 10px 14px; border: 1px solid var(--line); border-left: 5px solid var(--gold); border-radius: 14px; background: var(--surface); }
.p-quality.warn { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn-soft) 70%, var(--surface)); }
.p-quality.bad { border-left-color: var(--bad); background: color-mix(in srgb, var(--bad-soft) 70%, var(--surface)); }
.p-quality.ok { border-left-color: var(--ok); }
.p-share { display: inline-flex; align-items: center; gap: 10px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: inherit; font: inherit; font-size: 15px; }
button.p-share { cursor: pointer; }
button.p-share:hover, button.p-share:focus-visible { border-color: var(--gold); }
.p-share .bar { display: block; width: 90px; height: 9px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.p-share .bar i { display: block; height: 100%; background: var(--warn); border-radius: 99px; }
.p-share b { font-size: 16px; font-weight: 800; color: var(--warn); font-variant-numeric: tabular-nums; }
.p-share.low b { color: var(--bad); }
.p-share.low .bar i { background: var(--bad); }
.p-share.full b { color: var(--ok); }
.p-share.full .bar i { background: var(--ok); }
.p-quality-note { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 15px; font-weight: 600; line-height: 1.35; }
.p-quality-note svg { flex: none; }
.p-quality.warn .p-quality-note svg { color: var(--warn); }
.p-quality.bad .p-quality-note svg { color: var(--bad); }
.p-quality.ok .p-quality-note svg { color: var(--ok); }
@media (max-width: 1100px) { .p-quality { grid-template-columns: auto auto; } .p-quality-note { grid-column: 1 / -1; } }
/* One fact of a told thing on the "Is this right?" card: its label above, its words below. */
.p-fact { display: grid; gap: 2px; }
.p-told { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 15px; }
.p-list { display: grid; gap: 10px; }
.p-list .p-card { flex-direction: row; align-items: center; }
.p-list .p-card .grow { flex: 1; min-width: 0; }

/* The body picture: the figure on the left, its places as big buttons on the right. The seams between places are the
   page's surface colour, so the figure reads as one body; a chosen place is gold. */
.bm { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 18px; align-items: start; }
.bm-stage {
  position: relative;
  border: 1px solid var(--line); border-radius: 16px; padding: 10px; box-shadow: var(--shadow);
  background: radial-gradient(ellipse at 50% 40%, var(--gold-soft), transparent 70%), var(--surface);
}
.bm-bar { position: absolute; inset: 10px 10px auto; display: flex; align-items: center; gap: 8px; z-index: 1; }
.bm-bar .btn { gap: 4px; }
.bm-svg { display: block; width: 100%; height: clamp(320px, calc(100dvh - 380px), 540px); touch-action: manipulation; }
.bm-skin-top { stop-color: color-mix(in srgb, var(--gold) 16%, var(--surface-3)); }
.bm-skin-bottom { stop-color: color-mix(in srgb, var(--gold) 5%, var(--surface-2)); }
.bm-outline path { vector-effect: non-scaling-stroke; fill: none; stroke: color-mix(in srgb, var(--gold) 45%, var(--line)); stroke-width: 1.2; pointer-events: none; }
/* A place is invisible until pointed at or chosen; its seams show faintly where the body is cut into places. */
.bm-part { vector-effect: non-scaling-stroke; fill: var(--gold); fill-opacity: 0; stroke: var(--bg); stroke-opacity: 0.35; stroke-width: 1; stroke-linejoin: round; cursor: pointer; transition: fill-opacity 0.15s; }
.bm-part:hover, .bm-part:focus-visible { fill-opacity: 0.32; outline: none; }
.bm-part.on { fill-opacity: 0.88; }
/* Close up, the area being chosen in is tinted; the others stay as they are and can still be touched to move on. */
.bm-part.near { fill-opacity: 0.12; }
.bm-part.near:hover, .bm-part.near:focus-visible { fill-opacity: 0.38; }
.bm-part.near.on { fill-opacity: 0.88; }
.bm-features { pointer-events: none; }
.bm-hair { fill: color-mix(in srgb, var(--text) 32%, var(--surface-3)); }
.bm-eye { fill: color-mix(in srgb, var(--text) 70%, transparent); }
.bm-line { fill: none; stroke: color-mix(in srgb, var(--text) 50%, transparent); stroke-width: 1.3; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.bm-spine { stroke-dasharray: 3 4; }
/* Their right and left, in the picture's lower corners: in view however close the picture comes. */
.bm-sides { position: absolute; inset: auto 14px 10px; display: flex; justify-content: space-between; pointer-events: none; font-weight: 700; color: var(--gold-strong); }
.bm-sides span { padding: 3px 10px; border-radius: 99px; background: color-mix(in srgb, var(--surface) 85%, transparent); }
.bm-panel { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.bm-hint { margin: 0; }
.bm-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bm-buttons button {
  display: flex; align-items: center; gap: 8px; text-align: left; padding: 12px 14px; border-radius: 12px; font: inherit; font-size: 17px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; min-height: 54px;
}
.bm-buttons button:hover { border-color: var(--gold); }
.bm-buttons button.on { border-color: var(--gold); background: var(--gold-soft); font-weight: 600; }
.bm-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.bm-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 6px 6px 12px; border-radius: 99px; background: var(--gold); color: var(--on-gold); font-weight: 600; }
.bm-chip button { display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.14); color: inherit; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .bm-part { transition: none; } }
/* The profile's single lines: a question per row and its answers beside it. */
.p-single-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 10px; }
.p-single-question { flex: 1; min-width: 200px; }
.p-single .segmented button { height: 40px; font-size: 15px; }
.p-single.wide { grid-column: 1 / -1; }
.p-number { display: flex; align-items: center; gap: 6px; }
.p-number .input { max-width: 110px; }
/* The studies the gateway found, for the patient to confirm. */
/* The pain as faces: six big buttons, a face, its number and a word. */
.p-faces { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.p-faces button {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; border-radius: 14px; cursor: pointer; font: inherit;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
}
.p-faces button:hover { border-color: var(--gold); }
.p-faces button.on { border-color: var(--gold); background: var(--gold-soft); box-shadow: 0 0 0 2px var(--gold); }
.p-faces strong { font: 700 22px/1 var(--font-display); }
.p-faces span { font-size: 15px; color: var(--muted); text-align: center; }
.p-face { width: 64px; height: 64px; }
.p-face-eye { fill: #1c1a16; }
.p-face-line { fill: none; stroke: #1c1a16; stroke-width: 2.4; stroke-linecap: round; }
.p-face-tear { fill: #74a9dc; }
/* Seen by screen readers and by the label that opens it, not on the page (the photo picker). */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* Photos taken in the answers: the button, and a line for each one added. */
.p-photo { gap: 10px; min-height: 56px; padding: 0 22px; font-size: 18px; cursor: pointer; }
.p-photo-line { margin: 0; display: flex; align-items: center; gap: 8px; color: var(--ok); }
/* Suggested questions: a touch adds one. */
.p-suggest { display: flex; flex-wrap: wrap; gap: 8px; }
.p-suggest button { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 99px; font: inherit; font-size: 16px; cursor: pointer;
  border: 1px dashed color-mix(in srgb, var(--gold) 60%, var(--line)); background: var(--gold-soft); color: var(--text); }
.p-suggest button:hover { border-style: solid; border-color: var(--gold); }
/* Photos and videos are welcome: the upload step's line of help, with a camera before it. */
.p-film { display: flex; align-items: flex-start; gap: 10px; }
.p-film svg { flex: none; margin-top: 3px; color: var(--gold-strong); }
/* An operation: what it was, picked from those usual for the place, or written. */
.p-ops { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.p-op-list .p-card { flex-direction: row; align-items: center; padding: 12px 16px; }
.p-op-list .p-card .grow { flex: 1; min-width: 0; }
/* While the assistant reads the story (js/patient/waiting.js), a short film. The first 6.6 s are one take: the
   doctor walks in (0–2 s), leans back and reaches for the folder (2.3–3 s, grinning when he has it), carries it to the
   desk (3.4–5.4 s), slides it down, sits (5.8–6.3 s, knees bending), the screen wakes and he lifts his hands to the
   keys; the camera follows and pushes in. Then loops: typing, breathing, blinking, reading, leaning in, the clock.
   Every element's resting style is the last picture, so with reduced motion the scene stands finished. */
.dw { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 6px 0; }
/* The scene takes as much of its column as the screen's height leaves it (waiting.js fitScene), centred. */
.stack:has(.dw) { flex-shrink: 0; }
.dw-scene { display: block; width: 100%; max-width: 760px; height: auto; aspect-ratio: 360 / 210; margin-bottom: 8px; border-radius: 18px;
  border: 1px solid var(--line); box-shadow: var(--shadow); }
.dw-caption { margin: 0; font-size: 18px; font-weight: 600; color: var(--text); }
.dw-sub { margin: 0; font-size: 15px; color: var(--muted); }
/* The room follows the theme; things far back are mixed into the wall a little, so they recede. */
.dw-st-wall-top { stop-color: color-mix(in srgb, var(--gold) 10%, var(--surface-2)); }
.dw-st-wall { stop-color: var(--surface-2); }
.dw-st-floor-far { stop-color: color-mix(in srgb, var(--muted) 22%, var(--surface-3)); }
.dw-st-floor { stop-color: var(--surface-3); }
.dw-st-vig-0 { stop-color: var(--bg); stop-opacity: 0; }
.dw-st-vig-1 { stop-color: var(--bg); stop-opacity: 0.6; }
.dw-st-mri-1 { stop-color: color-mix(in srgb, #fbfcfd 72%, var(--surface-2)); }
.dw-st-mri-2 { stop-color: color-mix(in srgb, #d3dae2 72%, var(--surface-2)); }
.dw-st-mri-3 { stop-color: color-mix(in srgb, #94a0ad 72%, var(--surface-2)); }
.dw-st-bore-1 { stop-color: color-mix(in srgb, #3a4552 72%, var(--surface-2)); }
.dw-st-bore-2 { stop-color: color-mix(in srgb, #6c7886 72%, var(--surface-2)); }
.dw-wainscot { fill: color-mix(in srgb, var(--muted) 10%, var(--surface-3)); }
.dw-rail { stroke: color-mix(in srgb, var(--muted) 35%, transparent); stroke-width: 1; }
.dw-boards { stroke: color-mix(in srgb, var(--muted) 16%, transparent); stroke-width: 0.8; }
.dw-cord { stroke: #2b2f36; stroke-width: 1.2; }
.dw-bloom { opacity: 0.85; }
.dw-screen-bloom { opacity: 0.3; }
.dw-far { opacity: 0.8; }
.dw-heart { opacity: 0.55; }
.dw-spine { opacity: 0.75; }
.dw-bone { stroke: #d6dee7; stroke-width: 1.1; stroke-linecap: round; opacity: 0.62; }
.dw-ring { fill: none; stroke: var(--gold); stroke-opacity: 0.25; stroke-width: 2; }
.dw-spin { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; transform-box: fill-box; transform-origin: center;
  animation: p-turn 3.2s linear infinite; }
.dw-ticks { stroke: #5b6470; stroke-width: 0.8; }
.dw-hand-h { stroke: #2d3138; stroke-width: 1.4; stroke-linecap: round; }
.dw-hand-m { stroke: #2d3138; stroke-width: 1; stroke-linecap: round; }
.dw-hand-s { stroke: #c0392b; stroke-width: 0.5; }
.dw-second { transform-origin: 178px 46px; animation: dw-turn 60s steps(60, end) infinite; }
/* The AU-RAD sign: the plate takes the page's surface, so it is light on light and dark on dark, as in the top bar. */
.dw-st-plate-1 { stop-color: color-mix(in srgb, #ffffff 12%, var(--surface-2)); }
.dw-st-plate-2 { stop-color: color-mix(in srgb, #000000 8%, var(--surface)); }
.dw-sign-halo { opacity: 0.4; }
.dw-sign-drop { opacity: 0.18; }
.dw-sign-plate { stroke: color-mix(in srgb, var(--gold) 55%, transparent); stroke-width: 0.6; }
.dw-sign-bevel { stroke: #ffffff; stroke-opacity: 0.35; stroke-width: 0.6; stroke-linecap: round; }
.dw-sign-tile-shine { stroke: #fff6d8; stroke-opacity: 0.7; stroke-width: 0.6; stroke-linecap: round; }
.dw-sign-au { font: 800 9.5px var(--font-display); fill: #17130a; }
.dw-sign-no { font: 600 2.8px var(--font-display); fill: #17130a; }
.dw-sign-word { font: 800 13.5px var(--font-display); letter-spacing: -0.02em; fill: var(--text); }
.dw-sign-gold { fill: var(--gold); }
.dw-plant { transform-origin: 132px 124px; animation: dw-sway 5s ease-in-out infinite alternate; }
.dw-wood-line { stroke: rgba(70, 35, 10, 0.35); stroke-width: 0.8; }
.dw-desk-edge { stroke: rgba(255, 240, 215, 0.6); stroke-width: 0.7; }
.dw-chair-base { stroke: #2b323f; stroke-width: 3; stroke-linecap: round; }
.dw-midline { stroke: #2a313b; stroke-width: 0.8; }
.dw-scan { fill: var(--gold); opacity: 0.85; animation: dw-scan 2.8s ease-in-out infinite alternate; }
.dw-title { fill: var(--gold); }
.dw-line { fill: #8d9cad; transform-box: fill-box; transform-origin: 0 50%; animation: dw-write 6s 6.8s linear infinite both; }
.dw-report rect:nth-child(2) { animation-delay: 8s; }
.dw-report rect:nth-child(3) { animation-delay: 9.2s; }
.dw-report rect:nth-child(4) { animation-delay: 10.4s; }
.dw-report rect:nth-child(5) { animation-delay: 11.6s; }
.dw-glare { opacity: 0.06; }
.dw-keyrow { stroke: #8892a0; stroke-width: 0.9; stroke-dasharray: 1.4 1; opacity: 0.7; }
.dw-handle { stroke: #cdd4dc; stroke-width: 1.6; }
.dw-wisp { stroke: var(--faint); stroke-width: 0.9; stroke-linecap: round; opacity: 0.6; animation: dw-steam 2.6s ease-out infinite; }
.dw-wisp + .dw-wisp { animation-delay: 1.3s; }
.dw-mote { opacity: 0.6; animation: dw-mote 7s ease-in-out infinite; }
.dw-mote:nth-child(2) { animation-duration: 9s; animation-delay: -3s; }
.dw-mote:nth-child(3) { animation-duration: 8s; animation-delay: -5s; }
.dw-mote:nth-child(4) { animation-duration: 10s; animation-delay: -1s; }
.dw-mote:nth-child(5) { animation-duration: 7.5s; animation-delay: -6s; }
.dw-mote:nth-child(6) { animation-duration: 11s; animation-delay: -4s; }
.dw-mote:nth-child(7) { animation-duration: 8.5s; animation-delay: -2s; }
/* The doctor: cool key light from the lightbox, a warm rim from the lamp, the screen's blue on his face once it wakes. */
.dw-coat { stroke: rgba(80, 92, 110, 0.45); stroke-width: 0.6; }
.dw-fold { stroke: rgba(90, 104, 122, 0.45); stroke-width: 0.8; stroke-linecap: round; }
.dw-rim { stroke: #ffd27a; stroke-opacity: 0.75; stroke-width: 1.1; stroke-linecap: round; }
.dw-occlusion { opacity: 0.12; }
.dw-shine { opacity: 0.45; }
.dw-hair-shine { stroke: #ffffff; stroke-opacity: 0.3; stroke-width: 1.4; stroke-linecap: round; }
.dw-hair-strand { stroke: #2e1a0e; stroke-opacity: 0.45; stroke-width: 0.7; stroke-linecap: round; }
.dw-brow { stroke: #3a2213; stroke-width: 1.7; stroke-linecap: round; }
.dw-cheek { opacity: 0.35; }
.dw-smile { stroke: #8a3524; stroke-width: 1.4; stroke-linecap: round; }
.dw-tube { stroke: #2d3138; stroke-width: 1.5; stroke-linecap: round; }
.dw-clip { stroke: #8a95a2; stroke-width: 0.9; }
.dw-card { stroke: #c9d2dc; stroke-width: 0.4; }
.dw-card-lines { stroke: #b5c0cc; stroke-width: 0.6; }
/* The joints, each turning round its own point (the figure's own units: feet at 0, facing right). */
.dw-hip-f, .dw-hip-walk-f { transform-origin: 4px -34px; }
.dw-hip-b, .dw-hip-walk-b { transform-origin: -3px -34px; }
.dw-knee-f, .dw-knee-walk-f { transform-origin: 4px -17px; }
.dw-knee-b, .dw-knee-walk-b { transform-origin: -3px -17px; }
.dw-shoulder-f, .dw-swing-f { transform-origin: 3px -58px; }
.dw-shoulder-b, .dw-swing-b { transform-origin: -6px -58px; }
.dw-elbow-f { transform-origin: 3px -45px; }
.dw-elbow-b { transform-origin: -6px -45px; }
.dw-upper, .dw-breathe { transform-origin: 0 -34px; }
.dw-head, .dw-look { transform-origin: 3px -64px; }
.dw-flap { transform-origin: -12px -33px; }
/* The take: resting styles are its last picture. */
.dw-cam { transform-origin: 0 0; transform: scale(1.3) translate(-83px, -28px); }
.dw-walker { transform: translateX(236px); }
.dw-body { transform: translateY(10px); }
.dw-hip-f { transform: rotate(-78deg); }
.dw-knee-f { transform: rotate(78deg); }
.dw-hip-b { transform: rotate(-72deg); }
.dw-knee-b { transform: rotate(74deg); }
.dw-upper { transform: rotate(4deg); }
.dw-shoulder-f { transform: rotate(-60deg); }
.dw-elbow-f { transform: rotate(-40deg); }
.dw-shoulder-b { transform: rotate(-55deg); }
.dw-elbow-b { transform: rotate(-45deg); }
.dw-gaze { transform: translate(0.6px, 0.3px); }
.dw-pile, .dw-carried, .dw-grin, .dw-skirt-stand { opacity: 0; }
.dw-facelight { opacity: 0.55; }
.dw-cam, .dw-walker, .dw-body, .dw-hip-f, .dw-knee-f, .dw-hip-b, .dw-knee-b, .dw-upper, .dw-shoulder-f, .dw-elbow-f, .dw-shoulder-b, .dw-elbow-b,
.dw-gaze, .dw-brows, .dw-smile, .dw-grin, .dw-pile, .dw-carried, .dw-filed, .dw-skirt-stand, .dw-skirt-sit, .dw-wake, .dw-facelight, .dw-light {
  animation-duration: 6.6s; animation-fill-mode: both; animation-timing-function: ease-in-out; }
.dw-cam { animation-name: dw-cam; }
.dw-walker { animation-name: dw-walk; animation-timing-function: linear; }
.dw-body { animation-name: dw-sit-down; }
.dw-hip-f { animation-name: dw-hip-f; }
.dw-knee-f { animation-name: dw-knee-f; }
.dw-hip-b { animation-name: dw-hip-b; }
.dw-knee-b { animation-name: dw-knee-b; }
.dw-upper { animation-name: dw-upper; }
.dw-shoulder-f { animation-name: dw-shoulder-f; }
.dw-elbow-f { animation-name: dw-elbow-f; }
.dw-shoulder-b { animation-name: dw-shoulder-b; }
.dw-elbow-b { animation-name: dw-elbow-b; }
.dw-gaze { animation-name: dw-gaze; }
.dw-brows { animation-name: dw-brows; }
.dw-smile { animation-name: dw-smile; }
.dw-grin { animation-name: dw-grin; }
.dw-pile { animation-name: dw-pile; }
.dw-carried { animation-name: dw-carried; }
.dw-filed { transform-box: fill-box; transform-origin: center; animation-name: dw-filed; }
.dw-skirt-stand { animation-name: dw-skirt-stand; }
.dw-skirt-sit { animation-name: dw-skirt-sit; }
.dw-wake { animation-name: dw-wake; }
.dw-facelight { animation-name: dw-facelight; }
.dw-light { animation-name: dw-flicker; animation-timing-function: steps(1, end); }
/* The walk, twice (0–2 s and 3.4–5.4 s): legs, arms, a bounce, the head and the coat's tail a beat behind. */
.dw-hip-walk-f { animation: dw-hipw-f 1s linear 2, dw-hipw-f 1s linear 3.4s 2; }
.dw-knee-walk-f { animation: dw-kneew-f 1s linear 2, dw-kneew-f 1s linear 3.4s 2; }
.dw-hip-walk-b { animation: dw-hipw-b 1s linear 2, dw-hipw-b 1s linear 3.4s 2; }
.dw-knee-walk-b { animation: dw-kneew-b 1s linear 2, dw-kneew-b 1s linear 3.4s 2; }
.dw-swing-f { animation: dw-swing-f 1s ease-in-out 2, dw-swing-small 1s ease-in-out 3.4s 2; }
.dw-swing-b { animation: dw-swing-b 1s ease-in-out 2, dw-swing-b 1s ease-in-out 3.4s 2; }
.dw-squash { animation: dw-squash 0.5s ease-in-out 4, dw-squash 0.5s ease-in-out 3.4s 4; }
.dw-head { animation: dw-head 0.5s ease-in-out 0.06s 4, dw-head 0.5s ease-in-out 3.46s 4; }
.dw-flap { animation: dw-flap 0.5s ease-in-out 0.1s 4, dw-flap 0.5s ease-in-out 3.5s 4; }
/* Then, until the answer comes. */
.dw-drift { transform-origin: 230px 120px; animation: dw-drift 14s ease-in-out 6.6s infinite alternate; }
.dw-breathe { animation: dw-breathe 3.4s ease-in-out 6.6s infinite; }
.dw-tap { animation: dw-tap 1.7s ease-in-out 6.7s infinite; }
.dw-tap-b { animation-delay: 6.85s; }
.dw-look { animation: dw-look 7s ease-in-out 7.2s infinite; }
.dw-read { animation: dw-read 2.6s ease-in-out 6.6s infinite; }
.dw-lid { transform-box: fill-box; transform-origin: 50% 0; transform: scaleY(0.07); animation: dw-blink 4.2s ease-in-out 1.2s infinite; }
@keyframes dw-cam {
  0% { transform: scale(1.22) translate(0, -18px); }
  30.3%, 45.45% { transform: scale(1.3) translate(-10px, -26px); }
  81.8% { transform: scale(1.3) translate(-73px, -34px); }
  100% { transform: scale(1.3) translate(-83px, -28px); } }
@keyframes dw-walk {
  0% { transform: translateX(-50px); animation-timing-function: cubic-bezier(0.35, 0.05, 0.5, 0.95); }
  30.3%, 51.5% { transform: translateX(80px); animation-timing-function: cubic-bezier(0.35, 0.05, 0.5, 0.95); }
  81.8%, 87.9% { transform: translateX(250px); animation-timing-function: ease-in-out; }
  95.45%, 100% { transform: translateX(236px); } }
@keyframes dw-sit-down { 0%, 87.9% { transform: none; } 93% { transform: translateY(11.5px); } 96.5% { transform: translateY(9.3px); } 100% { transform: translateY(10px); } }
@keyframes dw-hip-f { 0%, 87.9% { transform: none; } 94% { transform: rotate(-82deg); } 100% { transform: rotate(-78deg); } }
@keyframes dw-knee-f { 0%, 87.9% { transform: none; } 94% { transform: rotate(81deg); } 100% { transform: rotate(78deg); } }
@keyframes dw-hip-b { 0%, 87.9% { transform: none; } 94% { transform: rotate(-76deg); } 100% { transform: rotate(-72deg); } }
@keyframes dw-knee-b { 0%, 87.9% { transform: none; } 94% { transform: rotate(77deg); } 100% { transform: rotate(74deg); } }
@keyframes dw-upper {
  0%, 30.3% { transform: none; }
  34.85% { transform: rotate(-2deg); }
  37.9% { transform: rotate(-6deg); animation-timing-function: cubic-bezier(0.3, 0, 0.2, 1); }
  42.4%, 45.45% { transform: rotate(10deg); }
  51.5%, 81.8% { transform: none; }
  84.85% { transform: rotate(7deg); }
  87.9% { transform: rotate(4deg); }
  91.5% { transform: rotate(12deg) scale(1.02, 0.97); }
  96% { transform: rotate(2deg) scale(0.99, 1.02); }
  100% { transform: rotate(4deg); } }
@keyframes dw-shoulder-f {
  0%, 30.3% { transform: none; }
  34.85% { transform: rotate(8deg); }
  37.9% { transform: rotate(20deg); animation-timing-function: cubic-bezier(0.3, 0, 0.2, 1); }
  42.4%, 45.45% { transform: rotate(-95deg); }
  51.5%, 81.8% { transform: rotate(15deg); }
  84.85% { transform: rotate(-70deg); }
  87.9% { transform: rotate(-60deg); }
  92.4% { transform: rotate(-5deg); }
  95.45% { transform: rotate(-25deg); }
  100% { transform: rotate(-60deg); } }
@keyframes dw-elbow-f {
  0%, 30.3% { transform: rotate(-15deg); }
  37.9% { transform: rotate(-50deg); }
  42.4%, 45.45% { transform: rotate(-5deg); }
  51.5%, 81.8% { transform: rotate(-100deg); }
  84.85%, 87.9% { transform: rotate(-20deg); }
  92.4% { transform: rotate(-35deg); }
  95.45% { transform: rotate(-70deg); }
  100% { transform: rotate(-40deg); } }
@keyframes dw-shoulder-b { 0%, 87.9% { transform: none; } 92.4% { transform: rotate(-5deg); } 100% { transform: rotate(-55deg); } }
@keyframes dw-elbow-b { 0%, 87.9% { transform: rotate(-15deg); } 100% { transform: rotate(-45deg); } }
@keyframes dw-gaze {
  0%, 34.85% { transform: none; } 37.9%, 45.45% { transform: translate(0.5px, 1.4px); } 51.5%, 81.8% { transform: none; }
  84.85%, 90% { transform: translate(0.5px, 1.3px); } 100% { transform: translate(0.6px, 0.3px); } }
@keyframes dw-brows { 0%, 40% { transform: none; } 44%, 52% { transform: translateY(-1.8px); } 58%, 100% { transform: none; } }
@keyframes dw-smile { 0%, 45% { opacity: 1; } 46.5%, 56% { opacity: 0; } 58%, 100% { opacity: 1; } }
@keyframes dw-grin { 0%, 45% { opacity: 0; } 46.5%, 56% { opacity: 1; } 58%, 100% { opacity: 0; } }
@keyframes dw-pile { 0%, 45% { opacity: 1; } 45.5%, 100% { opacity: 0; } }
@keyframes dw-carried { 0%, 45% { opacity: 0; } 45.5%, 84.5% { opacity: 1; } 85%, 100% { opacity: 0; } }
@keyframes dw-filed {
  0%, 84.5% { opacity: 0; transform: translate(-17px, -10px) rotate(-25deg); }
  84.85% { opacity: 1; transform: translate(-17px, -10px) rotate(-25deg); animation-timing-function: cubic-bezier(0.2, 0.7, 0.3, 1); }
  90.9% { opacity: 1; transform: translate(1.2px, 0) rotate(2deg); }
  92.4%, 100% { opacity: 1; transform: none; } }
@keyframes dw-skirt-stand { 0%, 90.5% { opacity: 1; } 91%, 100% { opacity: 0; } }
@keyframes dw-skirt-sit { 0%, 90.5% { opacity: 0; } 91%, 100% { opacity: 1; } }
@keyframes dw-wake { 0%, 90% { opacity: 0.3; } 97%, 100% { opacity: 1; } }
@keyframes dw-facelight { 0%, 92% { opacity: 0; } 100% { opacity: 0.55; } }
@keyframes dw-flicker { 0% { opacity: 0.2; } 3% { opacity: 1; } 5% { opacity: 0.35; } 7% { opacity: 1; } 9% { opacity: 0.6; } 11%, 100% { opacity: 1; } }
@keyframes dw-hipw-f { 0%, 100% { transform: none; } 25% { transform: rotate(18deg); } 40% { transform: rotate(5deg); } 55% { transform: rotate(-18deg); } 70% { transform: rotate(-20deg); } }
@keyframes dw-kneew-f { 0%, 70%, 100% { transform: none; } 25% { transform: rotate(15deg); } 40% { transform: rotate(45deg); } 55% { transform: rotate(15deg); } }
@keyframes dw-hipw-b { 0%, 100% { transform: none; } 20% { transform: rotate(-15deg); } 35% { transform: rotate(-20deg); } 60% { transform: none; } 85% { transform: rotate(18deg); } }
@keyframes dw-kneew-b { 0%, 35%, 100% { transform: none; } 20% { transform: rotate(30deg); } 60% { transform: rotate(5deg); } 85% { transform: rotate(15deg); } }
@keyframes dw-swing-f { 25% { transform: rotate(-18deg); } 62% { transform: rotate(18deg); } }
@keyframes dw-swing-small { 25% { transform: rotate(-4deg); } 62% { transform: rotate(4deg); } }
@keyframes dw-swing-b { 25% { transform: rotate(18deg); } 62% { transform: rotate(-18deg); } }
@keyframes dw-squash { 0%, 100% { transform: none; } 20% { transform: scale(1.03, 0.96); } 60% { transform: translateY(-2.5px) scale(0.98, 1.03); } }
@keyframes dw-head { 30% { transform: rotate(-2.5deg); } 70% { transform: rotate(2.5deg); } }
@keyframes dw-flap { 35% { transform: rotate(-12deg); } 70% { transform: rotate(4deg); } }
@keyframes dw-drift { to { transform: scale(1.035); } }
@keyframes dw-breathe { 50% { transform: scale(1.012, 1.028); } }
/* The hands sit on a forearm turned 100° forward: "up" on the screen is along the forearm in its own frame. */
@keyframes dw-tap { 8%, 24%, 40%, 56% { transform: translate(2px, 0.35px); } 0%, 16%, 32%, 48%, 64%, 100% { transform: none; } }
@keyframes dw-look {
  0%, 30%, 88%, 100% { transform: none; }
  40%, 48% { transform: rotate(7deg); } 53% { transform: rotate(3.5deg); } 58% { transform: rotate(7deg); } 63% { transform: rotate(3.5deg); } 68%, 76% { transform: rotate(7deg); } }
@keyframes dw-read { 0%, 100% { transform: translate(-0.7px, 0.4px); } 70% { transform: translate(0.6px, 0.4px); } }
@keyframes dw-blink { 0%, 90%, 100% { transform: scaleY(0.07); } 94% { transform: scaleY(1); } }
@keyframes dw-write { 0% { transform: scaleX(0); } 18%, 88% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
@keyframes dw-scan { to { transform: translateY(36px); } }
@keyframes dw-steam { 0% { opacity: 0; transform: translateY(2px); } 40% { opacity: 0.7; } 100% { opacity: 0; transform: translateY(-6px); } }
@keyframes dw-mote { 0% { opacity: 0; transform: none; } 30% { opacity: 0.9; } 70% { opacity: 0.7; } 100% { opacity: 0; transform: translate(5px, -12px); } }
@keyframes dw-turn { to { transform: rotate(360deg); } }
@keyframes dw-sway { from { transform: rotate(-2.5deg); } to { transform: rotate(2.5deg); } }
@media (prefers-reduced-motion: reduce) {
  .dw-scene * { animation: none; }
  .dw-cam { transform: scale(1.18) translate(-55px, -32px); } }

@media (max-width: 700px) {
  .p-tiles, .p-grid { grid-template-columns: 1fr; }
  .p-step .label { display: none; }
  .p-step.now .label { display: block; white-space: nowrap; }
  .p-hero { padding: 20px; }
  .p-hero svg.rings { right: -260px; }
  .p-top { padding: 0 12px; gap: 6px; }
  .p-top .brand-word { white-space: nowrap; }
  .p-top select.input { max-width: 116px; }
  .p-home-label { display: none; }
  .p-frame { flex: none; height: calc(100dvh - 250px); min-height: 420px; }
  /* Tiles lie down on a phone: icon on the left, so all four fit the screen. */
  .p-tile { display: grid; grid-template-columns: 46px minmax(0, 1fr); column-gap: 14px; row-gap: 2px; align-items: center; min-height: 0; padding: 16px; }
  .p-tile .tile-icon { grid-row: span 2; }
  .p-tile strong { font-size: 19px; }
  .p-main { padding: 20px 16px; }
  .p-question { font-size: 25px; }
  .p-shell { height: auto; min-height: 100vh; }
  .bm { grid-template-columns: 1fr; }
  .bm-svg { height: 44vh; }
  .p-ops { grid-template-columns: 1fr; }
  .p-faces { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* A laptop's screen, once the browser has its bars, is often only 600 to 750 pixels high: the same sheet, closer together,
   so that it still fits without scrolling. */
@media (min-width: 901px) and (max-height: 820px) {
  .p-shell { grid-template-rows: 54px 1fr; }
  .p-main { padding-block: 12px; }
  .p-shell .p-column { gap: 12px; }
  .p-shell .p-column > .p-cancel { top: 56px; }
  .p-step { gap: 4px; font-size: 12px; }
  .p-step .dot { width: 30px; height: 30px; }
  .p-step + .p-step::before { top: 14px; right: calc(50% + 19px); left: calc(-50% + 19px); }
  .p-question { font-size: 24px; margin: 0; }
  .p-help { font-size: 15px; }
  .p-card { padding: 14px 16px; gap: 10px; }
  .p-field textarea.input { min-height: 100px; }
  .p-mic { height: 44px; }
  .btn.huge { height: 50px; font-size: 17px; }
  .p-meter { padding: 10px 14px; gap: 6px; }
  .p-meter-value { font-size: 18px; }
  .p-part { min-height: 88px; padding: 10px 14px; gap: 4px; }
  .p-part .p-line-pic { width: 34px; height: 34px; }
  .p-parts { gap: 10px; }
  .bm-svg { height: clamp(220px, calc(100dvh - 330px), 540px); }
  .p-line-item { padding: 3px 0; }
  .p-strip-box { padding: 6px 0 8px; }
  .p-hero { padding: 18px 22px; }
  /* On a short screen the example's own words keep the room; the advice on speaking to the microphone gives way. */
  .p-example > .muted { display: none; }
  .p-speak textarea.input { min-height: 72px; }
}

/* The story as a chart of time: a line across, the moments above and below it in turn, each year's number on the line. */
.p-chart-box { display: grid; gap: 10px; }
.p-chart-legend { margin: 0; display: flex; gap: 18px; font-size: 14px; color: var(--muted); }
.p-chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.p-chart-legend span::before { content: ''; width: 12px; height: 12px; border-radius: 50%; }
.p-chart-legend .has::before { background: var(--ok); }
.p-chart-legend .lacks::before { background: var(--bad); }
.p-chart { --side: clamp(112px, calc((100dvh - 390px) / 2), 140px); list-style: none; margin: 0; padding: 0 8px; display: grid; position: relative; height: calc(2 * var(--side) + 24px); }
.p-chart.short { --side: 64px; }
.p-chart::before { content: ''; position: absolute; left: 0; right: 0; top: calc(var(--side) + 11px); height: 2px; background: color-mix(in srgb, var(--muted) 45%, transparent); }
.p-chart-point { position: relative; display: grid; grid-template-rows: var(--side) 24px var(--side); justify-items: center; min-width: 0; }
.p-chart-dot { grid-row: 2; align-self: center; width: 14px; height: 14px; border-radius: 50%; background: var(--gold); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line); position: relative; z-index: 1; }
.p-chart-dot.has { background: var(--ok); }
.p-chart-dot.lacks { background: var(--bad); }
.p-chart-year { position: absolute; left: 0; top: calc(var(--side) + 12px); transform: translate(-50%, -50%); z-index: 2; padding: 1px 7px; border-radius: 99px; background: var(--surface-3); font-size: 12px; font-weight: 800; color: var(--muted); }
/* Each moment's words may take the room of two columns: its neighbours stand on the other side of the line. */
.p-chart-moment { width: 200%; max-width: 220px; display: grid; justify-items: center; align-content: end; gap: 3px; padding: 0 4px; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; text-align: center; min-width: 0; }
.p-chart-point.above .p-chart-moment { grid-row: 1; align-self: end; padding-bottom: 4px; }
.p-chart-point.below .p-chart-moment { grid-row: 3; align-self: start; align-content: start; padding-top: 4px; }
.p-chart-point.below .p-chart-date { order: 1; }
.p-chart-point.below .p-chart-words { order: 2; }
.p-chart-point.below .p-chart-badge { order: 3; }
.p-chart-moment .p-line-pic { width: 36px; height: 36px; }
.p-chart-moment .p-line-pic svg { width: 22px; height: 22px; }
.p-chart-moment:hover .p-line-pic, .p-chart-moment:focus-visible .p-line-pic { box-shadow: 0 0 0 2px var(--gold); }
.p-chart-date { font-size: 12px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.p-chart-words { font-size: 13px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.p-chart-badge { font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 99px; }
.p-chart-moment.has .p-line-pic { background: color-mix(in srgb, var(--ok) 16%, var(--surface)); color: var(--ok); box-shadow: 0 0 0 2px var(--ok); }
.p-chart-moment.lacks .p-line-pic { background: var(--bad-soft); color: var(--bad); box-shadow: 0 0 0 2px var(--bad); }
.p-chart-moment.has .p-chart-badge { background: color-mix(in srgb, var(--ok) 16%, var(--surface)); color: var(--ok); }
.p-chart-moment.lacks .p-chart-badge { background: var(--bad-soft); color: var(--bad); }
.p-chart-moment.kind-complaint .p-line-pic, .p-chart-moment.kind-symptom .p-line-pic { background: var(--bad-soft); color: var(--bad); }
.p-chart-moment.kind-surgery .p-line-pic { background: rgba(120, 160, 230, 0.16); color: #7ba5da; }
.p-chart-undated { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.p-chart-undated .p-chart-moment { width: auto; max-width: none; grid-auto-flow: column; align-items: center; }
.p-chart-also { margin: 0; font-size: 14px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
/* A short screen: the coloured ring and the legend say whether a scan's images came; the word under it gives way. */
@media (min-width: 901px) and (max-height: 640px) { .p-chart { --side: 100px; } .p-chart-badge { display: none; } }
.p-chart-caption { margin: 0; min-height: 2.8em; height: 2.8em; font-size: 15px; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: var(--muted); }
@media (max-width: 900px) {
  .p-chart { grid-template-columns: minmax(0, 1fr) !important; height: auto; padding: 0 0 0 28px; }
  .p-chart::before { left: 14px; right: auto; top: 0; bottom: 0; width: 2px; height: auto; }
  .p-chart-point { grid-template-rows: none; grid-template-columns: 0 minmax(0, 1fr); justify-items: start; padding: 6px 0; }
  .p-chart-dot { position: absolute; left: -21px; top: 18px; }
  .p-chart-year { left: -14px; top: 0; transform: translate(-50%, 0); }
  .p-chart-point .p-chart-moment { grid-row: auto !important; width: 100%; max-width: none; justify-items: start; text-align: left; padding: 0; }
}

/* The whole story by years: a column for each year, its number on top and its moments down a line, month by month. */
.p-years { display: flex; gap: 14px; min-height: 0; }
.p-year { flex: 1 1 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0; overflow: hidden; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.p-year-head { margin: 0; font-size: 28px; font-weight: 800; color: var(--gold-strong); font-variant-numeric: tabular-nums; }
.p-year.side .p-year-head { font-size: 17px; color: inherit; }
.p-year-lines { display: flex; gap: 16px; min-height: 0; }
.p-year-lines > .p-year-list { flex: 1 1 0; min-width: 0; }
.p-year-list { list-style: none; margin: 0; padding: 0 0 0 4px; display: grid; gap: 12px; align-content: start; position: relative; }
.p-year-list::before { content: ''; position: absolute; left: 21px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.p-year-item { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; align-items: start; position: relative; }
.p-year-item .p-line-pic { width: 36px; height: 36px; position: relative; z-index: 1; }
.p-year-item .p-line-pic svg { width: 22px; height: 22px; }
.p-year-item > div { display: grid; gap: 2px; min-width: 0; }
.p-year-when { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.p-year-item strong { font-size: 15px; font-weight: 600; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.p-year-item .muted { font-size: 13px; }
.p-year-item.kind-complaint .p-line-pic, .p-year-item.kind-symptom .p-line-pic { background: var(--bad-soft); color: var(--bad); }
.p-year-item.kind-surgery .p-line-pic { background: rgba(120, 160, 230, 0.16); color: #7ba5da; }
.p-year-side { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 15px; }
.p-years.dense .p-year-item strong { -webkit-line-clamp: 2; font-size: 14px; }
.p-years.dense .p-year-item .muted { display: none; }
.p-years.dense .p-year-list { gap: 8px; }
@media (max-width: 900px) { .p-years, .p-year-lines { flex-direction: column; height: auto !important; } }

/* Specialists as a patient meets them (doctors.js): cards side by side, and a page of their own. */
.doc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; align-items: stretch; }
.doc-card { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); min-width: 0; }
.doc-head { display: flex; gap: 14px; align-items: center; min-width: 0; }
.doc-photo { flex: none; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold-soft); }
img.doc-photo { background: var(--surface-3); }
.doc-name { display: grid; gap: 4px; min-width: 0; }
.doc-name h3 { margin: 0; font-size: 18px; text-transform: none; letter-spacing: normal; color: var(--text); }
.doc-ribbon { justify-self: start; padding: 2px 10px; border-radius: 99px; background: var(--gold); color: var(--on-gold); font-size: 12px; font-weight: 800; }
.doc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.doc-tag { padding: 2px 10px; border-radius: 99px; background: var(--gold-soft); color: var(--gold-strong); font-size: 13px; font-weight: 600; }
.doc-facts { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; font-size: 14px; color: var(--muted); }
.doc-rating span { color: var(--gold); letter-spacing: 1px; }
/* The patient's stars under their report: five buttons, those up to the one chosen lit. */
.p-stars { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.p-stars button { border: 0; background: none; padding: 0 2px; font-size: 30px; line-height: 1; color: var(--line); cursor: pointer; }
.p-stars button.on { color: var(--gold); }
.p-stars button:focus-visible { outline: 2px solid var(--gold); border-radius: 4px; }
.doc-about { margin: 0; font-size: 15px; line-height: 1.5; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.doc-about.whole { display: block; -webkit-line-clamp: none; white-space: pre-line; }
.doc-foot { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.doc-price { display: grid; gap: 0; }
.doc-price span { font-size: 12px; color: var(--muted); }
.doc-price strong { font: 700 22px/1.1 var(--font-display); }
.btn.chosen { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); border-color: var(--ok); color: var(--ok); font-weight: 700; }
.doc-page { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; align-items: start; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.doc-side { display: grid; gap: 10px; justify-items: center; text-align: center; }
.doc-side h2 { margin: 6px 0 0; font-size: 22px; }
.doc-side .doc-tags { justify-content: center; }
.doc-main { display: grid; gap: 10px; min-width: 0; }
.doc-main h3 { margin: 6px 0 0; font-size: 16px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.doc-career { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; border-left: 2px solid var(--line); padding-left: 16px; }
.doc-career li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; font-size: 15px; position: relative; }
.doc-career li::before { content: ''; position: absolute; left: -22px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }
.doc-when { font-weight: 700; color: var(--gold-strong); font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .doc-page { grid-template-columns: minmax(0, 1fr); } }

/* "My profile" (staff side): the fields, and beside them the card a patient sees. */
.sp-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; min-height: 0; flex: 1; }
.sp-layout > .card { padding: 18px 20px; min-height: 0; }
.sp-preview { display: grid; gap: 10px; align-content: start; }
.sp-preview h3 { margin: 0; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.sp-section { margin: 10px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 15px; }
.sp-photo { display: inline-flex; }
@media (max-width: 900px) { .sp-layout { grid-template-columns: minmax(0, 1fr); } }

/* A patient's upload link (patient/link.js): their details two by two, the complaint across; a notice when it cannot go on. */
.p-link-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 20px; }
.p-link-form .p-choice { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.p-link-wide { grid-column: 1 / -1; }
.p-link-form textarea.input { min-height: 72px; }
.p-link-notice { align-items: center; text-align: center; gap: 10px; max-width: 620px; margin: 40px auto 0; }
.p-link-notice .p-actions { width: 100%; }
.p-link-mark { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--gold-soft); color: var(--gold-strong); }
@media (max-width: 700px) { .p-link-form { grid-template-columns: minmax(0, 1fr); } }
