:root {
  font: 16px/1.5 system-ui, sans-serif;
  color: #f0edf8;
  background: #171721;
  color-scheme: dark;
  --surface: #20202c;
  --well: #111119;
  --muted: #bbb8cd;
  --line: #424155;
  --accent: #c9bcff;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, h2, h3, p, figure, dl, dd { margin: 0; }
a { color: inherit; }
.shell { width: min(1190px, calc(100% - 64px)); margin-inline: auto; }
.skip { position: absolute; top: -80px; left: 15px; padding: 10px; background: var(--surface); z-index: 3; }
.skip:focus { top: 8px; }
.site-header { border-bottom: 1px solid var(--line); background: var(--well); }
.masthead, .result-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.masthead { min-height: 65px; }
.brand { display: inline-flex; gap: 9px; align-items: center; text-decoration: none; font-size: 1.22rem; letter-spacing: -.025em; font-weight: 720; }
nav { display: flex; gap: clamp(14px, 3vw, 36px); }
nav a { min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; font-size: .88rem; color: var(--muted); }
nav a:hover { color: var(--accent); text-decoration: underline; }
.launch-grid { display: grid; grid-template-columns: minmax(0, .94fr) minmax(0, 1fr); align-items: start; gap: clamp(28px, 5vw, 74px); padding-block: clamp(30px, 5vw, 62px); }
h1 { font-size: clamp(2.2rem, 4vw, 3.65rem); line-height: 1.04; letter-spacing: -.058em; font-weight: 720; max-width: 13ch; }
.intro p { margin-top: 15px; color: var(--muted); max-width: 47ch; }
.controls { margin-top: 26px; padding-top: 17px; border-top: 1px solid var(--line); }
h2 { font-size: 1.3rem; letter-spacing: -.025em; }
.controls p, #context, .review p, .pilot p, footer { color: var(--muted); font-size: .87rem; }
.controls h2 + p { max-width: 57ch; margin-top: 5px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-block: 13px; }
label { display: grid; gap: 5px; font-size: .81rem; font-weight: 650; color: var(--muted); }
.drop { position: relative; border: 1px dashed #716e8b; padding: 14px; min-height: 84px; background: var(--surface); border-radius: 6px; cursor: pointer; align-content: center; }
.drop strong { color: #f0edf8; font-size: .94rem; }
.drop span { overflow-wrap: anywhere; }
.drop input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; opacity: 0; cursor: pointer; }
.drop:focus-within, .drop.dragging { outline: 2px solid var(--accent); outline-offset: 2px; }
.drop:hover, .drop.dragging { background: #2a293c; }
input, select, textarea { min-width: 0; border: 1px solid #625f79; border-radius: 4px; padding: 8px; background: var(--well); color: #f0edf8; font: inherit; }
input:not([type="range"]), select { min-height: 44px; }
textarea { resize: vertical; }
button { min-height: 44px; border: 1px solid #625f79; border-radius: 5px; padding: 7px 12px; background: var(--surface); color: #f0edf8; font: 650 .82rem/1.3 system-ui; cursor: pointer; }
button.primary { background: var(--accent); color: #201739; border-color: var(--accent); }
button.quiet { background: transparent; border-color: transparent; color: var(--muted); }
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: .53; cursor: default; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
#status { margin-top: 8px; }
#status:empty { display: none; }
#status.error { color: #ffafb5; }
.sample { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.sample figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; align-items: center; padding: 11px 15px; font-size: .9rem; }
.sample figcaption span, .sample-images span, .sample > p { font-size: .8rem; color: var(--muted); }
.sample-images { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 10px 14px 14px; background: var(--well); border-block: 1px solid var(--line); }
.sample-images span { display: block; margin-bottom: 6px; }
.sample img { display: block; width: 100%; height: auto; }
.sample > p { padding: 10px 15px; }
.evidence { border-top: 1px solid var(--line); padding-block: 24px 32px; }
.result-head { align-items: end; }
.result-head > div { min-width: 0; }
#context { overflow-wrap: anywhere; margin-top: 4px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-block: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; }
.stats > div { padding: 10px 13px; }
.stats > div + div { border-left: 1px solid var(--line); }
dt, figcaption { font-size: .8rem; color: var(--muted); }
dd { font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.review-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 15px; align-items: start; }
.viewer, .review { min-width: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.viewer-tools { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 12px; padding: 10px 12px; }
.split-control { flex: 1 1 115px; padding-bottom: 2px; }
.split-control input { min-height: 40px; width: 100%; padding: 0; margin: 0; accent-color: var(--accent); }
.viewer:has(.views:not([data-mode="split"])) .split-control { display: none; }
.viewport { overflow: auto; max-height: 58svh; border-top: 1px solid var(--line); background: var(--well); }
.views {
  --split: 50%;
  --zoom: 1;
  --fit-width: calc((58svh - 32px) * var(--image-ratio, 1));
  position: relative;
  display: grid;
  width: calc(min(100%, var(--fit-width)) * var(--zoom));
  min-width: 0;
  margin-inline: auto;
}
.views figure { min-width: 0; background: var(--well); }
.views figcaption { padding: 6px 9px; font-weight: 650; }
canvas { display: block; width: 100%; height: auto; background: white; }
.views[data-mode="side"] { --fit-width: calc((58svh - 32px) * var(--image-ratio, 1) * 2 + 8px); grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.views[data-mode="split"] .before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--split)) 0 0); }
.views[data-mode="split"] .after figcaption { text-align: right; }
.views[data-mode="split"]::after { content: ""; position: absolute; top: 0; bottom: 0; left: var(--split); width: 2px; background: #7d58dc; pointer-events: none; }
.views:not([data-mode="overlay"]) .overlay, .views[data-mode="overlay"] :is(.before, .after) { display: none; }
.review { display: grid; gap: 13px; padding: 13px; }
.review h3 { font-size: 1rem; }
.pilot { display: grid; grid-template-columns: minmax(0, .94fr) minmax(0, 1fr); gap: 14px 44px; border-top: 1px solid var(--line); padding-block: 22px; }
.pilot p + p { margin-top: 8px; }
.pilot strong { color: var(--accent); }
footer { border-top: 1px solid var(--line); padding-block: 14px 28px; }
#review-summary, #print-notes, .print-brand { display: none; }
@media (max-width: 700px) {
  .shell { width: calc(100% - 32px); }
  .launch-grid, .review-grid, .pilot { grid-template-columns: 1fr; }
  .launch-grid { gap: 22px; }
  .result-head { align-items: start; }
  .stats > div { padding-inline: 8px; }
}
@page { size: A4; margin: 13mm; }
@media print {
  :root { color: #20192d; background: white; color-scheme: light; --muted: #534866; --line: #ded7e8; }
  .print-brand { display: block; color: #513677; margin-bottom: 9px; font-size: .9rem; font-weight: 700; }
  .site-header, .skip, footer, .launch-grid, .actions, .review, .viewer-tools, .pilot { display: none; }
  .shell { width: 100%; }
  .evidence, .viewer, .viewport { border: 0; padding: 0; margin: 0; background: white; }
  .review-grid { display: block; }
  .viewport { max-height: none; overflow: visible; }
  .stats, .views[data-mode] { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; break-inside: avoid; background: #f5f0fa; }
  .views[data-mode] { width: 100%; }
  .views[data-mode] :is(.before, .after, .overlay) { display: block !important; position: static; clip-path: none; background: #f5f0fa; }
  .views[data-mode] .after figcaption { text-align: left; }
  .views[data-mode]::after { display: none; }
  #review-summary, #print-notes { display: block; white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 8px; }
  .views canvas { max-height: 155mm; object-fit: contain; }
  figure, .stats { print-color-adjust: exact; }
}
.footer-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; }
.legal { padding-block: 34px 42px; }
.legal h1 { max-width: none; font-size: clamp(2rem, 5vw, 3rem); }
.legal h2 { margin-top: 20px; }
.legal p { max-width: 68ch; margin-top: 7px; color: var(--muted); }
