/* Visual Critique Workbench. Dark navy, cream and red. Fonts are self-hosted (SIL OFL). */
@font-face { font-family: "Archivo"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/archivo-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 800; font-style: normal; font-display: swap; src: url("fonts/archivo-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/inter-latin-700-normal.woff2") format("woff2"); }

:root {
  --bg: #0d142e;
  --bg-2: #101938;
  --panel: #141c3c;
  --panel-2: #1a2449;
  --line: #2d396e;
  --ink: #f3ebdc;
  --ink-2: #c9cde0;
  --ink-3: #a3abcb;
  --red: #ff7a63;
  --red-solid: #d63f2a;
  --on-red: #ffffff;
  --gold: #f0b02e;
  --on-gold: #0d142e;
  --teal: #62c2b8;
  --teal-solid: #1a7a71;
  --on-teal: #ffffff;
  --navy-chip: #2b3a7a;
  --on-navy-chip: #e6eaff;
  --focus: #ffd166;
  --display: "Archivo", "Arial Black", Arial, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.5;
  height: 100vh; overflow: hidden; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--display); font-weight: 800; margin: 0; letter-spacing: -0.01em; line-height: 1.15; }
p { margin: 0 0 8px; }
button, input, select, textarea { font: inherit; color: inherit; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.92em; background: var(--bg); padding: 1px 5px; border-radius: 4px; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--gold); color: var(--on-gold); padding: 8px 14px; border-radius: 6px; z-index: 2000; font-weight: 700; }
.skip:focus { top: 8px; }
.noscript { padding: 20px; background: var(--red-solid); color: var(--on-red); }

/* ---------- header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 20px; background: var(--bg-2); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mark { width: 40px; height: 40px; flex: none; }
.brand h1 { font-size: 22px; }
.brand .ver { color: var(--red); }
.tagline { color: var(--ink-3); font-size: 13px; margin: 0; }
.top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.privacy { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 5px 12px 5px 8px; }
.privacy svg { width: 16px; height: 16px; color: var(--teal); flex: none; }

.btn { background: var(--panel-2); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; cursor: pointer; font-weight: 600; font-size: 14px; min-height: 36px; }
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--red-solid); border-color: var(--red-solid); color: var(--on-red); }
.btn.primary:hover { background: #e24a35; }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 10px; min-height: 30px; font-size: 13px; }
.btn.danger { border-color: var(--red); color: var(--red); background: transparent; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.icon { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; font-size: 18px; line-height: 1; font-weight: 700; }

/* ---------- layout */
.layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 296px minmax(0, 1fr) 440px; grid-template-rows: minmax(0, 1fr); }
.col { min-height: 0; overflow-y: auto; }
.col-left { padding: 16px; border-right: 1px solid var(--line); background: var(--bg-2); }
.col-center { display: flex; flex-direction: column; min-width: 0; overflow: hidden; padding: 12px 14px 0; }
.col-right { border-left: 1px solid var(--line); background: var(--bg-2); position: relative; }

.col-title { font-size: 15px; display: flex; align-items: center; gap: 10px; margin: 20px 0 10px; letter-spacing: 0.01em; }
.col-title:first-child { margin-top: 0; }
.step { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--red-solid); color: var(--on-red); font-size: 13px; font-family: var(--display); }
.fine { font-size: 12.5px; color: var(--ink-3); margin-top: 8px; }

.samples { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.sample { background: var(--panel); border: 2px solid var(--line); border-radius: 8px; padding: 0; cursor: pointer; text-align: left; overflow: hidden; display: flex; flex-direction: column; }
.sample:hover { border-color: var(--ink-3); }
.sample[aria-pressed="true"] { border-color: var(--red); }
.sample img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--bg); }
.sample .cap { padding: 6px 8px 7px; font-size: 12.5px; line-height: 1.25; color: var(--ink-2); display: flex; justify-content: space-between; gap: 4px; }
.sample .cap b { color: var(--ink); font-weight: 600; }
.sample .done { color: var(--teal); font-weight: 700; }

.drop { margin-top: 14px; border: 2px dashed var(--ink-3); border-radius: var(--radius); padding: 16px 12px; text-align: center; cursor: pointer; display: grid; gap: 6px; justify-items: center; background: var(--panel); }
.drop:hover, .drop.is-over { border-color: var(--gold); background: var(--panel-2); }
.drop svg { width: 26px; height: 26px; color: var(--gold); }
.drop span { font-size: 12.5px; color: var(--ink-3); }
.error { color: var(--red); font-size: 13.5px; margin: 8px 0 0; border-left: 3px solid var(--red); padding-left: 10px; }

.field { display: block; margin-bottom: 10px; }
.field > span { display: block; font-size: 12.5px; color: var(--ink-3); margin-bottom: 4px; font-weight: 600; }
textarea, input[type="text"], select { width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; color: var(--ink); resize: vertical; }
select { appearance: auto; }
textarea::placeholder, input::placeholder { color: var(--ink-3); }

.scope { margin-top: 20px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.scope h3 { font-size: 13px; color: var(--gold); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.08em; }
.scope p { font-size: 12.5px; color: var(--ink-2); margin: 0; }

/* ---------- toolbar + viewport */
.toolbar { display: grid; gap: 8px; padding-bottom: 10px; }
.tools-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { background: transparent; border: 0; color: var(--ink-2); padding: 6px 12px; border-radius: 7px; cursor: pointer; font-weight: 600; font-size: 13.5px; min-height: 32px; }
.seg button:hover { color: var(--ink); background: var(--panel-2); }
.seg button[aria-checked="true"] { background: var(--ink); color: var(--bg); }
.seg button[disabled] { opacity: 0.5; cursor: not-allowed; }
.zoom { display: inline-flex; align-items: center; gap: 6px; }
#zoom-label { min-width: 46px; text-align: center; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--ink-2); }
.subcontrols { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); min-height: 0; }
.subcontrols:empty { display: none; }
.subcontrols label { display: inline-flex; align-items: center; gap: 6px; }
.subcontrols input[type="range"] { width: 120px; accent-color: var(--red-solid); }
.subcontrols .hint { flex-basis: 100%; color: var(--ink-3); }

.viewport {
  position: relative; flex: 1; min-height: 340px; overflow: hidden; overflow: clip; border: 1px solid var(--line); border-radius: var(--radius);
  background-color: #0a1024;
  background-image: linear-gradient(45deg, #0e1736 25%, transparent 25%, transparent 75%, #0e1736 75%), linear-gradient(45deg, #0e1736 25%, transparent 25%, transparent 75%, #0e1736 75%);
  background-size: 24px 24px; background-position: 0 0, 12px 12px;
  touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
}
.viewport[data-tool="pin"], .viewport[data-tool="probe"] { cursor: crosshair; }
.viewport[data-dragging] { cursor: grabbing; }
.stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.stage canvas { position: absolute; left: 0; top: 0; display: block; box-shadow: 0 6px 30px rgba(0, 0, 0, 0.5); }
.stage canvas.pixelated { image-rendering: pixelated; }
.overlay { position: absolute; inset: 0; pointer-events: none; overflow: hidden; overflow: clip; }
.probe-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.probe-line { stroke: var(--gold); stroke-width: 2; stroke-dasharray: 6 4; }
.probe-mark { position: absolute; left: 0; top: 0; width: 24px; height: 24px; margin: -12px 0 0 -12px; border: 2px solid var(--gold); border-radius: 50%; background: rgba(13, 20, 46, 0.7); color: var(--gold); display: grid; place-items: center; font-weight: 800; font-size: 12px; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.4); }
.pin { position: absolute; left: 0; top: 0; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; background: var(--red-solid); color: var(--on-red); border: 2px solid #fff; font: 800 14px var(--display); cursor: pointer; pointer-events: auto; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55); padding: 0; display: grid; place-items: center; }
.pin[data-tag="D"] { background: var(--teal-solid); color: var(--on-teal); }
.pin[data-tag="C?"] { background: var(--gold); color: var(--on-gold); }
.pin.is-selected { outline: 3px solid var(--focus); outline-offset: 2px; }
.pin.flash { animation: pulse 0.9s ease-out; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 209, 102, 0.9); } 100% { box-shadow: 0 0 0 22px rgba(255, 209, 102, 0); } }

.divider { position: absolute; left: 0; top: 0; width: 0; pointer-events: none; }
.divider::before { content: ""; position: absolute; left: -1px; top: 0; bottom: 0; width: 2px; background: var(--ink); box-shadow: 0 0 6px rgba(0, 0, 0, 0.6); }
.grip { position: absolute; left: -18px; top: 50%; margin-top: -18px; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; cursor: ew-resize; pointer-events: auto; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6); touch-action: none; }
.grip svg { width: 22px; height: 22px; }
.cmp-tag { position: absolute; top: 10px; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; font-size: 12px; font-weight: 700; pointer-events: none; max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-tag.a { left: 10px; }
.cmp-tag.b { right: 10px; background: var(--teal-solid); color: var(--on-teal); border-color: var(--teal-solid); }
.measuring { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); background: var(--gold); color: var(--on-gold); font-weight: 700; padding: 4px 12px; border-radius: 999px; font-size: 13px; }
.empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; gap: 10px; padding: 24px; background: rgba(10, 16, 36, 0.92); }
.empty svg { width: 64px; height: 64px; }
.empty h2 { font-size: 24px; }
.empty p { max-width: 380px; color: var(--ink-2); margin: 0; }
.statusbar { font-size: 12.5px; color: var(--ink-3); padding: 8px 2px 10px; min-height: 36px; margin: 0; }

/* ---------- right column */
.tabs { display: flex; gap: 2px; padding: 8px 10px 0; border-bottom: 1px solid var(--line); overflow-x: auto; position: sticky; top: 0; background: var(--bg-2); z-index: 5; }
.tab { background: transparent; border: 0; border-bottom: 3px solid transparent; color: var(--ink-2); padding: 10px 12px; cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap; min-height: 44px; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--red); }
.tab .count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--panel-2); color: var(--ink); font-size: 12px; line-height: 20px; }
.panel { padding: 14px 16px 40px; }
.panel h3 { font-size: 16px; }
.panel-intro { color: var(--ink-2); font-size: 13.5px; margin-bottom: 12px; }

.summary { position: sticky; top: 52px; z-index: 4; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; box-shadow: 0 8px 18px rgba(5, 8, 20, 0.55); }
.sum-row { display: flex; align-items: center; gap: 14px; }
.sum-mean { font: 800 40px/1 var(--display); min-width: 62px; font-variant-numeric: tabular-nums; }
.sum-mean small { display: block; font: 600 11px var(--body); color: var(--ink-3); letter-spacing: 0.05em; text-transform: uppercase; margin-top: 4px; }
.sum-verdict { flex: 1; min-width: 0; }
.verdict { display: inline-block; font: 800 16px var(--display); padding: 3px 12px; border-radius: 6px; background: var(--ink); color: var(--bg); }
.verdict[data-v="Ship"] { background: var(--teal); color: var(--bg); }
.verdict[data-v="Revise"] { background: var(--gold); color: var(--on-gold); }
.verdict[data-v="Reject"] { background: var(--red-solid); color: var(--on-red); }
.verdict[data-v="none"] { background: var(--panel); color: var(--ink-2); border: 1px dashed var(--ink-3); }
.sum-meta { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.gate-banner { margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: rgba(214, 63, 42, 0.18); border: 1px solid var(--red); color: var(--ink); font-size: 13px; }
.gate-banner b { color: var(--red); }
.bar { height: 6px; background: var(--panel); border-radius: 3px; margin-top: 10px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--teal); width: 0; transition: width 0.25s; }

.dims { display: grid; gap: 12px; }
.dim { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.dim.is-na { opacity: 0.75; }
.dim-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dim-head h3 { font-size: 16px; margin-right: auto; }
.dim-head .num { color: var(--ink-3); font: 700 12px var(--display); margin-right: 6px; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 800; letter-spacing: 0.04em; padding: 2px 8px; border-radius: 5px; text-transform: uppercase; }
.tag.C { background: var(--navy-chip); color: var(--on-navy-chip); }
.tag.D { background: var(--red-solid); color: var(--on-red); }
.tag.M { background: var(--teal-solid); color: var(--on-teal); }
.tag.Cq { background: var(--gold); color: var(--on-gold); }
.tag.gate { background: transparent; border: 1px solid var(--ink-3); color: var(--ink-2); font-weight: 700; margin: 0; padding: 1px 7px; }
.dim .q { color: var(--ink-2); font-size: 13.5px; margin: 6px 0 10px; }
.scorebar { display: flex; gap: 6px; flex-wrap: wrap; }
.score { width: 46px; height: 46px; border-radius: 9px; border: 2px solid var(--line); background: var(--panel-2); color: var(--ink); font: 800 20px var(--display); cursor: pointer; }
.score:hover { border-color: var(--ink-3); }
.score[aria-checked="true"] { background: var(--red-solid); border-color: var(--red-solid); color: var(--on-red); }
.score[aria-checked="true"].is-gate { background: var(--red-solid); box-shadow: 0 0 0 3px rgba(255, 122, 99, 0.45); }
.scorebar[aria-disabled="true"] .score { opacity: 0.4; cursor: not-allowed; }
.na-btn { margin-left: auto; align-self: center; }
.na-btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.anchor { font-size: 13px; color: var(--ink); margin: 10px 0 0; padding: 8px 10px; background: var(--bg); border-radius: 8px; min-height: 40px; border-left: 3px solid var(--line); }
.anchor .lbl { color: var(--gold); font-weight: 700; margin-right: 6px; }
.dim details { margin-top: 8px; font-size: 13px; color: var(--ink-2); }
.dim summary { cursor: pointer; color: var(--ink-3); font-weight: 600; }
.dim details ul { margin: 6px 0 0; padding-left: 18px; }
.hintline { font-size: 12.5px; color: var(--teal); margin-top: 8px; }
.note-row { display: grid; grid-template-columns: 82px 1fr; gap: 8px; margin-top: 10px; align-items: start; }
.note-row select { padding: 6px 6px; }
.note-row textarea { min-height: 38px; }

.reset-row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

/* measure */
.mcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; }
.mcard h3 { font-size: 15px; display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.mcard canvas { width: 100%; display: block; border-radius: 6px; background: var(--bg); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 10px 0 0; }
.stat { background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.stat b { display: block; font: 800 20px var(--display); font-variant-numeric: tabular-nums; }
.stat span { font-size: 11.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; }
.flags { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.flags li { font-size: 13px; padding: 6px 10px; border-radius: 6px; background: rgba(240, 176, 46, 0.14); border-left: 3px solid var(--gold); }
.flags li.ok { background: rgba(98, 194, 184, 0.12); border-left-color: var(--teal); }
.swatches { display: flex; height: 44px; border-radius: 8px; overflow: hidden; margin-bottom: 8px; border: 1px solid var(--line); }
.swatches i { display: block; height: 100%; }
.pal-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: 13px; }
.pal-list li { display: flex; align-items: center; gap: 8px; }
.pal-list .chip { width: 18px; height: 18px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, 0.35); flex: none; }
.pal-list .pct { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.parts { display: grid; gap: 6px; margin-top: 10px; }
.part { display: grid; grid-template-columns: 90px 1fr 38px; gap: 8px; align-items: center; font-size: 12.5px; color: var(--ink-2); }
.part .track { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.part .track i { display: block; height: 100%; background: var(--gold); }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.thumbs figure { margin: 0; }
.thumbs figcaption { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.probe-out { display: grid; gap: 8px; }
.probe-sw { display: flex; gap: 10px; align-items: center; }
.probe-sw i { width: 38px; height: 38px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.4); flex: none; }
.ratio { font: 800 30px var(--display); font-variant-numeric: tabular-nums; }
.pass { display: flex; gap: 6px; flex-wrap: wrap; }
.pass span { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 5px; }
.pass .y { background: var(--teal-solid); color: var(--on-teal); }
.pass .n { background: var(--panel-2); color: var(--ink-2); border: 1px solid var(--line); text-decoration: line-through; }
.how { margin-top: 10px; font-size: 12.5px; color: var(--ink-2); }
.how summary { cursor: pointer; color: var(--ink-3); font-weight: 600; }
.how p { margin: 6px 0 0; }
.grid9 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin-top: 10px; max-width: 200px; }
.grid9 i { display: block; aspect-ratio: 4 / 3; border-radius: 3px; background: var(--bg); position: relative; }
.grid9 i b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; color: var(--on-gold); font-weight: 700; }
.empty-note { color: var(--ink-3); padding: 24px 10px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }

/* pins list */
.pinlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pinitem { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: grid; grid-template-columns: 34px 1fr; gap: 6px 10px; }
.pinitem.is-selected { border-color: var(--focus); }
.pinbadge { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; background: var(--red-solid); color: var(--on-red); font: 800 14px var(--display); display: grid; place-items: center; cursor: pointer; padding: 0; }
.pinbadge[data-tag="D"] { background: var(--teal-solid); color: var(--on-teal); }
.pinbadge[data-tag="C?"] { background: var(--gold); color: var(--on-gold); }
.pinitem .body { display: grid; gap: 6px; }
.pinitem .row { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.pinitem select { width: auto; padding: 4px 8px; }
.pinitem .loc { font-size: 12px; color: var(--ink-3); }

/* reference */
.ref .table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0 14px; }
.ref th, .ref td { padding: 6px 6px; border-bottom: 1px solid var(--line); text-align: center; }
.ref th:first-child, .ref td:first-child { text-align: left; }
.ref th { font-size: 11.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; }
.ref .delta-0 { color: var(--teal); font-weight: 700; }
.ref .delta-1 { color: var(--gold); font-weight: 700; }
.ref .delta-2 { color: var(--red); font-weight: 700; }
.ref h4 { font-size: 14px; margin: 14px 0 6px; color: var(--gold); }
.ref ul, .ref ol { margin: 0 0 6px; padding-left: 20px; font-size: 13.5px; color: var(--ink-2); }
.ref li { margin-bottom: 4px; }
.ref p { font-size: 13.5px; color: var(--ink-2); }
.ref .brief { color: var(--ink); font-style: italic; }
.reveal { background: var(--panel); border: 1px dashed var(--ink-3); border-radius: var(--radius); padding: 16px; text-align: center; }
.reveal p { color: var(--ink-2); }

/* export */
.btn-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 8px; }
.btn-grid .btn { text-align: left; }
.sess { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.sess li { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.sess .meta { font-size: 12px; color: var(--ink-3); }
.sess .name { font-weight: 600; font-size: 14px; }
.preview-md { width: 100%; min-height: 160px; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; }
.section-gap { margin-top: 20px; }

/* footer, toast, dialogs, tour */
.foot { padding: 10px 20px; border-top: 1px solid var(--line); background: var(--bg-2); font-size: 12px; color: var(--ink-3); }
.foot p { margin: 0; }
.toast { position: fixed; left: 50%; bottom: 56px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-weight: 600; z-index: 3000; max-width: min(92vw, 520px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.toast[data-kind="error"] { background: var(--red-solid); color: var(--on-red); }
dialog { background: var(--panel-2); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; max-width: min(92vw, 560px); width: 100%; }
dialog::backdrop { background: rgba(5, 8, 20, 0.7); }
dialog h2 { font-size: 20px; margin-bottom: 10px; }
dialog p, dialog li { color: var(--ink-2); font-size: 14px; }
dialog ul { padding-left: 20px; }
dialog .close-row { display: flex; justify-content: flex-end; margin-top: 14px; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
kbd { background: var(--bg); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 7px; font: 600 12.5px ui-monospace, Consolas, monospace; color: var(--ink); }

.tour { position: fixed; inset: 0; z-index: 2500; }
.tour .spot { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(5, 8, 20, 0.78); border: 2px solid var(--gold); pointer-events: none; transition: all 0.25s ease; }
.tour .card { position: fixed; width: min(340px, calc(100vw - 24px)); background: var(--ink); color: var(--bg); border-radius: 12px; padding: 16px 18px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6); }
.tour .card h3 { font-size: 17px; margin-bottom: 6px; color: var(--bg); }
.tour .card p { font-size: 14px; color: #2a3358; margin-bottom: 12px; }
.tour .card .row { display: flex; align-items: center; gap: 8px; }
.tour .card .count { margin-right: auto; font-size: 12.5px; color: #3b4468; font-weight: 700; }
.tour .card .btn { background: var(--bg); color: var(--ink); border-color: var(--bg); }
.tour .card .btn.ghost { background: transparent; color: var(--bg); border-color: #3b4468; }
.dropveil { position: fixed; inset: 0; z-index: 2800; background: rgba(13, 20, 46, 0.86); display: grid; place-items: center; border: 4px dashed var(--gold); margin: 8px; border-radius: 16px; pointer-events: none; }
.dropveil p { font: 800 28px var(--display); }

/* ---------- responsive */
@media (max-width: 1280px) {
  .layout { grid-template-columns: 264px minmax(0, 1fr) 390px; }
}
@media (max-width: 1060px) {
  body { display: block; height: auto; overflow: visible; }
  .layout { display: flex; flex-direction: column; height: auto; }
  .col { overflow: visible; }
  .col-left { order: 1; border-right: 0; border-bottom: 1px solid var(--line); }
  .col-center { order: 2; padding: 10px 10px 0; overflow: visible; }
  .col-right { order: 3; border-left: 0; border-top: 1px solid var(--line); }
  .viewport { flex: none; height: 62vh; min-height: 320px; }
  .samples { display: flex; overflow-x: auto; gap: 8px; padding-bottom: 6px; scroll-snap-type: x proximity; }
  .sample { flex: 0 0 132px; scroll-snap-align: start; }
  .tabs { top: 0; }
  .summary { top: 52px; }
}
@media (max-width: 560px) {
  .top { padding: 8px 12px; }
  .brand h1 { font-size: 18px; }
  .tagline { display: none; }
  .privacy { font-size: 11.5px; }
  .col-left { padding: 12px; }
  .toolbar .seg { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .seg button { padding: 6px 10px; flex: none; }
  .tools-row { gap: 8px; }
  .panel { padding: 12px 12px 36px; }
  .sum-mean { font-size: 34px; min-width: 54px; }
  .score { width: 52px; height: 48px; }
  .btn-grid { grid-template-columns: 1fr; }
  .note-row { grid-template-columns: 1fr; }
  .cmp-tag { max-width: 44%; font-size: 11px; }
  .col-center { padding: 8px 8px 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .score[aria-checked="true"], .seg button[aria-checked="true"] { outline: 3px solid Highlight; }
}

.sess .row { display: flex; gap: 6px; }
.sample img { aspect-ratio: 3 / 2; }
.sample .cap { padding: 5px 7px 6px; font-size: 12px; }

.scorebar-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.note-row { grid-template-columns: 124px 1fr; }

h1, h2, h3, h4 { word-spacing: 0.06em; }

@media (max-width: 1360px) { .tab { padding: 10px 9px; font-size: 13.5px; } }
