/* e-MAS Health Screening — prototype stylesheet
   Layout: fixed left rail + sticky context bar + scrolling work area.
   Clinical neutrals biased cool; teal brand; semantic colours reserved for reading flags. */

:root {
  --bg: #f5f8f9;
  --surface: #ffffff;
  --surface-2: #eef3f5;
  --surface-3: #e4ecef;
  --line: #dae4e8;
  --line-strong: #c3d2d8;
  --ink: #0f2029;
  --ink-2: #44606d;
  --muted: #7a95a2;

  --brand: #0b7a8a;
  --brand-hover: #09616e;
  --brand-soft: #e0f3f5;
  --brand-ink: #064e59;

  --ok: #14774a;
  --ok-soft: #e1f4ea;
  --warn: #9c5f07;
  --warn-soft: #fcefd9;
  --high: #ab2129;
  --high-soft: #fcebeb;
  --info: #2a5aa0;
  --info-soft: #e8f0fb;
  --wa: #1fa855;
  --wa-soft: #e4f6ea;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(15, 32, 41, .06), 0 8px 24px -12px rgba(15, 32, 41, .18);
  --shadow-lg: 0 24px 60px -20px rgba(15, 32, 41, .35);

  --font-ui: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-data: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --rail: 232px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1317;
    --surface: #10202a;
    --surface-2: #162d38;
    --surface-3: #1d3a47;
    --line: #223b47;
    --line-strong: #2f4f5e;
    --ink: #e5eff2;
    --ink-2: #a6c0cb;
    --muted: #6d8995;

    --brand: #38b2c3;
    --brand-hover: #55c6d6;
    --brand-soft: #0d343c;
    --brand-ink: #a6e4ec;

    --ok: #5bcf8d;
    --ok-soft: #0d3123;
    --warn: #e3b263;
    --warn-soft: #382a10;
    --high: #ef8a8a;
    --high-soft: #39191b;
    --info: #88b2ef;
    --info-soft: #142541;
    --wa: #45c877;
    --wa-soft: #0d3320;

    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
    --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0a1317;
  --surface: #10202a;
  --surface-2: #162d38;
  --surface-3: #1d3a47;
  --line: #223b47;
  --line-strong: #2f4f5e;
  --ink: #e5eff2;
  --ink-2: #a6c0cb;
  --muted: #6d8995;

  --brand: #38b2c3;
  --brand-hover: #55c6d6;
  --brand-soft: #0d343c;
  --brand-ink: #a6e4ec;

  --ok: #5bcf8d;
  --ok-soft: #0d3123;
  --warn: #e3b263;
  --warn-soft: #382a10;
  --high: #ef8a8a;
  --high-soft: #39191b;
  --info: #88b2ef;
  --info-soft: #142541;
  --wa: #45c877;
  --wa-soft: #0d3320;

  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; font-weight: 600; }
h2 { font-size: 1.125rem; font-weight: 600; }
h3 { font-size: .95rem; font-weight: 600; }
p { margin: 0; }
a { color: var(--brand); }
img { max-width: 100%; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* ---------- shell ---------- */

.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }

.rail {
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding-bottom: 12px;
}

.rail__brand {
  display: flex; align-items: center; gap: 9px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}
.rail__mark {
  width: 28px; height: 28px; flex: none; border-radius: 7px;
  background: var(--brand); color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 12px; letter-spacing: -.03em;
}
.rail__name { font-family: var(--font-display); font-weight: 600; font-size: 13px; line-height: 1.15; }
.rail__sub { font-size: 10.5px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }

.rail__group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 14px 16px 5px; font-weight: 600; }

.rail a.nav {
  display: flex; align-items: center; gap: 10px;
  margin: 0 8px; padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink-2); text-decoration: none; font-weight: 500;
}
.rail a.nav:hover { background: var(--surface-2); color: var(--ink); }
.rail a.nav[aria-current="page"] { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.rail .nav svg { width: 16px; height: 16px; flex: none; opacity: .85; }
.rail .nav .count { margin-left: auto; font-family: var(--font-data); font-size: 11px; color: var(--muted); }

.rail__user {
  margin-top: auto; padding: 12px 14px 4px; border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 9px;
}
.rail__user .avatar { width: 30px; height: 30px; }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding-block: 10px;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.topbar h1 { font-size: 1.1rem; }
.topbar .spacer { flex: 1 1 auto; }

.page {
  padding-block: 20px 56px;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 18px;
}
.page--narrow > * { max-width: 920px; }

.menu-btn { display: none; }

@media (max-width: 880px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail {
    position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 60;
    transform: translateX(-102%); transition: transform .2s ease;
    box-shadow: var(--shadow-lg);
  }
  body.nav-open .rail { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(8, 20, 26, .5); z-index: 50; }
  .menu-btn { display: inline-flex; }
}

/* ---------- prototype banner ---------- */

.proto-bar {
  background: #1d2f38; color: #cfe3e9;
  font-size: 11.5px; letter-spacing: .02em;
  padding-block: 6px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.proto-bar b { color: #fff; font-weight: 600; }
.proto-bar a { color: #7fd6e2; text-decoration: none; }
.proto-bar a:hover { text-decoration: underline; }
.proto-bar .spacer { flex: 1 1 auto; }

/* ---------- primitives ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 550; cursor: pointer; text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn svg { width: 15px; height: 15px; }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn--wa { background: var(--wa); border-color: var(--wa); color: #062513; font-weight: 650; }
.btn--wa:hover { filter: brightness(1.07); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn--ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn--danger { color: var(--high); border-color: color-mix(in srgb, var(--high) 40%, var(--line)); background: var(--surface); }
.btn--sm { padding: 5px 10px; font-size: 12.5px; }
.btn--lg { padding: 12px 20px; font-size: 15px; }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  background: var(--surface-2); color: var(--ink-2);
  border: 1px solid transparent; white-space: nowrap;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.chip--plain::before { display: none; }
.chip--ok { background: var(--ok-soft); color: var(--ok); }
.chip--warn { background: var(--warn-soft); color: var(--warn); }
.chip--high { background: var(--high-soft); color: var(--high); }
.chip--info { background: var(--info-soft); color: var(--info); }
.chip--brand { background: var(--brand-soft); color: var(--brand-ink); }
.chip--wa { background: var(--wa-soft); color: var(--wa); }
.chip--muted { background: var(--surface-2); color: var(--muted); }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card__head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 13px 16px; border-bottom: 1px solid var(--line);
}
.card__head h2, .card__head h3 { margin-right: auto; }
.card__body { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.card__foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.grid { display: grid; gap: 14px; }
.grid--tiles { grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid > * { min-width: 0; }

.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 4px;
}
.tile__label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.tile__value { font-family: var(--font-display); font-size: 1.75rem; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile__note { font-size: 12px; color: var(--ink-2); }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.mono { font-family: var(--font-data); font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row--tight { gap: 6px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.push { margin-left: auto; }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }

.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-ink);
  font-weight: 650; font-size: 12px; letter-spacing: -.02em;
}
.avatar--lg { width: 46px; height: 46px; font-size: 15px; }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; }
table.data { width: 100%; min-width: 600px; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 600; padding: 9px 12px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
  position: sticky; top: 0; background: var(--surface);
}
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .num { text-align: right; font-family: var(--font-data); font-variant-numeric: tabular-nums; }
.cell-name { display: flex; align-items: center; gap: 9px; }
.cell-name strong { font-weight: 600; }
.cell-sub { font-size: 11.5px; color: var(--muted); }

/* ---------- forms ---------- */

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 11.5px; color: var(--muted); }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"],
input[type="date"], input[type="time"], input[type="password"], input[type="search"],
select, textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 8px 10px; width: 100%; min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: 2px solid color-mix(in srgb, var(--brand) 25%, transparent); outline-offset: 0; }
textarea { resize: vertical; min-height: 72px; }
::placeholder { color: var(--muted); }

.input-group { display: flex; align-items: stretch; }
.input-group input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .unit {
  display: grid; place-items: center; padding: 0 10px;
  border: 1px solid var(--line-strong); border-left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--surface-2); color: var(--muted);
  font-family: var(--font-data); font-size: 12px; white-space: nowrap;
}

.check { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; cursor: pointer; }
.check input { margin: 2px 0 0; accent-color: var(--brand); width: 15px; height: 15px; flex: none; }

.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); padding: 0 10px; min-width: 180px; flex: 1 1 220px; max-width: 360px;
}
.search input { border: 0; padding: 8px 0; background: transparent; }
.search input:focus { outline: none; }
.search svg { width: 15px; height: 15px; color: var(--muted); flex: none; }

/* ---------- tabs & segments ---------- */

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a, .tabs button {
  padding: 9px 13px; border: 0; background: transparent; font: inherit; font-weight: 550;
  color: var(--ink-2); text-decoration: none; cursor: pointer; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover, .tabs button:hover { color: var(--ink); }
.tabs [aria-current="page"], .tabs [aria-selected="true"] { color: var(--brand-ink); border-bottom-color: var(--brand); }

.seg { display: inline-flex; background: var(--surface-2); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: transparent; font: inherit; font-weight: 550; font-size: 12.5px;
  padding: 5px 11px; border-radius: 4px; color: var(--ink-2); cursor: pointer; white-space: nowrap;
}
.seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* ---------- reading flags ---------- */

.reading {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: baseline;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface);
  border-left: 3px solid var(--line-strong);
}
.reading--ok { border-left-color: var(--ok); }
.reading--warn { border-left-color: var(--warn); }
.reading--high { border-left-color: var(--high); }
.reading__name { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.reading__val { font-family: var(--font-data); font-size: 1.05rem; font-weight: 600; font-variant-numeric: tabular-nums; grid-row: 2; }
.reading__unit { font-family: var(--font-data); font-size: 11.5px; color: var(--muted); }
.reading__flag { grid-row: 2; justify-self: end; }
.reading__ref { grid-column: 1 / -1; font-size: 11px; color: var(--muted); font-family: var(--font-data); }

/* ---------- progress ---------- */

.bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.bar--ok > span { background: var(--ok); }

.stack-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.stack-bar > span { display: block; }

/* ---------- queue cards (tablet) ---------- */

.queue-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.qcard {
  display: flex; gap: 12px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 14px; text-decoration: none; color: inherit;
  border-left: 3px solid var(--line-strong);
  cursor: pointer; text-align: left; font: inherit;
  width: 100%;
}
.qcard:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.qcard--active { border-left-color: var(--warn); }
.qcard--done { border-left-color: var(--ok); }
.qcard--waiting { border-left-color: var(--brand); }
.qcard__body { min-width: 0; flex: 1; }
.qcard__name { font-weight: 650; font-size: 14.5px; }
.qcard__meta { font-size: 11.5px; color: var(--muted); font-family: var(--font-data); }

/* ---------- upload / dropzone ---------- */

.dropzone {
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius);
  background: var(--surface-2); padding: 26px 20px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.dropzone svg { width: 28px; height: 28px; color: var(--muted); }

/* ---------- template builder ---------- */

.fieldrow {
  display: grid; gap: 8px 12px; align-items: center;
  grid-template-columns: 18px minmax(140px, 1.6fr) minmax(110px, 1fr) minmax(90px, .7fr) minmax(140px, 1.2fr) auto;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface);
}
.fieldrow + .fieldrow { margin-top: 6px; }
.fieldrow .drag { color: var(--muted); cursor: grab; display: grid; place-items: center; }
.fieldrow input, .fieldrow select { padding: 6px 8px; font-size: 12.5px; }
@media (max-width: 780px) {
  .fieldrow { grid-template-columns: 18px minmax(0, 1fr) auto; }
  .fieldrow .wide-only { display: none; }
}

/* ---------- result card (the WhatsApp image) ---------- */

.rc-frame {
  width: 100%; max-width: 360px; margin-inline: auto;
  background: #ffffff; color: #10212b;
  border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow);
  font-family: var(--font-ui);
}
.rc-head { background: #0b7a8a; color: #fff; padding: 14px 16px; }
.rc-head .rc-title { font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.rc-head .rc-sub { font-size: 11px; opacity: .85; }
.rc-person { padding: 12px 16px; border-bottom: 1px solid #e7eef0; }
.rc-person .rc-nm { font-weight: 650; font-size: 15px; }
.rc-person .rc-id { font-family: var(--font-data); font-size: 11px; color: #6c8795; }
.rc-rows { padding: 6px 16px 12px; }
.rc-row { display: flex; align-items: baseline; gap: 8px; padding: 7px 0; border-bottom: 1px solid #f0f4f6; }
.rc-row:last-child { border-bottom: 0; }
.rc-row .rc-k { font-size: 12px; color: #44606d; flex: 1; }
.rc-row .rc-v { font-family: var(--font-data); font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }
.rc-row .rc-f { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 999px; letter-spacing: .02em; }
.rc-f--ok { background: #e1f4ea; color: #14774a; }
.rc-f--warn { background: #fcefd9; color: #9c5f07; }
.rc-f--high { background: #fcebeb; color: #ab2129; }
.rc-note { background: #fcefd9; color: #7a4a05; font-size: 11px; padding: 10px 16px; line-height: 1.45; }
.rc-foot { padding: 10px 16px 14px; font-size: 9.5px; color: #7a95a2; line-height: 1.5; border-top: 1px solid #e7eef0; }

.wa-preview {
  background: #e7ded3; border-radius: var(--radius); padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
}
:root[data-theme="dark"] .wa-preview { background: #10201a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wa-preview { background: #10201a; } }
.wa-bubble {
  background: #d9fdd3; color: #0d231a; border-radius: 8px 2px 8px 8px;
  padding: 8px 10px; font-size: 12.5px; line-height: 1.45; max-width: 100%;
  align-self: flex-end; box-shadow: 0 1px 1px rgba(0,0,0,.12);
}
.wa-bubble .wa-time { font-size: 10px; color: #4a6b58; text-align: right; margin-top: 3px; }

/* ---------- slide-over & modal ---------- */

.overlay { position: fixed; inset: 0; background: rgba(8, 20, 26, .5); z-index: 70; }
.slideover {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 80;
  width: min(460px, 100%); background: var(--surface);
  border-left: 1px solid var(--line); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
}
.slideover__head, .modal__head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.slideover__body, .modal__body { padding: 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.slideover__foot, .modal__foot { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; }
.modal {
  position: fixed; z-index: 80; inset: 0; display: grid; place-items: center; padding: 16px;
  pointer-events: none;
}
.modal__panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: 90vh; display: flex; flex-direction: column;
  pointer-events: auto;
}

/* ---------- misc ---------- */

.callout {
  display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--info-soft); color: var(--info); font-size: 12.5px; line-height: 1.5;
  border: 1px solid color-mix(in srgb, var(--info) 22%, transparent);
}
.callout--warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.callout--ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.callout svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.callout b { font-weight: 650; }

.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding-bottom: 14px; position: relative; }
.tl-item:not(:last-child)::before { content: ""; position: absolute; left: 10px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.tl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); margin: 5px auto 0; box-shadow: 0 0 0 3px var(--brand-soft); }
.tl-dot--muted { background: var(--muted); box-shadow: 0 0 0 3px var(--surface-2); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; align-items: baseline; }
.kv dt { color: var(--muted); font-size: 12px; }
.kv dd { margin: 0; font-weight: 550; }

.empty { text-align: center; padding: 34px 18px; color: var(--muted); display: flex; flex-direction: column; gap: 8px; align-items: center; }

.divider { height: 1px; background: var(--line); }

.station-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 12.5px;
}
.station-pill .n { font-family: var(--font-data); font-size: 11px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- field script prompts ---------- */

.saybox {
  border-left: 3px solid var(--brand); background: var(--brand-soft);
  padding: 9px 12px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.saybox > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 9px; min-width: 0; }
.saybox > summary::-webkit-details-marker { display: none; }
.saybox .lbl {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em;
  font-weight: 700; color: var(--brand-ink); flex: none;
}
.saybox .peek { font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.saybox[open] .peek { display: none; }
.saybox .caret { margin-left: auto; font-size: 11px; color: var(--brand-ink); flex: none; }
.saybox p { font-size: 13px; line-height: 1.6; color: var(--ink); margin-top: 6px; white-space: pre-line; }
.saybox--ack { border-left-color: var(--warn); background: var(--warn-soft); }
.saybox--ack .lbl, .saybox--ack .caret { color: var(--warn); }
.saybox--urgent { border-left-color: var(--high); background: var(--high-soft); }
.saybox--urgent .lbl, .saybox--urgent .caret { color: var(--high); }

/* ---------- screening form ---------- */

.work { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
.work__side { position: sticky; top: 72px; }
@media (max-width: 1060px) { .work { grid-template-columns: minmax(0, 1fr); } .work__side { position: static; } }

.pgrid { display: grid; gap: 14px 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.pgrid > * { min-width: 0; }
.fieldcell { align-content: start; }

/* The Enter key presses the first submit button in a form. This one is Save,
   kept in the DOM first but out of sight, so Enter never means "Remove". */
.sr-default { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.flag-slot:empty { display: none; }
.flagline {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px;
  padding: 6px 9px; border-radius: var(--radius-sm); font-size: 12px;
  background: var(--surface-2); border-left: 3px solid var(--line-strong);
}
.flagline--normal { border-left-color: var(--ok); }
.flagline--follow_up { border-left-color: var(--warn); }
.flagline--urgent { border-left-color: var(--high); }
.flagline--error { border-left-color: var(--high); background: var(--high-soft); color: var(--high); }
.flagline--none { color: var(--muted); }
.flagline__val { font-weight: 650; font-size: 13.5px; }
.flagline__ref { font-family: var(--font-data); font-size: 11px; color: var(--muted); }
.flagline__advice { font-size: 11.5px; color: var(--ink-2); line-height: 1.45; padding: 2px 2px 0; }
