:root {
  --bg: #fbf7f3; --surface: #ffffff; --surface-2: #f5eff2;
  --ink: #2a2140; --muted: #5f5672; --line: #e9e0e6; --field-line: #8e82a0;
  --accent: #5b3fa0; --accent-strong: #47307f; --accent-ink: #ffffff; --accent-soft: #efeafa;
  --coral: #e98a7a; --rose-ink: #a3443a; --peach: #ffe3d3;
  --ok: #2e6a4c; --ok-soft: #e4f1ea; --watch: #7d5200; --watch-soft: #f8ecd3;
  --act: #a8323a; --act-soft: #f9e3e4; --info: #2d5a87; --info-soft: #e5eef7;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(42,33,64,.05), 0 12px 32px -14px rgba(42,33,64,.2);
  --font: "Atkinson Hyperlegible Next", ui-sans-serif, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: var(--font);
}

@font-face { font-family: "Atkinson Hyperlegible Next"; src: url(fonts/AtkinsonHyperlegibleNext.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(28px, 4.4vw, 38px); font-weight: 700; letter-spacing: -.015em; max-width: 32ch; }
h2 { font-size: 30px; font-weight: 700; letter-spacing: -.015em; }
h3 { font-size: 17px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.fine { font-size: 14px; color: var(--muted); }
.lede { font-size: 18px; color: var(--muted); max-width: 70ch; }
.eyebrow { font-size: 14px; font-weight: 700; color: var(--accent); margin: 0 0 12px; }
.tag { font: 600 14px var(--font); background: var(--surface-2); color: var(--muted); padding: 3px 8px; border-radius: 99px; vertical-align: middle; }

/* header */
.top { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; gap: 24px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 22px; color: var(--ink); text-decoration: none; }
.brand img { width: 32px; height: 32px; display: block; }
.tabs { display: flex; gap: 2px; flex-wrap: nowrap; margin-left: auto; }
.tabs a { white-space: nowrap; padding: 10px 12px; border-radius: 99px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; }
.tabs a:hover { background: var(--surface-2); color: var(--ink); }
.tabs a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }

main { padding: 32px 20px 56px; }
.panel { animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 10px 16px; border-radius: 10px; font: 600 15px var(--font); cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-strong); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 12px; font-size: 15px; }
.btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
textarea, input[type=number], select { width: 100%; font: 16px/1.5 var(--font); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
textarea { resize: vertical; font-size: 16px; }
textarea:focus-visible, input:focus-visible, select:focus-visible, .btn:focus-visible, a:focus-visible, [tabindex]:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 5px #fff; }

/* report */
.report-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 24px; align-items: start; }
.examples { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.report-out { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 28px; color: var(--muted); text-align: center; }
.birads { border-radius: var(--radius); padding: 18px; border: 1px solid var(--line); background: var(--surface); }
.birads .cat { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.birads .num { font-size: 44px; font-weight: 700; line-height: 1; }
.tone-ok .num { color: var(--ok); } .tone-watch .num { color: var(--watch); } .tone-follow .num { color: var(--info); } .tone-act .num { color: var(--act); }
.scale { position: relative; margin: 18px 0 8px; }
.scale-bar { height: 12px; border-radius: 99px; background: linear-gradient(90deg, var(--ok) 0%, #c9a227 30%, var(--act) 100%); opacity: .85; }
.scale-band { position: absolute; top: -5px; height: 22px; border: 2.5px solid var(--ink); border-radius: 6px; background: rgba(255,255,255,.35); }
.scale-ticks { position: relative; height: 18px; font-size: 14px; color: var(--muted); margin-top: 6px; }
.scale-ticks span { position: absolute; transform: translateX(-50%); }
.scale-ticks span:first-child { transform: none; }
.scale-ticks span:last-child { transform: translateX(-100%); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin-top: 12px; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.density { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.density div { border: 1px solid var(--line); border-radius: 10px; padding: 8px; text-align: center; font-size: 14px; color: var(--muted); }
.density div.on { border: 2px solid var(--accent); color: var(--ink); background: var(--accent-soft); }
.density svg { width: 100%; height: 54px; display: block; margin-bottom: 4px; }
.annotated { overflow-wrap: anywhere; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; font-size: 14.5px; line-height: 1.75; white-space: pre-wrap; }
mark.term { background: none; border-bottom: 2px solid; padding: 0 1px; cursor: help; color: inherit; }
mark.t-ok { border-color: var(--ok); background: var(--ok-soft); }
mark.t-watch { border-color: var(--watch); background: var(--watch-soft); }
mark.t-act { border-color: var(--act); background: var(--act-soft); }
mark.t-info { border-color: var(--info); background: var(--info-soft); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.terms { display: grid; gap: 8px; }
.term-row { display: grid; grid-template-columns: 170px 1fr; gap: 10px; font-size: 14.5px; padding: 8px 0; border-top: 1px solid var(--line); }
.term-row b { font-weight: 650; }
.pill { display: inline-block; font-size: 13px; font-weight: 700; padding: 2px 8px; border-radius: 99px; margin-left: 6px; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.watch { background: var(--watch-soft); color: var(--watch); }
.pill.act { background: var(--act-soft); color: var(--act); } .pill.info { background: var(--info-soft); color: var(--info); }
.questions li { margin-bottom: 6px; }
.diagram { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.diagram figure { margin: 0; text-align: center; font-size: 13px; color: var(--muted); }
.diagram svg { width: 100%; max-width: 220px; }

/* scan */
.scan-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.samples { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 12px; }
.samples button { padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; background: #000; aspect-ratio: 1; }
.samples button[aria-pressed="true"] { border-color: var(--accent); }
.samples img { width: 100%; height: 100%; object-fit: cover; display: block; }
.drop { display: block; border: 2px dashed var(--line); border-radius: var(--radius); padding: 14px; text-align: center; color: var(--muted); cursor: pointer; margin-bottom: 12px; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.canvas-wrap { background: #111; border-radius: var(--radius); display: flex; justify-content: center; align-items: center; min-height: 260px; overflow: hidden; }
.canvas-wrap canvas { max-width: 100%; height: auto; display: block; }
.slider-row label { font-size: 15px; color: var(--muted); }
.slider-row input { flex: 1; accent-color: var(--accent); }
.probs { display: grid; gap: 10px; margin: 14px 0; }
.prob { display: grid; grid-template-columns: 90px 1fr 56px; align-items: center; gap: 10px; font-size: 15px; }
.prob .track { height: 14px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.prob .fill { height: 100%; border-radius: 99px; transition: width .5s ease; }
.prob .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
.verdict { border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.verdict.ok { background: var(--ok-soft); } .verdict.watch { background: var(--watch-soft); } .verdict.act { background: var(--act-soft); }
.verdict h3 { margin: 0 0 4px; }
.warn { background: var(--watch-soft); color: var(--ink); border-radius: 10px; padding: 12px 14px; font-size: 14.5px; margin-bottom: 12px; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0; }
.metric { background: var(--surface-2); border-radius: 10px; padding: 10px; }
.metric b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.metric span { font-size: 14px; color: var(--muted); }

/* check */
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.checklist { display: grid; gap: 4px; }
.checklist label, .form label.check { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; cursor: pointer; font-size: 15px; }
.checklist label:hover, .form label.check:hover { background: var(--surface-2); }
.checklist input, .form input[type=checkbox] { margin-top: 4px; accent-color: var(--accent); width: 17px; height: 17px; flex: none; }
.form { display: grid; gap: 10px; }
.form > label:not(.check) { display: grid; gap: 4px; font-size: 14px; color: var(--muted); font-weight: 600; }
#check-out { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 20px; }
.advice { border-radius: var(--radius); padding: 18px 20px; border: 1px solid var(--line); border-left: 6px solid; background: var(--surface); }
.advice.ok { border-color: var(--ok); } .advice.watch { border-color: var(--watch); } .advice.act { border-color: var(--act); } .advice.info { border-color: var(--info); }
.advice h3 { margin-bottom: 6px; }
.advice ul { margin: 6px 0 0; padding-left: 20px; }
.src { font-size: 14px; color: var(--muted); margin-top: 8px; }

/* lab */
.lab-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 24px; align-items: start; }
.slider { display: grid; grid-template-columns: 150px 1fr 70px; gap: 10px; align-items: center; font-size: 14px; margin-top: 8px; }
.slider input { accent-color: var(--accent); }
.slider output { text-align: right; font-variant-numeric: tabular-nums; }
.contrib { display: grid; grid-template-columns: 170px 1fr; gap: 6px 10px; align-items: center; font-size: 14.5px; }
.contrib .bar-wrap { position: relative; height: 16px; }
.contrib .mid { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--muted); }
.contrib .bar { position: absolute; top: 2px; height: 12px; border-radius: 3px; }
.gauge { height: 18px; border-radius: 99px; background: linear-gradient(90deg, var(--ok), #c9a227, var(--act)); position: relative; margin: 10px 0 4px; }
.gauge i { position: absolute; top: -6px; width: 4px; height: 30px; background: var(--ink); border-radius: 2px; transform: translateX(-2px); transition: left .3s; }

/* about */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; overflow-wrap: anywhere; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
td.num { font-variant-numeric: tabular-nums; text-align: right; }
.flow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 14px; }
.flow span { background: var(--surface-2); padding: 8px 12px; border-radius: 10px; }
.flow b { color: var(--muted); }

.popover { position: fixed; z-index: 30; max-width: 320px; background: var(--ink); color: var(--bg); padding: 12px 14px; border-radius: 10px; font-size: 15px; }
.popover b { display: block; margin-bottom: 2px; }

.foot { border-top: 1px solid var(--line); padding: 24px 0 40px; font-size: 15px; color: var(--muted); }
.foot p { margin: 4px 0; }

@media (max-width: 860px) {
  .stats, .cards.three, .report-grid, .scan-grid, .check-grid, .lab-grid, .about-grid { grid-template-columns: minmax(0, 1fr); }
  .samples { grid-template-columns: repeat(3, 1fr); }
  .density { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .term-row, .contrib { grid-template-columns: 1fr; }
  .slider { grid-template-columns: 110px 1fr 60px; }
  .kv { grid-template-columns: 110px 1fr; }
  main { padding: 20px 16px 48px; }
  .top { position: static; }
  .top-inner { gap: 4px; padding: 8px 0; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { white-space: nowrap; }
  .wrap { padding: 0 16px; }
}

/* ---- shared helpers ---- */
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--accent); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { top: 8px; }
.block { display: block; }
.print-only { display: none; }
main:focus { outline: none; }
.next-step { margin-top: 24px; color: var(--muted); }
.notice { background: var(--info-soft); border: 1px solid var(--info); border-radius: var(--radius); padding: 12px 14px; margin: 0 0 12px; font-size: 16px; }
.notice.bad { background: var(--act-soft); border-color: var(--act); }
.notice b:first-child { display: block; }
.demo-note { border: 1px solid var(--watch); background: var(--watch-soft); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 22px; }
.demo-note p { margin: 4px 0 0; }

/* ---- ask / chat ---- */
.intro { padding: 8px 0 0; } .intro h1 { margin-bottom: 4px; } .intro .lede { margin: 0; }
.chat { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; margin-top: 20px; display: flex; flex-direction: column; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.chat-head > div { flex: 1; min-width: 0; }
.chat-head .btn { flex: none; }
.guide-slot, .avatar { flex: none; display: inline-flex; width: 40px; height: 40px; }
.chat-log { position: relative; padding: 16px; display: flex; flex-direction: column; gap: 14px; min-height: 280px; max-height: min(70vh, 720px); overflow-y: auto; }
.msg { display: flex; gap: 10px; align-items: flex-start; max-width: 100%; }
.msg.user { justify-content: flex-end; }
.bubble { border-radius: 14px; padding: 12px 14px; max-width: min(100%, 640px); overflow-wrap: anywhere; }
.msg.bot .bubble { background: var(--surface-2); border-top-left-radius: 4px; }
.msg.user .bubble { background: var(--accent); color: var(--accent-ink); border-top-right-radius: 4px; white-space: pre-wrap; }
.bubble p { margin: 0 0 8px; } .bubble p:last-child { margin-bottom: 0; }
.bubble h3 { font-size: 16px; margin: 14px 0 4px; }
.bubble > h3:first-child { margin-top: 0; }
.starters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.src-block { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface); }
.src-report { border: 2px solid var(--accent); }
.src-general { border: 2px dashed var(--muted); }
.src-block h3 { margin: 0 0 2px; }
.src-block ul, .src-block ol { margin: 6px 0 0; padding-left: 20px; }
.src-block li { margin-bottom: 8px; }
q.quote { display: block; font-style: italic; border-left: 3px solid var(--accent); padding-left: 8px; margin-bottom: 2px; quotes: "“" "”"; }
.care { border: 2px solid var(--act); background: var(--act-soft); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.care.soon { border-color: var(--watch); background: var(--watch-soft); }
.care b { display: block; margin-bottom: 2px; }
.care p { margin: 0; }
.related { margin-top: 12px; font-size: 15px; }
.tools-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.review textarea { margin: 6px 0 4px; min-height: 180px; }
.review label { font-weight: 600; }
.report-chip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--accent-soft); font-size: 15px; }
.report-chip[hidden] { display: none; }
.report-chip span { flex: 1; min-width: 160px; }
.composer { border-top: 1px solid var(--line); padding: 12px 16px 14px; }
.composer textarea { min-height: 64px; }
.composer-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.composer-row .send { margin-left: auto; min-width: 96px; }
.composer .fine { margin: 8px 0 0; }
.typing { display: inline-flex; gap: 4px; align-items: center; color: var(--muted); }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite both; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.more { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 16px; }
.more a { font-weight: 600; }
dialog#consent { border: 1px solid var(--line); border-radius: 16px; padding: 0; max-width: min(560px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); }
dialog#consent::backdrop { background: rgba(42,33,64,.5); }
#consent-form { padding: 22px; }
#consent-form h2 { font-size: 22px; margin-bottom: 8px; }
#consent-form ul { padding-left: 20px; margin: 8px 0 14px; }
#consent-form li { margin-bottom: 6px; }
.dialog-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media (forced-colors: active) { .src-general { border-style: dashed; } .btn.primary { border: 2px solid ButtonText; } }

/* ---- polish ---- */
body { background: radial-gradient(900px 440px at 6% -10%, rgba(91,63,160,.10), transparent 62%), radial-gradient(760px 380px at 102% -4%, rgba(233,138,122,.20), transparent 62%), var(--bg); background-repeat: no-repeat; }
.top { background: rgba(251,247,243,.86); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid rgba(42,33,64,.08); }
.brand { font-weight: 500; font-size: 23px; letter-spacing: -.01em; }
.brand b { font-weight: 700; color: var(--accent); }
.brand img { width: 38px; height: 38px; border-radius: 11px; box-shadow: 0 4px 12px -4px rgba(74,47,134,.35); }
.tabs a { transition: background .15s, color .15s; }
.tabs a[aria-current="page"] { background: var(--accent); box-shadow: 0 6px 14px -6px rgba(91,63,160,.6); }
.btn { border-radius: 12px; border-color: var(--line); box-shadow: 0 1px 0 rgba(42,33,64,.04); transition: transform .15s, box-shadow .15s, border-color .15s, background .15s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 14px -8px rgba(42,33,64,.35); }
.btn:disabled:hover { transform: none; box-shadow: none; }
.btn.primary { background: linear-gradient(180deg, #6a4cb3, var(--accent)); border-color: var(--accent); box-shadow: 0 8px 18px -8px rgba(91,63,160,.7); }
.btn.primary:hover { background: linear-gradient(180deg, var(--accent-strong), var(--accent-strong)); }
textarea, input[type=number], select { border-radius: 12px; border-color: var(--field-line); }
.card, .birads, .annotated, .demo-note { border-radius: 16px; box-shadow: var(--shadow); }
.card { background: var(--surface); border: 1px solid var(--line); padding: 20px; }
.empty { border-radius: 16px; background: rgba(255,255,255,.5); }
.chat { border-radius: 22px; border-color: rgba(42,33,64,.08); box-shadow: 0 1px 2px rgba(42,33,64,.05), 0 24px 56px -20px rgba(42,33,64,.22); }
.chat-head { background: linear-gradient(180deg, #fff, #f8f3f6); }
.msg.bot .bubble { background: var(--surface-2); border: 1px solid var(--line); }
.msg.user .bubble { background: linear-gradient(180deg, #6a4cb3, var(--accent)); }
.starters .btn { border-radius: 99px; }
.composer textarea { border-radius: 14px; }
.upload-card { border: 1.5px dashed rgba(91,63,160,.45); background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(239,234,250,.6)); border-radius: 18px; padding: 18px; margin-bottom: 6px; }
.upload-card .fine { margin: 10px 0 0; }
.upload-card .notice { margin: 12px 0 0; }
.or { display: flex; align-items: center; gap: 12px; margin: 14px 0 10px; font-size: 14px; color: var(--muted); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.more { padding-top: 16px; border-top: 1px solid var(--line); }
.more a { text-decoration: none; padding: 6px 12px; border-radius: 99px; background: rgba(255,255,255,.7); border: 1px solid var(--line); }
.more a:hover { border-color: var(--accent); }
.foot { border-top: 1px solid var(--line); background: rgba(255,255,255,.4); color: var(--muted); font-size: 15px; }
@media (prefers-reduced-motion: reduce) { .btn:hover { transform: none; } }

/* ---- onboarding, menu, chip ---- */
.about-chip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 16px; background: var(--accent-soft); border-bottom: 1px solid var(--line); font-size: 15px; }
.about-chip[hidden] { display: none; }
.about-chip span { flex: 1; min-width: 160px; }
dialog.onboard { border: 0; padding: 0; border-radius: 24px; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto; background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(42,33,64,.5); }
dialog.onboard::backdrop { background: radial-gradient(circle at 20% 10%, rgba(233,138,122,.35), transparent 50%), radial-gradient(circle at 90% 90%, rgba(91,63,160,.45), transparent 55%), rgba(42,33,64,.62); }
.ob-top { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; padding: 18px 22px 0; }
.ob-top .fine { margin: 0; }
.ob-bar { grid-column: 1 / -1; grid-row: 2; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.ob-bar i { display: block; height: 100%; width: 20%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--coral)); transition: width .4s ease; }
.ob-step { padding: 18px 22px 24px; display: grid; gap: 10px; }
.ob-step[hidden] { display: none; }
.ob-step h2 { font-family: var(--font); font-size: 28px; font-weight: 700; letter-spacing: -.01em; margin: 4px 0 0; }
.ob-step h2:focus { outline: none; }
.ob-lede { font-size: 18px; color: var(--muted); margin: 0; }
.ob-guide { display: block; width: 96px; margin-bottom: 4px; }
.ob-q { margin: 8px 0 0; font-weight: 600; }
.ob-step label { font-weight: 600; }
.ob-opts { display: grid; gap: 8px; }
.ob-opt { display: block; position: relative; margin: 0; }
.ob-opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.ob-opt span { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 14px; border: 1.5px solid var(--field-line); border-radius: 14px; background: var(--surface); font-weight: 600; transition: transform .15s, border-color .15s, background .15s; }
.ob-opt:hover span { border-color: var(--accent); transform: translateY(-1px); }
.ob-opt span::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--field-line); flex: none; }
.ob-opt input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.ob-opt input:checked + span::before { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 0 45%, #fff 50%); }
.ob-opt input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.ob-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.ob-actions .primary { min-width: 120px; }
.ob-points { margin: 0; padding-left: 20px; display: grid; gap: 8px; }

/* ---- motion (all of it off under prefers-reduced-motion) ---- */
body::before { content: ""; position: fixed; inset: -20%; z-index: -1; pointer-events: none; background: radial-gradient(40% 40% at 25% 25%, rgba(91,63,160,.10), transparent 70%), radial-gradient(35% 35% at 75% 30%, rgba(255,205,180,.28), transparent 70%); animation: drift 40s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate3d(4%, 6%, 0) scale(1.08); } }
.msg { animation: rise .28s ease both; }
.msg.user { animation-name: rise-r; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes rise-r { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
.guide-face { animation: bob 4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-2px); } }
.guide-face .eyes { transform-origin: center; transform-box: fill-box; animation: blink 6s infinite; }
@keyframes blink { 0%, 95%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
.btn:active { transform: scale(.98); }
.brand:hover img { animation: bob 1s ease-in-out; }
.ob-step:not([hidden]) { animation: slide .3s ease both; }
@keyframes slide { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
dialog.onboard[open] { animation: pop .35s cubic-bezier(.2,.8,.2,1); }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
.report-out > * { animation: rise .4s ease both; }
.report-out > :nth-child(2) { animation-delay: .06s; } .report-out > :nth-child(3) { animation-delay: .12s; } .report-out > :nth-child(4) { animation-delay: .18s; } .report-out > :nth-child(5) { animation-delay: .24s; }
.typing i { background: var(--accent); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media print {
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; color: #000; background: #fff; padding: 0; font-size: 14pt; }
  #print-area h1 { font-size: 20pt; max-width: none; } #print-area li { margin-bottom: 8pt; }
}

@media (max-width: 860px) {
  .chat-log { max-height: 60vh; min-height: 240px; }
  .composer-row .send { flex: 1 0 100%; margin-left: 0; }
  .chat { border-radius: 12px; }
}

[hidden] { display: none !important; }
@media (max-width: 860px) {
  .chat-head { flex-wrap: wrap; }
  .chat-head > div { flex: 1 1 150px; }
  .tabs a { padding: 8px 12px; font-size: 14.5px; }
  .tabs { gap: 2px 4px; }
  .top-inner { padding: 10px 0 6px; }
}

/* ---- report decoder, clearer layout ---- */
.steps-bar { display: flex; gap: 10px; flex-wrap: wrap; list-style: none; margin: 0 0 18px; padding: 0; }
.steps-bar li { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; color: var(--muted); }
.steps-bar b, .step-n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 14px; flex: none; }
.steps-bar li + li::before { content: ""; width: 24px; height: 2px; background: var(--line); margin-right: 2px; }
.rep-in, .rep-out-wrap { padding: 20px; }
.step-h { display: flex; align-items: center; gap: 10px; font-size: 20px; margin: 0 0 14px; }
.add-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.add-opt { display: grid; gap: 2px; text-align: left; padding: 14px; min-height: 84px; border: 1.5px solid var(--field-line); border-radius: 14px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; transition: transform .15s, border-color .15s, background .15s; }
.add-opt:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.add-opt b { font-size: 17px; } .add-opt span { font-size: 14px; color: var(--muted); }
.add-opt.main { background: var(--accent); border-color: var(--accent); color: #fff; } .add-opt.main span { color: #ece6fa; } .add-opt.main:hover { background: var(--accent-strong); }
.add-opt:disabled { opacity: .6; cursor: wait; }
.mini { margin: 14px 0 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
.rep-in .notice { margin: 12px 0 0; }
.rep-in textarea { margin-top: 10px; }
.rep-in .row { margin-top: 12px; }
.empty.how { text-align: left; background: transparent; border: 0; padding: 4px 0; }
.empty.how > b:first-child { display: block; font-size: 18px; color: var(--ink); margin-bottom: 8px; }
.empty.how ol { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.hero { border-left: 6px solid var(--tone, var(--accent)); }
.hero.tone-ok { --tone: var(--ok); } .hero.tone-watch { --tone: var(--watch); } .hero.tone-follow { --tone: var(--info); } .hero.tone-act { --tone: var(--act); }
.hero-k { display: block; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.hero p { margin: 0; font-size: 18px; line-height: 1.5; }
.report-out .card h3 { font-size: 18px; }
@media (max-width: 860px) { .add-opts { grid-template-columns: 1fr; } .tabs { margin-left: 0; width: 100%; overflow-x: auto; scrollbar-width: none; } }
@media (max-width: 860px) { .steps-bar li + li::before { display: none; } .steps-bar { flex-direction: column; gap: 6px; } .tabs a:first-child { margin-left: 0; } }

/* Refined, quiet visual system */
:root {
  --bg: #f5f5f3; --surface: #fff; --surface-2: #f2f1f5;
  --ink: #242137; --muted: #625f70; --line: #dfdfe4; --field-line: #aaa7b5;
  --accent: #594181; --accent-strong: #453165; --accent-soft: #eeeaf4;
  --shadow: 0 2px 8px rgba(36,33,55,.03), 0 16px 40px rgba(36,33,55,.05);
}
body::before { display: none; }
body { background: var(--bg); }
a { text-underline-offset: .18em; }
.top { background: rgba(245,245,243,.96); border-bottom: 1px solid var(--line); }
.top-inner { min-height: 76px; }
.brand { letter-spacing: -.04em; font-size: 21px; gap: 9px; }
.tabs { gap: 3px; }
.tabs a { border-radius: 7px; padding: 9px 11px; font-size: 14px; transition: background .2s, color .2s; }
.tabs a[aria-current="page"] { color: var(--accent-strong); background: var(--accent-soft); }
main { padding-top: 54px; padding-bottom: 80px; }
.panel > h2 { font-size: clamp(32px, 4vw, 46px); letter-spacing: -.04em; margin-bottom: 10px; }
.panel > .lede { line-height: 1.55; margin: 0 0 32px; max-width: 68ch; }
.intro { padding: 5px 0 14px; }
.intro-label { color: var(--accent); font-weight: 700; font-size: 14px; margin: 0 0 14px; }
.intro h1 { max-width: 18ch; font-size: clamp(38px, 5.5vw, 64px); letter-spacing: -.045em; line-height: 1.08; margin-bottom: 15px; }
.intro .lede { font-size: 19px; }
.chat { margin-top: 26px; border-radius: 14px; box-shadow: var(--shadow); }
.chat-head { background: #fff; padding: 16px 20px; }
.chat-log { padding: 24px; min-height: 310px; }
.composer { padding: 16px 20px 18px; }
.composer textarea { background: #fafafa; border-color: var(--line); }
.bubble { padding: 16px 18px; line-height: 1.6; }
.msg.bot .bubble { background: var(--surface-2); }
.guide-face, .guide-face .eyes { animation: none; }
.btn { border-radius: 8px; transition: background .2s, border-color .2s, transform .2s; }
.btn:hover:not(:disabled) { transform: translateY(-2px); }
.card, .birads, .annotated, .demo-note { border-radius: 12px; box-shadow: none; }
.card { padding: 26px; }
.check-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
.check-grid .card h3 { font-size: 21px; letter-spacing: -.02em; margin-bottom: 12px; }
.check-grid .card > .muted { margin: 0 0 15px; }
.checklist { gap: 1px; }
.checklist label, .form label.check { padding: 10px 9px; line-height: 1.45; }
.form { gap: 12px; }
.form > label:not(.check) { color: var(--ink); }
.results-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 42px 0 0; padding-bottom: 12px; border-bottom: 1px solid var(--line); font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.results-heading span + span { color: var(--muted); font-size: 14px; font-weight: 400; letter-spacing: 0; }
#check-out { gap: 0; margin: 0; }
.advice { position: relative; padding: 26px 0 26px 24px; background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.advice::before { content: ""; position: absolute; left: 0; top: 29px; bottom: 29px; width: 3px; border-radius: 3px; background: var(--accent); }
.advice.ok::before { background: var(--ok); } .advice.watch::before { background: var(--watch); } .advice.act::before { background: var(--act); } .advice.info::before { background: var(--info); }
.advice h3 { font-size: 20px; letter-spacing: -.02em; margin: 0 0 8px; }
.advice p { max-width: 75ch; margin: 0 0 10px; }
.advice .src { margin: 15px 0 0; }
.advice .src a { font-weight: 600; }
.next-step { margin-top: 28px; }
.foot { background: #eeedef; padding: 28px 0 36px; }
.foot p { max-width: 90ch; }
dialog.onboard::backdrop { background: rgba(33,30,45,.6); }
.ob-bar i { background: var(--accent); }
@media (max-width: 860px) {
  .top-inner { min-height: 0; padding: 12px 0 8px; gap: 8px; }
  .tabs { padding-bottom: 2px; }
  main { padding-top: 32px; padding-bottom: 55px; }
  .panel > .lede { margin-bottom: 24px; }
  .check-grid { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 20px; }
  .intro h1 { font-size: clamp(36px, 9vw, 52px); }
  .chat-log { padding: 18px; }
  .results-heading { margin-top: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .btn:hover:not(:disabled) { transform: none; }
}
main.wrap { padding-top: 54px; padding-bottom: 80px; }
@media (max-width: 860px) { main.wrap { padding-top: 32px; padding-bottom: 55px; } }
