/* Vellum: one plain stylesheet, no framework, no build step.
   White page, near-black text, grey secondary text, hairline borders, Inter (system-ui fallback).
   ONE accent, blue, used sparingly: links, focus rings, one word in the landing headline.
   Green only for savings and "done"; red/amber only for status words. Always light, on purpose. */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --fill: #f9fafb;           /* subtle fill */
  --sunk: #f3f4f6;           /* pills, steps, tabs */
  --ink: #0a0a0a;
  --ink-2: #6b7280;          /* secondary text: 4.8:1 on white */
  --ink-3: #4b5563;          /* secondary text on grey fills: 7.0:1 on #f3f4f6 */
  --line: #e5e7eb;
  --line-2: #d1d5db;
  --accent: #2563eb;         /* the one accent: 5.2:1 on white */
  --accent-ink: #ffffff;
  --accent-soft: #eff6ff;
  --btn: #0a0a0a;            /* primary pill */
  --btn-hover: #262626;
  --save: #16a34a;           /* savings, large numbers only (3.3:1, AA for large text) */
  --ok: #15803d;             /* green text at small sizes: 5.0:1 */
  --ok-soft: #f0fdf4;
  --warn: #b45309;           /* 5.0:1 */
  --warn-soft: #fffbeb;
  --bad: #b91c1c;            /* 6.5:1 */
  --bad-soft: #fef2f2;
  --focus: var(--accent);

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.05);

  /* aliases read by hospital.css / fund.css / verify.css */
  --paper: var(--bg); --paper-2: var(--surface); --paper-3: var(--sunk);
  --ink-soft: var(--ink-2); --rule: var(--line);
  --jade: var(--accent); --jade-ink: var(--accent-ink); --jade-soft: var(--accent-soft);
  --brass: var(--warn); --seal: var(--bad); --seal-soft: var(--bad-soft);
  --serif: var(--sans); --body: var(--sans); --display: var(--sans);
  --r-sm: 8px; --r-md: 10px; --r-lg: 14px;

  color-scheme: light;
}
/* No dark theme: the product is deliberately white, whatever the OS prefers;
   color-scheme: light keeps form controls light too. */

/* ---------------------------------------------------------------- base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: #ffffff; color: var(--ink); font: 400 15px/1.6 var(--sans); overflow-x: hidden;
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01";
}
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
b, strong { font-weight: 600; }

.shell { max-width: 960px; margin: 0 auto; padding: 40px 24px 96px; }
.shell.wide { max-width: 960px; }

h1, h2, h3 { font-weight: 600; line-height: 1.2; letter-spacing: -0.015em; color: var(--ink); }
h1 { font-size: 32px; margin: 0 0 10px; }
h1:focus { outline: none; }
h2 { font-size: 20px; margin: 40px 0 12px; }
h3 { font-size: 16px; margin: 0 0 8px; letter-spacing: -0.01em; }
.lede { color: var(--ink-2); font-size: 17px; margin: 0 0 24px; max-width: 40em; }
.fine { font-size: 13px; color: var(--ink-2); margin: 8px 0; }
.eyebrow, .label { margin: 0 0 6px; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.mono { font-family: var(--mono); font-size: 0.85em; overflow-wrap: anywhere; }
.num { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------- header: wordmark + plain links */
.masthead { background: #ffffff; border-bottom: 1px solid var(--line); }
.masthead-in { max-width: 960px; margin: 0 auto; padding: 0 24px; min-height: 64px; display: flex; align-items: center; flex-wrap: wrap; gap: 0 32px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; padding: 12px 0; }
.brand:hover { text-decoration: none; }
.mark { width: 14px; height: 14px; border-radius: 4px; background: var(--accent); flex: none; }
.wordmark { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.nav { display: flex; flex-wrap: wrap; gap: 0 4px; margin-left: auto; }
.nav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 10px; color: var(--ink-2); font-size: 14px; font-weight: 500; border-radius: 999px; }
.nav a:hover { color: var(--ink); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--ink); }
@media (max-width: 700px) {
  .masthead-in { padding: 0 16px; gap: 0; }
  .brand { flex: 1 0 100%; padding: 14px 0 2px; }
  .nav { margin: 0 -8px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: calc(100% + 16px); }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { min-height: 44px; padding: 0 8px; font-size: 14px; white-space: nowrap; }
}
@media (max-width: 420px) {
  .nav { margin: 0 -5px; }
  .nav a { padding: 0 5px; font-size: 13px; }
}

/* --------------------------- "What this page does" + "Sponsors used here" */
.about { background: var(--fill); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin: 0 0 32px; font-size: 14px; color: var(--ink-2); }
.about p { margin: 0 0 6px; }
.about p:last-child { margin-bottom: 0; }
.about b { color: var(--ink); font-weight: 600; }
.live-tag, .notlive-tag { display: inline-block; font-size: 12px; font-weight: 500; line-height: 20px; padding: 0 8px; border-radius: 999px; white-space: nowrap; }
.live-tag { background: var(--ok-soft); color: var(--ok); }
.notlive-tag { background: var(--sunk); color: var(--ink-3); }

/* ------------------------------------------------------------- buttons: pills */
.primary, .secondary, .ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; margin: 16px 8px 0 0; border-radius: 999px; cursor: pointer;
  font-size: 15px; font-weight: 500; line-height: 1.2; text-decoration: none; text-align: center;
  border: 1px solid transparent; transition: background-color 0.15s ease, border-color 0.15s ease;
}
.primary { background: var(--btn); color: #ffffff; border-color: var(--btn); }
.primary:hover { background: var(--btn-hover); border-color: var(--btn-hover); text-decoration: none; }
.secondary { background: #ffffff; color: var(--ink); border-color: var(--line); }
.secondary:hover { background: var(--fill); border-color: var(--line-2); text-decoration: none; }
.ghost { background: transparent; color: var(--ink); border-color: var(--line); margin: 0; }
.ghost:hover { background: var(--fill); }
.primary:disabled, .secondary:disabled, .ghost:disabled { opacity: 0.4; cursor: not-allowed; }
.text { background: none; border: 0; padding: 10px 0; cursor: pointer; color: var(--accent); font-size: 14px; font-weight: 500; }
.text:hover { text-decoration: underline; }
button.busy { position: relative; color: transparent !important; }
button.busy::after, .spinner {
  content: ""; width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--ink-2); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.primary.busy::after { border-color: rgba(255, 255, 255, 0.3); border-top-color: #ffffff; }
button.busy::after { position: absolute; inset: 0; margin: auto; }
.spinner { display: inline-block; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 480px) { .primary, .secondary { width: 100%; margin-right: 0; } }

/* ---------------------------------------------------------------- forms */
.stack { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field > span, .seg legend { font-size: 13px; font-weight: 500; color: var(--ink); }
.field input, .field textarea, .field select {
  width: 100%; min-height: 44px; padding: 10px 14px; background: #ffffff;
  border: 1px solid var(--line); border-radius: var(--radius-sm); transition: border-color 0.15s ease;
}
.field input:hover, .field textarea:hover, .field select:hover { border-color: var(--line-2); }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }
.field textarea { resize: vertical; }
.field.inline { grid-template-columns: auto 90px; align-items: center; gap: 8px; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row .field { flex: 1 1 180px; }
.row .grow { flex: 3 1 240px; }
.consent { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; font-size: 14px; color: var(--ink); }
.consent input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--ink); }

.seg { border: 0; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.seg legend { padding: 0; margin-bottom: 6px; }
.seg label { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; cursor: pointer; font-size: 14px; }
.seg input { accent-color: var(--ink); margin: 0; }

.dropzone { position: relative; display: flex; align-items: center; gap: 12px; padding: 18px; cursor: pointer; border: 1px dashed var(--line-2); border-radius: var(--radius-sm); background: var(--fill); }
.dropzone:hover { border-color: var(--ink-2); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.dz-icon { color: var(--ink-2); display: inline-flex; }
.dz-text { font-size: 14px; word-break: break-word; }

/* ----------------------------------------------------------------- cards */
.doc, .card, .summary, .fed, .outcome, .claim-head, .note {
  background: #ffffff; border: 1px solid var(--line); border-radius: var(--radius);
}
.doc { padding: 24px; box-shadow: var(--shadow); }
.doc-head { display: flex; justify-content: space-between; gap: 8px; margin: 0 0 12px; font-size: 13px; color: var(--ink-2); }
.note { padding: 14px 18px; margin: 16px 0 0; font-size: 14px; }
.note .secondary { margin-top: 10px; }

/* "Deal reached": a plain green pill (no stamp) */
.deal-pill, .stamp {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 12px; border-radius: 999px;
  background: var(--ok-soft); color: var(--ok); font-size: 13px; font-weight: 600; white-space: nowrap;
}

.pill { display: inline-block; white-space: nowrap; padding: 0 10px; line-height: 22px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--sunk); color: var(--ink-3); }
.pill.review { color: var(--warn); background: var(--warn-soft); }
.pill.live { color: var(--accent); background: var(--accent-soft); }
.pill.done { color: var(--ok); background: var(--ok-soft); }
.pill.fail { color: var(--bad); background: var(--bad-soft); }
tr.met .pill { color: var(--ok); background: var(--ok-soft); }
tr.unmet .pill { color: var(--bad); background: var(--bad-soft); }

.error {
  display: flex; gap: 12px; align-items: flex-start; justify-content: space-between;
  background: var(--bad-soft); color: var(--ink); border: 1px solid #fecaca; border-radius: var(--radius-sm);
  padding: 12px 16px; margin: 0 0 20px; font-size: 14px;
}
.error p { margin: 0; overflow-wrap: anywhere; }
.error button { flex: none; background: #ffffff; border: 1px solid var(--line); color: var(--ink); border-radius: 999px; cursor: pointer; min-height: 32px; padding: 0 12px; font-size: 13px; }
.preview-banner, .banner { margin: 0 0 20px; padding: 10px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--fill); color: var(--ink-3); font-size: 14px; }
.banner.info { background: var(--accent-soft); border-color: #dbeafe; }

.limit-guard { margin: 16px 0 0; padding: 0; color: var(--ink-2); font-size: 14px; }
.limit-guard.unset { color: var(--bad); }
.limit-guard .onchain { font-weight: 500; }

.formwrap { margin: 20px 0 0; }
.formwrap > summary { cursor: pointer; padding: 6px 0; color: var(--ink-2); font-size: 14px; font-weight: 500; width: max-content; max-width: 100%; }
.formwrap > summary:hover { color: var(--ink); }
.formwrap form { margin-top: 10px; }

/* live progress line: spinner + latest message */
.status-line { display: flex; align-items: center; gap: 12px; margin: 16px 0 0; padding: 12px 16px; background: var(--fill); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 14px; color: var(--ink-3); }
.status-line.done { background: var(--ok-soft); border-color: #dcfce7; color: var(--ok); }
.status-line.done .spinner { display: none; }

/* ============================================================ PATIENT FLOW */
/* landing hero */
.hero { text-align: center; padding: 56px 0 72px; }
.hero h1 { font-size: 56px; font-weight: 600; line-height: 1.08; letter-spacing: -0.035em; max-width: 12em; margin: 0 auto 20px; }
.accent { color: var(--accent); }
.hero-sub { font-size: 18px; line-height: 1.55; color: var(--ink-2); max-width: 34em; margin: 0 auto; }
.hero-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-actions .primary, .hero-actions .secondary { margin: 0; min-height: 48px; padding: 0 24px; }
.hero-own { margin: 20px 0 0; font-size: 14px; }
.hero-own a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.hero-own a:hover { color: var(--ink); }
@media (max-width: 600px) {
  .hero { padding: 24px 0 48px; }
  .hero h1 { font-size: 38px; }
  .hero-sub { font-size: 16px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
}

.how { border-top: 1px solid var(--line); padding: 56px 0 8px; scroll-margin-top: 16px; }
.how > h2 { font-size: 28px; margin: 0 0 12px; letter-spacing: -0.02em; }
.how > p { color: var(--ink-2); font-size: 16px; max-width: 40em; margin: 0 0 32px; }
.how > h3 { margin: 40px 0 12px; font-size: 15px; }
.how-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; counter-reset: how; }
.how-steps li { counter-increment: how; display: grid; gap: 4px; align-content: start; padding: 20px; background: #ffffff; border: 1px solid var(--line); border-radius: var(--radius); }
.how-steps li::before { content: counter(how); display: inline-grid; place-items: center; width: 26px; height: 26px; margin-bottom: 8px; border-radius: 999px; background: var(--sunk); color: var(--ink); font-size: 13px; font-weight: 600; }
.how-steps b { font-size: 15px; }
.how-steps span { font-size: 14px; color: var(--ink-2); line-height: 1.5; }
@media (max-width: 860px) { .how-steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .how-steps { grid-template-columns: 1fr; } .how-steps li { grid-template-columns: auto 1fr; column-gap: 12px; padding: 16px; } .how-steps li::before { grid-row: 1 / 3; margin: 0; } }

.home { margin: 0 0 40px; }
.tracks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); font-size: 14px; }
.tracks li { display: grid; grid-template-columns: 170px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tracks b { font-weight: 500; }
.tracks li > span { color: var(--ink-2); }
@media (max-width: 520px) { .tracks li { grid-template-columns: 1fr; gap: 0; } }
#patient-app:not(.landing) .home, #patient-app:not(.landing) .about { display: none; }

/* use your own bill */
.own-bill { border: 1px solid var(--line); border-radius: var(--radius); padding: 0 20px; scroll-margin-top: 16px; }
.own-bill > summary { cursor: pointer; padding: 16px 0; font-weight: 500; list-style-position: inside; }
.own-bill[open] { padding-bottom: 20px; }
.own-bill .doc { box-shadow: none; border: 0; padding: 0; }
.own-bill .what { margin-top: 0; }

/* steps: grey pills, the current one white with a border */
.progress { margin: 0 0 40px; }
.progress ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 4px; background: var(--sunk); border-radius: 999px; width: max-content; max-width: 100%; counter-reset: step; }
.progress li { counter-increment: step; padding: 0 14px; line-height: 32px; border-radius: 999px; color: var(--ink-3); font-size: 13px; font-weight: 500; border: 1px solid transparent; white-space: nowrap; }
.progress li::before { content: counter(step) "  "; color: var(--ink-2); }
.progress li.done { color: var(--ink-3); }
.progress li.done::before { content: "✓  "; color: var(--ok); }
.progress li.now { background: #ffffff; color: var(--ink); border-color: var(--line); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); }
.step-label { margin: 10px 0 0; font-size: 13px; color: var(--ink-2); }
#patient-app.landing .progress { display: none; }
@media (max-width: 700px) {
  .progress ol { border-radius: var(--radius); width: 100%; }
  .progress li { padding: 0 10px; font-size: 12px; line-height: 30px; }
  .progress li:not(.now) { font-size: 0; padding: 0 9px; }
  .progress li:not(.now)::before { font-size: 12px; }
}

.screen > h1 { margin-top: 0; font-size: 36px; letter-spacing: -0.025em; }
.what { margin: 0 0 28px; color: var(--ink-2); font-size: 16px; max-width: 40em; }
.step-foot { display: flex; justify-content: flex-end; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.step-foot .primary { margin: 0; min-width: 160px; }
@media (max-width: 480px) { .step-foot .primary { width: 100%; } }

/* bill */
.summary { padding: 24px; margin-bottom: 8px; box-shadow: var(--shadow); }
.provider { margin: 0 0 4px; font-size: 13px; color: var(--ink-2); }
.owe { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px; padding: 4px 0 16px; border-bottom: 1px solid var(--line); }
.owe b { font-size: 36px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stake { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px; padding: 16px 0 0; color: var(--bad); font-weight: 500; }
.stake b { font-size: 20px; font-variant-numeric: tabular-nums; }
.flagged-note { color: var(--ink-2); }
.lines { list-style: none; margin: 0; padding: 0; background: #ffffff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.lines > li { padding: 14px 20px; border-top: 1px solid var(--line); }
.lines > li:first-child { border-top: 0; }
.lines > li.flagged { background: var(--bad-soft); box-shadow: inset 3px 0 0 var(--bad); }
.li-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.li-desc { margin: 0; }
.li-amt { font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lines > li.flagged .li-amt { color: var(--bad); }
.li-meta { margin: 2px 0 0; font-size: 12px; color: var(--ink-2); white-space: pre-wrap; font-variant-numeric: tabular-nums; }
.flag { margin-top: 8px; font-size: 14px; }
.flag p { margin: 0 0 2px; }
.flag b { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: 999px; background: #ffffff; border: 1px solid #fecaca; color: var(--bad); font-weight: 500; font-size: 12px; }
.summary .flag { padding: 12px 0 0; border-top: 1px solid var(--line); margin-top: 12px; color: var(--ink-2); }

/* intake */
#intake-form.doc { padding: 24px; }
.talk { display: grid; justify-items: start; gap: 4px; margin-top: 8px; }
.mic { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 20px; border-radius: 999px; cursor: pointer; background: #ffffff; color: var(--ink); border: 1px solid var(--line); font-size: 15px; font-weight: 500; }
.mic:hover { background: var(--fill); }
.mic-ring { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.mic.live { background: var(--btn); color: #ffffff; border-color: var(--btn); }
.mic.live .mic-ring { background: #ef4444; }
.chat { list-style: none; padding: 0; margin: 8px 0 0; width: 100%; max-height: 40vh; overflow-y: auto; font-size: 14px; }
.chat:empty { display: none; }
.chat li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.chat li::before { font-weight: 600; margin-right: 6px; }
.chat li.bb::before { content: "Vellum:"; }
.chat li.me::before { content: "You:"; }

/* research */
.feed { list-style: none; padding: 0; margin: 8px 0 0; font-size: 13px; color: var(--ink-2); }
.feed:empty::before { content: "Nothing yet."; }
.feed li { padding: 6px 0 6px 16px; position: relative; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.feed li::before { content: ""; position: absolute; left: 2px; top: 14px; width: 5px; height: 5px; border-radius: 50%; background: var(--line-2); }
.feed li.warn { color: var(--warn); }
.feed li.warn::before { background: var(--warn); }
.ladder { margin-top: 8px; }
.ladder h2 { font-size: 17px; margin: 32px 0 12px; }
.rungs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: #ffffff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.rung { padding: 20px 24px; display: grid; gap: 4px; min-width: 0; }
.rung + .rung { border-left: 1px solid var(--line); }
.rung span { font-size: 13px; color: var(--ink-2); }
.rung b { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
@media (max-width: 520px) { .rung { padding: 14px; } .rung b { font-size: 19px; } }
.charity { font-size: 15px; padding: 16px 20px; background: var(--fill); border: 1px solid var(--line); border-radius: var(--radius-sm); margin: 0; }
.td-sub { display: block; font-size: 12px; color: var(--ink-2); }
.sources { list-style: none; padding: 0; margin: 0; font-size: 14px; border-top: 1px solid var(--line); }
.sources li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.via { color: var(--ink-2); font-size: 12px; white-space: nowrap; }

/* the call: a light ticker with big dark numbers */
.ticker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: #ffffff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); position: relative; }
.tk { display: grid; gap: 4px; padding: 20px 24px; min-width: 0; align-content: start; }
.tk + .tk { border-left: 1px solid var(--line); }
.tk span { font-size: 13px; color: var(--ink-2); }
.tk b { font-size: 32px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tk.asked b { color: var(--ink-2); text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: var(--line-2); }
.tk.saved b { color: var(--save); }
.tk.saved i { color: var(--ok); font-style: normal; font-size: 13px; font-weight: 500; }
.ticker .deal-pill { position: absolute; right: 16px; top: -14px; }
@media (max-width: 520px) { .tk b { font-size: 21px; } .tk { padding: 14px 12px; } .tk span { font-size: 12px; } }

.deal-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 0; padding: 16px 20px; border: 1px solid #dcfce7; background: var(--ok-soft); border-radius: var(--radius); }
.deal-box .deal-pill { background: #ffffff; font-size: 15px; min-height: 34px; padding: 0 16px; }
.deal-box #deal-text:empty { display: none; }
.deal-box .primary { margin: 0; }
@media (max-width: 480px) { .deal-box .deal-pill { width: 100%; justify-content: center; } }

.voices { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 24px 0 0; font-size: 13px; color: var(--ink-2); }
.voice { display: inline-flex; gap: 6px; align-items: center; }
.voice i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.voice.on { color: var(--ink); }
.voice.on i { background: var(--save); }
.room-status:not(:empty) { margin-left: auto; }
.room-log:empty { display: none; }

/* transcript as a chat: Vellum on the left, the hospital on the right */
.transcript { list-style: none; padding: 20px; margin: 12px 0 0; display: grid; gap: 12px; background: var(--fill); border: 1px solid var(--line); border-radius: var(--radius); }
.transcript .line { max-width: 80%; padding: 10px 14px; background: #ffffff; border: 1px solid var(--line); border-radius: 14px; }
.transcript .line.us { justify-self: start; border-bottom-left-radius: 4px; }
.transcript .line.them { justify-self: end; background: var(--sunk); border-color: var(--sunk); border-bottom-right-radius: 4px; }
.transcript .who { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.transcript .line.us .who { color: var(--accent); }
.transcript p { margin: 2px 0 0; font-size: 14px; line-height: 1.5; }
.transcript .empty { color: var(--ink-2); font-size: 14px; text-align: center; padding: 16px 0; }
.timeline .empty { color: var(--ink-2); font-size: 14px; }
@media (max-width: 520px) { .transcript { padding: 12px; } .transcript .line { max-width: 92%; } }
.dash .transcript, .clinic .transcript { background: var(--fill); }

/* summary */
.sum-figs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 8px 0 24px; }
@media (max-width: 760px) { .sum-figs { grid-template-columns: 1fr 1fr; } }
.sum-figs .stat { padding: 20px; box-shadow: var(--shadow); }
.sum-figs .stat-value { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.sum-figs .removed .stat-value { color: var(--bad); }
.sum-figs .saved .stat-value { color: var(--save); }
@media (max-width: 480px) { .sum-figs .stat { padding: 14px; } .sum-figs .stat-value { font-size: 22px; } }
.next-steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--ink); }
.next-steps li::marker { color: var(--ink-2); }

.pay-row { margin: 40px 0 0; border: 1px solid var(--line); border-radius: var(--radius); }
.pay-row > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; cursor: pointer; list-style: none; }
.pay-row > summary::-webkit-details-marker { display: none; }
.pay-row > summary .fine { margin: 0; }
.pay-more { flex: none; font-size: 14px; font-weight: 500; color: var(--accent); }
.pay-more::after { content: " ›"; }
.pay-row[open] .pay-more::after { content: " ⌄"; }
.pay-body { padding: 0 20px 20px; border-top: 1px solid var(--line); }
.pay-body h3 { margin: 24px 0 8px; }
.pay-summary { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 4px; font-size: 14px; color: var(--ink-3); }
.pay-summary:empty { display: none; }
@media (max-width: 480px) { .pay-row > summary .fine { display: none; } }

/* receipts */
.actions { display: grid; gap: 0; margin-top: 16px; background: #ffffff; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.act { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--line); }
.act:first-child { border-top: 0; }
.act p { margin: 0; font-size: 14px; color: var(--ink-2); }
.act p b { color: var(--ink); font-weight: 500; }
.act .secondary { margin: 0; }
@media (max-width: 480px) { .act { grid-template-columns: 1fr; } }
.loan-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.loan-row .secondary { margin: 0; }
.fed { padding: 16px; margin: 16px 0 0; border-radius: var(--radius-sm); }
.fed h2, .fed h3 { margin: 0 0 4px; }
.rec { font-size: 17px; font-weight: 500; margin: 12px 0 2px; color: var(--ink); }
.odds { display: grid; gap: 6px; margin-top: 8px; }
.odd { display: grid; grid-template-columns: minmax(0, 1.2fr) 2fr auto; gap: 10px; align-items: center; font-size: 13px; }
.odd .bar { height: 6px; background: var(--sunk); border-radius: 999px; overflow: hidden; }
.odd .bar i { display: block; height: 100%; background: var(--ink); border-radius: 999px; }

.timeline { list-style: none; padding: 0; margin: 16px 0 0; background: #ffffff; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.timeline.compact { margin-top: 8px; }
.timeline > li { padding: 10px 16px; border-top: 1px solid var(--line); }
.timeline > li:first-child { border-top: 0; }
.receipt { display: grid; grid-template-columns: 24px 1fr; gap: 12px; }
.chain-mark { color: var(--ink-2); display: inline-flex; padding-top: 2px; }
.chain-mark svg { width: 18px; height: 18px; }
.r-body { min-width: 0; }
.r-title { margin: 0; font-size: 14px; font-weight: 500; }
.r-meta { margin: 1px 0 0; font-size: 12px; color: var(--ink-2); white-space: pre-wrap; }
.r-link { font: 12px/1.5 var(--mono); overflow-wrap: anywhere; }

.outcome { padding: 24px; margin: 0 0 8px; }
.outcome h2 { margin: 0 0 8px; }
.hear-icon { font-size: 11px; }
.hear-note { background: var(--fill); padding: 10px 14px; border-radius: var(--radius-sm); }
.hear-why { display: block; margin-top: 4px; font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; }
.hear-why summary { cursor: pointer; width: max-content; }
.hear-why > span { display: block; margin-top: 4px; }
.outcome-tag { display: inline-block; margin: 0 0 8px; padding: 0 10px; line-height: 22px; border-radius: 999px; background: var(--sunk); color: var(--ink-3); font-size: 12px; font-weight: 500; }
.outcome-en { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 16px; }
.outcome .secondary { margin-top: 20px; }

/* ----------------------------------------------------------------- table */
.table-wrap { overflow-x: auto; background: #ffffff; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; vertical-align: top; padding: 10px 16px; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
th { font-size: 12px; font-weight: 500; color: var(--ink-3); background: var(--fill); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.mark { white-space: nowrap; }

/* ---------------------------------------------------------------- clinic */
.panel { margin-bottom: 40px; }
.claim-head { padding: 20px 24px; box-shadow: var(--shadow); }
.claim-head h2 { margin: 2px 0 6px; }
.claim-head .payer { margin: 0; color: var(--ink-2); font-size: 13px; }
.denial { margin: 0; }
.denial b { color: var(--bad); font-weight: 600; }
.tally { font-size: 14px; color: var(--warn); margin: 10px 0 0; }
.tally.ok { color: var(--ok); }
.letter { white-space: pre-wrap; font: 14px/1.7 var(--sans); margin: 0; padding: 24px; background: #ffffff; border: 1px solid var(--line); border-radius: var(--radius); max-height: 60vh; overflow-y: auto; }

/* ------------------------------------------------- case overview (dashboard) */
.as-link { text-align: center; text-decoration: none; }
.dash .card { padding: 20px 24px; margin: 0 0 16px; min-width: 0; }
.dash .card h2 { margin: 0 0 10px; font-size: 17px; }
.dash .card.subtle { background: var(--fill); }
.dash .card.subtle p { margin: 0; font-size: 14px; color: var(--ink-2); }
.card-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.dash .card-title h2 { margin: 0; }

.case-head { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: start; }
.case-head h1 { margin: 0; overflow-wrap: anywhere; }
.case-meta { margin: 2px 0 0; font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; }
.case-head .stepper, .case-head .as-link { grid-column: 1 / -1; }
.case-head .as-link { justify-self: start; }

.stepper { list-style: none; margin: 16px 0 0; padding: 4px; display: flex; flex-wrap: wrap; gap: 4px; background: var(--sunk); border-radius: 999px; width: max-content; max-width: 100%; }
.stepper li { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px 0 6px; line-height: 30px; border-radius: 999px; font-size: 12px; font-weight: 500; color: var(--ink-3); border: 1px solid transparent; }
.stepper .dot { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #ffffff; font-size: 11px; line-height: 1; }
.stepper li.done .dot { color: var(--ok); }
.stepper li.now { background: #ffffff; color: var(--ink); border-color: var(--line); }
.stepper li.now .dot { background: var(--sunk); }
.stepper li.fail { color: var(--bad); }
@media (max-width: 600px) { .stepper { border-radius: var(--radius); } }

.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
.stat { padding: 16px 20px; display: grid; gap: 4px; align-content: start; min-width: 0; background: #ffffff; border: 1px solid var(--line); border-radius: var(--radius); }
.stat-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; }
.stat-label { font-size: 13px; color: var(--ink-2); }
.stat-value { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat.issues .stat-value { color: var(--bad); }
.stat.deal .stat-value { color: var(--save); }
.stat.deal.pending .stat-value { color: var(--ink-2); }
.stat-foot { margin: 0; font-size: 12px; color: var(--ink-2); }
@media (min-width: 640px) { .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.findings { list-style: none; margin: 0; padding: 0; }
.finding { display: grid; grid-template-columns: 26px 1fr; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.finding:first-child { border-top: 0; padding-top: 0; }
.finding .num { color: var(--bad); font-size: 13px; padding-top: 1px; }
.finding-body { min-width: 0; }
.finding-text { margin: 0; font-size: 14px; }
.finding-line { margin: 2px 0 0; font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; }
.finding-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 4px; font-size: 13px; }
.finding-foot .tag { font-size: 12px; color: var(--ink-2); }
.finding-foot b { color: var(--bad); font-weight: 500; }
.findings .empty { color: var(--ink-2); font-size: 14px; }

.option { padding: 10px 0; border-top: 1px solid var(--line); }
.option:first-child { border-top: 0; }
.option h3 { margin: 0 0 2px; }
.option p { margin: 2px 0 0; font-size: 14px; color: var(--ink-2); }
.option .text { padding: 6px 0 0; }
.option .rec-sm { color: var(--ink); font-weight: 600; }

.dash .transcript.compact-t { max-height: 420px; overflow-y: auto; overscroll-behavior: contain; }
.run-steps { list-style: none; margin: 0; padding: 0; }
.run-step { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 10px; font-size: 14px; padding: 8px 0; border-top: 1px solid var(--line); }
.run-step:first-child { border-top: 0; }
.run-name { flex: 1 1 200px; }
.run-step .sim, .run-step .run-msg { flex-basis: 100%; font-size: 12px; color: var(--ink-2); }
.run-step .sim { color: var(--warn); }
.dash #activity { margin-top: 0; }
.dash .timeline { margin-top: 0; }

.case-list { list-style: none; margin: 0 0 8px; padding: 0; background: #ffffff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.case-row { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.case-row:hover { background: var(--fill); text-decoration: none; }
.case-list > :first-child .case-row, .case-list > .case-row:first-child { border-top: 0; }
.case-row .pill { grid-row: 1 / 3; grid-column: 2; }
.cr-name { font-weight: 500; }
.cr-meta { font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; }
.case-list .empty { color: var(--ink-2); font-size: 14px; padding: 14px 20px; }

@media (min-width: 880px) {
  .dash-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
}

.colophon { max-width: 960px; margin: 0 auto; padding: 24px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-2); }

@media (max-width: 600px) {
  .shell { padding: 24px 16px 72px; }
  h1, .screen > h1 { font-size: 28px; }
  .colophon { padding: 20px 16px; }
  .doc, .summary, #intake-form.doc, .outcome { padding: 18px; }
  .lines > li { padding: 12px 14px; }
  .owe b { font-size: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 2s !important; transition: none !important; scroll-behavior: auto !important; }
}

/* demo bill picture on step 1 */
.bill-image { margin: 20px 0 24px; }
.bill-image img { display: block; width: 100%; max-width: 560px; height: auto; margin: 0 auto;
  border: 1px solid #e5e7eb; border-radius: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.05); }
.bill-image figcaption { text-align: center; color: #6b7280; font-size: 13px; margin-top: 8px; }

.voice-toggle { display: inline-flex; align-items: center; gap: 8px; margin-right: 16px; color: #374151; font-size: 14px; cursor: pointer; }
.voice-toggle input { width: 16px; height: 16px; accent-color: #2563eb; }
