:root {
  color-scheme: light;
  --ink: #202329;
  --muted: #5e626b;
  --paper: #f5f4f0;
  --line: #e0dfd9;
  --primary: #213bce;
  --olive: #556236;
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
.masthead { display: flex; align-items: center; justify-content: space-between; min-height: 68px; padding: 0 max(24px, calc((100% - 1210px) / 2)); border-bottom: 1px solid var(--line); background: #fbfaf7; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; letter-spacing: -.025em; white-space: nowrap; }
.mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 7px; background: var(--primary); color: #fff; font-size: 17px; font-weight: 800; }
.privacy { display: flex; align-items: center; gap: 7px; color: #454d34; font-size: 13px; }
.privacy i { width: 7px; height: 7px; border-radius: 50%; background: #657643; }
main { width: min(1210px, calc(100% - 48px)); margin: 0 auto 54px; }
.intro { padding: 39px 0 27px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(35px, 5vw, 59px); line-height: 1.08; letter-spacing: -.055em; font-weight: 720; }
.intro p { margin-top: 14px; color: var(--muted); max-width: 48em; line-height: 1.6; }
.layout { display: grid; grid-template-columns: minmax(0, 1.54fr) minmax(310px, 1fr); gap: 18px; align-items: start; }
.side { display: grid; gap: 18px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.panel-head { min-height: 59px; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; gap: 8px; border-bottom: 1px solid #ecebe7; }
h2 { font-size: 17px; letter-spacing: -.017em; }
.overlay-control { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
input[type="checkbox"], input[type="range"], progress { accent-color: var(--primary); }
.stage { margin: 16px 16px 0; display: grid; place-items: center; min-height: 300px; border-radius: 7px; overflow: hidden; background: #151922; color: #f7f7fa; }
.placeholder { display: grid; place-items: center; gap: 9px; padding: 22px; text-align: center; }
.placeholder p { margin-top: 5px; font-size: 17px; font-weight: 600; }
.placeholder small { color: #c9cdd8; font-size: 12px; }
.frame-mark { position: relative; height: 48px; width: 58px; color: #94a2ff; }
.frame-mark b { position: absolute; width: 14px; height: 14px; border: 2px solid currentColor; }
.frame-mark b:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; }
.frame-mark b:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; }
.frame-mark b:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; }
.frame-mark b:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; }
.frame-mark span { position: absolute; width: 9px; height: 9px; background: currentColor; border-radius: 50%; left: calc(50% - 4px); top: calc(50% - 4px); }
.viewport { display: inline-grid; position: relative; max-width: 100%; }
.viewport img, .viewport video { display: block; max-width: 100%; max-height: 455px; width: auto; height: auto; }
#overlay-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.transport { display: flex; gap: 12px; align-items: center; padding: 12px 16px 0; }
.transport input { flex: 1; min-width: 70px; }
.focus-controls { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px 0; }
.viewport.choosing-focus { cursor: crosshair; touch-action: none; }
.time { font-size: 12px; font-variant-numeric: tabular-nums; }
.input-pane { padding: 16px 20px 21px; display: grid; gap: 11px; }
.input-pane label:not(.button) { font-weight: 600; font-size: 13px; }
.file-line { display: flex; gap: 11px; align-items: center; margin-bottom: 4px; }
.filename { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 13px; }
button, select, .button { font: inherit; }
button, .button { font-weight: 650; cursor: pointer; }
.button { display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; }
.primary, .secondary { padding: 9px 14px; min-height: 39px; border: 1px solid transparent; border-radius: 6px; }
.primary { color: #fff; background: var(--primary); justify-self: start; }
.primary:disabled { color: #585d70; background: #e5e7f1; }
.secondary { color: var(--ink); background: #fff; border-color: #d9d9e1; }
.secondary:hover:not(:disabled) { border-color: var(--primary); }
button:disabled { cursor: default; }
.text-button { border: 0; background: none; color: var(--primary); font-size: 13px; padding: 6px; }
.text-button:disabled { color: #747786; }
input:focus-visible, select:focus-visible, a:focus-visible, button:focus-visible, label:has(+ input:focus-visible) { outline: 3px solid #6579f0; outline-offset: 3px; }
select { border: 1px solid #d9d9e1; border-radius: 6px; min-height: 40px; background: #fff; color: var(--ink); padding: 7px 9px; }
.capture-tip, .status, .quality { color: var(--muted); font-size: 13px; line-height: 1.55; }
.status { min-height: 20px; }
.status.error { color: #a11b24; }
progress { width: 100%; height: 9px; }
.state-label { color: var(--muted); font-size: 12px; }
.results-empty { display: grid; gap: 11px; min-height: 173px; align-content: center; padding: 22px 20px; color: var(--muted); font-size: 14px; line-height: 1.5; }
#results { padding: 16px 19px 19px; display: grid; gap: 14px; }
.pattern { font-size: 16px; font-weight: 700; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.stat { background: #f6f6f9; padding: 10px; border-radius: 6px; display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.stat strong { color: var(--ink); font-size: 21px; font-variant-numeric: tabular-nums; }
#chart { width: 100%; height: 160px; border: 1px solid #eeedf0; border-radius: 5px; }
.rep-list { padding: 0; margin: 0; display: grid; gap: 5px; max-height: 180px; overflow-y: auto; list-style: none; }
.rep-list button { width: 100%; text-align: left; font-size: 13px; padding: 7px 8px; background: #fff; border: 1px solid #e7e7ec; border-radius: 5px; color: var(--primary); }
#export { justify-self: start; }
.evidence-panel p { padding: 0 20px; color: var(--muted); margin-top: 13px; font-size: 14px; line-height: 1.55; }
.evidence-panel .source-links { display: flex; flex-wrap: wrap; gap: 9px 14px; margin: 14px 0 18px; }
.local-file-guide { padding: 12px 16px; border: 1px solid #b99457; border-radius: 8px; background: #fff5e2; line-height: 1.5; }
.fundamentals details { padding: 12px 20px; border-bottom: 1px solid #ecebe7; }
.fundamentals details:last-child { border-bottom: 0; }
.fundamentals summary { cursor: pointer; font-size: 14px; font-weight: 650; line-height: 1.5; }
.fundamentals p { margin: 10px 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.fundamentals a { display: inline-block; margin-bottom: 4px; font-size: 13px; }
a { color: #243ab6; text-underline-offset: 3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 770px) {
  main { width: calc(100% - 28px); }
  .masthead { padding-inline: 14px; }
  .intro { padding-top: 27px; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .stage { min-height: 230px; }
}
