/* EyeMatch demo app. Tokens are the ones start.mjs dealt for the product page:
   palette mint-pink-accounts, Manrope + JetBrains Mono, soft radius, pill buttons.
   Motion: transform, scale and opacity only; one ease-out for UI, one settle curve for entrances. */
:root {
  --bg: #f8f8f8; --surface: #eeeeee; --card: #ffffff; --ink: #0a0a0a; --muted: #6a6a6a;
  --accent: #1f6b3a; --accent-ink: #ffffff;
  --accent-soft: color-mix(in oklab, var(--accent) 9%, #fff);
  --line: color-mix(in oklab, var(--ink) 11%, transparent);
  --line-strong: color-mix(in oklab, var(--ink) 22%, transparent);
  --warn: #7a5200; --warn-bg: #fff1c9; --urgent: #a3231c; --urgent-bg: #fdeae8;
  --font: "Manrope", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --r-sm: 8px; --r-md: 12px; --r-lg: 20px;
  --ease: cubic-bezier(.2, .8, .2, 1); --ease-enter: cubic-bezier(.22, 1, .36, 1); --ease-io: cubic-bezier(.65, 0, .35, 1);
  --top: 64px; --tour: 64px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 400 15px/1.5 var(--font); color: var(--ink); background: var(--bg); overflow: hidden; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 24px; font-weight: 500; letter-spacing: -.03em; line-height: 1.15; }
h3 { font-size: 17px; font-weight: 500; letter-spacing: -.02em; line-height: 1.25; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* buttons: pill, step up 1px on hover, press down and scale .985 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 22px; border-radius: 999px; font-weight: 500; white-space: nowrap;
  transition: transform 150ms var(--ease), background-color 150ms var(--ease), border-color 150ms var(--ease), opacity 150ms var(--ease); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--ghost { border: 1px solid var(--line-strong); }
.btn--sm { height: 36px; padding: 0 16px; font-size: 14px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .38; cursor: not-allowed; }
@media (hover: hover) and (pointer: fine) {
  .btn:not([disabled]):hover { transform: translateY(-1px); }
  .btn--primary:not([disabled]):hover { background: color-mix(in oklab, var(--accent) 86%, var(--ink)); }
  .btn--ghost:not([disabled]):hover { background: color-mix(in oklab, var(--ink) 5%, transparent); border-color: var(--ink); }
}
.btn:not([disabled]):active { transform: translateY(1px) scale(.985); transition-duration: 90ms; }

/* top bar */
.top { position: fixed; inset: 0 0 auto 0; height: var(--top); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 32px; background: var(--bg); border-bottom: 1px solid var(--line); z-index: 20; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 500; letter-spacing: -.03em; color: inherit; text-decoration: none; justify-self: start; }
.mark { width: 24px; height: 24px; }
.top__right { justify-self: end; display: flex; align-items: center; gap: 12px; }
.tag { font-size: 13px; color: var(--muted); }
.seg { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: 999px; background: var(--surface); }
.seg button { position: relative; z-index: 1; height: 36px; padding: 0 20px; border-radius: 999px; font-weight: 500; font-size: 14px; color: var(--muted); transition: color 200ms var(--ease); }
.seg button[aria-selected="true"] { color: var(--bg); }
.seg__pill { position: absolute; top: 4px; left: 4px; height: 36px; width: calc(50% - 4px); border-radius: 999px; background: var(--ink); transition: transform 260ms var(--ease-io); }
.seg[data-v="researcher"] .seg__pill { transform: translateX(100%); }

/* views */
main { position: fixed; inset: var(--top) 0 var(--tour) 0; }
.view { position: absolute; inset: 0; opacity: 0; transform: translateY(10px) scale(.992); transition: opacity 220ms var(--ease), transform 360ms var(--ease-enter); pointer-events: none; }
.view.on { opacity: 1; transform: none; pointer-events: auto; }

/* participant */
.pwrap { height: 100%; max-width: 1180px; margin: 0 auto; padding: 20px 32px; display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 56px; }
.pcol { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.personas { display: grid; grid-template-columns: repeat(3, auto); gap: 6px; justify-content: space-between; }
.chip { height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 13px; font-weight: 500; white-space: nowrap; transition: background-color 150ms var(--ease), color 150ms var(--ease), border-color 150ms var(--ease), transform 150ms var(--ease); }
.chip[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip:active { transform: scale(.97); }
.phone { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line-strong); border-radius: 36px; overflow: hidden; box-shadow: 0 24px 60px -32px color-mix(in oklab, var(--ink) 35%, transparent); }
.phone__bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 48px; padding: 0 20px; font-size: 13px; font-weight: 500; border-bottom: 1px solid var(--line); flex: none; }
.phone__title { font-size: 14px; }
.lang { justify-self: end; height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 12px; font-weight: 500; }
.phone__body { position: relative; flex: 1; min-height: 0; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; opacity: 0; transform: translateX(var(--dx, 28px)); transition: opacity 240ms var(--ease), transform 380ms var(--ease-enter); will-change: transform, opacity; }
.screen.on { opacity: 1; transform: none; }
.screen.out { transform: translateX(calc(var(--dx, 28px) * -1)); pointer-events: none; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; scrollbar-width: none; }
.scroll::-webkit-scrollbar { display: none; }
.foot { flex: none; padding: 12px 20px 18px; border-top: 1px solid var(--line); display: grid; gap: 8px; background: var(--card); }
.lead { font-size: 15px; color: var(--muted); }

/* consent toggles */
.rows { display: grid; }
.row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.row b { font-weight: 500; display: block; }
.switch { position: relative; width: 44px; height: 26px; border-radius: 999px; background: var(--line-strong); transition: background-color 180ms var(--ease); flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 180ms var(--ease); }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }
.switch:active::after { transform: scaleX(1.2); }
.switch[aria-checked="true"]:active::after { transform: translateX(16px) scaleX(1.2); }

/* document capture */
.cam { position: relative; border-radius: var(--r-lg); background: #1b1b1b; padding: 22px; overflow: hidden; }
.doc { background: #fbfaf6; border-radius: 6px; padding: 14px 16px; font-size: 12px; line-height: 1.45; color: #222; transform: rotate(-1.2deg); }
.doc h4 { margin: 0 0 6px; font-size: 13px; font-weight: 600; letter-spacing: -.01em; }
.doc table { width: 100%; border-collapse: collapse; margin: 8px 0; font-family: var(--mono); font-size: 11.5px; }
.doc td, .doc th { border: 1px solid #cfcabd; padding: 3px 6px; text-align: center; font-weight: 400; }
.doc .hand { font-family: "Bradley Hand", "Segoe Script", cursive; font-size: 14px; }
.scanline { position: absolute; left: 0; right: 0; top: 0; height: 64px; background: linear-gradient(to bottom, transparent, color-mix(in oklab, var(--accent) 55%, transparent)); border-bottom: 2px solid #7be3a2; opacity: 0; transform: translateY(-64px); }
.scanning .scanline { opacity: 1; animation: scan 1.5s var(--ease-io) forwards; }
@keyframes scan { to { transform: translateY(var(--scan-to, 260px)); opacity: 0; } }
.field { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); }
.field label { font-size: 12.5px; color: var(--muted); display: block; }
.field input { width: 100%; border: 0; background: none; font: 500 16px var(--font); color: var(--ink); padding: 0; outline: 0; }
.field.low { background: var(--warn-bg); border-color: color-mix(in oklab, var(--warn) 40%, transparent); }
.field.low .conf { color: var(--warn); }
.conf { font-size: 12px; color: var(--muted); font-family: var(--mono); }
.pop { animation: rise 420ms var(--ease-enter) both; animation-delay: calc(var(--i, 0) * 55ms); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* match cards */
.mcard { border: 1px solid var(--line-strong); border-radius: var(--r-lg); padding: 16px; display: grid; gap: 12px; transition: transform 180ms var(--ease), border-color 180ms var(--ease); }
.mcard__head { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start; }
.mcard__meta { font-size: 13px; color: var(--muted); }
.ring { position: relative; width: 56px; height: 56px; flex: none; }
.ring svg { width: 56px; height: 56px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; }
.ring .t { stroke: var(--surface); }
.ring .v { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 144.5; stroke-dashoffset: 144.5; transition: stroke-dashoffset 900ms var(--ease-enter); }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 500; font-size: 16px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fitline { font-weight: 500; }
.crit { display: grid; gap: 6px; }
.crit li, ul.plain li { list-style: none; }
ul.plain, .crit { margin: 0; padding: 0; }
.crit li { display: grid; grid-template-columns: 18px 1fr; gap: 8px; align-items: start; font-size: 13.5px; }
.dot { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; margin-top: 1px; }
.dot svg { width: 12px; height: 12px; }
.dot.met { background: var(--accent); color: #fff; }
.dot.unknown { border: 1.5px dashed var(--muted); color: var(--muted); }
.dot.not_met { background: var(--ink); color: #fff; }
.quiet { border-radius: var(--r-md); background: var(--bg); padding: 12px 14px; font-size: 13.5px; }
.quiet b { font-weight: 500; }

/* chat */
.chat { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 16px 8px; display: flex; flex-direction: column; gap: 8px; scrollbar-width: none; scroll-behavior: smooth; }
.chat::-webkit-scrollbar { display: none; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 18px; font-size: 15px; line-height: 1.45; animation: msg 380ms var(--ease-enter) both; transform-origin: 0 100%; }
.msg.bot { align-self: flex-start; background: var(--bg); border-bottom-left-radius: 6px; }
.msg.me { align-self: flex-end; background: var(--ink); color: var(--bg); border-bottom-right-radius: 6px; transform-origin: 100% 100%; }
@keyframes msg { from { opacity: 0; transform: translateY(8px) scale(.96); } }
.note { align-self: center; font-size: 12px; font-family: var(--mono); color: var(--accent); background: var(--accent-soft); padding: 5px 10px; border-radius: 999px; animation: msg 380ms var(--ease-enter) both; text-align: center; }
.typing { display: inline-flex; gap: 4px; padding: 14px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite both; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: none; } 40% { opacity: 1; transform: translateY(-2px); } }
.replies { flex: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px 16px; min-height: 62px; border-top: 1px solid var(--line); align-content: flex-start; }
.reply { min-height: 40px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--ink); font-weight: 500; font-size: 14px; text-align: left; animation: rise 320ms var(--ease-enter) both; animation-delay: calc(var(--i, 0) * 45ms); transition: background-color 150ms var(--ease), color 150ms var(--ease), transform 150ms var(--ease); }
.reply:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .reply:hover { background: var(--ink); color: var(--bg); } }

.chathead { flex: none; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.chathead b { display: block; font-weight: 500; font-size: 14.5px; }
.chathead .ring, .chathead .ring svg { width: 44px; height: 44px; }
.chathead .ring span { font-size: 14px; }

/* bottom sheet */
.sheet { position: absolute; inset: 0; z-index: 5; display: flex; align-items: flex-end; background: color-mix(in oklab, var(--ink) 0%, transparent); pointer-events: none; transition: background-color 260ms var(--ease); }
.sheet.on { background: color-mix(in oklab, var(--ink) 38%, transparent); pointer-events: auto; }
.sheet__panel { width: 100%; background: var(--card); border-radius: 24px 24px 0 0; padding: 22px 20px 20px; display: grid; gap: 14px; transform: translateY(102%); transition: transform 380ms var(--ease-enter); }
.sheet.on .sheet__panel { transform: none; }
.sheet ul { margin: 0; padding-left: 18px; font-size: 14px; display: grid; gap: 4px; }

/* done, navigation */
.done { margin: auto 0; display: grid; gap: 14px; justify-items: start; }
.tick { width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; animation: tick 520ms var(--ease-enter) both; }
.tick svg { width: 26px; height: 26px; stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw 420ms 220ms var(--ease) forwards; }
@keyframes tick { from { transform: scale(.6); opacity: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.level { border-radius: var(--r-lg); padding: 16px; display: grid; gap: 4px; background: var(--warn-bg); color: #3d2a00; }
.level b { font-size: 19px; font-weight: 500; letter-spacing: -.02em; line-height: 1.2; }
.level.urgent { background: var(--urgent); color: #fff; }
.level.routine { background: var(--accent-soft); color: var(--ink); }
.place { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.place b { font-weight: 500; }
.place span:nth-child(2) { font-family: var(--mono); font-size: 12.5px; }
.timeline { display: grid; gap: 0; padding: 0; margin: 0; }
.timeline li { list-style: none; position: relative; padding: 0 0 18px 26px; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--ink); }
.timeline li::after { content: ""; position: absolute; left: 9px; top: 16px; bottom: 0; width: 1px; background: var(--line-strong); }
.timeline li:last-child::after { display: none; }
.timeline li.now::before { background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.push { border: 1px solid var(--line-strong); border-radius: var(--r-lg); padding: 14px 16px; display: grid; gap: 4px; background: var(--card); box-shadow: 0 16px 36px -24px color-mix(in oklab, var(--ink) 50%, transparent); animation: drop 620ms var(--ease-enter) both; }
@keyframes drop { from { opacity: 0; transform: translateY(-24px) scale(.97); } }

/* under the hood */
.hood { min-height: 0; overflow-y: auto; padding: 4px 4px 24px; display: flex; flex-direction: column; gap: 24px; scrollbar-width: thin; }
.hood h2 { max-width: 20ch; }
.hood__block { display: grid; gap: 10px; }
.hood__label { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 500; padding-bottom: 8px; border-bottom: 1px solid var(--line-strong); }
.hood__label span { font-weight: 400; color: var(--muted); }
.fact { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.fact .mono { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fact b { font-weight: 500; font-variant-numeric: tabular-nums; }
.src { font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line-strong); white-space: nowrap; }
.src.document, .src.tool { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.src.clinician { border-style: dashed; color: var(--muted); }
.new { animation: flash 1100ms var(--ease) both; }
@keyframes flash { 0% { opacity: 0; transform: translateX(-8px); background: var(--accent-soft); } 35% { opacity: 1; transform: none; background: var(--accent-soft); } 100% { background: transparent; } }
.rule { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.rule .state { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.rule.is-met .state { color: var(--accent); }
.scores { display: grid; gap: 10px; }
.score { display: grid; grid-template-columns: 128px 1fr 44px; gap: 12px; align-items: center; font-size: 14px; }
.bar { height: 8px; border-radius: 999px; background: var(--surface); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: var(--ink); transform-origin: 0 50%; transform: scaleX(0); transition: transform 800ms var(--ease-enter); }
.score.total .bar i { background: var(--accent); }
.score b { font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.formula { font-family: var(--mono); font-size: 12px; color: var(--muted); line-height: 1.6; }
.empty { color: var(--muted); font-size: 14px; padding: 6px 0; }

/* researcher */
.rwrap { height: 100%; display: grid; grid-template-columns: 280px minmax(0, 1fr); }
.side { border-right: 1px solid var(--line); padding: 20px 16px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.side__label { font-size: 13px; color: var(--muted); padding: 0 12px 6px; }
.sitem { text-align: left; padding: 10px 12px; border-radius: var(--r-md); display: grid; gap: 2px; transition: background-color 150ms var(--ease), transform 150ms var(--ease); }
.sitem b { font-weight: 500; font-size: 14.5px; }
.sitem span { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.sitem[aria-current="true"] { background: var(--surface); }
.sitem:active { transform: scale(.985); }
@media (hover: hover) and (pointer: fine) { .sitem:hover { background: var(--surface); } }
.live { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.live.draft { background: none; border: 1.5px solid var(--muted); }
.count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 12px; font-weight: 500; display: grid; place-items: center; }
.count.bump { animation: bump 520ms var(--ease-enter); }
@keyframes bump { 0% { transform: scale(.4); } 60% { transform: scale(1.15); } }
.rmain { position: relative; min-width: 0; }
.rmain > .screen { transform: translateY(var(--dy, 12px)); }
.rmain > .screen.on { transform: none; }
.rmain > .screen.out { transform: translateY(-8px); }
.rhead { flex: none; padding: 24px 40px 0; display: grid; gap: 14px; }
.rhead__row { display: flex; align-items: center; gap: 14px; }
.rhead__row h2 { font-size: 28px; }
.status { font-size: 12.5px; font-weight: 500; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-strong); }
.status.is-live { background: var(--accent); color: #fff; border-color: var(--accent); }
.tabs { position: relative; display: flex; gap: 24px; border-bottom: 1px solid var(--line); }
.tabs button { height: 40px; font-weight: 500; font-size: 14.5px; color: var(--muted); transition: color 150ms var(--ease); }
.tabs button[aria-selected="true"] { color: var(--ink); }
.tabs__ink { position: absolute; left: 0; bottom: -1px; height: 2px; width: 1px; background: var(--ink); transform-origin: 0 50%; transition: transform 260ms var(--ease-io); }
.rbody { flex: 1; min-height: 0; overflow-y: auto; padding: 24px 40px 40px; }
.tabpane { animation: rise 360ms var(--ease-enter) both; }

.drop { border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg); min-height: 360px; display: grid; place-content: center; justify-items: center; gap: 14px; text-align: center; padding: 32px; transition: background-color 180ms var(--ease), border-color 180ms var(--ease), transform 180ms var(--ease); }
.drop.over { background: var(--accent-soft); border-color: var(--accent); transform: scale(1.005); }
.drop svg { width: 36px; height: 36px; }
.parse { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 32px; align-items: start; }
.poster { position: relative; background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--r-md); padding: 22px; font-size: 13px; line-height: 1.5; overflow: hidden; position: sticky; top: 0; }
.poster h4 { margin: 0 0 8px; font-size: 21px; font-weight: 500; letter-spacing: -.03em; line-height: 1.1; }
.poster ul { margin: 8px 0; padding: 0; display: grid; gap: 2px; }
.poster li { list-style: none; padding: 3px 6px; margin: 0 -6px; border-radius: 6px; transition: background-color 200ms var(--ease), color 200ms var(--ease); }
.poster li.hl { background: var(--accent); color: #fff; }
.poster .band { margin: 12px -22px -22px; padding: 12px 22px; background: var(--ink); color: var(--bg); font-size: 12.5px; }
.clist { display: grid; gap: 8px; }
.crow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); transition: border-color 180ms var(--ease), transform 180ms var(--ease), background-color 180ms var(--ease); }
.crow.ok { border-color: var(--accent); }
@media (hover: hover) and (pointer: fine) { .crow:hover { border-color: var(--ink); } .crow.ok:hover { border-color: var(--accent); } }
.crow__rule { font-weight: 500; font-size: 15px; }
.crow__src { font-size: 13px; color: var(--muted); grid-column: 1; }
.crow__chips { display: flex; gap: 6px; flex-wrap: wrap; grid-column: 1; }
.crow .cbtn { grid-row: 1 / span 3; grid-column: 2; }
.cbtn { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; transition: background-color 150ms var(--ease), color 150ms var(--ease), border-color 150ms var(--ease), transform 150ms var(--ease); }
.cbtn svg { width: 13px; height: 13px; }
.cbtn[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.cbtn:active { transform: scale(.96); }
.skel { height: 78px; border-radius: var(--r-md); background: linear-gradient(100deg, var(--surface) 40%, #f6f6f6 50%, var(--surface) 60%); background-size: 200% 100%; animation: shim 1.1s linear infinite; }
@keyframes shim { to { background-position: -200% 0; } }
.subhead { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 0 10px; }
.plan { display: grid; gap: 6px; }
.plan li { list-style: none; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px; border-radius: var(--r-md); background: var(--surface); font-size: 14px; }
.plan { margin: 0; padding: 0; }
.addq { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 8px; }
.addq input { height: 40px; border-radius: 999px; border: 1px solid var(--line-strong); padding: 0 16px; font: inherit; background: var(--card); outline: 0; transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease); }
.addq input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 18%, transparent); }
.pubbar { display: flex; align-items: center; gap: 12px; margin-top: 24px; }
pre.json { margin: 0; padding: 16px; border-radius: var(--r-md); background: var(--ink); color: #e9e9e9; font: 12px/1.55 var(--mono); overflow: auto; max-height: 420px; }

.anon { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface); margin-bottom: 20px; }
.anon b { font-size: 34px; font-weight: 500; letter-spacing: -.04em; font-variant-numeric: tabular-nums; line-height: 1; }
table.cand { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.cand th { text-align: left; font-weight: 500; font-size: 13px; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--line-strong); }
table.cand td { padding: 14px 12px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
table.cand tbody tr { cursor: pointer; transition: background-color 150ms var(--ease); }
@media (hover: hover) and (pointer: fine) { table.cand tbody tr:hover { background: var(--surface); } }
table.cand tr.fresh { animation: fresh 2.4s var(--ease) both; }
@keyframes fresh { 0% { opacity: 0; transform: translateY(-10px); background: var(--accent-soft); } 20% { opacity: 1; transform: none; background: var(--accent-soft); } 100% { background: transparent; } }
.badge { font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 999px; background: var(--accent); color: #fff; margin-left: 8px; }

.whatif { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 48px; align-items: start; }
.ctrl { display: grid; gap: 18px; }
.ctrl label { display: grid; gap: 6px; font-size: 14px; }
.ctrl label span { display: flex; justify-content: space-between; }
.ctrl label b { font-weight: 500; font-variant-numeric: tabular-nums; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 999px; background: var(--line-strong); outline-offset: 6px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--ink); transition: transform 120ms var(--ease); }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.15); }
.big { font-size: 88px; font-weight: 500; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.dots { display: grid; grid-template-columns: repeat(10, 22px); gap: 10px; margin-top: 24px; }
.dots i { width: 22px; height: 22px; border-radius: 50%; background: var(--surface); transform: scale(.55); transition: transform 380ms var(--ease-enter), background-color 240ms var(--ease); }
.dots i.fit { background: var(--accent); transform: none; }
.dots i.maybe { background: none; box-shadow: inset 0 0 0 2px var(--accent); transform: none; }
.legend { display: flex; gap: 20px; font-size: 13px; color: var(--muted); margin-top: 16px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; background: var(--accent); }
.legend i.m { background: none; box-shadow: inset 0 0 0 2px var(--accent); }

/* drawer */
.scrim { position: absolute; inset: 0; background: color-mix(in oklab, var(--ink) 30%, transparent); opacity: 0; pointer-events: none; transition: opacity 240ms var(--ease); z-index: 6; }
.scrim.on { opacity: 1; pointer-events: auto; }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--card); border-left: 1px solid var(--line-strong); z-index: 7; transform: translateX(102%); transition: transform 420ms var(--ease-enter); display: flex; flex-direction: column; }
.drawer.on { transform: none; }
.drawer__head { flex: none; padding: 24px 28px 16px; display: flex; justify-content: space-between; align-items: start; gap: 16px; border-bottom: 1px solid var(--line); }
.drawer__body { flex: 1; overflow-y: auto; padding: 20px 28px; display: grid; gap: 24px; align-content: start; }
.drawer__foot { flex: none; padding: 16px 28px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; }
.x { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-strong); transition: transform 150ms var(--ease), background-color 150ms var(--ease); }
.x:active { transform: scale(.94); }

/* tour */
.tour { position: fixed; inset: auto 0 0 0; height: var(--tour); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; padding: 0 32px; border-top: 1px solid var(--line); background: var(--bg); z-index: 20; }
.steps { display: flex; gap: 4px; margin: 0; padding: 0; justify-content: center; min-width: 0; }
.steps li { list-style: none; min-width: 0; }
.steps button { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 6px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; transition: color 180ms var(--ease), background-color 180ms var(--ease), transform 150ms var(--ease); }
.steps button i { font-style: normal; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; border: 1px solid var(--line-strong); transition: background-color 180ms var(--ease), color 180ms var(--ease), border-color 180ms var(--ease); }
.steps button[aria-current="step"] { color: var(--ink); background: var(--surface); }
.steps button[aria-current="step"] i { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.steps button.past i { background: var(--accent); color: #fff; border-color: var(--accent); }
.steps button:active { transform: scale(.97); }
.toast { position: fixed; left: 50%; bottom: calc(var(--tour) + 20px); transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 500; z-index: 30; pointer-events: none; transition: transform 380ms var(--ease-enter), opacity 220ms var(--ease); }
.toast.on { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 1180px) { .steps button span { display: none; } .steps button { padding: 0 6px; } }
@media (max-width: 980px) {
  body { overflow: auto; }
  main { position: static; padding: var(--top) 0 var(--tour); }
  .view { position: static; display: none; } .view.on { display: block; }
  .pwrap { grid-template-columns: 1fr; height: auto; padding: 16px; gap: 24px; }
  .phone { height: 680px; flex: none; }
  .top { padding: 0 16px; grid-template-columns: auto 1fr; } .top__right { display: none; } .seg { justify-self: end; }
  .rwrap { grid-template-columns: 1fr; height: auto; } .side { border-right: 0; border-bottom: 1px solid var(--line); }
  .rmain { min-height: 720px; } .parse, .whatif { grid-template-columns: 1fr; } .poster { position: relative; }
  .rhead, .rbody { padding-left: 16px; padding-right: 16px; }
  .tour { padding: 0 16px; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
}
