:root {
  --ink: #e9f7f1;
  --muted: #7d948c;
  --faint: #40534d;
  --bg: #07100e;
  --panel: #0b1714;
  --panel-2: #0e1d19;
  --line: rgba(142, 183, 168, .18);
  --green: #66f7b1;
  --green-dim: #2e8e65;
  --amber: #ffc66d;
  --red: #ff6978;
  --cyan: #59d7e9;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); }
body { margin: 0; min-width: 320px; min-height: 100vh; font-family: var(--sans); background: radial-gradient(circle at 70% 10%, rgba(36, 100, 76, .12), transparent 35%), var(--bg); }
button, select, input { font: inherit; }
button, select, label { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
[hidden] { display: none !important; }

.noise { position: fixed; inset: 0; pointer-events: none; opacity: .035; z-index: 20; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.65'/%3E%3C/svg%3E"); }
.shell { width: min(1480px, calc(100% - 44px)); margin-inline: auto; }
.topbar { height: 82px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: baseline; gap: 18px; color: inherit; text-decoration: none; }
.brand-mark { font: 800 22px/1 var(--mono); letter-spacing: -.07em; }
.brand-mark span { color: var(--green); font-weight: 400; }
.brand-copy { color: var(--muted); font: 600 10px/1 var(--mono); letter-spacing: .19em; }
.top-actions { display: flex; align-items: center; gap: 22px; }
.text-button { appearance: none; background: none; border: 0; padding: 8px 0; color: var(--muted); cursor: pointer; font: 600 9px/1 var(--mono); letter-spacing: .12em; }
.text-button:hover { color: var(--green); }
.version { color: var(--faint); font: 600 10px/1 var(--mono); }

.status-strip { min-height: 74px; display: grid; grid-template-columns: repeat(6, 1fr); align-items: stretch; border-bottom: 1px solid var(--line); }
.status-strip > div { display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 0 20px; border-left: 1px solid var(--line); }
.status-strip > div:last-child { border-right: 1px solid var(--line); }
.status-strip span, .panel header > span { color: var(--muted); font: 600 8px/1 var(--mono); letter-spacing: .17em; }
.status-strip strong { font: 650 10px/1 var(--mono); letter-spacing: .06em; color: var(--muted); }
[data-state="ready"] { color: var(--green) !important; }
[data-state="warning"] { color: var(--amber) !important; }
[data-state="error"] { color: var(--red) !important; }
.graph-control label { position: relative; }
.graph-control select, .transport select { appearance: none; color: var(--green); background: transparent; border: 0; outline: 0; padding: 0 18px 0 0; cursor: pointer; font: 650 10px/1 var(--mono); letter-spacing: .06em; }
.graph-control label::after { content: "⌄"; color: var(--green); position: absolute; right: 0; top: -3px; pointer-events: none; }

.hero { min-height: 645px; display: grid; grid-template-columns: 1.05fr .95fr; grid-template-rows: 1fr auto; align-items: center; gap: 36px 72px; padding: 90px 5vw 40px; border-inline: 1px solid var(--line); position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, transparent 49.95%, var(--line) 50%, transparent 50.05%), linear-gradient(rgba(102,247,177,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(102,247,177,.025) 1px, transparent 1px); background-size: 100% 100%, 38px 38px, 38px 38px; mask-image: linear-gradient(to bottom, #000, transparent 92%); }
.hero > * { position: relative; z-index: 1; }
.eyebrow { color: var(--green); font: 650 9px/1 var(--mono); letter-spacing: .2em; }
.hero h1 { margin: 22px 0 26px; max-width: 650px; font-size: clamp(45px, 5.2vw, 84px); line-height: .95; letter-spacing: -.065em; font-weight: 660; }
.hero h1 em { color: var(--green); font-style: normal; font-family: var(--mono); font-weight: 500; }
.hero-copy p { max-width: 580px; margin: 0; color: #9aafa8; font-size: 15px; line-height: 1.75; }
.source-entry { display: grid; gap: 12px; align-self: center; }
.drop-zone { height: 225px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed rgba(102,247,177,.38); background: rgba(10,25,20,.72); cursor: pointer; transition: .25s ease; position: relative; }
.drop-zone::before, .drop-zone::after { content: ""; position: absolute; width: 18px; height: 18px; border-color: var(--green); opacity: .7; }
.drop-zone::before { left: -1px; top: -1px; border-left: 1px solid; border-top: 1px solid; }
.drop-zone::after { right: -1px; bottom: -1px; border-right: 1px solid; border-bottom: 1px solid; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--green); background: rgba(26,60,47,.46); transform: translateY(-2px); }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-zone strong { margin-top: 25px; font: 700 13px/1 var(--mono); letter-spacing: .18em; }
.drop-zone > span:not(.drop-orbit) { margin-top: 11px; color: var(--muted); font-size: 11px; }
.drop-zone u { color: var(--green); text-decoration: none; }
.drop-zone small { position: absolute; bottom: 23px; color: var(--faint); font: 600 8px/1 var(--mono); letter-spacing: .13em; }
.paste-panel { display: grid; grid-template-columns: 1fr auto; border: 1px solid var(--line); background: rgba(7,16,14,.88); }
.paste-panel label { grid-column: 1 / -1; padding: 11px 13px 0; color: var(--green); font: 650 8px/1 var(--mono); letter-spacing: .14em; }
.paste-panel textarea { grid-column: 1 / -1; width: 100%; min-height: 95px; resize: vertical; padding: 11px 13px; color: var(--ink); background: transparent; border: 0; outline: 0; font: 11px/1.55 var(--mono); }
.paste-panel textarea::placeholder { color: var(--faint); }
.paste-panel button { grid-column: 2; margin: 0 8px 8px; padding: 9px 13px; color: #04100b; background: var(--green); border: 1px solid var(--green); cursor: pointer; font: 650 8px/1 var(--mono); letter-spacing: .09em; }
.drop-orbit { width: 84px; height: 84px; position: relative; display: grid; place-items: center; border: 1px solid rgba(102,247,177,.16); border-radius: 50%; }
.drop-orbit::before, .drop-orbit::after { content: ""; position: absolute; inset: 14px; border: 1px solid rgba(102,247,177,.24); border-radius: 50%; }
.drop-orbit::after { inset: 29px; background: rgba(102,247,177,.07); }
.drop-orbit i { position: absolute; inset: 0; border-top: 1px solid var(--green); border-radius: 50%; animation: orbit 5s linear infinite; }
.drop-orbit i:nth-child(2) { inset: 14px; animation-duration: 3s; animation-direction: reverse; }
.drop-orbit i:nth-child(3) { inset: 29px; animation-duration: 2s; }
.drop-orbit b { z-index: 1; color: var(--green); font: 300 30px/1 var(--mono); }
@keyframes orbit { to { rotate: 360deg; } }
.privacy-banner { grid-column: 1 / -1; display: flex; align-items: center; gap: 15px; padding-top: 28px; border-top: 1px solid var(--line); }
.privacy-icon { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--green-dim); border-radius: 50%; color: var(--green); font-size: 9px; }
.privacy-banner div { display: flex; flex-direction: column; gap: 5px; }
.privacy-banner strong { color: var(--green); font: 650 9px/1 var(--mono); letter-spacing: .16em; }
.privacy-banner div span { color: var(--muted); font-size: 10px; }

.loading-panel { min-height: 560px; padding: 72px 8vw; border: 1px solid var(--line); border-top: 0; }
.loading-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 70px; }
.loading-head h2 { margin: 14px 0 0; font-size: clamp(30px, 4vw, 55px); letter-spacing: -.045em; }
.spinner { width: 42px; height: 42px; border: 1px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: orbit 1s linear infinite; }
.progress-list { display: grid; gap: 24px; }
.progress-row { display: grid; grid-template-columns: 150px 1fr 70px; align-items: center; gap: 24px; color: var(--muted); font: 600 9px/1 var(--mono); letter-spacing: .13em; }
.progress-row > div { height: 3px; background: #182520; overflow: hidden; }
.progress-row i { display: block; width: 0; height: 100%; background: var(--green); box-shadow: 0 0 12px rgba(102,247,177,.6); transition: width .2s; }
.progress-row b { color: var(--green); text-align: right; }
#loading-message { margin: 50px 0 0 174px; color: var(--muted); font: 10px/1.6 var(--mono); }

.analysis { padding-top: 20px; }
.verdict-banner { position: sticky; top: 0; z-index: 12; display: grid; grid-template-columns: 165px minmax(0, 1fr) auto; align-items: center; gap: 18px; min-height: 104px; margin: 0 0 34px; padding: 18px 25px; border: 1px solid rgba(255,198,109,.48); border-left: 6px solid var(--amber); background: radial-gradient(circle at 75% 35%, rgba(255,198,109,.11), transparent 45%), #101b17; box-shadow: 0 15px 28px rgba(0,0,0,.38); }
.verdict-banner span { color: var(--muted); font: 700 10px/1.4 var(--mono); letter-spacing: .14em; }
.verdict-banner strong { color: var(--amber); font: 800 clamp(26px, 3vw, 45px)/1.05 var(--mono); letter-spacing: -.06em; overflow-wrap: anywhere; }
.verdict-banner small { max-width: 240px; color: var(--amber); text-align: right; font: 700 11px/1.45 var(--mono); letter-spacing: .04em; }
.verdict-banner[data-state="ready"] { border-color: rgba(102,247,177,.5); border-left-color: var(--green); background: radial-gradient(circle at 75% 35%, rgba(102,247,177,.13), transparent 45%), #101b17; }
.verdict-banner[data-state="ready"] strong, .verdict-banner[data-state="ready"] small { color: var(--green); }
.verdict-banner[data-state="error"] { border-color: rgba(255,105,120,.65); border-left-color: var(--red); background: radial-gradient(circle at 75% 35%, rgba(255,105,120,.17), transparent 45%), #1a1416; }
.verdict-banner[data-state="error"] strong, .verdict-banner[data-state="error"] small { color: var(--red); }
.analysis-head { display: flex; justify-content: space-between; align-items: end; padding: 0 4px 24px; }
.analysis-head h2 { margin: 9px 0 0; font: 600 clamp(20px, 3vw, 34px)/1 var(--mono); letter-spacing: -.04em; word-break: break-all; }
.analysis-actions { display: flex; align-items: center; gap: 18px; color: var(--muted); font: 9px/1 var(--mono); }
.outline-button { border: 1px solid var(--line); background: transparent; padding: 11px 16px; cursor: pointer; font: 650 9px/1 var(--mono); letter-spacing: .1em; }
.outline-button:hover { border-color: var(--green); color: var(--green); }
.workbench { display: grid; grid-template-columns: 1fr 1fr; }
.panel { min-width: 0; border: 1px solid var(--line); background: rgba(9,20,17,.86); }
.panel + .panel { border-left: 0; }
.panel header { height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid var(--line); }
.panel header > div { display: flex; align-items: center; gap: 13px; }
.panel header strong { font: 650 9px/1 var(--mono); letter-spacing: .15em; }
.panel-index { color: var(--green); font: 500 9px/1 var(--mono); }
.source-view { height: 460px; overflow: auto; padding: 16px 0 36px; background: #07100e; font: 12px/1.75 var(--mono); outline: none; counter-reset: line; }
.source-line { display: grid; grid-template-columns: 58px 1fr; min-height: 21px; white-space: pre; }
.source-line::before { counter-increment: line; content: counter(line); padding-right: 15px; color: #354a42; text-align: right; user-select: none; }
.source-line code { display: block; min-width: max-content; padding-right: 24px; }
.source-line.current { background: rgba(102,247,177,.055); box-shadow: inset 2px 0 var(--green); }
.source-line.current::before { color: var(--green); }
.source-line .current-token { background: rgba(102,247,177,.17); color: #effff7; border-bottom: 1px solid var(--green); }
.syn-comment { color: #49675d; font-style: italic; }
.syn-string { color: #dfbd77; }
.syn-number { color: #d988b9; }
.syn-variable { color: #70c8e8; }
.syn-keyword { color: #c69eff; }
.syn-name { color: #84d8a8; }
.syn-tag { color: #68bea6; }
.syn-error { text-decoration: wavy underline var(--red); }
.neural-stage { height: 460px; position: relative; overflow: hidden; background: radial-gradient(circle at 50% 45%, rgba(30,88,67,.22), transparent 53%), #07100e; }
.neural-stage::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(102,247,177,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(102,247,177,.035) 1px, transparent 1px); background-size: 32px 32px; }
#neural-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.neural-legend { position: absolute; bottom: 20px; left: 20px; display: flex; gap: 16px; color: var(--muted); font: 600 8px/1 var(--mono); letter-spacing: .1em; }
.dot { display: inline-block; width: 5px; height: 5px; margin-right: 6px; border-radius: 50%; }
.dot.input { background: var(--amber); box-shadow: 0 0 7px var(--amber); }
.dot.active { background: var(--green); box-shadow: 0 0 7px var(--green); }
.dot.quiet { background: #2a4b40; }
.neural-readout { position: absolute; top: 17px; right: 17px; display: grid; gap: 1px; }
.neural-readout > div { width: 118px; padding: 10px 12px; display: flex; justify-content: space-between; background: rgba(6,15,12,.82); border: 1px solid var(--line); }
.neural-readout span { color: var(--muted); font: 600 7px/1 var(--mono); letter-spacing: .12em; }
.neural-readout b { color: var(--green); font: 600 10px/1 var(--mono); }
.neurochem-readout { position: absolute; right: 17px; bottom: 17px; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; width: 214px; }
.neurochem-readout > div { min-width: 0; padding: 7px 9px; display: flex; justify-content: space-between; background: rgba(6,15,12,.84); border: 1px solid var(--line); }
.neurochem-readout span { color: var(--muted); font: 600 6px/1 var(--mono); letter-spacing: .1em; }
.neurochem-readout b { color: var(--ink); font: 600 8px/1 var(--mono); }
.neurochem-readout .dopamine { border-color: rgba(255,198,109,.34); }
.neurochem-readout .dopamine span, .neurochem-readout .dopamine b { color: var(--amber); }
.fly-panel { margin-top: 22px; }
.fly-specimen { height: 430px; position: relative; overflow: hidden; background: #0b1714; }
.fly-specimen canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.fly-specimen canvas:active { cursor: grabbing; }
.fly-loading { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--muted); font: 650 10px/1.5 var(--mono); letter-spacing: .12em; pointer-events: none; text-align: center; }
.fly-panel[data-loading="ready"] .fly-loading { display: none; }
.fly-status { position: absolute; z-index: 4; left: 20px; top: 18px; display: flex; align-items: center; gap: 10px; font: 650 9px/1 var(--mono); letter-spacing: .1em; pointer-events: none; }
.fly-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.fly-status strong { color: var(--green); }
.fly-status span { padding-left: 10px; border-left: 1px solid var(--line); color: var(--muted); }
.fly-camera { position: absolute; top: 14px; right: 16px; display: flex; gap: 5px; }
.fly-camera button { border: 1px solid var(--line); background: rgba(6,15,12,.86); padding: 8px 12px; font: 650 8px/1 var(--mono); cursor: pointer; }
.fly-camera button[aria-pressed="true"], .fly-camera button:hover { color: var(--green); border-color: var(--green-dim); }
.fly-specimen-meta { position: absolute; left: 16px; right: 16px; bottom: 14px; display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font: 600 8px/1.5 var(--mono); letter-spacing: .09em; pointer-events: none; }
.fly-panel + .timeline-panel { border-left: 1px solid var(--line); }
.timeline-panel { margin-top: 22px; }
.timeline-panel #timeline { min-height: 254px; padding: 12px 14px 2px; overflow: hidden; }
.empty-timeline { min-height: 215px; display: grid; place-items: center; margin: 0; color: var(--faint); font: 600 9px/1 var(--mono); letter-spacing: .14em; }
.uplot { font-family: var(--mono) !important; }
.u-legend { color: var(--muted); font-size: 9px !important; }
.u-label { font-size: 8px !important; }
.transport { min-height: 58px; display: flex; gap: 8px; align-items: center; padding: 9px 14px; border-top: 1px solid var(--line); }
.transport button { height: 34px; min-width: 42px; padding: 0 13px; border: 1px solid var(--line); background: #0c1a16; cursor: pointer; font: 650 9px/1 var(--mono); letter-spacing: .08em; }
.transport button:hover { border-color: var(--green); color: var(--green); }
.transport button:disabled { opacity: .4; cursor: not-allowed; }
.transport button:disabled:hover { border-color: var(--line); color: inherit; }
.transport #fast-replay:not(:disabled) { border-color: rgba(255,198,109,.55); color: var(--amber); }
.transport #play { min-width: 76px; background: var(--green); color: #04100b; border-color: var(--green); }
.transport label { margin-left: 10px; color: var(--muted); font: 600 8px/1 var(--mono); letter-spacing: .1em; }
.transport select { margin-left: 8px; }
.transport .wide { margin-left: auto; }
.transport .wide + .wide { margin-left: 0; }
#event-counter { min-width: 92px; color: var(--muted); text-align: right; font: 9px/1 var(--mono); }
.result-grid { display: grid; grid-template-columns: .8fr 1.2fr; margin-top: 22px; }
.result-panel { min-height: 330px; }
.untrained { height: calc(100% - 52px); padding: 35px; display: flex; flex-direction: column; justify-content: center; background: repeating-linear-gradient(-45deg, rgba(255,198,109,.02), rgba(255,198,109,.02) 8px, transparent 8px, transparent 16px); }
.untrained > span { color: var(--green); font: 650 9px/1 var(--mono); letter-spacing: .17em; }
.untrained strong { margin-top: 15px; color: var(--amber); font: 500 clamp(31px, 4vw, 54px)/.94 var(--mono); letter-spacing: -.07em; }
.untrained p { max-width: 510px; margin: 22px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.top-deltas { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 18px; color: var(--muted); font: 600 8px/1 var(--mono); letter-spacing: .08em; }
.top-deltas button { padding: 7px 9px; color: var(--green); background: transparent; border: 1px solid var(--line); cursor: pointer; font: 600 8px/1 var(--mono); }
.event-details { margin: 0; padding: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; }
.event-details div { min-width: 0; min-height: 56px; padding: 10px 13px; background: rgba(255,255,255,.018); }
.event-details dt { color: var(--muted); font: 600 7px/1 var(--mono); letter-spacing: .13em; }
.event-details dd { overflow: hidden; margin: 9px 0 0; color: var(--ink); font: 600 10px/1.25 var(--mono); text-overflow: ellipsis; white-space: nowrap; }
#event-risk { color: var(--amber); }
.method-strip { display: grid; grid-template-columns: repeat(4,1fr); margin-top: 70px; border: 1px solid var(--line); }
.method-strip div { min-height: 112px; display: flex; flex-direction: column; gap: 13px; justify-content: center; padding: 20px; border-right: 1px solid var(--line); }
.method-strip div:last-child { border-right: 0; }
.method-strip b { color: var(--green); font: 650 9px/1 var(--mono); letter-spacing: .15em; }
.method-strip span { color: var(--muted); font-size: 10px; line-height: 1.5; }
footer { min-height: 130px; display: flex; justify-content: space-between; gap: 40px; align-items: center; }
footer p { max-width: 800px; color: var(--faint); font-size: 10px; line-height: 1.7; }
footer a { color: var(--muted); font: 600 8px/1 var(--mono); letter-spacing: .12em; text-decoration: none; }
.toast { position: fixed; z-index: 50; right: 24px; bottom: 24px; max-width: 460px; padding: 16px 19px; border: 1px solid var(--green-dim); background: #0d1e18; box-shadow: 0 18px 70px rgba(0,0,0,.5); color: var(--ink); font: 10px/1.5 var(--mono); }
.toast.error { border-color: var(--red); }

/* Desktop workbench: the page stays within the viewport; source and result
   panes keep their own overflow for large files and long explanations. */
@media (min-width: 1100px) and (min-height: 700px) {
  body { height: 100dvh; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
  .topbar { flex: none; height: 50px; }
  main.shell { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .status-strip { flex: none; height: 48px; min-height: 48px; }
  .status-strip > div { gap: 4px; padding-inline: 12px; }
  .hero { flex: 1; min-height: 0; padding-block: 24px 12px; }
  .loading-panel { flex: 1; min-height: 0; padding-block: 36px; }
  .method-strip { display: none; }
  footer { flex: none; min-height: 34px; gap: 20px; }
  footer p { max-width: none; margin: 0; font-size: 9px; line-height: 1.2; }
  footer a { flex: none; }

  body.analysis-mode .analysis {
    flex: 1;
    min-height: 0;
    padding-top: 8px;
    display: grid;
    grid-template-columns: 1.1fr 1fr 1.1fr;
    grid-template-rows: 62px 42px minmax(0, 1.35fr) minmax(0, 1fr);
    grid-template-areas:
      "verdict verdict verdict"
      "head head head"
      "source neural fly"
      "timeline result event";
    gap: 8px;
  }
  .analysis .verdict-banner { grid-area: verdict; position: static; min-height: 0; margin: 0; padding: 8px 16px; gap: 12px; box-shadow: none; }
  .analysis .verdict-banner strong { font-size: clamp(20px, 2.3vw, 33px); }
  .analysis .analysis-head { grid-area: head; align-items: center; min-width: 0; padding: 0 3px; }
  .analysis-head > div:first-child { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
  .analysis-head h2 { max-width: min(42vw, 600px); margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 23px; }
  .analysis-actions .outline-button { padding: 8px 11px; }
  .analysis .workbench, .analysis .result-grid { display: contents; }
  .analysis .source-panel { grid-area: source; }
  .analysis .neural-panel { grid-area: neural; }
  .analysis .fly-panel { grid-area: fly; }
  .analysis .timeline-panel { grid-area: timeline; }
  .analysis .result-panel { grid-area: result; }
  .analysis .event-panel { grid-area: event; }
  .analysis .panel { min-height: 0; margin: 0; border: 1px solid var(--line); overflow: hidden; }
  .analysis .panel header { height: 38px; padding-inline: 10px; }
  .analysis .panel header strong { font-size: 8px; letter-spacing: .09em; }
  .analysis .panel header > span { font-size: 7px; letter-spacing: .07em; }
  .analysis .source-view, .analysis .neural-stage, .analysis .fly-specimen { height: calc(100% - 38px); }
  .analysis .source-view { padding-block: 7px 14px; font-size: 10px; line-height: 1.5; }
  .analysis .source-line { min-height: 16px; grid-template-columns: 42px 1fr; }
  .analysis .source-line::before { padding-right: 9px; }
  .analysis .neural-legend { bottom: 8px; left: 8px; gap: 7px; font-size: 6px; }
  .analysis .neural-readout { top: 8px; right: 8px; }
  .analysis .neural-readout > div { width: 84px; padding: 6px; }
  .analysis .neurochem-readout { right: 8px; bottom: 8px; width: 168px; }
  .analysis .neurochem-readout > div { padding: 5px; }
  .analysis .fly-status { top: 9px; left: 8px; gap: 5px; font-size: 7px; }
  .analysis .fly-camera { top: 6px; right: 7px; }
  .analysis .fly-camera button { padding: 6px; }
  .analysis .fly-specimen-meta { left: 8px; right: 8px; bottom: 7px; font-size: 6px; }
  .analysis .timeline-panel { display: flex; flex-direction: column; }
  .analysis .timeline-panel #timeline { flex: 1; min-height: 0; padding: 4px 6px 0; }
  .analysis .empty-timeline { min-height: 0; height: 100%; }
  .analysis .transport { flex: none; min-height: 40px; gap: 3px; padding: 3px 5px; }
  .analysis .transport button { height: 28px; min-width: 29px; padding-inline: 6px; font-size: 7px; }
  .analysis .transport #play { min-width: 48px; }
  .analysis .transport label { margin-left: 3px; font-size: 7px; }
  .analysis .transport select { margin-left: 3px; font-size: 8px; }
  .analysis #event-counter { min-width: 54px; font-size: 7px; }
  .analysis .result-panel { min-height: 0; }
  .analysis .untrained { height: calc(100% - 38px); padding: 12px; overflow: auto; }
  .analysis .untrained strong { margin-top: 5px; font-size: clamp(20px, 2.2vw, 31px); }
  .analysis .untrained p { margin-top: 7px; font-size: 9px; line-height: 1.35; }
  .analysis .top-deltas { margin-top: 7px; gap: 4px; }
  .analysis .top-deltas button { padding: 4px 5px; font-size: 7px; }
  .analysis .event-details { height: calc(100% - 38px); padding: 6px; overflow: auto; gap: 2px; }
  .analysis .event-details div { min-height: 38px; padding: 5px 7px; }
  .analysis .event-details dd { margin-top: 5px; font-size: 8px; }
}

@media (max-width: 980px) {
  .status-strip { grid-template-columns: repeat(3, 1fr); }
  .status-strip > div:nth-child(3) { border-right: 1px solid var(--line); }
  .status-strip > div { min-height: 60px; border-bottom: 1px solid var(--line); }
  .hero { grid-template-columns: 1fr; padding-top: 65px; }
  .hero::before { background: linear-gradient(rgba(102,247,177,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(102,247,177,.025) 1px, transparent 1px); background-size: 38px 38px; }
  .drop-zone { height: 225px; }
  .workbench, .result-grid { grid-template-columns: 1fr; }
  .panel + .panel { border-left: 1px solid var(--line); border-top: 0; }
  .result-grid .event-panel { border-top: 0; }
  .method-strip { grid-template-columns: 1fr 1fr; }
  .method-strip div:nth-child(2) { border-right: 0; }
  .method-strip div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 640px) {
  .shell { width: calc(100% - 22px); }
  .topbar { height: 66px; }
  .brand-copy, .text-button { display: none; }
  .status-strip { grid-template-columns: 1fr 1fr; }
  .status-strip > div:nth-child(3) { border-right: 0; }
  .status-strip > div:nth-child(even) { border-right: 1px solid var(--line); }
  .hero { padding: 55px 20px 25px; gap: 44px; }
  .loading-panel { padding: 50px 20px; }
  .progress-row { grid-template-columns: 98px 1fr 44px; gap: 10px; }
  #loading-message { margin-left: 0; }
  .analysis-head { align-items: flex-start; flex-direction: column; gap: 18px; }
  .analysis-actions { width: 100%; justify-content: space-between; }
  .analysis-actions { flex-wrap: wrap; }
  .verdict-banner { grid-template-columns: 1fr; gap: 7px; padding: 13px 18px; }
  .verdict-banner small { max-width: none; text-align: left; }
  .source-view, .neural-stage { height: 390px; }
  .transport { flex-wrap: wrap; }
  .transport .wide { margin-left: 0; }
  #event-counter { margin-left: auto; }
  .event-details { grid-template-columns: 1fr; }
  .fly-specimen { height: 330px; }
  .fly-specimen-meta { flex-wrap: wrap; }
  .method-strip { grid-template-columns: 1fr; }
  .method-strip div { border-right: 0; border-bottom: 1px solid var(--line); }
  footer { padding-block: 30px; flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
