/* Ophi — the clinic worklist. Hand-written; no framework. Light only.
   Colour means status: red is a chart gap or lateness, amber is a person needed, green is done, slate is Sun Life.
   Everything else is ink on paper and stone. Linen marks the one step you are on. */

@font-face { font-family: "Geist"; src: url("fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --paper: #ffffff; --stone: #f6f4ef; --linen: #ede8de; --rule: #e7e2d8; --rule-strong: #d2cbbd;
  --ink: #2b2926; --ink-soft: #4d4943; --muted: #6a665e;
  --gap: #b3261e; --gap-tint: #fbeeec; --gap-line: #efc6c1;
  --person: #8a5300; --person-tint: #fbf1df; --person-line: #ecd3a6;
  --done: #1e6a3a; --done-tint: #e9f3ec; --done-line: #bfdcc8;
  --payer: #33557f; --payer-tint: #ebf0f6; --payer-line: #c3d0e1;
  --focus: #2f6fd6;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, Consolas, monospace;
  --r-panel: 10px; --r-control: 8px;
  --gutter: 28px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
::selection { background: #e2dccf; }
a { color: inherit; text-decoration-color: var(--rule-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance; font-weight: 560; }
p { margin: 0; }
q { quotes: "“" "”"; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.t-bad { color: var(--gap); }
.t-warn { color: var(--person); }
.t-ok { color: var(--done); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* --- chrome -------------------------------------------------------------------------------------- */
.demo { display: flex; justify-content: center; align-items: baseline; flex-wrap: wrap; gap: 2px 12px; background: var(--stone); border-bottom: 1px solid var(--rule); color: var(--muted); font-size: 12.5px; padding: 5px var(--gutter); text-align: center; text-wrap: balance; }
.demo form { display: inline; }
.demo .linkish { font-size: 12.5px; }
.bar { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 1px solid var(--rule); }
.bar-in { max-width: 1480px; margin: 0 auto; padding: 0 var(--gutter); height: 56px; display: flex; align-items: center; gap: 28px; }
.brand { display: block; color: var(--ink); line-height: 0; }
.brand svg { height: 19px; width: auto; }
.nav { display: flex; gap: 22px; height: 100%; }
.nav a { display: flex; align-items: center; height: 100%; white-space: nowrap; color: var(--muted); text-decoration: none; font-weight: 500; box-shadow: inset 0 -2px 0 transparent; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
.me { margin-left: auto; display: flex; align-items: center; gap: 4px; padding: 3px; border-radius: 999px; background: var(--stone); border: 1px solid var(--rule); }
.me-k { padding: 0 6px 0 8px; font-size: 12.5px; color: var(--muted); }
.me button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px 0 4px; border: 0; border-radius: 999px; background: none; font: 500 13px/1 var(--font); color: var(--ink-soft); cursor: pointer; white-space: nowrap; }
.me button:hover { color: var(--ink); }
.me button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(43, 41, 38, .1); }
.me .mono-mark { width: 22px; height: 22px; }
.page { max-width: 1480px; margin: 0 auto; padding: 32px var(--gutter) 72px; }

/* monogram: who does a step */
.who { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.mono-mark { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--stone); border: 1px solid var(--rule); font-size: 10.5px; font-weight: 600; color: var(--ink-soft); letter-spacing: .02em; }
.who-dentist .mono-mark { background: var(--person-tint); border-color: var(--person-line); color: var(--person); }
.who-sun_life .mono-mark { background: var(--payer-tint); border-color: var(--payer-line); color: var(--payer); border-radius: 5px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 16px; border-radius: var(--r-control); border: 1px solid var(--rule-strong);
  background: var(--paper); color: var(--ink); font: 500 14px/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--ink-soft); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #45423d; border-color: #45423d; }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 13.5px; }
.btn-danger { color: var(--gap); border-color: var(--gap-line); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.linkish { background: none; border: 0; padding: 2px 0; font: 500 13px/1.2 var(--font); color: var(--muted); text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 3px; cursor: pointer; }
.linkish:hover { color: var(--ink); text-decoration-color: currentColor; }

/* form fields */
.field { display: grid; gap: 6px; }
.field > span { font-size: 13.5px; font-weight: 500; color: var(--ink-soft); }
.input { font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--rule-strong); border-radius: var(--r-control); padding: 0 10px; height: 38px; }
textarea.input { width: 100%; height: auto; padding: 8px 10px; line-height: 1.5; resize: vertical; }
.input:focus { border-color: var(--ink-soft); }

/* confirmation after a write */
.done-note { position: fixed; z-index: 40; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 500; font-size: 14px; box-shadow: 0 8px 24px rgba(43, 41, 38, .18); transition: opacity .3s; }
.done-note.is-gone { opacity: 0; pointer-events: none; }
.done-note::before { content: ""; width: 16px; height: 16px; flex: none; border-radius: 50%; background: var(--done) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.6 8.3l2.2 2.2 4.6-4.8' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat; }

/* notes */
.note { padding: 12px 14px; border-radius: var(--r-control); border: 1px solid var(--rule); background: var(--stone); font-size: 14px; color: var(--ink-soft); }
.note-warn { background: var(--person-tint); border-color: var(--person-line); color: #5e3a00; }
.note-bad { background: var(--gap-tint); border-color: var(--gap-line); color: #7a1a14; }

/* Sun Life's own words and decisions — never Ophi's voice */
.payer { color: var(--payer); }
.payer-quote { font-style: italic; }

/* --- page heads ---------------------------------------------------------------------------------- */
.head { margin-bottom: 28px; max-width: 80ch; }
.head-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.dateline { color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.head h1 { font-size: 32px; font-weight: 500; letter-spacing: -.022em; line-height: 1.12; }
.lede { margin-top: 10px; font-size: 16px; color: var(--ink-soft); max-width: 70ch; }
.lede + .lede { margin-top: 8px; }
.back { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 14px; color: var(--muted); text-decoration: none; }
.back::before { content: ""; width: 7px; height: 7px; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.back:hover { color: var(--ink); }

/* --- board: one column per step, one card per case ------------------------------------------------ */
.board-head { margin-bottom: 20px; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; }
.board-head h1 { font-size: 28px; font-weight: 500; letter-spacing: -.02em; line-height: 1.15; }
.board-fresh-all { display: grid; gap: 4px; justify-items: end; }
.board-fresh { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.board-rules { font-size: 12.5px; color: var(--muted); text-align: right; }
.board-rules a { color: inherit; }
.rules-error { max-width: 80ch; margin: 0 0 20px; padding: 12px 16px; border-radius: var(--r-control); border: 1px solid var(--gap-line); background: var(--gap-tint); color: var(--gap); }
.rules-quote { margin: 6px 0 0; padding-left: 12px; border-left: 2px solid var(--rule-strong); font-size: 13.5px; color: var(--ink-soft); }
.rules-impact li, .rules-quote { overflow-wrap: anywhere; }
.rules-chain { margin-top: 8px; }
.rules-more { margin-top: 10px; }
.rules-more summary { cursor: pointer; color: var(--muted); }
.rules-more .plain { margin-top: 8px; }
.rules-checking { margin-bottom: 8px; color: var(--person); }
.rules-chain + .rules-chain { margin-top: 2px; }
.rules-ack { display: flex; gap: 10px; align-items: baseline; cursor: pointer; }


/* the one thing to do first */
.start { display: flex; align-items: center; gap: 14px 24px; margin: 0 0 24px; padding: 18px 22px; border-radius: var(--r-panel); background: var(--linen); }
.start-body { flex: 1; min-width: 0; }
.start-who { font-size: 13.5px; color: var(--ink-soft); }
.start-who b { font-weight: 600; color: var(--ink); }
.start-title { margin-top: 2px; font-size: 17px; font-weight: 560; letter-spacing: -.005em; }
.start-why { margin-top: 6px; font-size: 14px; color: var(--ink-soft); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.src { font-size: 12.5px; color: var(--muted); }

/* the patient is still in the chair: the one visit where a gap costs nothing extra */
.start-chair { align-items: flex-start; }
.chair-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; max-width: 760px; }
.chair-item { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) auto; align-items: center; gap: 4px 16px; min-height: 44px; padding: 6px 8px 6px 14px; border-radius: 8px; background: var(--paper); border: 1px solid var(--rule); }
.chair-label { font-size: 14.5px; font-weight: 560; color: var(--ink); }
.chair-role { margin-left: 6px; font-size: 12.5px; color: var(--muted); }
.chair-hint { font-size: 13px; color: var(--ink-soft); }
.chair-do { grid-column: 3; justify-self: end; }
.chair-more { padding-left: 14px; font-size: 13px; color: var(--muted); }

/* deadline chip: the only coloured element on a card */
.due { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--stone); border: 1px solid var(--rule); font-size: 12.5px; font-weight: 500; color: var(--ink-soft); white-space: nowrap; }
.due::before { content: ""; width: 6px; height: 6px; border-radius: 50%; display: none; }
.due-bad::before, .due-warn::before, .due-ok::before { display: block; }
.due-bad { background: var(--gap-tint); border-color: var(--gap-line); color: var(--gap); }
.due-bad::before { background: var(--gap); }
.due-warn { background: var(--person-tint); border-color: var(--person-line); color: var(--person); }
.due-warn::before { background: var(--person); }
.due-ok { background: var(--done-tint); border-color: var(--done-line); color: var(--done); }
.due-ok::before { background: var(--done); }

.board { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; align-items: start; }
.col { background: var(--stone); border-radius: 12px; padding: 12px 10px 10px; min-width: 0; }
.col.is-empty { padding-bottom: 2px; }
.col-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px 8px; padding: 0 3px 10px; }
.col-head h2 { font-size: 14.5px; font-weight: 600; letter-spacing: -.005em; }
.col-n { font-size: 13px; font-weight: 600; color: var(--muted); }
.col-job { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); line-height: 1.35; min-width: 0; }
.col-job-t { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-job .mono-mark { width: 18px; height: 18px; font-size: 9px; }
.tiles { list-style: none; padding: 0; display: grid; gap: 8px; }
.tile { display: grid; gap: 2px; padding: 12px 12px 11px; border-radius: 10px; background: transparent; border: 1px solid var(--rule-strong); color: var(--ink-soft); text-decoration: none; }
.tile.is-mine { background: var(--paper); border-color: var(--rule); color: var(--ink); box-shadow: 0 1px 2px rgba(43, 41, 38, .06); }
.tile:hover { border-color: var(--ink-soft); }
.tile-name { font-size: 14.5px; font-weight: 560; line-height: 1.3; }
.tile-tx { font-size: 12.5px; color: var(--muted); }
.tile-act { margin-top: 8px; font-size: 13.5px; line-height: 1.4; }
.tile-note { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.tile-note.payer { color: var(--payer); }
.tile-wait { margin-top: 8px; font-size: 13px; color: var(--muted); }
.tile-foot { margin-top: 10px; }
.tile.is-done .tile-foot { margin-top: 6px; }
.tile-empty { padding: 14px 4px; font-size: 13px; color: var(--muted); text-align: center; border: 1px dashed var(--rule-strong); border-radius: 10px; }
.tile-pre { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.tile-risk { display: flex; align-items: center; gap: 4px; white-space: nowrap; margin-top: 6px; font-size: 12px; color: var(--muted); }
.more { display: inline-block; padding: 0 6px; border-radius: 999px; background: var(--stone); border: 1px solid var(--rule); font-size: 11.5px; color: var(--muted); font-weight: 500; vertical-align: 1px; }

/* --- case page ------------------------------------------------------------------------------------ */
.case-head { margin-bottom: 26px; }
.case-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.case-head h1 { font-size: 32px; font-weight: 500; letter-spacing: -.022em; line-height: 1.12; }
.case-tx { margin-top: 8px; font-size: 16px; color: var(--ink-soft); }
.case-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 0 56px; align-items: start; }
.case-main > * + * { margin-top: 20px; }
.case-main > .stepper + * { margin-top: 0; }
.case-side { position: sticky; top: 80px; padding: 2px 0 0 24px; border-left: 1px solid var(--rule); font-size: 14px; }
.side-h { margin: 26px 0 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.case-side > .side-h:first-child { margin-top: 0; }
.kv-line { display: block; }
.files { margin: 0; padding: 0 0 0 20px; display: grid; gap: 4px; font-size: 14px; }
.files li::marker { color: var(--muted); font-variant-numeric: tabular-nums; }

/* stepper: the board's columns, as this case's progress */
.stepper { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.stp { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; align-content: start; gap: 2px 8px; padding: 10px 0 0; border-top: 3px solid var(--rule); font-size: 13.5px; color: var(--muted); }
.stp-mark { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--rule-strong); background: var(--paper); }
.stp-label { font-weight: 500; }
.stp-who { grid-column: 2; font-size: 12.5px; }
.stp.is-done { border-top-color: var(--done); color: var(--ink-soft); }
.stp.is-done .stp-mark { background: var(--done); border-color: var(--done); color: var(--paper); }
.stp.is-current { border-top-color: var(--ink); color: var(--ink); }
.stp.is-current .stp-mark { border: 5px solid var(--ink); }
.stp.is-current .stp-label { font-weight: 600; }
.stp-now { display: none; margin: -12px 0 18px; font-size: 14px; color: var(--ink-soft); }

/* now: the one step the case is waiting on */
.now { padding: 22px 24px; border-radius: var(--r-panel); background: var(--linen); scroll-margin-top: 72px; }
.now > * + * { margin-top: 16px; }
.now-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.now-head h2 { font-size: 19px; font-weight: 560; letter-spacing: -.01em; margin-right: auto; }
.now.is-waiting { background: var(--paper); border: 1px solid var(--rule-strong); }
.now.is-waiting .now-head h2 { font-weight: 500; }
.now-advice { padding: 10px 14px; border-radius: var(--r-control); background: var(--gap-tint); border: 1px solid var(--gap-line); color: #7a1a14; font-size: 14.5px; }
.now-advice-warn { background: var(--person-tint); border-color: var(--person-line); color: #5e3a00; }
.now-lead { font-size: 15px; max-width: 68ch; text-wrap: pretty; }
.contact { font-size: 15px; margin-top: 6px; }
.contact a { font-weight: 600; }
.now-foot { font-size: 13.5px; color: var(--ink-soft); }
.now-foot.btn-row { gap: 8px 12px; }
.reveal > summary { list-style: none; width: max-content; }
.reveal > summary::-webkit-details-marker { display: none; }
.reveal[open] > summary { display: none; }
.decision-form .reason { display: none; }
.decision-form:has(input[value="denied"]:checked) .reason { display: grid; }
.stack .field-date { width: max-content; }
.push-end { margin-left: auto; }

/* test runs: chart gaps skipped to try the flow; never a status colour */
.btn-test { border-style: dashed; }
.test-run { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: -8px 0 24px; padding: 10px 10px 10px 16px; border: 1px dashed var(--ink-soft); border-radius: var(--r-control); background: var(--stone); font-size: 14px; color: var(--ink-soft); }
.test-run b { color: var(--ink); font-weight: 600; }
.tag.tag-test { display: inline-block; padding: 0 6px; border: 1px dashed var(--ink-soft); border-radius: 999px; background: none; color: var(--ink-soft); font-size: 11px; font-weight: 600; letter-spacing: .02em; vertical-align: 2px; }
.now .note { background: rgba(255,255,255,.6); }
.now-undo { padding-top: 2px; }

/* The plan's models take seconds on a cold case; the page arrives first and this stands in for it. */
.now-skel > * + * { margin-top: 12px; }
.now-skel-bar { height: 13px; border-radius: 999px; background: var(--rule); }
.now-skel-bar.is-title { height: 19px; width: 42%; }
.now-skel-card { padding: 14px 16px; border-radius: var(--r-control); background: var(--paper); border: 1px solid var(--rule); }
.now-skel-card > * + * { margin-top: 10px; }
.now-skel [data-w="short"] { width: 34%; }
.now-skel [data-w="mid"] { width: 62%; }
.now-skel [data-w="long"] { width: 88%; }
.now-skel-bar { animation: skel-pulse 1.4s ease-in-out infinite; }
.now-skel-card:nth-child(3) .now-skel-bar { animation-delay: .18s; }
@keyframes skel-pulse { 50% { opacity: .45; } }
.now-skel-note { font-size: 13.5px; color: var(--ink-soft); }
.why { font-size: 14px; color: var(--ink-soft); }
.why summary, .crit-note summary { display: flex; align-items: center; gap: 7px; list-style: none; cursor: pointer; width: max-content; color: var(--muted); font-size: 13.5px; }
.why summary::-webkit-details-marker, .crit-note summary::-webkit-details-marker { display: none; }
.why summary::before, .crit-note summary::before { content: ""; width: 5px; height: 5px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
.why[open] summary::before, .crit-note[open] summary::before { transform: rotate(45deg); }
.why summary:hover, .crit-note summary:hover { color: var(--ink); }
.why[open] summary { margin-bottom: 6px; }
.why p + p { margin-top: 6px; }
.why-list { margin: 4px 0 0; padding-left: 18px; }
.why-list li { margin-top: 3px; }
.why p + .why-list { margin-top: 6px; }
.stack { display: grid; gap: 16px; justify-items: start; }
.stack > * { margin: 0; }
.stack .field { width: 100%; max-width: 520px; }
.gap-below { margin-bottom: 18px; }
.mt-6 { margin-top: 6px; } .mt-12 { margin-top: 12px; } .mt-18 { margin-top: 18px; }

/* chart gaps inside the step */
.gaps { list-style: none; padding: 0; display: grid; gap: 10px; }
.gap { padding: 14px 16px; border-radius: var(--r-control); background: var(--paper); border: 1px solid var(--rule); }
.gap > * + * { margin-top: 8px; }
.gap-title { font-size: 16px; font-weight: 560; }
.gap-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.gap-group { margin: 18px 0 8px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.gap-hint { font-size: 14px; color: var(--gap); margin-top: 2px; }
.gap-rule { margin-top: 8px; font-size: 13px; color: var(--muted); }
/* denial risk from past decisions, and the fixes Ophi makes itself */
.lvl { display: inline-block; padding: 0 7px; border-radius: 999px; border: 1px solid; font-size: 12px; font-weight: 600; line-height: 18px; }
.lvl-high { background: var(--gap-tint); border-color: var(--gap-line); color: var(--gap); }
.lvl-medium { background: var(--person-tint); border-color: var(--person-line); color: var(--person); }
.lvl-low { background: var(--done-tint); border-color: var(--done-line); color: var(--done); }
.risk { padding: 12px 14px; border-radius: var(--r-control); background: rgba(255,255,255,.6); border: 1px solid var(--rule); }
.risk-levels { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 14px; }
.risk-k { font-weight: 600; margin-right: 4px; }
.risk-at { display: inline-flex; align-items: center; gap: 6px; }
.risk-arrow { color: var(--muted); }
.risk-line { margin-top: 6px; font-size: 14px; color: var(--ink-soft); max-width: 68ch; }
.risk-src { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.risk + .gaps { margin-top: 14px; }
.gap-n { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 8px; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: 12px; vertical-align: 2px; }
.gap-effect { font-size: 13.5px; font-weight: 500; }
.effect-most { color: var(--done); }
.effect-some { color: var(--ink-soft); }
.effect-none { color: var(--muted); font-weight: 400; }
.autofix-done { font-size: 13.5px; color: var(--done); }
.proposal { padding: 12px 14px; border-radius: var(--r-control); background: var(--stone); }
.proposal-quote { margin: 0 0 10px; font-size: 15px; color: var(--ink); }
.proposal-ask { font-size: 13.5px; color: var(--ink-soft); margin-right: 4px; }

/* clause chip + popover (keyboard and hover) */
.chip { position: relative; display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 6px; background: var(--paper); border: 1px solid var(--rule); font-size: 12.5px; color: var(--ink-soft); cursor: help; }
.chip-src { font-weight: 600; }
.chip-pop { display: none; position: absolute; z-index: 30; left: 0; top: calc(100% + 6px); width: min(380px, 80vw); padding: 12px 14px; border-radius: var(--r-control); background: var(--paper); border: 1px solid var(--rule-strong);
  box-shadow: 0 8px 24px rgba(43, 41, 38, .12); font-size: 13px; line-height: 1.5; color: var(--ink); white-space: normal; }
.chip:hover .chip-pop, .chip:focus-within .chip-pop, .chip:focus .chip-pop { display: grid; gap: 6px; }
.chip-pop q { color: var(--ink-soft); }
.chip-also { color: var(--muted); }

.src-chart { display: inline-block; padding: 0 6px; border: 1px solid var(--rule); border-radius: 999px; color: var(--muted); font-size: 12px; font-weight: 500; line-height: 18px; white-space: nowrap; }

/* criteria form */
.crit-group { justify-self: stretch; }
.crit-group .gap-group { margin-top: 4px; }
.pre-ev { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 5px; font-size: 13.5px; color: var(--ink-soft); }
.pre-ev li { display: flex; align-items: baseline; gap: 8px; }
.pre-ev li > span:last-child { min-width: 0; }
.pre-ev-against > span:last-child { color: var(--person); }
.pre-ev-none { color: var(--muted); }
/* The citation and the note toggle share a line until the note opens. */
.crit-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 6px; }
.crit-foot .crit-meta { margin-top: 0; }
.crit-foot .crit-note[open] { flex-basis: 100%; }
/* A suggestion is dashed until the dentist touches it or confirms it; then it reads as their answer. */
.crit-pick { display: grid; gap: 4px; justify-items: end; }
.crit.is-pre .seg input:checked + span { background: var(--paper); color: var(--ink); outline: 1.5px dashed var(--ink-soft); outline-offset: -4px; }
.crit-sugg { font-size: 12px; color: var(--muted); }
.crit:not(.is-pre) .crit-sugg { display: none; }
.crit-look { color: var(--ink); font-weight: 500; }
.crit-submit { justify-self: stretch; position: sticky; bottom: 0; z-index: 5; margin: 0 -24px -22px; padding: 14px 24px; background: var(--linen); border-top: 1px solid var(--rule-strong); border-radius: 0 0 var(--r-panel) var(--r-panel); }
.crit-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; justify-self: stretch; }
#crit-form .crits { justify-self: stretch; }
.crits { list-style: none; padding: 0; background: var(--paper); border-radius: var(--r-control); border: 1px solid var(--rule); }
.crit { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 18px; align-items: start; padding: 14px 16px; scroll-margin: 72px 0 80px; }
.crit + .crit { border-top: 1px solid var(--rule); }
.crit-label { font-weight: 500; }
.crit-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 4px; font-size: 13px; color: var(--muted); }
.crit-now { font-size: 13px; color: var(--muted); margin-top: 4px; }
.crit-note { font-size: 13.5px; }
.crit-note[open] summary { margin-bottom: 6px; }
.crit-note .input { width: 100%; min-height: 34px; font-size: 14px; }
.seg { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: var(--r-control); overflow: hidden; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: block; padding: 7px 12px; font-size: 13.5px; font-weight: 500; color: var(--ink-soft); background: var(--paper); cursor: pointer; }
.seg label + label span { border-left: 1px solid var(--rule-strong); }
.seg input:checked + span { background: var(--ink); color: var(--paper); }
.seg input[value="not_met"]:checked + span { background: var(--gap); }
.seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: -2px; }
.seg input:disabled + span { cursor: default; color: var(--muted); }
.val { font-weight: 560; }
.val-met { color: var(--done); }
.val-not_met { color: var(--gap); }

/* sub-steps (send the packet) */
.substeps { padding: 0 0 0 20px; display: grid; gap: 12px; }
.substeps li { padding-left: 4px; }
.substeps li::marker { font-weight: 600; color: var(--muted); }
.inline-form { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 12px; }
.choice-cards { display: flex; flex-wrap: wrap; gap: 10px; border: 0; padding: 0; }
.choice-cards label { position: relative; }
.choice-cards input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice-cards span { display: block; padding: 0 18px; line-height: 36px; border-radius: var(--r-control); border: 1px solid var(--rule-strong); background: var(--paper); font-weight: 500; cursor: pointer; }
.choice-cards input:checked + span { border-color: var(--payer); background: var(--payer-tint); color: var(--payer); box-shadow: inset 0 0 0 1px var(--payer); }
.choice-cards input[value="denied"]:checked + span { border-color: var(--gap); background: var(--gap-tint); color: var(--gap); box-shadow: inset 0 0 0 1px var(--gap); }
.choice-cards input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.option { padding: 16px; border-radius: var(--r-control); background: var(--paper); border: 1px solid var(--rule); display: grid; gap: 8px; align-content: start; }
.option h3 { font-size: 15.5px; }
.option p { font-size: 14px; color: var(--ink-soft); }
.attempts { padding: 12px 16px; border-radius: var(--r-panel); border: 1px solid var(--rule); font-size: 14px; color: var(--ink-soft); }
.attempts b { color: var(--ink); font-weight: 560; }

.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 14px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.plain { list-style: none; padding: 0; display: grid; gap: 8px; font-size: 14px; }
:where(.gaps, .plain, .substeps, .crits, .choice-cards, .tiles) { margin: 0; }
.plain .muted { font-size: 13px; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 13.5px; }
.feed time { display: block; font-size: 12.5px; color: var(--muted); }
.source { font-size: 12.5px; color: var(--muted); margin-top: 10px; }

/* folds */
.case-main > .folds { margin-top: 36px; }
.folds { border-top: 1px solid var(--rule); }
.fold { border-bottom: 1px solid var(--rule); }
.fold > summary { list-style: none; display: flex; align-items: baseline; gap: 12px; padding: 16px 0; cursor: pointer; }
.fold-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; min-width: 0; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; flex: none; align-self: center; }
.fold[open] > summary::before { transform: rotate(45deg); }
.fold-title { font-weight: 560; }
.fold-sub { font-size: 13.5px; color: var(--muted); }
.fold-body { padding: 0 0 22px 19px; }
.reqs { list-style: none; margin: 0; padding: 0; }
.req { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--rule); }
.req:first-child { border-top: 0; }
.req-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 4px; font-size: 13px; color: var(--muted); }
.req-detail { margin-top: 4px; font-size: 14px; color: var(--ink-soft); }
.st { flex: none; margin-top: 3px; }
.st-ok { fill: var(--done); }
.st-bad { fill: var(--gap); }
.st-ask { fill: var(--person); }
.st-risk { stroke: var(--person); fill: var(--person); }
.st-risk circle:first-child { fill: none; }
.st-pending { stroke: var(--person); fill: var(--person); }
.st-pending circle:first-child { fill: none; }
.st-na { fill: var(--rule-strong); }
.ev-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.ev-col h3 { font-size: 14px; font-weight: 600; margin: 0 0 8px; }
.ev { padding: 10px 0; border-top: 1px solid var(--rule); font-size: 14px; }
.ev.is-stale .ev-meta { color: var(--gap); }
.ev-meta { font-size: 13px; color: var(--muted); }
.note-text { margin: 6px 0 0; font-size: 14px; color: var(--ink-soft); }
mark { background: var(--person-tint); color: inherit; padding: 0 2px; border-radius: 3px; }
mark.q-confirmed { background: var(--done-tint); }
mark.q-rejected { background: none; text-decoration: line-through; color: var(--muted); }
.depths { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 6px; font-size: 13px; }
.depth { min-width: 22px; text-align: center; padding: 1px 4px; border-radius: 4px; background: var(--paper); border: 1px solid var(--rule); }
.depth.deep { border-color: var(--gap-line); color: var(--gap); }
.psr { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 6px; max-width: 180px; }
.sextant { display: flex; justify-content: space-between; padding: 3px 6px; border-radius: 4px; background: var(--paper); border: 1px solid var(--rule); font-size: 12.5px; }
.sextant.hl { border-color: var(--ink); }
.sextant.high .score { color: var(--gap); font-weight: 600; }
.tag { font-size: 12px; padding: 0 6px; border-radius: 999px; background: var(--person-tint); color: var(--person); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 500; font-size: 13px; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--rule-strong); }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.tbl-wrap { overflow-x: auto; }

/* --- packet page ---------------------------------------------------------------------------------- */
.pdf { display: block; width: 100%; height: 780px; border: 1px solid var(--rule); border-radius: var(--r-panel); background: var(--stone); }
.pdf-open { display: inline-block; margin-top: 8px; color: var(--muted); }
.panel { padding: 20px 22px; border-radius: var(--r-panel); border: 1px solid var(--rule); background: var(--paper); }
.panel + .panel { margin-top: 18px; }
.panel h2 { font-size: 16.5px; margin-bottom: 12px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
.attest { font-size: 15.5px; color: var(--ink); padding-left: 14px; border-left: 3px solid var(--rule-strong); }
.fold-body .attest { margin-bottom: 14px; }
.narrative-ro { white-space: pre-wrap; font: 13.5px/1.55 var(--font); color: var(--ink-soft); margin: 0; max-height: 420px; overflow: auto; }
.next-up { display: flex; justify-content: space-between; align-items: center; gap: 12px 16px; flex-wrap: wrap; padding: 10px 10px 10px 18px; border-radius: var(--r-panel); background: var(--stone); font-size: 14.5px; }
.next-up p { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; }
.next-up b { font-weight: 600; }
.next-up-act { color: var(--ink-soft); }

/* --- recover -------------------------------------------------------------------------------------- */
.tally { display: flex; flex-wrap: wrap; gap: 10px 32px; margin: 0 0 28px; padding: 16px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); font-size: 14.5px; }
.tally b { font-size: 20px; font-weight: 560; margin-right: 6px; }
.calls { list-style: none; margin: 0; padding: 0; }
.call { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(330px, 1fr); gap: 12px 28px; padding: 18px 0; border-bottom: 1px solid var(--rule); scroll-margin-top: 72px; }
.call.is-closed { color: var(--muted); }
.orphan-note { max-width: 1240px; margin: 20px 0 0; }
.call-name { font-weight: 560; font-size: 16px; }
.call-sub { font-size: 13.5px; color: var(--muted); }
.call-fee { font-size: 16px; font-weight: 560; margin-top: 4px; }
.call-why { font-size: 14px; color: var(--ink-soft); }
.call-why + .call-why { margin-top: 6px; }
.call-act { display: grid; gap: 8px; align-content: start; }
.call-status { font-size: 13.5px; }
.call-act .input { width: 100%; min-height: 34px; font-size: 14px; }
.call-act .btn-row { gap: 6px; flex-wrap: nowrap; }
.call-act .btn-sm { padding: 0 10px; font-size: 13px; }
.call-due { font-size: 13px; color: var(--muted); margin-top: 6px; }
.call-due.is-due, .tally .is-due { color: var(--warn, #9a4a12); font-weight: 560; }
.call.is-due { background: linear-gradient(to right, var(--stone), transparent 40%); }
.call.is-back { color: var(--muted); }
.call-back-note, .call-next { font-size: 14px; color: var(--ink-soft); margin-top: 8px; }
.call-when { display: block; font-size: 13px; color: var(--ink-soft); }
.call-when .input { margin-top: 4px; }
.call-log { font-size: 13px; color: var(--ink-soft); margin-top: 8px; }
.call-log ol { margin: 6px 0 0 18px; padding: 0; }
.call-script { margin-top: 10px; padding: 12px 14px; border-radius: var(--r-panel); background: var(--stone); }
.call-script-head { font-size: 13px; font-weight: 600; }
.call-script-text { font-size: 14.5px; line-height: 1.55; white-space: pre-wrap; margin: 8px 0; }
.call-script-err { font-size: 14px; color: var(--warn, #9a4a12); margin-top: 8px; }

/* --- results -------------------------------------------------------------------------------------- */
.report { max-width: 900px; }
.page > .head { max-width: 900px; }
.settings-grid, .calls, .tally { max-width: 1240px; }
.fact { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 8px 32px; padding: 26px 0; border-top: 1px solid var(--rule); scroll-margin-top: 72px; }
.fact-k { font-size: 14px; font-weight: 600; color: var(--ink-soft); padding-top: 4px; }
.fact-v { font-size: 20px; letter-spacing: -.01em; line-height: 1.4; max-width: 60ch; }
.fact-v b { font-weight: 600; }
.fact-more { margin-top: 14px; font-size: 14.5px; color: var(--ink-soft); }
.counts { list-style: none; margin: 14px 0 0; padding: 0; display: grid; font-size: 14.5px; max-width: 560px; }
.counts li { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-bottom: 1px solid var(--rule); }
.counts-k { margin-top: 18px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.counts-k + .counts { margin-top: 4px; }

/* --- settings --------------------------------------------------------------------------------------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 32px; align-items: start; }
.settings-grid .panel h3 { font-size: 14px; margin: 18px 0 8px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--person); margin-right: 6px; }
.error-panel { max-width: 640px; }
.error-panel h1 { font-size: 26px; font-weight: 500; margin-bottom: 10px; }
.error-panel p + p { margin-top: 14px; }

/* --- narrow screens ----------------------------------------------------------------------------------- */
@media (max-width: 1280px) and (min-width: 861px) {
  .board { grid-template-columns: repeat(6, 232px); overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 8px; }
  .col { scroll-snap-align: start; }
}
@media (max-width: 1240px) {
  .case-grid { grid-template-columns: minmax(0, 1fr) 260px; gap: 0 36px; }
  .case-side { padding-left: 20px; }
}
@media (max-width: 1080px) {
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .case-grid { grid-template-columns: minmax(0, 1fr); }
  .case-side { position: static; margin-top: 28px; padding: 0; border-left: 0; }
}
@media (max-width: 860px) {
  :root { --gutter: 16px; }
  .bar-in { gap: 18px; height: auto; min-height: 56px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 0; }
  .nav { order: 3; width: 100%; height: 40px; gap: 14px; font-size: 14px; }
  .me > span { display: none; }
  .page { padding-top: 22px; }
  .head h1, .case-head h1 { font-size: 26px; }
  .start { flex-wrap: wrap; padding: 14px 16px; }
  .start .btn { width: 100%; }
  .chair-item { grid-template-columns: minmax(0, 1fr); padding: 10px 12px; }
  .chair-do { grid-column: 1; justify-self: stretch; }
  .test-run { margin-top: -10px; }
  .board { grid-template-columns: minmax(0, 1fr); }
  .col.is-empty .col-head { padding-bottom: 0; }
  /* phones: six progress segments, with only the current step named */
  .stepper { gap: 4px; }
  .stp { display: block; padding-top: 0; }
  .stp > * { display: none; }
  .stp-now { display: block; }
  .now { padding: 18px 16px; }
  .options, .ev-grid { grid-template-columns: minmax(0, 1fr); }
  .crit { grid-template-columns: minmax(0, 1fr); }
  .crit-pick { justify-items: stretch; }
  .crit-submit { margin: 0 -16px -18px; padding: 12px 16px; }
  .seg { display: flex; }
  .seg label { flex: 1; }
  .seg span { padding: 11px 8px; text-align: center; }
  .call { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .fact { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 20px 0; }
  .fact-v { font-size: 18px; }
  .pdf { height: 520px; }
}
@media print {
  .demo, .bar, .print-hide, .done-note { display: none; }
  .page { padding: 0; max-width: none; }
  .fold:not([open]) { display: none; }
  body { font-size: 12px; }
}

/* Sun Life's answer: what the PMS shows, and what the last denial asked for */
.pms-line { font-size: 13px; color: var(--muted); margin: 4px 0 12px; }
.letter-form { margin-bottom: 12px; }
.ask { display: flex; gap: 12px; align-items: center; justify-content: space-between; }

/* Past outcomes list and one past request */
.plist-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.plist-tab { display: inline-flex; align-items: baseline; gap: 7px; padding: 8px 14px; border-radius: var(--r-control); border: 1px solid var(--rule-strong); background: var(--paper); color: var(--ink-soft); font-size: 14px; text-decoration: none; }
.plist-tab b { font-size: 17px; font-weight: 560; color: var(--ink); }
.plist-tab:hover { border-color: var(--ink-soft); }
.plist-tab.is-on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.plist-tab.is-on b { color: var(--paper); }
.plist-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 16px; margin: 0 0 18px; }
.plist-filters .input { min-width: 170px; }
.plist-clear { font-size: 14px; color: var(--muted); }
.plist-link { color: var(--ink); font-weight: 500; white-space: nowrap; }
.plist-ok { color: var(--done); font-weight: 500; }
.plist-no { color: var(--payer); }
.plist-resent { display: inline-block; margin-left: 4px; padding: 0 7px; border-radius: 999px; background: var(--done-tint); border: 1px solid var(--done-line); color: var(--done); font-size: 12.5px; white-space: nowrap; }
.plist-pager { display: flex; align-items: center; gap: 14px; margin: 18px 0 0; font-size: 14px; }
.plist-report { margin-top: 36px; border-top: 1px solid var(--rule); }
.past-page { max-width: 820px; }
.past-big { font-size: 22px; font-weight: 560; letter-spacing: -.012em; line-height: 1.25; }
.past-then { margin: 24px 0 8px; }
.past-then > * + * { margin-top: 10px; }
.past-then h2 { font-size: 17px; font-weight: 560; }
.past-changes { margin: 0; padding-left: 20px; font-size: 15px; }
@media (max-width: 860px) {
  .plist-filters .field { flex: 1 1 100%; }
  .plist-filters .input { width: 100%; }
  .plist td, .plist th { padding-left: 6px; padding-right: 6px; }
  .plist .muted { display: block; }  /* tooth kind under the number */
  .plist .plist-clinic { display: none; }
}
