/* ScanMiner stage demo. Light theme for a shared screen. The page scales like a slide: 1rem is 16px at 1920 by 1080
   and shrinks in proportion on smaller screens, so the layout holds when Zoom scales it down. Phones get a stacked,
   scrolling layout (see the end of the file). */

@font-face { font-family: "Be Vietnam Pro"; font-weight: 400; font-style: normal; font-display: block; src: url("/scanminer/fonts/be-vietnam-pro-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 500; font-style: normal; font-display: block; src: url("/scanminer/fonts/be-vietnam-pro-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 600; font-style: normal; font-display: block; src: url("/scanminer/fonts/be-vietnam-pro-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 700; font-style: normal; font-display: block; src: url("/scanminer/fonts/be-vietnam-pro-latin-700-normal.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --paper: #F3F1EC; --paper-2: #ECE9E2; --surface: #FFFFFF; --sunken: #F7F6F2;
  --ink: #0F1B2D; --ink-2: #33415A; --ink-3: #566275; --ink-4: #7C8696;
  --line: rgba(15, 27, 45, .10); --line-2: rgba(15, 27, 45, .17);
  --action: #0B6FE0; --action-hover: #0759C4; --action-soft: #E4F0FF; --action-ink: #0A4BA8;
  --treat: #6B778A; --treat-soft: #EDEFF2; --treat-ink: #3E4A5B;
  --recall: #0B8F84; --recall-soft: #E1F4F1; --recall-ink: #075F57;
  --new: #3A5FD9; --new-soft: #E7EDFC; --new-ink: #233F9E;
  --hot: #E2580E; --hot-soft: #FFEFE2; --hot-ink: #9C3A05;
  --good: #1D8A4B; --good-soft: #E2F4E8; --good-ink: #12663A;
  --wait: #B06800; --wait-soft: #FFF2D4; --wait-ink: #774200;
  --stop: #B3372F; --stop-soft: #FBEAE8; --stop-ink: #8C1F19;
  --claude: #B4552A; --claude-soft: #F6EADF; --claude-ink: #7A3415;
  --team-soft: #E5EDF8; --team-ink: #1C3D72;
  --sample-soft: #FFF1C9; --sample-ink: #6E4600;
  --shadow-1: 0 1px 2px rgba(15, 27, 45, .06), 0 .5rem 1.5rem -.75rem rgba(15, 27, 45, .20);
  --shadow-2: 0 2px 4px rgba(15, 27, 45, .06), 0 1.25rem 3rem -1.25rem rgba(15, 27, 45, .32);
  --r-card: .875rem; --r-lg: 1.25rem;
  --pad-x: 3rem;
  --ease: cubic-bezier(.2, .75, .25, 1);
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
}

html { font-size: clamp(10px, min(.8333vw, 1.4815vh), 20px); -webkit-text-size-adjust: 100%; }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 1rem; line-height: 1.45; -webkit-font-smoothing: antialiased; overflow: hidden; height: 100vh; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; border-radius: .375rem; }
svg { display: block; }

/* ---------- Shell ---------- */
.shell { height: 100vh; display: grid; grid-template-rows: auto auto minmax(0, 1fr); }
.top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1.5rem; padding: .875rem var(--pad-x); border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .55); }
.brand { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.brand .mark { width: 2.25rem; height: 2.25rem; border-radius: .625rem; background: var(--ink); display: grid; place-items: center; flex: none; }
.brand .mark svg { width: 1.5rem; height: 1.5rem; }
.brand .word { font-weight: 700; font-size: 1.375rem; letter-spacing: -.01em; }
.brand .where { color: var(--ink-3); font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: .875rem; border-left: 1px solid var(--line-2); }
.sample { justify-self: end; display: inline-flex; align-items: center; gap: .5rem; padding: .3125rem .875rem; border-radius: 999px; background: var(--sample-soft); color: var(--sample-ink); font-weight: 600; font-size: .9375rem; white-space: nowrap; box-shadow: inset 0 0 0 1px rgba(110, 70, 0, .16); }
.sample::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: #D99A00; }
/* The always-on badges: the sample badge, and under it a quieter chip saying Claude works from row numbers. */
.badges { justify-self: end; display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; min-width: 0; }
.rowsonly { display: inline-flex; align-items: center; gap: .375rem; padding: .1875rem .625rem; border-radius: 999px; background: rgba(255, 255, 255, .7); color: var(--ink-3); font-weight: 600; font-size: .75rem; line-height: 1.35; white-space: nowrap; box-shadow: inset 0 0 0 1px var(--line); }
.rowsonly svg { width: .75rem; height: .75rem; flex: none; color: var(--ink-4); }

.rail { display: flex; gap: .25rem; padding: .25rem; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.rail button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: .5rem; padding: .375rem .875rem .375rem .375rem; border-radius: 999px; color: var(--ink-3); font-weight: 500; font-size: .9375rem; white-space: nowrap; transition: background .25s, color .25s; }
.rail button .n { width: 1.625rem; height: 1.625rem; border-radius: 50%; display: grid; place-items: center; font-size: .8125rem; font-weight: 700; background: var(--paper); color: var(--ink-2); transition: background .25s, color .25s; }
.rail button:hover { background: var(--sunken); color: var(--ink); }
.rail button.done .n { background: var(--good-soft); color: var(--good-ink); }
.rail button[aria-current="step"] { background: var(--ink); color: #fff; }
.rail button[aria-current="step"] .n { background: rgba(255, 255, 255, .16); color: #fff; }
.rail button:focus-visible { outline: 3px solid var(--action); outline-offset: 1px; }

.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 2.5rem; padding: 1rem var(--pad-x) 1.25rem; transition: opacity .35s var(--ease); }
.head[hidden] { display: none; }
.titles { min-width: 0; flex: 1; }
.eyebrow { display: flex; align-items: center; gap: .75rem; font-size: 1rem; font-weight: 600; color: var(--ink-3); margin-bottom: .5rem; letter-spacing: .01em; }
.titles h1 { font-size: 2.5rem; line-height: 1.12; font-weight: 700; letter-spacing: -.022em; text-wrap: balance; }
.titles .subline { margin-top: .5rem; font-size: 1.25rem; line-height: 1.4; color: var(--ink-2); max-width: 64rem; text-wrap: pretty; }
.titles.swap { animation: rise .45s var(--ease) both; }

.counters { display: flex; gap: .75rem; flex: none; }
.tile { width: 10.25rem; padding: .75rem 1rem .8125rem; border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow-1); transition: opacity .35s, transform .35s var(--ease); }
.tile .k { font-size: .8125rem; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.tile .v { font-size: 2.25rem; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; margin-top: .125rem; }
.tile .s { font-size: .8125rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.15em; }
.tile.off { opacity: .38; }
.tile.off .v { color: var(--ink-4); }
.tile.bump .v { animation: bump .5s var(--ease); }
.tile.t-sent:not(.off) .v { color: var(--good); }

.stage { grid-row: 3; position: relative; min-height: 0; padding: 0 var(--pad-x) 6rem; }
.scene { position: absolute; inset: 0 var(--pad-x) 6rem; display: none; }
.scene.on { display: block; animation: rise .5s var(--ease) both; }
.scene.on.still { animation: none; }

/* ---------- Chips ---------- */
.chip { display: inline-flex; align-items: center; gap: .375rem; padding: .1875rem .625rem; border-radius: 999px; font-size: .8125rem; font-weight: 600; line-height: 1.35; white-space: nowrap; }
.chip svg { width: .875rem; height: .875rem; flex: none; }
.chip.claude { background: var(--claude-soft); color: var(--claude-ink); }
.chip.claude svg { color: var(--claude); }
.chip.team { background: var(--team-soft); color: var(--team-ink); }
.chip.good { background: var(--good-soft); color: var(--good-ink); }
.chip.wait { background: var(--wait-soft); color: var(--wait-ink); }
.chip.stop { background: var(--stop-soft); color: var(--stop-ink); }
.chip.muted { background: var(--treat-soft); color: var(--treat-ink); }
.chip.b-treat { background: var(--treat-soft); color: var(--treat-ink); }
.chip.b-recall { background: var(--recall-soft); color: var(--recall-ink); }
.chip.b-new { background: var(--new-soft); color: var(--new-ink); }
.chip.b-consult { background: var(--hot-soft); color: var(--hot-ink); }
.chip.lg { font-size: .9375rem; padding: .3125rem .8125rem; }

/* ---------- Scene 1 and 2: scans and buckets ---------- */
.scans { height: 100%; display: flex; flex-direction: column; gap: 1.25rem; }
.export { display: flex; align-items: center; gap: 1rem; padding: .875rem 1.25rem; border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow-1); width: max-content; max-width: 100%; }
.export .file { width: 2.75rem; height: 2.75rem; border-radius: .625rem; background: var(--action-soft); color: var(--action-ink); display: grid; place-items: center; flex: none; }
.export .file svg { width: 1.5rem; height: 1.5rem; }
.export b { font-size: 1.125rem; }
.export span { color: var(--ink-3); font-size: 1rem; }
.export .rows { margin-left: .5rem; }
.scans[data-mode="buckets"] .export { display: none; }

.inbox { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; align-content: start; }
.buckets { display: none; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; align-items: start; min-height: 0; }
.scans[data-mode="buckets"] .inbox { display: none; }
.scans[data-mode="buckets"] .buckets { display: grid; }

.bucket { border-radius: var(--r-lg); background: rgba(255, 255, 255, .5); box-shadow: inset 0 0 0 1px var(--line); padding: .875rem; display: flex; flex-direction: column; gap: .75rem; }
.bucket .bh { display: flex; flex-direction: column; gap: .25rem; padding: .25rem .375rem .375rem; }
.bucket .bh-top { display: flex; align-items: center; gap: .625rem; }
.bucket .bh-top h2 { font-size: 1.375rem; font-weight: 700; letter-spacing: -.01em; }
.bucket .count { margin-left: auto; min-width: 2.5rem; height: 2.5rem; padding: 0 .625rem; border-radius: .75rem; display: grid; place-items: center; font-size: 1.5rem; font-weight: 700; color: #fff; }
.bucket .count.bump { animation: bump .45s var(--ease); }
.bucket .bl { font-size: .9375rem; color: var(--ink-3); }
.bucket .list { display: flex; flex-direction: column; gap: .75rem; }
.bucket.treat { background: repeating-linear-gradient(135deg, rgba(107, 119, 138, .05) 0 .5rem, transparent .5rem 1rem), rgba(255, 255, 255, .35); }
.bucket.treat .count { background: var(--treat); }
.bucket.recall .count { background: var(--recall); }
.bucket.new .count { background: var(--new); }
.bucket.consult .count { background: var(--hot); }
.bucket.consult { box-shadow: inset 0 0 0 2px rgba(226, 88, 14, .30); background: rgba(255, 239, 226, .45); }

.card { position: relative; height: 7.25rem; border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow-1); padding: .875rem 1rem .8125rem 1.125rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 1fr auto; column-gap: .75rem; overflow: hidden; will-change: transform; }
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: .3125rem; background: var(--line-2); transition: background .4s; }
.card .meta { grid-column: 1; display: flex; gap: .625rem; align-items: baseline; font-size: .9375rem; color: var(--ink-3); font-weight: 500; }
.card .meta .id { font-variant-numeric: tabular-nums; }
/* The row number Claude works from: it appears as the cards come back sorted. */
.card .rowmark { align-self: center; padding: .0625rem .4375rem; border-radius: .375rem; background: var(--claude-soft); color: var(--claude-ink); font-size: .8125rem; font-weight: 700; line-height: 1.35; font-variant-numeric: tabular-nums; white-space: nowrap; opacity: 0; transition: opacity .35s; }
.card.landed .rowmark { opacity: 1; }
.card .nm { grid-column: 1; align-self: center; font-size: 1.625rem; font-weight: 700; letter-spacing: -.015em; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .nm small { font-size: 1rem; font-weight: 500; color: var(--ink-3); margin-left: .375rem; letter-spacing: 0; }
.card .ln { grid-column: 1 / -1; position: relative; height: 1.375rem; font-size: .9375rem; color: var(--ink-3); }
.card .ln > span { position: absolute; inset: 0; display: flex; align-items: center; gap: .375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .35s, transform .35s var(--ease); }
.card .ln svg { width: 1rem; height: 1rem; flex: none; }
.card .ln .why { opacity: 0; transform: translateY(.375rem); color: var(--ink-2); font-weight: 500; }
.card.landed .ln .src { opacity: 0; transform: translateY(-.375rem); }
.card.landed .ln .why { opacity: 1; transform: none; }
.card .art { grid-column: 2; grid-row: 1 / 3; width: 5.75rem; height: 4.4rem; margin: -.25rem -.25rem 0 0; color: var(--ink-3); }
.card.landed.b-treat::before { background: var(--treat); }
.card.landed.b-recall::before { background: var(--recall); }
.card.landed.b-new::before { background: var(--new); }
.card.landed.b-consult::before { background: var(--hot); }
.card.landed.b-treat { background: #FAFAF9; }
.card.landed.b-treat .nm { color: var(--ink-2); }
.card.flying { z-index: 5; box-shadow: var(--shadow-2); }
.card.repeat.landed .why { color: var(--hot-ink); font-weight: 600; }
.card.focus { box-shadow: 0 0 0 3px var(--hot), var(--shadow-2); }

.link-strip { display: grid; grid-template-columns: auto 1fr; gap: .25rem .75rem; align-items: center; margin: -.375rem .5rem 0 1.25rem; padding: .625rem .875rem; border-radius: 0 0 .75rem .75rem; border: 2px dashed rgba(226, 88, 14, .45); border-top: 0; background: rgba(255, 255, 255, .7); font-size: .9375rem; color: var(--ink-2); opacity: 0; transform: translateY(-.75rem); transition: opacity .45s, transform .55s var(--ease); }
.link-strip.on { opacity: 1; transform: none; }
.link-strip .ic { grid-row: 1 / 3; width: 2.25rem; height: 2.25rem; border-radius: .625rem; background: var(--hot-soft); color: var(--hot-ink); display: grid; place-items: center; }
.link-strip .ic svg { width: 1.25rem; height: 1.25rem; }
.link-strip b { color: var(--ink); font-weight: 600; }
.link-strip .chip { justify-self: start; margin-top: .125rem; }
.link-strip .by { display: flex; gap: .375rem; align-items: flex-start; margin-top: .125rem; font-size: .875rem; font-weight: 600; line-height: 1.35; color: var(--team-ink); }
.link-strip .by svg { width: .9375rem; height: .9375rem; flex: none; margin-top: .0625rem; }

/* ---------- Scene 3: the tracking sheet ---------- */
.sheet { height: 100%; display: flex; flex-direction: column; gap: .5rem; }
.sheet-bar { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.sheet-bar .title { font-weight: 700; font-size: 1.125rem; }
.sheet-bar .hint { color: var(--ink-3); font-size: .9375rem; }
.seg { margin-left: auto; display: inline-flex; padding: .25rem; gap: .25rem; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.seg button { all: unset; cursor: pointer; padding: .3125rem .875rem; border-radius: 999px; font-size: .9375rem; font-weight: 600; color: var(--ink-3); }
.seg button:hover { color: var(--ink); background: var(--sunken); }
.seg button.on { background: var(--ink); color: #fff; }
.seg button:focus-visible { outline: 3px solid var(--action); }
.sheet-wrap { position: relative; flex: 1; min-height: 0; overflow: auto; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); overscroll-behavior: contain; scrollbar-width: thin; }
table.grid { border-collapse: separate; border-spacing: 0; font-size: .9375rem; min-width: 100%; }
.grid th, .grid td { text-align: left; vertical-align: middle; padding: .375rem .75rem; line-height: 1.3; border-bottom: 1px solid var(--line); background: var(--surface); }
.grid thead th { position: sticky; z-index: 2; font-weight: 600; color: var(--ink-3); font-size: .8125rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.grid thead tr.g th { top: 0; height: 2.375rem; background: var(--sunken); border-bottom: 1px solid var(--line); color: var(--ink-2); text-transform: none; letter-spacing: 0; font-size: .875rem; }
.grid thead tr.g th .chip { margin-left: .5rem; vertical-align: middle; }
.grid thead tr.c th { top: 2.375rem; height: 2.5rem; border-bottom: 1px solid var(--line-2); }
.grid .gs { border-left: 1px solid var(--line-2); }
.grid .fz { position: sticky; z-index: 1; }
.grid thead .fz { z-index: 3; }
.grid .fz.c0 { left: 0; width: 3rem; min-width: 3rem; padding-right: .25rem; }
.grid .fz.c1 { left: 3rem; width: 7.5rem; min-width: 7.5rem; }
.grid .fz.c2 { left: 10.5rem; width: 8.25rem; min-width: 8.25rem; box-shadow: 1px 0 0 var(--line-2), .5rem 0 .75rem -.75rem rgba(15, 27, 45, .35); }
.grid td.fz.c0 { font-variant-numeric: tabular-nums; color: var(--claude-ink); font-weight: 700; }
.grid td.fz.c1 { font-variant-numeric: tabular-nums; color: var(--ink-3); }
.grid .lk { display: inline-block; vertical-align: -.125rem; margin-right: .3125rem; color: var(--ink-3); }
.grid .lk svg { width: .8125rem; height: .8125rem; }
.grid thead tr.g th.gn { padding-left: .75rem; }
.grid td.fz.c2 { font-weight: 700; font-size: 1.0625rem; }
.grid td.fz.c2 small { display: block; font-weight: 500; font-size: .8125rem; color: var(--ink-3); }
.grid td { color: var(--ink-2); }
.grid .w-date { min-width: 7rem; white-space: nowrap; }
.grid .w-bucket { min-width: 11.5rem; }
.grid .w-repeat { min-width: 11.5rem; white-space: nowrap; }
.grid .w-motiv { min-width: 28.5rem; max-width: 30rem; }
.grid .w-note { min-width: 30rem; max-width: 32rem; }
.grid .w-tmpl { min-width: 11rem; }
.grid .w-chat { min-width: 10.5rem; }
.grid .w-out { min-width: 8.25rem; white-space: nowrap; }
.grid .w-fu { min-width: 8.75rem; white-space: nowrap; }
.grid .w-owner { min-width: 6rem; }
.grid tbody tr { cursor: pointer; }
.grid tbody tr:hover td { background: #F7FAFF; }
.grid tbody tr.opp td.fz.c2 { box-shadow: 1px 0 0 var(--line-2), .5rem 0 .75rem -.75rem rgba(15, 27, 45, .35); }
.grid tbody tr.track td { background: #FAFAF8; color: var(--ink-4); }
.grid tbody tr.track td.fz.c2 { color: var(--ink-3); }
.grid tbody tr.track:hover td { background: #F4F4F1; }
.grid .trackcell { color: var(--ink-4); font-style: italic; background-image: repeating-linear-gradient(135deg, rgba(107, 119, 138, .07) 0 .375rem, transparent .375rem .75rem) !important; }
.grid .q { display: inline-block; margin: .125rem .25rem .125rem 0; padding: .0625rem .5rem; border-radius: .375rem; background: var(--sunken); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); font-weight: 500; }
.grid .note { margin-right: .375rem; }
.grid td[data-k="note"] .chip { vertical-align: .0625rem; padding: .0625rem .5rem; }
.grid .empty { display: inline-block; width: 5.5rem; height: 1.625rem; border-radius: .375rem; border: 1.5px dashed var(--line-2); vertical-align: middle; }
.grid .logged { font-weight: 600; color: var(--good-ink); }
.grid .sched { font-weight: 600; color: var(--action-ink); }
.grid tr.rowin td { animation: rowin .5s var(--ease) both; }
.grid tr.pulse td { animation: rowpulse 1.6s ease-in-out 2; }
.grid td.flash { animation: cellflash 1.4s var(--ease); }
.sheet-fade { position: absolute; top: 0; right: 0; bottom: 0; width: 4rem; pointer-events: none; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .95)); border-radius: 0 var(--r-lg) var(--r-lg) 0; transition: opacity .3s; }
.sheet-cap { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: .375rem 2rem; font-size: .9375rem; line-height: 1.35; color: var(--ink-2); }
.sheet-cap .cl { display: inline-flex; align-items: center; gap: .5rem; }
.sheet-cap svg { width: 1rem; height: 1rem; flex: none; color: var(--ink-3); }
.sheet-cap .of svg, .grid .lk.of { color: var(--team-ink); }
.sheet-cap b { color: var(--ink); font-weight: 700; }

/* ---------- Scene 4: one patient ---------- */
.patient { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 1rem; }
.picker { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.picker .lbl { font-size: .9375rem; color: var(--ink-3); font-weight: 600; margin-right: .25rem; }
.pick { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: .5rem; padding: .375rem .875rem .375rem .625rem; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; font-size: .9375rem; color: var(--ink-2); transition: background .2s, box-shadow .2s; }
.pick:hover { box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink); }
.pick .dot { width: .625rem; height: .625rem; border-radius: 50%; background: var(--action); }
.pick .dot.d-wait { background: var(--wait); }
.pick .dot.d-stop { background: transparent; box-shadow: inset 0 0 0 2px var(--stop); }
.pick .dot.d-sent { background: var(--good); }
.pick .dot.d-track { background: var(--treat); }
.pick[aria-pressed="true"] { background: var(--ink); color: #fff; box-shadow: none; }
.pick:focus-visible { outline: 3px solid var(--action); }
.picker .sep { width: 1px; height: 1.5rem; background: var(--line-2); margin: 0 .25rem; }

.pview { display: grid; grid-template-columns: 25rem minmax(0, 1fr) 27rem; gap: 1.25rem; min-height: 0; }
.pview.solo { grid-template-columns: 25rem minmax(0, 1fr); }
.panel { border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); min-height: 0; }
.profile { padding: 1.25rem 1.375rem; display: flex; flex-direction: column; gap: .875rem; overflow: auto; }
.who { display: flex; align-items: center; gap: .875rem; }
.ava { width: 3.25rem; height: 3.25rem; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 1.375rem; flex: none; }
.ava.b-treat { background: var(--treat); } .ava.b-recall { background: var(--recall); } .ava.b-new { background: var(--new); } .ava.b-consult { background: var(--hot); }
.who h2 { font-size: 1.875rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.who p { color: var(--ink-3); font-size: .9375rem; }
.scanart { border-radius: var(--r-card); background: linear-gradient(180deg, #F4F8FB, #EDF3F7); box-shadow: inset 0 0 0 1px var(--line); padding: .5rem .75rem .75rem; display: flex; flex-direction: column; align-items: center; gap: .25rem; color: var(--ink-3); }
.scanart .caps { align-self: stretch; display: flex; justify-content: space-between; gap: .5rem; font-size: .75rem; color: var(--ink-4); }
.scanart .caps b { color: var(--ink-3); font-weight: 600; }
.scanart .arches { display: flex; gap: 1.25rem; align-items: center; }
.scanart svg { width: 9.5rem; height: 7.25rem; }
.fact { display: grid; gap: .3125rem; }
.fact .fk { display: flex; align-items: center; gap: .5rem; font-size: .8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.fact .fk .chip { text-transform: none; letter-spacing: 0; }
.fact .fv { font-size: 1.0625rem; color: var(--ink); line-height: 1.4; }
.quotes { display: flex; flex-wrap: wrap; gap: .375rem; }
.quote { padding: .3125rem .75rem; border-radius: .625rem; background: var(--hot-soft); color: var(--hot-ink); font-weight: 600; font-size: 1.0625rem; }
.consent { display: flex; gap: .5rem; flex-wrap: wrap; }

/* The draft column: what Claude was given, the draft, and what the sheet filled in. */
.dcol { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: .375rem; min-height: 0; min-width: 0; }
.given { display: block; padding: .375rem .75rem; border-radius: var(--r-card); background: var(--claude-soft); color: var(--claude-ink); font-size: .875rem; line-height: 1.4; box-shadow: inset 0 0 0 1px rgba(180, 85, 42, .18); }
.given .gk { display: inline-flex; align-items: center; gap: .375rem; margin-right: .625rem; vertical-align: .0625rem; font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.given .gk svg { width: .8125rem; height: .8125rem; color: var(--claude); align-self: center; }
.given .gv { display: inline; font-weight: 600; color: var(--ink); }
.given .gv span { white-space: nowrap; }
.given .gv i { font-style: normal; margin: 0 .3125rem; color: var(--claude); opacity: .6; }
.mergeline { display: flex; align-items: center; gap: .75rem; padding: 0 .25rem; font-size: .9375rem; line-height: 1.4; color: var(--ink-2); }
.mergeline p { flex: 1; min-width: 0; }
.tokf { padding: 0 .25rem; border-radius: .25rem; background: var(--action-soft); color: var(--action-ink); font-weight: 600; white-space: nowrap; }
.nmf, .namefill { border-radius: .3125rem; padding: 0 .1875rem; background: var(--team-soft); color: var(--team-ink); font-weight: 600; box-shadow: inset 0 -.125rem 0 rgba(28, 61, 114, .38); }
.namefill .r { display: none; }
.raw .namefill .m { display: none; }
.raw .namefill .r { display: inline; }
.raw .namefill { background: var(--action-soft); color: var(--action-ink); box-shadow: none; white-space: nowrap; }
.btn-fake .namefill { background: rgba(255, 255, 255, .18); color: #fff; box-shadow: inset 0 -.125rem 0 rgba(255, 255, 255, .6); }
.rawsw { all: unset; cursor: pointer; flex: none; display: inline-flex; align-items: center; gap: .5rem; padding: .1875rem .75rem .1875rem .4375rem; border-radius: 999px; background: var(--surface); color: var(--ink-2); font-size: .875rem; font-weight: 600; line-height: 1.3; white-space: nowrap; box-shadow: inset 0 0 0 1px var(--line-2); }
.rawsw:hover { color: var(--ink); }
.rawsw:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; }
.rawsw .knob { position: relative; width: 1.875rem; height: 1.0625rem; border-radius: 999px; background: var(--line-2); transition: background .2s; }
.rawsw .knob::after { content: ""; position: absolute; left: .125rem; top: .125rem; width: .8125rem; height: .8125rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(15, 27, 45, .25); transition: transform .2s var(--ease); }
.rawsw[aria-checked="true"] { color: var(--action-ink); box-shadow: inset 0 0 0 1.5px rgba(11, 111, 224, .45); }
.rawsw[aria-checked="true"] .knob { background: var(--action); }
.rawsw[aria-checked="true"] .knob::after { transform: translateX(.8125rem); }

.mail { display: flex; flex-direction: column; overflow: hidden; }
.mhead { padding: 1rem 1.5rem .875rem; border-bottom: 1px solid var(--line); display: grid; gap: .375rem; }
.mrow { display: flex; align-items: center; gap: .75rem; font-size: .9375rem; color: var(--ink-3); }
.mrow .kind { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--ink); font-size: 1rem; }
.mrow .kind svg { width: 1.125rem; height: 1.125rem; }
.mrow .spacer { flex: 1; }
.mrow b { color: var(--ink-2); font-weight: 600; }
.mrow .from b { margin-left: .5rem; } /* one item, so on a phone "From" stays with the name */
.subject { font-size: 1.5rem; font-weight: 700; letter-spacing: -.015em; line-height: 1.25; color: var(--ink); }
.mbody { padding: 1.125rem 1.5rem 1.25rem; overflow: auto; font-size: 1.0625rem; line-height: 1.55; color: var(--ink-2); display: flex; flex-direction: column; gap: .75rem; position: relative; }
.mbody p { text-wrap: pretty; }
.mbody .greet { color: var(--ink); font-weight: 500; }
mark.goal { background: linear-gradient(transparent 58%, rgba(226, 88, 14, .22) 58%); color: inherit; padding: 0 .0625rem; transition: background .6s; }
.cta { display: inline-flex; align-items: center; gap: .875rem; flex-wrap: wrap; }
.cta .btn-fake { display: inline-flex; align-items: center; padding: .625rem 1.125rem; border-radius: .625rem; background: var(--action); color: #fff; font-weight: 700; font-size: 1rem; cursor: default; user-select: none; }
.inert { color: var(--action-ink); font-weight: 600; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: .2em; cursor: default; overflow-wrap: anywhere; }
.signoff { color: var(--ink); }
.unsub { margin-top: .25rem; padding-top: .75rem; border-top: 1px solid var(--line); font-size: .875rem; color: var(--ink-3); font-style: italic; }
.unsub u { text-decoration-style: dotted; }

.side { display: flex; flex-direction: column; gap: 1rem; min-height: 0; overflow: auto; scrollbar-width: none; }
.side > .panel { flex: none; }
.sms { padding: 1rem 1.25rem 1.125rem; display: grid; gap: .75rem; }
.bubble { background: #E9EDF2; border-radius: 1.25rem 1.25rem 1.25rem .375rem; padding: .875rem 1.125rem; font-size: 1.0625rem; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; }
.bubble .inert { color: var(--action-ink); }
.meter { display: flex; align-items: center; gap: .75rem; font-size: .9375rem; color: var(--ink-3); }
.meter .mbar { flex: 1; height: .5rem; border-radius: 999px; background: var(--sunken); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.meter .mbar i { display: block; height: 100%; width: 0; background: var(--good); border-radius: 999px; transition: width .2s linear; }
.meter b { color: var(--ink); font-size: 1.125rem; }
.notext { padding: 1.125rem 1.25rem; display: grid; gap: .5rem; color: var(--ink-2); font-size: 1rem; }
.notext h3 { font-size: 1.125rem; color: var(--ink); }
.checks { padding: 1rem 1.25rem; display: grid; gap: .5rem; }
.checks h3 { font-size: .8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin-bottom: .125rem; }
.check { display: flex; gap: .625rem; align-items: flex-start; font-size: .9375rem; color: var(--ink-2); line-height: 1.4; }
.check svg { width: 1.125rem; height: 1.125rem; flex: none; margin-top: .0625rem; }
.check.ok svg { color: var(--good); }
.check.no svg { color: var(--wait); }
.check.x svg { color: var(--stop); }
.approve { margin-top: auto; padding: 1rem 1.25rem; display: grid; gap: .625rem; }
.approve .row { display: flex; gap: .625rem; align-items: center; }
.btn { all: unset; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .8125rem 1.25rem; border-radius: .75rem; font-weight: 700; font-size: 1.0625rem; transition: background .2s, transform .15s, box-shadow .2s; }
.btn svg { width: 1.25rem; height: 1.25rem; }
.btn.primary { background: var(--good); color: #fff; flex: 1; box-shadow: 0 .5rem 1.25rem -.625rem rgba(29, 138, 75, .7); }
.btn.primary:not([disabled]):hover { background: #157240; }
.btn.primary.pressed, .btn.primary:active { transform: scale(.97); background: #126236; }
.btn.ghost { background: var(--sunken); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.btn[disabled], .btn[aria-disabled="true"] { cursor: not-allowed; background: var(--treat-soft); color: var(--ink-3); box-shadow: none; }
.btn:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; }
.approve .fine { font-size: .875rem; color: var(--ink-3); display: flex; align-items: center; gap: .5rem; }
.banner { display: flex; gap: .75rem; align-items: flex-start; padding: .875rem 1.125rem; border-radius: var(--r-card); font-size: 1rem; line-height: 1.4; }
.banner svg { width: 1.375rem; height: 1.375rem; flex: none; }
.banner.wait { background: var(--wait-soft); color: var(--wait-ink); }
.banner.good { background: var(--good-soft); color: var(--good-ink); }
.banner b { font-weight: 700; }
.drafting { display: inline-flex; align-items: center; gap: .375rem; }
.drafting .dots { display: inline-flex; gap: .1875rem; }
.drafting .dots i { width: .3125rem; height: .3125rem; border-radius: 50%; background: currentColor; animation: dot 1s infinite ease-in-out; }
.drafting .dots i:nth-child(2) { animation-delay: .15s; } .drafting .dots i:nth-child(3) { animation-delay: .3s; }
.typing .tw { opacity: 0; }
.typing mark.goal { background: none; }
.typing .namefill { background: none; box-shadow: none; }
.namefill { transition: background .6s, box-shadow .6s; }
.typing .tw.on { opacity: 1; transition: opacity .12s; }
.typing .btn-fake, .typing .unsub { transition: opacity .3s; }

.nodraft { display: grid; place-items: center; padding: 3rem; text-align: center; }
.nodraft .inner { max-width: 40rem; display: grid; gap: 1.125rem; justify-items: center; }
.nodraft .big { width: 5rem; height: 5rem; border-radius: 50%; display: grid; place-items: center; }
.nodraft .big svg { width: 2.5rem; height: 2.5rem; }
.nodraft .big.stop { background: var(--stop-soft); color: var(--stop); }
.nodraft .big.track { background: var(--treat-soft); color: var(--treat); }
.nodraft h3 { font-size: 2rem; line-height: 1.2; letter-spacing: -.015em; }
.nodraft p { font-size: 1.25rem; color: var(--ink-2); }

/* the approve stamp */
.stampable { position: relative; }
.stamp { position: absolute; z-index: 4; right: 1.5rem; top: 5.5rem; padding: .625rem 1.125rem .6875rem; border: .25rem solid var(--good); border-radius: .875rem; color: var(--good); background: rgba(255, 255, 255, .86); transform: rotate(-6deg); text-align: center; pointer-events: none; box-shadow: 0 .75rem 2rem -1rem rgba(29, 138, 75, .55); }
.stamp b { display: block; font-size: 1.75rem; letter-spacing: .14em; font-weight: 700; line-height: 1.1; }
.stamp span { display: block; font-size: .875rem; font-weight: 600; letter-spacing: .02em; color: var(--good-ink); }
.stamp.land { animation: stamp .55s var(--ease) both; }

/* ---------- Scene 5: approved and logged ---------- */
.approved { height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 34rem; gap: 1.25rem; min-height: 0; }
.ap-left { display: grid; grid-template-rows: auto auto auto; gap: 1.125rem; align-content: start; min-width: 0; }
.sent { padding: 1.25rem 1.5rem; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.25rem; align-items: center; }
.sent .msgs { display: grid; gap: .625rem; }
.sent .msg { display: flex; align-items: center; gap: .875rem; padding: .75rem 1rem; border-radius: .75rem; background: var(--sunken); box-shadow: inset 0 0 0 1px var(--line); font-size: 1.0625rem; min-width: 0; }
.sent .msg svg { width: 1.25rem; height: 1.25rem; flex: none; color: var(--ink-3); }
.sent .msg .t { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.sent .msg .t b { color: var(--ink); }
.sent .msg .st { margin-left: auto; flex: none; }
.sent .stamp { position: static; transform: rotate(-6deg); }
.logrow { padding: 1rem 1.25rem 1.125rem; display: grid; gap: .75rem; }
.logrow .lh { display: flex; align-items: center; gap: .75rem; }
.logrow .lh h3 { font-size: 1.125rem; }
.logrow .lh .chip { margin-left: auto; }
.cells { display: grid; grid-template-columns: 8rem repeat(5, minmax(0, 1fr)) 7rem; border-radius: .75rem; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line-2); }
.cells > div { padding: .625rem .75rem; border-right: 1px solid var(--line); min-width: 0; }
.cells > div:last-child { border-right: 0; }
.cells .ck { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cells .cv { margin-top: .25rem; font-size: 1.125rem; font-weight: 700; min-height: 1.6rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cells .cv.pend { color: var(--ink-4); font-weight: 500; }
.cells .cv .empty { display: inline-block; width: 4.5rem; height: 1.375rem; border-radius: .375rem; border: 1.5px dashed var(--line-2); vertical-align: middle; }
.cells .fill { animation: cellflash 1.4s var(--ease); }
.cells .fill .cv { animation: rise .4s var(--ease) both; }
.cells .c-fu2 { background: var(--action-soft); }
.cells .c-fu2 .cv { color: var(--action-ink); }
.cells .c-name .cv { font-size: 1.25rem; }
.logline { font-size: 1.0625rem; color: var(--ink-2); display: flex; align-items: center; gap: .625rem; flex-wrap: wrap; }
.logline b { color: var(--good-ink); }
.cadence { padding: 1rem 1.25rem 1.125rem; display: grid; gap: .875rem; }
.cadence .lh { display: flex; align-items: center; gap: .75rem; }
.cadence h3 { font-size: 1.125rem; }
.cadence .fine { margin-left: auto; font-size: .875rem; color: var(--ink-3); }
.steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: relative; }
.steps::before { content: ""; position: absolute; left: 1rem; right: 1rem; top: .9375rem; height: 2px; background: var(--line-2); }
.steps .s { position: relative; display: grid; gap: .25rem; justify-items: start; padding-right: .5rem; }
.steps .s i { min-width: 2rem; padding: 0 .5rem; height: 2rem; border-radius: 999px; white-space: nowrap; background: var(--surface); box-shadow: inset 0 0 0 2px var(--line-2); display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: .8125rem; color: var(--ink-3); }
.steps .s b { font-size: 1rem; color: var(--ink); }
.steps .s span { font-size: .875rem; color: var(--ink-3); }
.steps .s.done i { background: var(--good); color: #fff; box-shadow: none; }
.steps .s.next i { background: var(--action); color: #fff; box-shadow: 0 0 0 .3125rem rgba(11, 111, 224, .18); }
.steps .s.next b { color: var(--action-ink); }

.queue { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.qh { padding: 1.125rem 1.375rem .875rem; border-bottom: 1px solid var(--line); display: grid; gap: .375rem; }
.qh .top2 { display: flex; align-items: center; gap: .625rem; }
.qh h3 { font-size: 1.25rem; }
.qh .chip { margin-left: auto; }
.qh .big { font-size: 1.125rem; color: var(--ink-2); }
.qh .big b { color: var(--ink); font-size: 1.375rem; }
.qlist { overflow: auto; padding: .5rem .75rem .75rem; display: grid; gap: .375rem; align-content: start; }
.qitem { all: unset; cursor: pointer; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .875rem; align-items: center; padding: .625rem .75rem; border-radius: .75rem; transition: background .2s; }
.qitem:hover { background: var(--sunken); }
.qitem:focus-visible { outline: 3px solid var(--action); }
.qitem .ava { width: 2.5rem; height: 2.5rem; font-size: 1.0625rem; }
.qitem .qn { font-weight: 700; font-size: 1.125rem; line-height: 1.2; }
.qitem .qtx { min-width: 0; display: block; }
.qitem .qs { display: block; font-size: .875rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qitem.locked { background: var(--wait-soft); }
.qitem.in { animation: rise .45s var(--ease) both; }
.qsub { padding: .75rem 1.375rem .25rem; font-size: .8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); display: flex; align-items: center; gap: .5rem; }
.qsub .chip { text-transform: none; letter-spacing: 0; }

/* ---------- Scene 6: close ---------- */
.close { height: 100%; display: grid; align-content: center; justify-items: center; gap: 2.5rem; text-align: center; position: relative; }
.close .bg { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: .5; }
.close .bg svg { width: 62rem; height: 48rem; color: rgba(15, 27, 45, .10); }
.close h2 { position: relative; font-size: 4.25rem; line-height: 1.08; letter-spacing: -.03em; font-weight: 700; max-width: 70rem; text-wrap: balance; }
.close h2 em { font-style: normal; color: var(--good); }
.recap { position: relative; display: flex; gap: .75rem; flex-wrap: wrap; justify-content: center; }
.recap .r { display: inline-flex; align-items: baseline; gap: .25rem; padding: .75rem 1.25rem; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-1); font-size: 1.125rem; color: var(--ink-2); }
.recap .r b { color: var(--ink); font-size: 1.25rem; margin-right: .25rem; }
.recap .r.priv { align-items: center; gap: .5rem; background: var(--team-soft); color: var(--team-ink); font-weight: 600; box-shadow: none; }
.recap .r.priv svg { width: 1.125rem; height: 1.125rem; flex: none; }
.soon { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 32rem)); gap: 1.25rem; text-align: left; }
.soon .sc { padding: 1.375rem 1.5rem; border-radius: var(--r-lg); background: var(--ink); color: #fff; display: grid; gap: .5rem; box-shadow: var(--shadow-2); }
.soon .sc .tag { justify-self: start; padding: .1875rem .625rem; border-radius: 999px; background: rgba(255, 255, 255, .14); font-size: .8125rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #FFE7B3; }
.soon .sc h3 { font-size: 1.5rem; letter-spacing: -.01em; line-height: 1.2; }
.soon .sc p { font-size: 1.0625rem; color: rgba(255, 255, 255, .78); line-height: 1.45; }
.close .tagline { position: relative; font-size: 1.125rem; color: var(--ink-3); font-weight: 500; }
.close .in1 { animation: rise .7s var(--ease) both; }
.close .in2 { animation: rise .7s var(--ease) .5s both; }
.close .in3 { animation: rise .7s var(--ease) 1.1s both; }
.close .in4 { animation: rise .7s var(--ease) 1.7s both; }

/* ---------- Control bar ---------- */
.bar { position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: .25rem; padding: .375rem; border-radius: 999px; background: rgba(15, 27, 45, .94); color: #fff; box-shadow: 0 1rem 2.5rem -1rem rgba(15, 27, 45, .55); transition: transform .4s var(--ease), opacity .3s; overflow: hidden; }
.bar.hide { transform: translate(-50%, 180%); opacity: 0; pointer-events: none; }
.bar button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: .5rem; height: 2.75rem; padding: 0 1rem; border-radius: 999px; font-size: .9375rem; font-weight: 600; color: rgba(255, 255, 255, .88); white-space: nowrap; transition: background .2s, color .2s; }
.bar button svg { width: 1.25rem; height: 1.25rem; }
.bar button:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.bar button:focus-visible { outline: 3px solid #7DB8FF; outline-offset: -3px; }
.bar button.icon { width: 2.75rem; padding: 0; justify-content: center; }
.bar button.main { background: #fff; color: var(--ink); }
.bar button.main:hover { background: #E8EEF6; }
.bar button.on { background: rgba(255, 255, 255, .16); color: #fff; }
.bar .pos { padding: 0 .875rem; font-size: .9375rem; color: rgba(255, 255, 255, .7); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar .div { width: 1px; height: 1.75rem; background: rgba(255, 255, 255, .16); margin: 0 .25rem; }
.bar .prog { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: #7DB8FF; opacity: 0; transition: opacity .3s; }
.bar.playing .prog { opacity: 1; }
.showbar { position: fixed; right: 1rem; bottom: 1rem; z-index: 29; width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 0; background: rgba(15, 27, 45, .5); color: #fff; display: none; place-items: center; cursor: pointer; opacity: .35; transition: opacity .2s; }
.showbar:hover, .showbar:focus-visible { opacity: 1; }
.showbar svg { width: 1.25rem; height: 1.25rem; }
.bar.hide + .showbar { display: grid; }

/* ---------- Panels (prompts, templates) ---------- */
.modal { position: fixed; inset: 5rem 0 0 0; z-index: 40; display: none; background: rgba(15, 27, 45, .32); padding: 1.5rem var(--pad-x) 1.5rem; }
.modal.on { display: grid; place-items: start center; animation: fade .25s both; }
.sheetbox { width: min(84rem, 100%); max-height: 100%; height: 100%; border-radius: var(--r-lg); background: var(--paper); box-shadow: var(--shadow-2); display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; animation: rise .4s var(--ease) both; }
.mh { display: flex; align-items: center; gap: 1rem; padding: 1.25rem 1.75rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.mh > svg { width: 1.75rem; height: 1.75rem; flex: none; color: var(--ink-2); }
.mh h2 { font-size: 1.625rem; letter-spacing: -.015em; }
.mh .x { margin-left: auto; }
.mb { overflow: auto; padding: 1.5rem 1.75rem 2rem; }
.lead { font-size: 1.125rem; color: var(--ink-2); max-width: 70rem; padding: 1rem 1.25rem; border-radius: var(--r-card); background: var(--wait-soft); color: var(--wait-ink); display: flex; gap: .75rem; align-items: flex-start; margin-bottom: 1.25rem; }
.lead svg { width: 1.375rem; height: 1.375rem; flex: none; margin-top: .125rem; }
.lead .privline { display: block; margin-top: .375rem; font-weight: 700; }
.prompt { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: 1.25rem 1.5rem 1.375rem; display: grid; gap: .75rem; margin-bottom: 1rem; }
.prompt .ph { display: flex; align-items: center; gap: .875rem; }
.prompt .ph .n { width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; }
.prompt .ph h3 { font-size: 1.375rem; }
.prompt .ph .btn { margin-left: auto; padding: .5rem 1rem; font-size: .9375rem; }
.prompt pre { margin: 0; white-space: pre-wrap; font-family: var(--font); font-size: 1.0625rem; line-height: 1.6; color: var(--ink-2); background: var(--sunken); border-radius: .75rem; padding: 1rem 1.25rem; box-shadow: inset 0 0 0 1px var(--line); }
.btn.copied { background: var(--good-soft); color: var(--good-ink); }
.tpl { display: grid; grid-template-columns: 21rem minmax(0, 1fr); gap: 1.5rem; height: 100%; min-height: 0; }
.tlist { display: grid; gap: .375rem; align-content: start; }
.tlist button { all: unset; cursor: pointer; display: grid; gap: .25rem; padding: .75rem 1rem; border-radius: .75rem; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.tlist button b { font-size: 1.0625rem; line-height: 1.3; }
.tlist button .chip { justify-self: start; }
.tlist button[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--ink); }
.tlist button:focus-visible { outline: 3px solid var(--action); }
.tview { display: grid; grid-template-columns: minmax(0, 1fr) 24rem; gap: 1.25rem; align-content: start; }
.tview .mail { overflow: visible; }
.tview .mbody { overflow: visible; }
.tview .tnote { grid-column: 1 / -1; font-size: 1rem; color: var(--ink-3); }
.field { background: var(--action-soft); color: var(--action-ink); border-radius: .25rem; padding: 0 .1875rem; font-weight: 600; }

/* ---------- Motion ---------- */
/* ---------- Live mode (only when the server switches it on) ---------- */
.act { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: .4375rem; padding: .375rem .875rem; border-radius: 999px; font-size: .875rem; font-weight: 700; line-height: 1.3; white-space: nowrap; transition: background .2s, box-shadow .2s, transform .15s; }
.act svg { width: .9375rem; height: .9375rem; flex: none; }
.act.golive, .act.ask, .act.showlive { background: var(--claude); color: #fff; box-shadow: 0 .375rem 1rem -.5rem rgba(180, 85, 42, .8); }
.act.golive:hover, .act.ask:hover, .act.showlive:hover { background: #9C4520; }
.act.prepared { background: var(--sunken); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.act.prepared svg { color: var(--ink-3); }
.act:active { transform: scale(.97); }
.act[disabled] { cursor: progress; background: var(--claude-soft); color: var(--claude-ink); box-shadow: none; }
.act:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; }
.chip.live { background: var(--claude); color: #fff; }
.chip.live svg { color: #FFD9A8; }
.chip.live .model { margin-left: .25rem; padding-left: .5rem; border-left: 1px solid rgba(255, 255, 255, .35); font: 500 .75rem/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0; opacity: .9; }
.panel.mail.live { box-shadow: var(--shadow-1), inset 0 0 0 2px rgba(180, 85, 42, .28); }
.panel.sms.live { box-shadow: var(--shadow-1), inset 0 0 0 2px rgba(180, 85, 42, .2); }
.caret { display: inline-block; width: .5rem; height: 1.1em; margin-left: .125rem; vertical-align: text-bottom; border-radius: 1px; background: var(--claude); animation: caret 1s steps(2, jump-none) infinite; }
.ph { color: var(--ink-4); font-weight: 500; }
.prompt .ph { color: inherit; font-weight: inherit; }
.mnote { padding: .875rem 1.5rem 0; }
.banner.stop { background: var(--stop-soft); color: var(--stop-ink); }
.meter .mbar.over i { background: var(--stop); }
.chh { display: flex; align-items: center; gap: .625rem; margin-bottom: .125rem; }
.chh h3 { margin: 0; }
.chh .chip { margin-left: auto; }
.check.pend svg { color: var(--ink-4); }
.check.pend { color: var(--ink-3); font-style: italic; }
.pills { display: flex; flex-wrap: wrap; gap: .375rem; }
.pill { display: inline-flex; align-items: center; gap: .3125rem; padding: .25rem .6875rem .25rem .5625rem; border-radius: 999px; font-size: .875rem; font-weight: 600; line-height: 1.3; }
.pill svg { width: .875rem; height: .875rem; flex: none; }
.pill.ok { background: var(--good-soft); color: var(--good-ink); }
.pill.x { background: var(--stop-soft); color: var(--stop-ink); box-shadow: inset 0 0 0 1.5px rgba(179, 55, 47, .45); }
.fixnote { display: flex; gap: .5rem; align-items: flex-start; color: var(--stop-ink); font-size: .9375rem; line-height: 1.4; margin-top: .125rem; }
.fixnote svg { width: 1.0625rem; height: 1.0625rem; flex: none; margin-top: .125rem; color: var(--stop); }
.fixnote b { font-weight: 700; }
.sms.live .bubble { font-size: .9375rem; line-height: 1.45; padding: .75rem 1rem; }
.nodraft .act { margin-top: .25rem; }
.nodraft .banner { text-align: left; max-width: 34rem; }
.sample.mini { display: none; }

@keyframes rise { from { opacity: 0; transform: translateY(.75rem); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes rowin { from { opacity: 0; transform: translateY(.5rem); } to { opacity: 1; transform: none; } }
@keyframes rowpulse { 0%, 100% { background: var(--surface); } 50% { background: #DCEBFF; } }
@keyframes cellflash { 0% { background: #D9F2E2; } 100% { background: transparent; } }
@keyframes stamp { 0% { opacity: 0; transform: rotate(-6deg) scale(1.6); } 60% { opacity: 1; transform: rotate(-6deg) scale(.96); } 100% { opacity: 1; transform: rotate(-6deg) scale(1); } }
.spot { outline: .1875rem solid transparent; outline-offset: .3125rem; animation: spot 3.6s ease-in-out both; }
@keyframes spot { 0% { outline-color: rgba(11, 111, 224, 0); } 15%, 75% { outline-color: rgba(11, 111, 224, .6); } 100% { outline-color: rgba(11, 111, 224, 0); } }
@keyframes dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@keyframes caret { 0% { opacity: 1; } 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}

/* ---------- Phones and narrow windows: stacked and scrolling ---------- */
@media (max-width: 760px) {
  html { font-size: 15px; }
  body { overflow: auto; height: auto; }
  :root { --pad-x: 1rem; }
  .shell { height: auto; display: block; }
  .top { grid-template-columns: 1fr; gap: .625rem; padding: .75rem var(--pad-x); }
  .brand .where { display: none; }
  .badges { grid-row: 2; justify-self: start; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .375rem; }
  .rail { grid-row: 3; overflow-x: auto; justify-self: stretch; scrollbar-width: none; }
  .grid .fz.c0, .grid .fz.c1 { position: static; width: auto; min-width: 0; }
  .grid .fz.c2 { left: 0; width: 6.5rem; min-width: 6.5rem; }
  .grid th, .grid td { padding: .375rem .5rem; }
  .rail button { padding-right: .625rem; font-size: .875rem; }
  .sample { font-size: .8125rem; padding: .3125rem .625rem; }
  .head { flex-direction: column; align-items: stretch; gap: 1rem; padding: 1.125rem var(--pad-x) 1rem; }
  .titles h1 { font-size: 1.75rem; }
  .titles .subline { font-size: 1.0625rem; }
  .counters { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
  .tile { width: auto; padding: .625rem .75rem; }
  .tile .v { font-size: 1.75rem; }
  .stage { padding: 0 var(--pad-x) 6.5rem; }
  .scene { position: static; }
  .inbox, .buckets { grid-template-columns: 1fr; }
  .scans { height: auto; }
  .card { height: 6.75rem; }
  .sheet { height: auto; }
  .sheet-wrap { max-height: 75vh; }
  .seg { margin-left: 0; }
  .patient { height: auto; }
  .pview, .pview.solo { grid-template-columns: 1fr; }
  .mergeline { flex-wrap: wrap; row-gap: .5rem; }
  .mergeline p { flex-basis: 100%; }
  .sheet-cap, .sheet-cap .cl { align-items: flex-start; }
  .sheet-cap svg { margin-top: .125rem; }
  .mbody, .profile { overflow: visible; }
  .approved { grid-template-columns: 1fr; height: auto; }
  .sent { grid-template-columns: 1fr; }
  .cells { grid-template-columns: 1fr 1fr; }
  .cells > div { border-bottom: 1px solid var(--line); }
  .steps { grid-template-columns: 1fr; gap: .75rem; }
  .steps::before { display: none; }
  .close { height: auto; padding: 2rem 0; }
  .close h2 { font-size: 2.25rem; }
  .soon { grid-template-columns: 1fr; }
  .bar { left: .5rem; right: .5rem; transform: none; bottom: .5rem; justify-content: space-between; overflow-x: auto; }
  .bar.hide { transform: translateY(180%); }
  .bar .lbl { display: none; }
  .bar button { padding: 0 .75rem; }
  .bar .pos { padding: 0 .375rem; }
  .modal { inset: 0; padding: .5rem; }
  .mh { flex-wrap: wrap; gap: .5rem .75rem; }
  .sample.mini { display: inline-flex; order: 3; flex-basis: 100%; justify-content: center; font-size: .8125rem; padding: .3125rem .625rem; }
  .mnote { padding: .75rem 1rem 0; }
  .mhead { grid-template-columns: minmax(0, 1fr); }
  .mrow { flex-wrap: wrap; row-gap: .375rem; }
  .chip.live .model { display: none; }
  .tpl, .tview { grid-template-columns: 1fr; }
}

/* The setup file link in the Prompts panel: the one real link on the page (a plain file beside the script). */
.mh .setupfile { padding: .5rem 1rem; font-size: .9375rem; text-decoration: none; color: var(--action-ink); background: var(--action-soft); }
.mh .setupfile:hover { background: #D5E7FF; }
.mh .kitfile { margin-left: .5rem; }
