:root {
  --paper: #faf8f3; --surface: #ffffff; --ink: #1c1b2e; --muted: #4b4a63; --line: #e4e0d6;
  --accent: #3730a3; --accent-soft: #eceafc; --on-accent: #ffffff;
  --ok: #046c4e; --ok-bg: #e3f4ec; --warn: #8a4b06; --warn-bg: #fdf1df; --bad: #9f1c1c; --bad-bg: #fde8e8;
  --focus: #f59e0b; --radius: 14px; --shadow: 0 1px 2px rgba(28,27,46,.06), 0 10px 30px rgba(28,27,46,.07);
  --font: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #13121c; --surface: #1d1c2a; --ink: #f1f0f8; --muted: #b9b7cf; --line: #2f2d42;
    --accent: #a5b4fc; --accent-soft: #24233d; --on-accent: #13121c;
    --ok: #6ee7b7; --ok-bg: #0f2a22; --warn: #fcd34d; --warn-bg: #2d2311; --bad: #fca5a5; --bad-bg: #2f1414;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.3);
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 18px/1.6 var(--font); }
main { max-width: 1040px; margin: 0 auto; padding: 0 20px 64px; }
h1 { font-size: clamp(1.8rem, 4.4vw, 2.8rem); line-height: 1.15; letter-spacing: -.01em; margin: .4em 0 .5em; }
h2 { font-size: 1.45rem; margin: 2.2rem 0 1rem; line-height: 1.25; }
h3 { font-size: 1.1rem; margin: 1.4rem 0 .5rem; }
p { margin: .5em 0; }
a { color: var(--accent); text-underline-offset: 3px; }
q { quotes: "\201C" "\201D"; font-style: italic; }
kbd { font: .85em var(--mono); padding: .05em .4em; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: var(--surface); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--on-accent); padding: .5rem 1rem; border-radius: 8px; z-index: 50; }
.skip:focus { left: 12px; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; max-width: 1040px; margin: 0 auto; padding: 14px 20px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 700; font-size: 1.25rem; color: var(--accent); text-decoration: none; }
.brand span { color: var(--ink); }
.top nav { display: flex; align-items: center; gap: 1.1rem; font-size: .95rem; }
.top nav a { color: var(--ink); text-decoration: none; }
.top nav a:hover { text-decoration: underline; }
.chip { font-size: .8rem; padding: .25rem .65rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: var(--surface); }
.chip.live { color: var(--ok); background: var(--ok-bg); border-color: transparent; }

.hero .lede { font-size: 1.2rem; max-width: 48rem; color: var(--muted); }
.hero .lede strong { color: var(--ink); }
.draft { display: flex; gap: .55rem; align-items: flex-start; max-width: 48rem; padding: .75rem 1rem; border-radius: 10px; background: var(--warn-bg); color: var(--warn); font-size: .98rem; }
.draft svg { flex: none; margin-top: .2rem; }

.samples { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 18px; }
.sample { display: grid; grid-template-rows: auto 1fr; text-align: left; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 0; overflow: hidden; cursor: pointer; color: inherit; font: inherit; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.sample:hover { border-color: var(--accent); }
.sample img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top; background: #fff; border-bottom: 1px solid var(--line); }
.sample span { display: block; padding: .7rem .9rem .85rem; }
.sample b { display: block; }
.sample small { color: var(--muted); font-size: .88rem; }

.drop { display: grid; gap: .6rem; padding: 1.1rem; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--surface); }
.drop.dragging { border-color: var(--accent); background: var(--accent-soft); }
.drop-label { display: flex; align-items: center; gap: .7rem; cursor: pointer; color: var(--accent); }
.drop-label span { color: var(--ink); }
.drop input[type=file] { font: inherit; font-size: .95rem; color: var(--muted); }
.help { color: var(--muted); font-size: .9rem; margin: 0; }

button, .button { font: inherit; font-size: 1rem; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 44px; padding: .55rem 1.1rem; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; transition: background-color .15s, border-color .15s; }
button:disabled { opacity: .55; cursor: not-allowed; }
.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.primary:hover:not(:disabled) { filter: brightness(1.08); }
.secondary:hover, .ghost:hover { border-color: var(--accent); }
.ghost { background: transparent; }
.row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 1rem; }
.inline { display: inline-flex; gap: .4rem; align-items: center; font-size: .95rem; }

.rail { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rail li { display: grid; grid-template-columns: 14px 1fr auto; gap: .7rem; align-items: center; padding: .55rem .9rem; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: .97rem; }
.rail .dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); }
.rail li.running { color: var(--ink); border-color: var(--accent); }
.rail li.running .dot { border-color: var(--accent); animation: pulse 1s infinite; }
.rail li.done { color: var(--ink); }
.rail li.done .dot { background: var(--ok); border-color: var(--ok); }
.rail .who { font: .8rem var(--mono); color: var(--muted); }
.rail .info { color: var(--muted); font-size: .85rem; }
@keyframes pulse { 50% { transform: scale(1.4); opacity: .6; } }

.banner { padding: .75rem 1rem; border-radius: 10px; background: var(--accent-soft); color: var(--ink); margin: 1rem 0; font-size: .95rem; }
.results-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1.2rem; }
.results-head h2 { margin-right: auto; }
.summary { color: var(--muted); margin: 0; }
.figures { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.fig-card { width: 100%; height: 100%; text-align: left; display: grid; grid-template-rows: auto 1fr; padding: 0; overflow: hidden; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface); }
.fig-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #fff; border-bottom: 1px solid var(--line); }
.fig-card .body { padding: .75rem .9rem .9rem; display: grid; gap: .3rem; align-content: start; }
.fig-card .title { font-weight: 700; line-height: 1.3; }
.badge { justify-self: start; display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; }
.badge::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: currentColor; }
.badge.verified { color: var(--ok); background: var(--ok-bg); }
.badge.review { color: var(--warn); background: var(--warn-bg); }
.badge.review::before { border-radius: 2px; transform: rotate(45deg); }
.badge.unsupported { color: var(--muted); background: var(--accent-soft); }
.badge.unsupported::before { border-radius: 0; height: .15rem; }
.fig-card .reason { font-size: .88rem; color: var(--muted); }

.figure { margin-top: 2rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.2rem 1.4rem; }
.figure:focus { outline: none; }
.fig-head { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: flex-start; }
.fig-head h2 { margin: .1rem 0 .3rem; }
.kicker { font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0; }
.status { margin: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 2px solid var(--line); margin: 1rem 0 0; }
.tabs [role=tab] { border: 0; border-radius: 10px 10px 0 0; background: transparent; color: var(--muted); padding: .6rem 1rem; margin-bottom: -2px; border-bottom: 3px solid transparent; }
.tabs [role=tab][aria-selected=true] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 700; }
.panel { padding: 1.1rem .1rem 0; }
.panel-intro { color: var(--muted); max-width: 52rem; }

.compare { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1.2rem; align-items: start; }
@media (max-width: 760px) { .compare { grid-template-columns: 1fr; } }
.compare figure { margin: 0; }
.overlay { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.overlay img { display: block; width: 100%; }
.overlay .rerender { position: absolute; inset: 0; opacity: .5; mix-blend-mode: multiply; }
.slider-label { display: flex; justify-content: space-between; font-size: .92rem; margin-top: .6rem; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.compare figcaption { font-size: .92rem; color: var(--muted); }
.disputes h3 { margin-top: 0; }
.disputes ul { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .6rem; }
.dispute { border: 1.5px solid var(--warn); background: var(--warn-bg); border-radius: 10px; padding: .6rem .75rem; }
.dispute p { margin: 0 0 .4rem; font-size: .95rem; }
.dispute label { display: flex; gap: .5rem; align-items: center; font-size: .92rem; }
.dispute input { font: inherit; width: 8rem; padding: .3rem .5rem; border-radius: 8px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); }
.ok { color: var(--ok); background: var(--ok-bg); padding: .6rem .8rem; border-radius: 10px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 1rem; }
.table-wrap table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.table-wrap caption { text-align: left; padding: .6rem .8rem; font-weight: 700; }
.table-wrap th, .table-wrap td { padding: .45rem .8rem; border-top: 1px solid var(--line); text-align: right; white-space: nowrap; }
.table-wrap th[scope=row], .table-wrap thead th:first-child { text-align: left; }
.table-wrap td.flag { background: var(--warn-bg); }

.explorer { position: relative; border: 2px solid var(--line); border-radius: 12px; background: var(--paper); padding: .5rem; }
.explorer:focus-visible { border-color: var(--focus); outline: none; }
.explorer svg { width: 100%; height: auto; display: block; }
.explorer-now { margin: .3rem .4rem; font-size: 1.15rem; font-weight: 700; min-height: 1.6em; }

.prose { max-width: 52rem; }
.audit { list-style: none; padding: 0; display: grid; gap: .5rem; }
.audit li { padding: .55rem .8rem; border-radius: 10px; border-left: 5px solid var(--line); background: var(--paper); }
.audit li.consistent { border-left-color: var(--ok); }
.audit li.inconsistent { border-left-color: var(--bad); background: var(--bad-bg); }
.audit li.unverifiable { border-left-color: var(--warn); }
.audit b { text-transform: capitalize; }
.alt { font-style: italic; }
.fine { font-size: .88rem; color: var(--muted); }

.tactile-preview { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #f3f1ea; max-width: 760px; }
.tactile-preview svg { display: block; width: 100%; height: auto; }
.tactile-key { font-size: .95rem; color: var(--muted); }

.how { margin-top: 3rem; }
.steps { padding-left: 1.3rem; display: grid; gap: .6rem; max-width: 52rem; }
.foot { max-width: 1040px; margin: 0 auto; padding: 18px 20px 40px; color: var(--muted); font-size: .88rem; border-top: 1px solid var(--line); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: .65rem 1.1rem; border-radius: 10px; box-shadow: var(--shadow); max-width: calc(100vw - 32px); z-index: 40; }
@media (max-width: 600px) { body { font-size: 17px; } .top nav a { display: none; } }
