/* Premise · Cortex. Shared, byte for byte, by the v1 brain and the v2 review app (tests assert it). */
@import url('tokens.css');
@font-face { font-family: 'Unbounded'; src: url('fonts/unbounded.woff2') format('woff2'); font-weight: 400 800; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('fonts/manrope.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('fonts/jetbrains-mono.woff2') format('woff2'); font-weight: 400 500; font-display: swap; }
@view-transition { navigation: auto; }

/* Tokens live in tokens.css (imported above); this sheet only consumes them. */

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; scrollbar-color: #232744 var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: radial-gradient(1200px 700px at 50% -260px, rgb(91 99 255 / 0.16), transparent 70%), var(--bg); color: var(--ink); font: 400 16px/1.6 var(--ui); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
::selection { background: var(--indigo); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #232744; border: 2px solid var(--bg); border-radius: 8px; }
img, svg, canvas { display: block; max-width: 100%; }
p { margin: 0 0 1em; max-width: 66ch; }
a { color: var(--ink); text-decoration: underline; text-decoration-color: rgb(139 146 255 / 0.5); text-underline-offset: 3px; transition: color .18s ease, text-decoration-color .18s ease; }
a:hover { text-decoration-color: var(--indigo-2); }
:focus-visible { outline: 2px solid var(--indigo-2); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { margin: 0; font-weight: 600; text-wrap: balance; }
h1 { font: 700 clamp(2.4rem, 5vw, 4.6rem)/1 var(--display); letter-spacing: -0.04em; margin-bottom: 20px; }
h2 { font: 600 clamp(1.35rem, 2vw, 1.75rem)/1.15 var(--display); letter-spacing: -0.03em; margin-bottom: 18px; }
h3 { font: 600 1rem/1.3 var(--ui); margin: 26px 0 12px; display: flex; align-items: center; gap: 8px; }
code, pre, kbd { font-family: var(--mono); font-size: 0.86em; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }
small { display: block; font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.i { width: 1.05em; height: 1.05em; flex: none; vertical-align: -0.15em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; left: 0; top: 0; }
.skip { position: absolute; left: 16px; top: -80px; z-index: 50; padding: 10px 14px; border-radius: 10px; background: var(--ink); color: var(--bg); }
.skip:focus { top: 12px; }
.id code, code.id { font: 500 13.5px/1.4 var(--mono); color: var(--ice); letter-spacing: -0.01em; }
.id { font-weight: 500; text-decoration: none; }
.num { font-variant-numeric: tabular-nums; }
.quiet { color: var(--ink-3); }
.lede, .intro { color: var(--ink-2); }
.warning { color: var(--unknown); display: flex; gap: 6px; align-items: baseline; }

/* Header: a floating glass bar */
header.bar, body > header { position: sticky; top: 14px; z-index: 30; display: flex; align-items: center; gap: clamp(14px, 3vw, 40px); max-width: calc(var(--max) - 2 * var(--gutter)); margin: 14px auto 0; padding: 10px 12px 10px 10px; border-radius: 999px; background: rgb(12 13 24 / 0.72); box-shadow: 0 0 0 1px var(--line) inset, 0 20px 50px -30px #000; backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%); }
.brand { display: inline-flex; align-items: center; gap: 12px; padding: 4px 16px 4px 4px; border-radius: 999px; background: var(--panel); box-shadow: 0 0 0 1px var(--line) inset; font: 700 13px var(--display); letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none; color: var(--ink); }
.brand small { display: inline; margin: 0; font: 600 11px var(--ui); letter-spacing: 0.04em; color: var(--ink-3); text-transform: none; }
.mark { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 0; background: radial-gradient(circle at 35% 30%, #fff, #a3a9ff 55%, #343a99); box-shadow: 0 0 18px rgb(140 150 255 / 0.75); transition: transform .5s var(--ease), box-shadow .3s; }
.brand:hover .mark { transform: rotate(160deg) scale(1.06); box-shadow: 0 0 26px rgb(140 150 255 / 1); }
header nav { display: flex; gap: 4px; }
header nav a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14px; transition: color .18s ease, background-color .18s ease; }
header nav a:hover { color: var(--ink); background: var(--panel); }
header nav a[aria-current='page'] { color: var(--ink); background: var(--panel-2); box-shadow: 0 0 0 1px var(--line) inset; }
.workspace { margin: 0 6px 0 auto; text-align: right; font-weight: 600; font-size: 14px; line-height: 1.25; }
.workspace small, .fiction { display: block; margin: 0; font-size: 12px; font-weight: 500; color: var(--ink-3); }

main { max-width: var(--max); margin: 0 auto; padding: 22px var(--gutter) 40px; }
section { margin-bottom: clamp(56px, 7vw, 100px); }

/* Controls */
button { font: inherit; color: inherit; }
.button, form button, .fix button, .metal { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 12px 20px; border: 0; border-radius: var(--r-control); font: 700 15px/1 var(--ui); color: #0b0c14; text-decoration: none; cursor: pointer; background: linear-gradient(180deg, #ffffff, #c9cde4); box-shadow: 0 1px 0 #fff inset, 0 12px 30px -12px rgb(140 150 255 / 0.9); transition: transform .14s var(--ease), box-shadow .3s var(--ease), filter .2s; }
.button:hover, form button:hover, .fix button:hover, .metal:hover { box-shadow: 0 1px 0 #fff inset, 0 16px 44px -10px rgb(140 150 255 / 1); filter: brightness(1.04); }
.button:active, form button:active, .fix button:active, .metal:active, .chip:active { transform: scale(0.97); }
button:disabled { opacity: .55; cursor: progress; }
.chip { display: inline-flex; align-items: center; gap: 9px; min-height: 40px; padding: 9px 15px; border: 0; border-radius: 999px; background: var(--panel); box-shadow: 0 0 0 1px var(--line) inset; color: var(--ink); font: 600 14px/1.3 var(--ui); text-align: left; cursor: pointer; max-width: 100%; overflow-wrap: anywhere; transition: transform .14s var(--ease), background-color .2s, box-shadow .3s var(--ease); }
.chip:hover { background: var(--panel-2); box-shadow: 0 0 0 1px var(--line-2) inset, 0 10px 30px -14px rgb(91 99 255 / 0.9); }
.chip .i { color: var(--indigo-2); }
.chip[aria-pressed='true'] { background: linear-gradient(180deg, #ffffff, #d0d4ea); color: #0b0c14; box-shadow: 0 0 0 1px #fff inset, 0 0 30px -4px rgb(139 146 255 / 0.9); }
.chip[aria-pressed='true'] .i { color: #c2264b; }
.quiet-chip .i { color: var(--ink-3); }

/* State chips: colour always travels with a word and a glyph */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 8px; border-radius: 999px; background: rgb(255 255 255 / 0.06); color: var(--ink-2); font: 700 12.5px/1.5 var(--ui); white-space: nowrap; vertical-align: middle; }
.badge .i { width: 14px; height: 14px; }
.badge.holds, .badge.holding, .badge.verified, .badge.clear_within_scope { color: var(--holds); background: rgb(124 240 200 / 0.1); box-shadow: 0 0 18px -6px rgb(124 240 200 / 0.6); }
.badge.unknown, .badge.unverified, .badge.unevaluable, .badge.needs_review, .badge.partial, .badge.checking { color: var(--unknown); background: rgb(255 210 122 / 0.1); box-shadow: 0 0 18px -6px rgb(255 210 122 / 0.6); }
.badge.broken, .badge.violated, .badge.blocked, .badge.rejected, .badge.error { color: var(--broken); background: rgb(255 107 139 / 0.12); box-shadow: 0 0 18px -6px rgb(255 107 139 / 0.7); }
.badge.large { font-size: 15px; padding: 9px 16px 9px 12px; gap: 8px; } .badge.large .i { width: 18px; height: 18px; }
td .badge + small { margin-top: 6px; }

/* Glass surfaces and cards: frosted at rest, rising into the indigo light under the pointer */
.glass, .table-wrap, .analyst, .impact, .graph-panel, .fix, .gap, .empty, .review, .lexical-pair > div, .warnings, .command, blockquote, .reason-list li, .json, .reason-panel {
  background: linear-gradient(180deg, var(--panel), rgb(150 160 230 / 0.025)); box-shadow: 0 0 0 1px var(--line) inset, 0 1px 0 rgb(255 255 255 / 0.12) inset, 0 24px 50px -34px #000; border-radius: var(--r-card); }
.card { --x: 50%; --y: 0%; position: relative; isolation: isolate; display: flex; flex-direction: column; padding: 24px; border-radius: var(--r-card); background: linear-gradient(180deg, var(--panel), rgb(150 160 230 / 0.025)); box-shadow: 0 0 0 1px var(--line) inset, 0 1px 0 rgb(255 255 255 / 0.14) inset, 0 24px 50px -34px #000; text-decoration: none; color: inherit; overflow: hidden; transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
.card::before { content: ''; position: absolute; left: 12%; right: 12%; top: 0; height: 1px; background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.8), transparent); opacity: .45; }
.card::after { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: radial-gradient(360px circle at var(--x) var(--y), rgb(91 99 255 / 0.28), transparent 60%); opacity: 0; transition: opacity .4s var(--ease); }
.card:hover { transform: translateY(-6px); box-shadow: 0 0 0 1px var(--line-2) inset, 0 1px 0 rgb(255 255 255 / 0.25) inset, 0 40px 80px -34px rgb(91 99 255 / 0.75); }
.card:hover::after { opacity: 1; }
.card.is-broken { box-shadow: 0 0 0 1px rgb(255 107 139 / 0.6) inset, 0 30px 70px -30px rgb(255 107 139 / 0.7); background: linear-gradient(180deg, rgb(255 107 139 / 0.14), rgb(255 107 139 / 0.03)); }
.card.is-unknown { box-shadow: 0 0 0 1px rgb(255 210 122 / 0.32) inset, 0 24px 50px -34px #000; }
.card.is-fired-broken { box-shadow: 0 0 0 1.5px var(--broken) inset, 0 0 60px -10px rgb(255 107 139 / 0.55) inset, 0 34px 80px -30px rgb(255 107 139 / 0.8); animation: alarm 1.6s ease-in-out infinite; }
.card.is-fired-unknown { box-shadow: 0 0 0 1.5px var(--unknown) inset, 0 34px 80px -30px rgb(255 210 122 / 0.6); }
@keyframes alarm { 50% { box-shadow: 0 0 0 1.5px var(--broken) inset, 0 0 90px -10px rgb(255 107 139 / 0.75) inset, 0 34px 90px -26px rgb(255 107 139 / 1); } }
.hud-idle b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* Tables */
.table-wrap { position: relative; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { padding: 15px 18px; text-align: left; font: 700 12.5px var(--ui); letter-spacing: 0.02em; color: var(--ink-3); white-space: nowrap; border-bottom: 1px solid var(--line); }
td { padding: 16px 18px; vertical-align: top; border-bottom: 1px solid var(--line); }
tbody tr { transition: background-color .2s ease; }
tbody tr:hover { background: rgb(139 146 255 / 0.06); }
tbody tr:last-child td { border-bottom: 0; }
td p { margin: 5px 0 0; color: var(--ink-2); font-size: 15px; }
td a { text-decoration: none; } td a:hover { text-decoration: underline; }
td code { color: var(--ink-2); }
.predicate { color: var(--ink) !important; font-size: 13.5px; }
.proposed { color: var(--unknown); }

/* Hero: the cortex frame */
.frame { position: relative; isolation: isolate; overflow: hidden; border-radius: var(--r-frame); background: radial-gradient(70% 60% at 62% 70%, rgb(91 99 255 / 0.36), transparent 70%), radial-gradient(90% 70% at 50% 110%, rgb(60 70 160 / 0.5), transparent 70%), var(--frame); box-shadow: 0 0 0 1px var(--line) inset, 0 0 160px 10px rgb(91 99 255 / 0.14); }
.hero { position: relative; min-height: max(min(calc(100vh - 100px), 940px), 780px); margin-bottom: 26px; }
.wordmark { position: relative; z-index: 0; margin: clamp(22px, 3.4vh, 40px) 0 0; text-align: center; font: 800 clamp(64px, 12.6vw, 200px)/0.86 var(--display); letter-spacing: -0.05em; color: #f6f7ff; text-shadow: 0 0 70px rgb(140 150 255 / 0.35); user-select: none; background: linear-gradient(100deg, #f6f7ff 40%, #c6cbff 50%, #f6f7ff 60%) 0 0 / 300% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: sheen 9s var(--ease-io) infinite; pointer-events: none; }
@keyframes sheen { 0%, 55% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.hero-copy { position: absolute; z-index: 3; left: clamp(20px, 3vw, 40px); bottom: clamp(26px, 4vh, 44px); width: min(560px, 42%); }
.hero-copy h1 { font-size: clamp(2rem, 3.4vw, 3.2rem); margin-bottom: 14px; }
.statement { font-size: clamp(1.02rem, 1.25vw, 1.18rem); line-height: 1.55; color: var(--ink); max-width: 40ch; margin-bottom: 22px; }
.readout { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; padding: 0; list-style: none; }
.readout li { display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 999px; background: var(--panel); box-shadow: 0 0 0 1px var(--line) inset; font-size: 13.5px; color: var(--ink-2); }
.readout b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.readout code { font-size: 12.5px; color: var(--ice); }
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--holds); box-shadow: 0 0 12px var(--holds); }
.t-holds { color: var(--holds) !important; } .t-unknown { color: var(--unknown) !important; } .t-broken { color: var(--broken) !important; }
.fire-label { color: var(--ink-2); font-size: 14px; margin-bottom: 10px; }
.fire-presets, .preset-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.brain-stage { position: absolute; z-index: 1; left: 34%; right: 15%; top: 15%; bottom: 0; }
.brain-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; }
.brain-stage canvas:active { cursor: grabbing; }
.brain-hint { position: absolute; left: 50%; bottom: 18px; translate: -50% 0; z-index: 2; margin: 0; padding: 6px 12px; border-radius: 999px; background: rgb(10 11 20 / 0.6); box-shadow: 0 0 0 1px var(--line) inset; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; pointer-events: none; transition: opacity .6s; }
.brain-stage.touched .brain-hint { opacity: 0; }
.brain-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); font-size: 14px; }
.brain-stage.ready .brain-fallback { display: none; }
.hud { position: absolute; z-index: 3; right: clamp(16px, 2vw, 30px); bottom: clamp(26px, 4vh, 44px); width: 270px; padding: 18px; }
.hud h2 { font: 700 13px var(--ui); letter-spacing: 0.02em; margin: 0 0 4px; }
.hud p { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.hud .verdict-line { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin: 12px 0 8px; font-weight: 600; font-size: 14px; }
.hud a { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; margin-top: 8px; }
.hud .settle, .fire-result .settle { animation: settle .28s var(--ease) both; }
.tip { position: absolute; z-index: 5; max-width: 300px; padding: 11px 13px; border-radius: 14px; background: rgb(14 15 28 / 0.92); box-shadow: 0 0 0 1px var(--line-2) inset, 0 18px 40px -12px #000; backdrop-filter: blur(12px); font-size: 13.5px; line-height: 1.45; color: var(--ink-2); pointer-events: none; opacity: 0; transform: translateY(4px) scale(.98); transition: opacity .14s ease, transform .14s var(--ease); }
.tip.show { opacity: 1; transform: none; }
.tip strong { display: block; margin-bottom: 3px; font: 500 12.5px var(--mono); color: var(--ice); }
.tip .badge { margin-top: 8px; }

/* The 2D nerve plate */
.network { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: stretch; }
.network-copy { padding: 26px; display: flex; flex-direction: column; justify-content: space-between; }
.network-copy p { color: var(--ink-2); }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 14px; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 10px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.specimen { margin: 0; }
.specimen-stage { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-card); overflow: hidden; background: radial-gradient(60% 60% at 60% 50%, rgb(91 99 255 / 0.14), transparent 70%), var(--panel-solid); box-shadow: 0 0 0 1px var(--line) inset; }
.specimen figcaption, figure figcaption { margin-top: 12px; font-size: 14px; color: var(--ink-3); max-width: 70ch; }
.fig { font-weight: 700; color: var(--ink-2); margin-right: 4px; }
.plate-fallback { display: none; }
.neuro { position: absolute; inset: 0; width: 100%; height: 100%; }
.neuro .edge { fill: none; stroke: var(--indigo-2); stroke-opacity: 0.28; stroke-width: 1.2; stroke-linecap: round; transition: stroke-opacity .25s ease, stroke .25s ease, stroke-width .25s ease; }
.neuro .twig { fill: none; stroke: var(--ice); stroke-opacity: 0.35; stroke-width: 0.9; stroke-linecap: round; }
.neuro .soma { fill: var(--ice); transition: fill .25s ease, opacity .25s ease; }
.neuro .soma.holds, .neuro .soma.holding { fill: var(--holds); }
.neuro .soma.unknown, .neuro .soma.unverified, .neuro .soma.unevaluable { fill: var(--unknown); }
.neuro .soma.broken, .neuro .soma.violated { fill: var(--broken); }
.neuro .ring { fill: none; stroke: currentColor; stroke-width: 1.2; opacity: 0; transform-box: fill-box; transform-origin: center; }
.neuro .label { paint-order: stroke; stroke: var(--panel-solid); stroke-width: 5px; stroke-linejoin: round; fill: var(--ink-2); font: 500 11.5px var(--mono); transition: fill .25s ease, opacity .25s ease; }
.neuro .cell.assumption .label { opacity: 0; }
.neuro .cell.assumption.on .label, .neuro .cell.assumption.fired .label, .neuro .cell.assumption.touched .label, .neuro .cell.assumption.checked .label { opacity: 1; }
.neuro .stratum { fill: var(--ink-3); font: 600 12px var(--ui); letter-spacing: 0.08em; text-transform: uppercase; }
.neuro .cell { cursor: pointer; }
.neuro .cell:focus-visible { outline: none; }
.neuro .cell:focus-visible .soma { stroke: var(--indigo-2); stroke-width: 2; }
.neuro.tracing .edge { stroke-opacity: 0.07; }
.neuro.tracing .edge.on { stroke: var(--ice); stroke-opacity: 0.9; stroke-width: 1.6; }
.neuro.tracing .cell { opacity: 0.3; } .neuro.tracing .cell.on { opacity: 1; }
.neuro.tracing .cell.on .label { fill: var(--ink); }
.neuro .edge.fired { stroke: var(--broken); stroke-opacity: 0.95; stroke-width: 1.8; stroke-dasharray: 5 7; animation: fire .9s linear infinite; }
.neuro .edge.checked { stroke: var(--holds); stroke-opacity: 0.85; stroke-width: 1.4; }
.neuro .cell.fired .label { fill: var(--broken); } .neuro .cell.checked .label { fill: var(--holds); }
.neuro .cell.touched .soma { fill: var(--unknown); } .neuro .cell.touched .label { fill: var(--unknown); }
.neuro .cell.fired .ring, .neuro .cell.touched .ring { animation: ripple 1.8s var(--ease) infinite; }
.neuro .cell.fired { color: var(--broken); } .neuro .cell.touched { color: var(--unknown); }
.neuro.firing .edge:not(.fired):not(.checked) { stroke-opacity: 0.06; }
.neuro.firing .cell:not(.fired):not(.touched):not(.checked) { opacity: 0.4; }
.neuro .pulse { fill: #fff; opacity: 0; }

/* Guarantee bento */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.section-head p { color: var(--ink-3); font-size: 14px; margin: 0 0 18px; }
.bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(200px, auto); gap: 14px; }
.bento .card:first-child { grid-column: span 2; grid-row: span 2; background: radial-gradient(80% 60% at 30% 0%, rgb(91 99 255 / 0.3), transparent), linear-gradient(180deg, var(--panel), rgb(150 160 230 / 0.025)); }
.bento .card:first-child .g-statement { font: 600 clamp(1.4rem, 2.2vw, 2rem)/1.2 var(--display); letter-spacing: -0.03em; }
.g-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.g-statement { font-size: 18px; font-weight: 600; line-height: 1.35; margin: 14px 0 auto; color: var(--ink); }
.g-foot { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-top: 20px; font-size: 13px; color: var(--ink-3); }
.prereq { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 8px; }
.prereq li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: rgb(3 3 8 / 0.35); box-shadow: 0 0 0 1px var(--line) inset; font-size: 13px; color: var(--ink-3); }
.prereq code { color: var(--ice); font-size: 12.5px; overflow-wrap: anywhere; }
.prereq i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.prereq i.holding { background: var(--holds); box-shadow: 0 0 8px var(--holds); } .prereq i.violated { background: var(--broken); box-shadow: 0 0 8px var(--broken); } .prereq i.unknown, .prereq i.unverified { background: var(--unknown); box-shadow: 0 0 8px var(--unknown); }
.dots { display: flex; gap: 5px; flex-wrap: wrap; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); }
.dots i.holding { background: var(--holds); box-shadow: 0 0 8px var(--holds); }
.dots i.violated { background: var(--broken); box-shadow: 0 0 8px var(--broken); }
.dots i.unknown, .dots i.unverified, .dots i.unevaluable { background: var(--unknown); box-shadow: 0 0 8px var(--unknown); }

.board { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 22px; align-items: start; margin-bottom: clamp(56px, 7vw, 100px); }
.board section { margin: 0; }
.analyst { position: sticky; top: 90px; padding: 26px; overflow: hidden; }
.analyst::before { content: ''; position: absolute; inset: -40% -20% auto auto; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgb(91 99 255 / 0.45), transparent 70%); filter: blur(10px); pointer-events: none; }
.analyst > * { position: relative; }
.analyst > p { color: var(--ink-2); }
label { display: block; font-size: 14px; font-weight: 700; margin: 20px 0 8px; }
textarea, input { width: 100%; padding: 13px 15px; border: 0; border-radius: 14px; background: rgb(3 3 8 / 0.6); box-shadow: 0 0 0 1px var(--line-2) inset; color: var(--ink); font: 15px/1.5 var(--ui); caret-color: var(--indigo-2); transition: box-shadow .2s ease, background-color .2s ease; }
textarea { resize: vertical; min-height: 110px; }
textarea::placeholder, input::placeholder { color: var(--ink-3); }
textarea:focus, input:focus { outline: none; box-shadow: 0 0 0 1px var(--indigo-2) inset, 0 0 0 4px rgb(91 99 255 / 0.22); }
form button { width: 100%; margin-top: 12px; }
.mode { margin: 14px 0 0; font-size: 13px; color: var(--ink-3); }
#answer { overflow-wrap: anywhere; }
#answer:not(:empty) { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
#answer h3 { margin: 0 0 10px; font: 700 1.05rem/1.2 var(--display); text-transform: capitalize; letter-spacing: -0.02em; }
#answer p { font-size: 15px; color: var(--ink-2); white-space: pre-wrap; }
#answer details { padding: 8px 0; border-bottom: 1px solid var(--line); }
#answer summary { font: 500 13px var(--mono); }
#answer pre { max-height: 340px; overflow: auto; padding: 12px; border-radius: 12px; background: rgb(3 3 8 / 0.6); font-size: 12px; }
#answer ul { padding-left: 18px; font-size: 13px; }
#answer .reveal-word { opacity: 0; animation: word .32s var(--ease) forwards; }
#answer.thinking::before { content: ''; display: block; height: 2px; margin-top: 20px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--indigo-2), transparent); animation: scan 1.1s var(--ease-io) infinite; }

.lower-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 22px; }
.lower-grid section { margin-bottom: clamp(40px, 5vw, 72px); }
.gap-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.gap { display: flex; gap: 14px; align-items: flex-start; padding: 18px; text-decoration: none; color: inherit; transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.gap:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--line-2) inset, 0 24px 50px -28px rgb(91 99 255 / 0.8); }
.gap > .i { color: var(--unknown); margin-top: 3px; }
.gap-body span { display: block; color: var(--ink-2); font-size: 15px; margin-top: 2px; }
.empty { display: flex; gap: 14px; padding: 24px; color: var(--ink-2); }
.empty .i { width: 22px; height: 22px; color: var(--ink-3); }
.empty p { margin: 0; }
details { padding: 14px 0; }
summary { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 700; font-size: 14.5px; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; margin-left: auto; font: 400 18px/1 var(--ui); color: var(--ink-3); transition: transform .24s var(--ease); }
details[open] > summary::after { transform: rotate(45deg); }
.warnings { padding: 14px 20px; margin-bottom: 40px; color: var(--ink-2); }
.warnings ul { margin: 12px 0 0; font-size: 15px; }

/* Inner pages */
.back { display: inline-flex; align-items: center; gap: 8px; margin: 18px 0 10px; color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 600; }
.back:hover { color: var(--ink); } .back .i { transition: transform .2s var(--ease); } .back:hover .i { transform: translateX(-4px); }
.page-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 28px; padding: clamp(28px, 5vw, 64px) clamp(22px, 3vw, 44px); margin: 10px 0 clamp(32px, 4vw, 56px); }
.page-head h1 { max-width: 16ch; }
.page-head .statement { max-width: 52ch; margin-bottom: 18px; }
.page-head .orb { position: absolute; z-index: -1; right: -6%; top: -30%; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgb(91 99 255 / 0.45), transparent 66%); filter: blur(8px); animation: drift 14s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translate(0, 0); } to { transform: translate(-60px, 40px); } }
.entity-id { font: 600 clamp(2rem, 4.4vw, 3.8rem)/1 var(--mono) !important; letter-spacing: -0.04em !important; overflow-wrap: anywhere; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--ink-2); margin: 0; overflow-wrap: anywhere; }
.meta span, .meta a { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; background: var(--panel); box-shadow: 0 0 0 1px var(--line) inset; text-decoration: none; }
.meta .i { color: var(--ink-3); }
.note { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: rgb(255 210 122 / 0.1); color: var(--unknown); font-weight: 700; font-size: 14px; margin: 0; box-shadow: 0 0 0 1px rgb(255 210 122 / 0.25) inset; }
.verdict { display: grid; justify-items: end; gap: 10px; }
.verdict-label { font-size: 13px; font-weight: 700; color: var(--ink-3); letter-spacing: 0.06em; text-transform: uppercase; }
.verdict .badge.large { font: 800 clamp(1rem, 1.6vw, 1.35rem)/1.2 var(--display); letter-spacing: -0.01em; padding: 13px 20px 13px 15px; }
.verdict .badge.large .i { width: 22px; height: 22px; }

.reason-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.reason-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: baseline; padding: 14px 18px; border-radius: 16px; }
.reason-list code { color: var(--unknown); font-size: 13px; }
.reason-list.compact li { grid-template-columns: minmax(0, 1fr); padding: 10px 14px; font-size: 15px; color: var(--ink-2); }

.graph-panel { margin: 0 0 16px; padding: clamp(16px, 2.4vw, 30px); overflow: auto; }
.graph-panel figcaption { margin-top: 16px; }
.graph-panel pre.mermaid { overflow-x: auto; }
.mermaid { margin: 0 auto; text-align: center; background: transparent; font-family: var(--ui); }
.mermaid svg, #whatif-graph svg { max-width: none !important; height: auto; margin: 0 auto; display: block; }
.mermaid.scrolls { mask-image: linear-gradient(to right, #000 80%, transparent); -webkit-mask-image: linear-gradient(to right, #000 80%, transparent); }
.graph-panel svg .flowchart-link { stroke-dasharray: 6 6; animation: fire 1.6s linear infinite; }
.graph-panel svg .edgeLabel, .graph-panel svg .edgeLabel p { background: transparent !important; color: var(--ink-3) !important; }
#whatif-graph:empty { display: none; }

.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.evidence-line { display: flex; gap: 14px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line); }
.evidence-line p { margin: 0; color: var(--ink-2); } .evidence-line a { color: var(--ink); }
.review { padding: 12px 18px; margin-bottom: 8px; border-radius: 16px; }
.review summary > span { flex: 1; }
.review p, .review ul { color: var(--ink-2); font-size: 14px; margin: 10px 0 0; }

.fixes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 14px; }
.fix { position: relative; padding: 22px; overflow: hidden; }
.fix.verified { box-shadow: 0 0 0 1px rgb(124 240 200 / 0.4) inset, 0 24px 50px -30px rgb(124 240 200 / 0.4); }
.fix.rejected { box-shadow: 0 0 0 1px rgb(255 107 139 / 0.35) inset; }
.fix.partial { box-shadow: 0 0 0 1px rgb(255 210 122 / 0.35) inset; }
.fix dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; margin: 18px 0 14px; font-size: 14px; }
.fix dt { font-family: var(--mono); font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.fix dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.fix p { font-size: 15px; color: var(--ink-2); margin: 0; }
.fix pre { margin: 0 0 16px; padding: 14px; border-radius: 12px; background: rgb(3 3 8 / 0.6); font-size: 13px; color: var(--ink); overflow-x: auto; }
.fix button { width: 100%; }
.attest { margin: 0; } .attest small .i { margin-right: 4px; }

.lexical-pair { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.lexical-pair > div { padding: clamp(20px, 2.4vw, 30px); }
.lexical-pair > div:first-child { color: var(--ink-2); }
.lexical-pair > .graph-side { box-shadow: 0 0 0 1px rgb(124 240 200 / 0.35) inset, 0 30px 60px -30px rgb(124 240 200 / 0.35); }
.lexical-head { display: flex; align-items: center; gap: 8px; font: 700 1rem var(--display); color: var(--ink); letter-spacing: -0.02em; }
.lexical strong { color: var(--holds); }
.sources { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 15px; }
.sources li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; overflow-wrap: break-word; color: var(--ink-2); }
.sources .i { color: var(--ink-3); }
.paths { list-style: none; padding: 0; margin: 0; }
.paths li { padding: 16px 0; border-bottom: 1px solid var(--line); }
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 10px 0 0; }
.chain a { padding: 5px 11px; border-radius: 999px; background: var(--panel); box-shadow: 0 0 0 1px var(--line) inset; text-decoration: none; transition: box-shadow .25s var(--ease), transform .2s var(--ease); }
.chain a:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--indigo-2) inset, 0 10px 26px -10px rgb(91 99 255 / 0.9); }
.arrow { color: var(--indigo-2); transition: color .25s; } .paths li:hover .arrow { color: var(--ice); }
section > pre { padding: 16px 18px; border-radius: 16px; background: linear-gradient(180deg, var(--panel), rgb(150 160 230 / 0.025)); box-shadow: 0 0 0 1px var(--line) inset; }
.people, .history { list-style: none; padding: 0; margin: 0; }
.people li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); }
.people .num { font: 700 1.6rem var(--display); }
.people small { grid-column: 1 / -1; margin: 0; }
.history li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.history a { display: inline-flex; gap: 8px; align-items: center; text-decoration: none; font-weight: 700; }
.raw { margin-bottom: clamp(48px, 6vw, 80px); }
.json { max-height: 560px; overflow: auto; padding: 20px; margin: 14px 0 0; font-size: 12.5px; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.plate-note { margin: 18px 0 0; font-size: 14px; color: var(--ink-3); }

/* What-if workbench */
.workbench { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 22px; align-items: start; margin-bottom: clamp(56px, 7vw, 96px); }
.workbench section { margin-bottom: 40px; }
.facts td { padding: 12px 10px; } .facts th { padding: 12px 10px; }
.facts td:first-child, .facts th:first-child { padding-left: 18px; }
.fact-input { width: 8.5em; min-width: 0; max-width: 100%; padding: 9px 11px; font: 14px var(--mono); border-radius: 10px; }
.fact-input:not(:placeholder-shown) { box-shadow: 0 0 0 1px var(--unknown) inset, 0 0 18px -6px var(--unknown); color: var(--unknown); }
.impact { position: sticky; top: 90px; padding: clamp(20px, 2.4vw, 30px); min-width: 0; overflow-wrap: anywhere; margin: 0 !important; }
.impact-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.impact-head h2 { margin: 0; }
#check-verdict { font-size: 14px; padding: 7px 14px 7px 11px; transition: background-color .24s, color .24s; }
.advice { color: var(--ink); font-size: 15.5px; } .advice:empty { display: none; }
.impact .graph-panel, .impact .table-wrap, .impact .fix { background: transparent; box-shadow: none; }
.impact .graph-panel { padding: 0; margin: 20px 0; }
.impact #whatif-graph svg { max-width: 100% !important; }
.impact .fix { padding: 18px 0 0; }
.impact .id code { overflow-wrap: normal; word-break: normal; white-space: nowrap; }
.impact .chain-line { display: block; margin-top: 6px; font-size: 12.5px; color: var(--ink-3); overflow-wrap: break-word; }
.decisions p { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: 15px; }
.decisions p:empty { display: none; }
.impact.updating > :not(.impact-head) { opacity: .45; filter: blur(1px); }
.impact > * { transition: opacity .24s ease, filter .24s ease; }

/* Error */
.dark-room { position: relative; display: grid; min-height: 70vh; align-items: center; padding: clamp(28px, 5vw, 64px); }
.dark-copy { position: relative; z-index: 2; max-width: 640px; }
.dark-copy h1 { margin: 22px 0; }
.command { padding: 18px 20px; font-size: 14px; color: var(--ink); }

/* v2 review surface (shares this sheet) */
.heading { display: flex; align-items: end; justify-content: space-between; gap: 28px; padding: clamp(28px, 5vw, 56px) clamp(22px, 3vw, 40px); margin: 10px 0 clamp(28px, 4vw, 48px); border-radius: var(--r-frame); background: radial-gradient(60% 90% at 90% 0%, rgb(91 99 255 / 0.32), transparent 70%), var(--frame); box-shadow: 0 0 0 1px var(--line) inset; }
.heading h1 { margin-bottom: 12px; }
.revision { margin: 0; padding: 8px 14px; border-radius: 999px; background: var(--panel); box-shadow: 0 0 0 1px var(--line) inset; font-weight: 700; font-size: 14px; white-space: nowrap; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-heading span { color: var(--ink-3); font-size: 14px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.split > div { min-width: 0; }
blockquote { margin: 12px 0 8px; padding: 18px 22px; max-width: 72ch; overflow-wrap: anywhere; color: var(--ink); }
.reason-panel { padding: 20px; }
.table-wrap:focus-visible { outline: 2px solid var(--indigo-2); outline-offset: 3px; }

/* Close */
body > footer, footer.close { position: relative; overflow: hidden; max-width: var(--max); margin: 0 auto; padding: clamp(40px, 6vw, 80px) var(--gutter) 28px; color: var(--ink-3); font-size: 14px; display: block; }
.close-word { margin: 0 0 22px -0.05em; max-width: none; font: 800 clamp(4rem, 17vw, 16rem)/0.8 var(--display); letter-spacing: -0.06em; color: transparent; -webkit-text-stroke: 1px rgb(200 210 255 / 0.28); user-select: none; }
.close-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 40px; }
.close-row p, body > footer > span { margin: 0; }
body > footer > span { display: block; margin-bottom: 6px; }
.close-power { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); }
.credits { margin: 22px 0 0; font-size: 13px; color: var(--ink-3); max-width: 90ch; }
.credits a { color: var(--ink-2); }

/* Motion */
@keyframes fire { to { stroke-dashoffset: -24; } }
@keyframes ripple { 0% { opacity: .8; transform: scale(1); } 100% { opacity: 0; transform: scale(2.6); } }
@keyframes settle { from { opacity: 0; transform: translateY(6px); filter: blur(3px); } }
@keyframes scan { 0% { transform: scaleX(0); } 50% { transform: scaleX(1); } 100% { transform: scaleX(0); transform-origin: right; } }
@keyframes rise { from { opacity: 0; transform: translateY(26px); filter: blur(6px); } }
@keyframes word { from { opacity: 0; filter: blur(4px); } to { opacity: 1; filter: none; } }
.js .rise { animation: rise .9s var(--ease) both; }
.js .rise:nth-child(2) { animation-delay: 90ms; } .js .rise:nth-child(3) { animation-delay: 180ms; } .js .rise:nth-child(4) { animation-delay: 270ms; } .js .rise:nth-child(5) { animation-delay: 360ms; }
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }
::view-transition-old(root) { animation: .22s ease both fadeout; }
::view-transition-new(root) { animation: .32s var(--ease) both fadein; }
@keyframes fadeout { to { opacity: 0; } } @keyframes fadein { from { opacity: 0; transform: translateY(8px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; }
  .js .reveal { opacity: 1; transform: none; }
  .neuro .edge.fired, .graph-panel svg .flowchart-link { animation: none; stroke-dasharray: none; }
  .card:hover, .gap:hover { transform: none; }
}

/* Responsive */
@media (max-width: 1100px) {
  .hero { min-height: 0; display: flex; flex-direction: column; }
  .brain-stage { position: relative; inset: auto; height: 460px; margin-top: -40px; }
  .hero-copy { position: relative; left: auto; bottom: auto; width: auto; padding: 0 22px 24px; }
  .hud { position: relative; right: auto; bottom: auto; width: auto; margin: 0 22px 22px; }
  .board, .workbench, .network, .lower-grid, .split { grid-template-columns: minmax(0, 1fr); }
  .analyst, .impact { position: relative; top: 0; }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace { display: none; }
}
@media (max-width: 760px) {
  header.bar, body > header { flex-wrap: wrap; border-radius: 22px; top: 8px; margin: 8px 8px 0; }
  header nav { order: 3; width: 100%; overflow-x: auto; }
  header nav a { padding: 8px 10px; font-size: 13.5px; white-space: nowrap; }
  header nav a[href^='https'] span { display: none; }
  .bento { grid-template-columns: minmax(0, 1fr); }
  .bento .card:first-child { grid-column: auto; grid-row: auto; }
  .page-head, .heading { grid-template-columns: minmax(0, 1fr); display: grid; align-items: start; }
  .verdict { justify-items: start; }
  .pair, .lexical-pair { grid-template-columns: minmax(0, 1fr); }
  .reason-list li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .table-wrap table thead { display: none; }
  .table-wrap tbody tr { display: grid; grid-template-columns: repeat(2, auto); justify-content: start; gap: 10px 28px; padding: 16px; border-bottom: 1px solid var(--line); }
  .table-wrap tbody tr:last-child { border-bottom: 0; }
  .table-wrap td { padding: 0; border: 0; min-width: 0; overflow-wrap: break-word; }
  .table-wrap td:first-child, table.facts td:last-child, .table-wrap td.wide { grid-column: 1 / -1; }
  table.facts tbody tr { grid-template-columns: repeat(3, auto); }
  .fact-input { width: 100%; }
  td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 4px; font-size: 12.5px; color: var(--ink-3); }
  .chip { width: 100%; }
  .brain-stage { height: 360px; margin-top: -20px; }
  .specimen-stage { aspect-ratio: 4 / 5; }
}

/* Public deployment mode: shared by every rendered application page. */
.public-demo-banner{padding:8px 16px;text-align:center;font-size:12px;background:#17212b;color:#f5f5fa;border-bottom:1px solid #46546a}.public-demo-banner a{color:#7cf0c8;text-decoration:underline}
