/* Quickdraw — "Duel Terminal" visual system.
 * Ink black, bone text and a single signal gold. Every edge is square: corners are a hard rule,
 * enforced below. Condensed Archivo carries the voice, JetBrains Mono carries data and labels.
 * The camera overlays use solid fills, not backdrop blur, so the live preview stays cheap to composite. */
@font-face { font-family: 'Archivo'; src: url('/fonts/archivo-latin.woff2') format('woff2'); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/fonts/jetbrains-mono-latin.woff2') format('woff2'); font-weight: 100 800; font-display: swap; }

:root {
  --ink: #0a0a0b;
  --ink-2: #0f0f11;
  --panel: #141416;
  --panel-2: #1b1b1e;
  --panel-3: #26262a;
  --rule: #2a2a2f;
  --rule-2: #3b3b42;
  --bone: #f1ece1;
  --dim: #a39d92;
  --faint: #6c675f;
  --gold: #ffc629;
  --gold-2: #ffd75e;
  --gold-ink: #110c00;
  --lock: #3ef08a;
  --lock-deep: #0f8a45;
  --alert: #ff4a3d;
  --violet: #a48bff;
  --tabbar-h: 0px;
  --display: 'Archivo', 'Arial Narrow', system-ui, sans-serif;
  --body: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --hard: 4px 4px 0 #000;
  /* Older names, still used by the benchmark page and the photo cropper. */
  --bg: var(--ink); --bg-2: var(--ink-2); --surface: var(--panel); --surface-2: var(--panel-2); --surface-3: var(--panel-3);
  --line: var(--rule); --line-2: var(--rule-2); --text: var(--bone); --muted: var(--dim); --green: var(--lock); --green-2: var(--lock); --red: var(--alert);
  color-scheme: dark;
}

/* The house rule: no rounded corners, anywhere. */
*, *::before, *::after { box-sizing: border-box; border-radius: 0 !important; }

html { -webkit-text-size-adjust: 100%; background: var(--ink); }
body {
  margin: 0; min-height: 100dvh; color: var(--bone); font: 400 15px/1.5 var(--body);
  background-color: var(--ink);
  background-image:
    linear-gradient(#ffffff07 1px, transparent 1px),
    linear-gradient(90deg, #ffffff07 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { font-family: var(--display); font-stretch: 72%; font-weight: 800; letter-spacing: .01em; word-spacing: .1em; margin: 0; line-height: 1; text-transform: uppercase; }
p { margin: 0; }
a { color: var(--gold); text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .4; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
::selection { background: var(--gold); color: var(--gold-ink); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon-defs { position: absolute; width: 0; height: 0; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; stroke-linejoin: miter; }

/* ---------- Buttons & controls ---------- */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 10px 20px; border: 2px solid transparent; font: 800 15px/1 var(--display); font-stretch: 85%; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; white-space: nowrap; transition: transform .08s, box-shadow .08s, background .12s, border-color .12s; }
.button-primary { color: var(--gold-ink); background: var(--gold); border-color: var(--gold); box-shadow: var(--hard); }
.button-primary:hover:not(:disabled) { background: var(--gold-2); }
.button-primary:active:not(:disabled) { transform: translate(4px, 4px); box-shadow: 0 0 0 #000; }
.button-primary:disabled { box-shadow: none; }
.button-ghost { background: transparent; border-color: var(--rule-2); color: var(--bone); }
.button-ghost:hover:not(:disabled) { border-color: var(--bone); }
.button-ghost:active:not(:disabled) { background: var(--panel-2); }
.button-danger { background: transparent; color: var(--alert); border-color: var(--alert); }
.button-lg { min-height: 56px; padding: 14px 28px; font-size: 17px; }
.button-sm { min-height: 38px; padding: 8px 14px; font-size: 13px; }
.icon-button { display: inline-grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 1px solid var(--rule); background: transparent; color: var(--dim); transition: color .12s, border-color .12s; }
.icon-button:hover { border-color: var(--bone); color: var(--bone); }
.text-button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 2px; background: none; border: 0; color: var(--gold); font: 600 12px/1.2 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.text-button .icon { width: 16px; height: 16px; }
.chip-button { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 8px 14px; background: #0a0a0bcc; border: 1px solid var(--rule-2); color: var(--bone); font: 600 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; transition: border-color .12s, color .12s; }
.chip-button:hover { border-color: var(--gold); color: var(--gold); }
.chip-button .icon { width: 16px; height: 16px; }
.count-badge { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 6px; background: var(--panel-3); color: var(--bone); font: 700 12px/1 var(--mono); }
.eyebrow { display: flex; align-items: center; gap: 8px; font: 600 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-bottom: 12px; }
.eyebrow::before { content: ''; width: 8px; height: 8px; background: var(--gold); flex: none; }
.search-field { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; background: var(--ink-2); border: 1px solid var(--rule-2); color: var(--dim); transition: border-color .12s; }
.search-field:focus-within { border-color: var(--gold); box-shadow: inset 3px 0 0 var(--gold); }
.search-field input { flex: 1; min-width: 0; height: 46px; background: none; border: 0; outline: none; color: var(--bone); }
.search-field input::placeholder { color: var(--faint); }
.select-field { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 14px; background: var(--ink-2); border: 1px solid var(--rule-2); }
.select-field select, select.inline-select { appearance: none; -webkit-appearance: none; background: transparent; border: 0; outline: none; padding-right: 20px; color: var(--bone); font: 600 12px/1.2 var(--mono); letter-spacing: .04em; text-transform: uppercase; background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%); background-size: 5px 5px; background-position: right 5px center, right 0 center; background-repeat: no-repeat; }
.select-field option, select.inline-select option { background: var(--panel); color: var(--bone); }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font: 600 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.check input, .row-check { appearance: none; -webkit-appearance: none; width: 24px; height: 24px; margin: 0; border: 2px solid var(--rule-2); background: var(--ink); display: grid; place-items: center; cursor: pointer; flex: none; }
.check input:checked, .row-check:checked { background: var(--gold); border-color: var(--gold); }
.check input:checked::after, .row-check:checked::after { content: ''; width: 11px; height: 6px; border: solid var(--gold-ink); border-width: 0 0 3px 3px; transform: translateY(-1px) rotate(-45deg); }
.check input:indeterminate { border-color: var(--gold); }
.check input:indeterminate::after { content: ''; width: 10px; height: 3px; background: var(--gold); }

/* ---------- Top bar & navigation ---------- */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; height: 64px; padding: 0 20px; padding-top: env(safe-area-inset-top); background: var(--ink); border-bottom: 1px solid var(--rule); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--bone); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; color: var(--gold-ink); background: var(--gold); }
.brand-mark .icon { stroke-width: 2.6; width: 22px; height: 22px; }
.brand-word { font: 900 24px/1 var(--display); font-stretch: 64%; letter-spacing: .02em; text-transform: uppercase; }
.brand-word b { color: var(--gold); font-weight: 900; }
.brand-tag { align-self: center; padding: 2px 4px; border: 1px solid var(--rule-2); color: var(--faint); font: 600 9px/1 var(--mono); letter-spacing: .1em; }
.main-nav { display: flex; margin: 0 auto; border: 1px solid var(--rule-2); counter-reset: nav; }
.nav-button { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border: 0; border-right: 1px solid var(--rule-2); background: none; color: var(--dim); font: 600 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.nav-button:last-child { border-right: 0; }
.nav-button::before { counter-increment: nav; content: '0' counter(nav); color: var(--faint); font-size: 10px; }
.nav-button:hover { color: var(--bone); }
.nav-button.active { background: var(--gold); color: var(--gold-ink); }
.nav-button.active::before { color: var(--gold-ink); opacity: .6; }
.nav-button .icon { display: none; }
.nav-count { min-width: 20px; height: 18px; padding: 0 5px; background: var(--bone); color: var(--ink); font: 700 11px/1 var(--mono); display: inline-grid; place-items: center; }
.nav-count.muted { background: var(--panel-3); color: var(--dim); }
.nav-button.active .nav-count { background: var(--ink); color: var(--gold); }
.header-tools { display: flex; gap: 8px; }
.tabbar { display: none; }

.storage-notice { margin: 12px 16px 0; padding: 12px 16px; background: #ff4a3d14; border: 1px solid var(--alert); border-left-width: 4px; color: #ffd2cd; font-size: 14px; }

/* ---------- Views ---------- */
.view { width: 100%; max-width: 1200px; margin: 0 auto; padding: 32px 24px 56px; }
.view-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--rule); }
.view-heading h1 { font-size: clamp(44px, 7vw, 76px); font-weight: 900; font-stretch: 62%; line-height: .86; }
.view-description { margin-top: 12px; max-width: 520px; color: var(--dim); }
.heading-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.footnote { margin-top: 32px; color: var(--faint); font: 500 11px/1.6 var(--mono); letter-spacing: .04em; text-align: center; text-transform: uppercase; }
.empty-state {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: 64px 24px;
  background:
    linear-gradient(var(--gold) 0 0) 0 0 / 18px 2px, linear-gradient(var(--gold) 0 0) 0 0 / 2px 18px,
    linear-gradient(var(--gold) 0 0) 100% 0 / 18px 2px, linear-gradient(var(--gold) 0 0) 100% 0 / 2px 18px,
    linear-gradient(var(--gold) 0 0) 0 100% / 18px 2px, linear-gradient(var(--gold) 0 0) 0 100% / 2px 18px,
    linear-gradient(var(--gold) 0 0) 100% 100% / 18px 2px, linear-gradient(var(--gold) 0 0) 100% 100% / 2px 18px,
    repeating-linear-gradient(135deg, #ffffff05 0 2px, transparent 2px 10px), var(--ink-2);
  background-repeat: no-repeat; border: 1px solid var(--rule);
}
.empty-state h2 { font-size: 34px; font-stretch: 66%; font-weight: 900; }
.empty-state p { max-width: 400px; color: var(--dim); }
.empty-state .button { margin-top: 10px; }
.empty-icon { display: grid; place-items: center; width: 64px; height: 64px; background: var(--panel-2); color: var(--gold); border: 1px solid var(--rule-2); transform: rotate(45deg); margin-bottom: 8px; }
.empty-icon .icon { width: 28px; height: 28px; transform: rotate(-45deg); }

/* ---------- Scan view ---------- */
.scan-view { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.camera-panel { min-width: 0; }
.camera-stage { position: relative; isolation: isolate; height: calc(100dvh - 128px); min-height: 460px; max-height: 860px; overflow: hidden; background: radial-gradient(ellipse at 50% 42%, #1a1813, var(--ink) 70%); border: 1px solid var(--rule-2); }
.camera-stage video, .frozen-frame { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; }
.camera-stage.live video { display: block; }
.camera-stage.video-source video { object-fit: contain; background: #000; }
.camera-stage.frozen .frozen-frame { display: block; object-fit: contain; padding: 64px 24px 90px; }
.camera-stage::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 4; background: linear-gradient(180deg, #000b, transparent 20%, transparent 72%, #000d); opacity: 0; transition: opacity .3s; }
.camera-stage.live::after { opacity: 1; }
.detection-overlay { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; }
.detection-overlay polygon { fill: #ffc62914; stroke: var(--gold); stroke-width: 3; stroke-linejoin: miter; transition: all .12s; }
.camera-stage.matched .detection-overlay polygon, .detection-overlay.confirmed polygon { fill: #3ef08a22; stroke: var(--lock); stroke-width: 4; }
.viewfinder { position: absolute; inset: 15% 14%; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .3s; }
.camera-stage.live:not(.video-source) .viewfinder { opacity: .9; }
.viewfinder i { position: absolute; width: 30px; height: 30px; border: 0 solid var(--gold); }
.viewfinder i:nth-child(1) { top: 0; left: 0; border-width: 4px 0 0 4px; }
.viewfinder i:nth-child(2) { top: 0; right: 0; border-width: 4px 4px 0 0; }
.viewfinder i:nth-child(3) { bottom: 0; left: 0; border-width: 0 0 4px 4px; }
.viewfinder i:nth-child(4) { bottom: 0; right: 0; border-width: 0 4px 4px 0; }
.focus-marker { position: absolute; z-index: 6; width: 36px; height: 36px; border: 2px solid var(--gold); transform: translate(-50%, -50%) rotate(45deg); pointer-events: none; box-shadow: 0 0 0 3px #0008; }

.stage-top { position: absolute; z-index: 6; top: 14px; left: 14px; right: 14px; display: flex; justify-content: space-between; gap: 10px; pointer-events: none; }
.pill { pointer-events: auto; display: inline-flex; align-items: center; gap: 9px; height: 34px; padding: 0 12px; background: #0a0a0be6; border: 1px solid var(--rule-2); color: var(--bone); font: 600 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.pill .icon { width: 15px; height: 15px; color: var(--gold); }
.state-dot { width: 8px; height: 8px; background: var(--faint); }
.state-dot.live { background: var(--alert); box-shadow: 0 0 0 3px #ff4a3d40; animation: rec 1.6s steps(2, jump-none) infinite; }
@keyframes rec { 50% { opacity: .25; } }

.camera-welcome { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 32px 24px; text-align: center; }
.camera-welcome h2 { font-size: clamp(52px, 15vw, 88px); font-weight: 900; font-stretch: 62%; line-height: .84; max-width: 7ch; }
.camera-welcome p { max-width: 320px; color: var(--dim); }
.camera-welcome .button-lg { margin-top: 10px; min-width: 240px; }
/* The status pills sit at the top of the stage. When the stage is short, the welcome block starts below
 * them instead of centring into them, and a running session drops the copy the pills already say. */
.camera-stage { container: stage / size; }
.camera-welcome { justify-content: safe center; padding: 62px 20px 16px; overflow: hidden; }
.scan-view.has-session .welcome-kicker, .scan-view.has-session .camera-welcome > p { display: none; }
.scan-view.has-session .camera-welcome h2 { font-size: clamp(40px, 11vw, 64px); max-width: none; }
.welcome-kicker { display: inline-flex; align-items: center; gap: 10px; color: var(--dim) !important; font: 500 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; max-width: none !important; }
.welcome-kicker span { padding: 4px 6px; background: var(--lock); color: #04150b; font-weight: 700; }
.welcome-alt { display: flex; flex-wrap: wrap; justify-content: center; gap: 0; margin-top: 8px; }
.welcome-alt .chip-button + .chip-button { border-left-width: 0; }
.welcome-alt .upload-button { min-width: 240px; justify-content: center; }
.welcome-art { position: relative; width: 170px; height: 150px; flex: none; margin-bottom: 8px; }
/* Container queries on the camera stage drop decoration as the camera area gets shorter (short
 * phones, the address bar showing, a session tray below), so the block always fits under the pills. */
@container stage (max-height: 700px) {
  .camera-welcome { gap: 10px; }
  .welcome-art { height: 104px; margin-bottom: 0; scale: .7; }
}
@container stage (max-height: 600px) {
  .welcome-art { display: none; }
  .camera-welcome h2 { font-size: clamp(44px, 13vw, 64px); max-width: 9ch; }
}
@container stage (max-height: 480px) {
  .welcome-kicker { display: none; }
  .camera-welcome { gap: 8px; }
  .camera-welcome h2 { font-size: 40px; max-width: none; line-height: .9; }
  .camera-welcome p { font-size: 13px; line-height: 1.4; max-width: 300px; }
  .camera-welcome .button-lg { margin-top: 4px; min-height: 50px; padding: 10px 22px; }
  .welcome-alt { margin-top: 2px; }
  .welcome-alt .chip-button { min-height: 38px; }
}
@container stage (max-height: 400px) { .camera-welcome p { display: none; } }
@container stage (max-width: 380px) { .welcome-alt .chip-button { padding: 8px 11px; } }
.ghost-card { position: absolute; left: 50%; top: 50%; width: 84px; height: 122px; margin: -61px 0 0 -42px; border: 1px solid var(--rule-2); background: var(--panel); }
.ghost-card.g1 { transform: rotate(-12deg) translateX(-34px); background: repeating-linear-gradient(135deg, #ffffff0a 0 1px, transparent 1px 7px), var(--panel); }
.ghost-card.g2 { transform: rotate(9deg) translateX(32px); background: repeating-linear-gradient(45deg, #ffffff0a 0 1px, transparent 1px 7px), var(--panel-2); }
.ghost-card.g3 { display: grid; place-items: center; background: var(--ink); border: 2px solid var(--gold); box-shadow: inset 0 0 0 5px var(--ink), inset 0 0 0 6px #ffc62966, 6px 6px 0 #000; color: var(--gold); animation: float 4s ease-in-out infinite; }
.ghost-card.g3 .icon { width: 36px; height: 36px; stroke-width: 2.4; }
@keyframes float { 50% { transform: translateY(-6px); } }

.live-match-banner { position: absolute; z-index: 8; left: 14px; right: 14px; bottom: 84px; max-width: 440px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; border: 0; border-left: 5px solid var(--lock); background: #08120ce8; color: var(--bone); text-align: left; box-shadow: var(--hard); animation: rise .18s ease-out; }
.live-match-image { width: 40px; height: 58px; flex: none; object-fit: cover; background: var(--panel-2); }
.live-match-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.live-match-copy strong { font: 800 17px/1.05 var(--display); font-stretch: 75%; text-transform: uppercase; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.live-match-copy > span { color: var(--lock); font: 600 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.match-check { display: grid; place-items: center; width: 34px; height: 34px; background: var(--lock); color: #04150b; flex: none; }
.match-check .icon { width: 20px; height: 20px; stroke-width: 3; }
.live-match-banner:not([hidden]) ~ .live-hint { visibility: hidden; }
.duplicate-prompt { position: absolute; z-index: 9; right: 14px; bottom: 140px; display: flex; align-items: stretch; max-width: calc(100% - 28px); padding: 0; border: 1px solid var(--gold); background: #0a0a0bf0; color: var(--bone); font: 600 11px/1.2 var(--mono); letter-spacing: .04em; text-transform: uppercase; box-shadow: var(--hard); animation: rise .18s ease-out; }
.duplicate-prompt[hidden] { display: none; }
.duplicate-copy { padding: 12px 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.duplicate-copy strong { color: var(--gold); font-weight: 700; }
.duplicate-add { display: flex; align-items: center; padding: 0 16px; background: var(--gold); color: var(--gold-ink); font-size: 16px; font-weight: 800; }
.camera-stage.summon-on .duplicate-prompt { bottom: 120px; }
.live-hint { position: absolute; z-index: 6; left: 50%; bottom: 92px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 10px; max-width: calc(100% - 28px); padding: 9px 14px; background: #0a0a0be0; border: 1px solid var(--rule-2); font: 500 11px/1.2 var(--mono); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hint-dot { width: 7px; height: 7px; background: var(--gold); flex: none; animation: rec 1.4s steps(2, jump-none) infinite; }
.camera-tools { position: absolute; z-index: 7; left: 14px; right: 14px; bottom: 16px; display: flex; justify-content: center; gap: 0; }
.stage-tool { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 54px; height: 54px; padding: 0 18px; border: 1px solid var(--rule-2); background: #0a0a0bf0; color: var(--bone); font: 800 14px/1 var(--display); font-stretch: 85%; letter-spacing: .08em; text-transform: uppercase; }
.stage-tool + .stage-tool { border-left-width: 0; }
.stage-tool:hover { background: var(--panel-2); }
.stage-tool[aria-pressed='true'] { background: var(--bone); color: var(--ink); border-color: var(--bone); }
.stop-tool .icon { color: var(--alert); fill: var(--alert); }
.review-tool { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.review-tool:hover { background: var(--gold-2); }
.tool-count, .tab-count { position: absolute; top: -9px; right: -9px; min-width: 22px; height: 20px; padding: 0 5px; background: var(--lock); color: #04150b; font: 700 11px/1 var(--mono); display: grid; place-items: center; border: 2px solid var(--ink); }
.camera-error { position: absolute; inset: 0; z-index: 9; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 28px; text-align: center; background: repeating-linear-gradient(135deg, #ff4a3d0d 0 12px, transparent 12px 24px), #0a0a0bf5; }
.camera-error h2 { font-size: 40px; font-stretch: 64%; font-weight: 900; }
.camera-error p { max-width: 360px; color: var(--dim); }
.camera-error-icon { display: grid; place-items: center; width: 60px; height: 60px; background: var(--alert); color: var(--ink); }

/* Matched! flash: a hard green frame with the viewfinder corners and a stamped badge. */
.match-flash {
  position: absolute; inset: 0; z-index: 7; display: grid; place-items: center; pointer-events: none; opacity: 0;
  background:
    linear-gradient(var(--lock) 0 0) 16px 16px / 56px 8px, linear-gradient(var(--lock) 0 0) 16px 16px / 8px 56px,
    linear-gradient(var(--lock) 0 0) calc(100% - 16px) 16px / 56px 8px, linear-gradient(var(--lock) 0 0) calc(100% - 16px) 16px / 8px 56px,
    linear-gradient(var(--lock) 0 0) 16px calc(100% - 16px) / 56px 8px, linear-gradient(var(--lock) 0 0) 16px calc(100% - 16px) / 8px 56px,
    linear-gradient(var(--lock) 0 0) calc(100% - 16px) calc(100% - 16px) / 56px 8px, linear-gradient(var(--lock) 0 0) calc(100% - 16px) calc(100% - 16px) / 8px 56px,
    #3ef08a26;
  background-repeat: no-repeat; box-shadow: inset 0 0 0 4px var(--lock);
}
.match-flash-badge { display: inline-flex; align-items: center; gap: 10px; padding: 14px 24px 12px; color: #04150b; background: var(--lock); font: 900 34px/1 var(--display); font-stretch: 62%; letter-spacing: .04em; text-transform: uppercase; box-shadow: 6px 6px 0 #000; transform: rotate(-3deg); }
.match-flash-badge .icon { width: 28px; height: 28px; stroke-width: 3.4; }
.match-flash.show { opacity: 1; animation: match-flash 1s ease-out forwards; }
.match-flash.show .match-flash-badge { animation: match-badge 1s cubic-bezier(.2, 1.4, .4, 1) forwards; }
@keyframes match-flash { 0% { opacity: 0; } 10% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }
@keyframes match-badge { 0% { transform: rotate(-3deg) scale(1.6); } 22% { transform: rotate(-3deg) scale(.96); } 36%, 100% { transform: rotate(-3deg) scale(1); } }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } }

.video-controls { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 8px 12px 8px 8px; background: var(--panel); border: 1px solid var(--rule); color: var(--dim); font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.video-replay { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; background: var(--ink); border: 1px solid var(--rule-2); color: var(--bone); }
.video-replay:hover { border-color: var(--gold); color: var(--gold); }
.video-replay .icon { width: 16px; height: 16px; }
.video-track { flex: 1; height: 3px; background: var(--rule-2); position: relative; overflow: hidden; }
.video-track i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--gold); }
.video-controls select { background: var(--ink); border: 1px solid var(--rule-2); padding: 8px; font: inherit; color: var(--bone); }
#videoProgress { font-variant-numeric: tabular-nums; color: var(--bone); white-space: nowrap; }

/* Session dock */
.session-dock { position: sticky; top: 88px; display: flex; flex-direction: column; max-height: calc(100dvh - 128px); background: var(--panel); border: 1px solid var(--rule-2); overflow: hidden; }
.dock-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 18px 16px; border-bottom: 1px solid var(--rule); }
.dock-head h2 { font-size: 26px; font-weight: 900; font-stretch: 64%; }
.dock-meta { margin-top: 6px; color: var(--dim); font: 500 11px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.session-tray { flex: 1; min-height: 160px; overflow-y: auto; padding: 0; display: flex; flex-direction: column; }
.tray-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; height: 100%; min-height: 150px; padding: 20px; color: var(--faint); text-align: center; font: 500 11px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.tray-empty .icon { width: 26px; height: 26px; color: var(--rule-2); }
.tray-item { width: 100%; border: 0; border-bottom: 1px solid var(--rule); background: none; color: var(--bone); text-align: left; font: inherit; cursor: pointer; }
.tray-item:hover { background: var(--panel-2); }
.tray-item:active img { outline: 2px solid var(--gold); outline-offset: -2px; }
.tray-item { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--rule); animation: rise .22s ease-out; }
.tray-item.fresh { background: #3ef08a10; box-shadow: inset 4px 0 0 var(--lock); }
.tray-item img { width: 38px; height: 55px; flex: none; object-fit: cover; background: var(--panel-2); }
.tray-copy { flex: 1; min-width: 0; }
.tray-copy strong { display: block; font: 700 15px/1.15 var(--display); font-stretch: 82%; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tray-copy small { color: var(--faint); font: 500 11px/1.4 var(--mono); }
.tray-qty { min-width: 34px; height: 24px; padding: 0 6px; background: var(--gold); color: var(--gold-ink); font: 700 12px/1 var(--mono); display: grid; place-items: center; }
.dock-foot { padding: 12px 18px 14px; border-top: 1px solid var(--rule); background: var(--ink-2); }
.engine-status { display: flex; align-items: center; gap: 10px; color: var(--dim); font: 500 11px/1.3 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.engine-dot { width: 8px; height: 8px; background: var(--lock); flex: none; }
.engine-dot.loading { background: var(--gold); animation: rec 1.2s steps(2, jump-none) infinite; }
.engine-dot.error { background: var(--alert); }
.scan-performance { margin-top: 6px; color: var(--faint); font: 500 10px/1.4 var(--mono); font-variant-numeric: tabular-nums; }
.scan-performance:empty { display: none; }

/* ---------- Stats: one spec-sheet strip ---------- */
.review-stats, .stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0; margin-bottom: 24px; border: 1px solid var(--rule-2); background: var(--panel); }
.stat { padding: 14px 16px 12px; border-right: 1px solid var(--rule-2); }
.stat:last-child { border-right: 0; }
.stat b { display: block; font: 900 40px/1 var(--display); font-stretch: 62%; font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 6px; color: var(--dim); font: 500 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.stat.accent { background: var(--gold); color: var(--gold-ink); }
.stat.accent span { color: #110c00b3; }

/* ---------- Review ---------- */
.review-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.review-list { display: flex; flex-direction: column; border-top: 1px solid var(--rule-2); }
.review-row { position: relative; display: grid; grid-template-columns: auto 64px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 14px 16px 14px 18px; background: var(--panel); border: 1px solid var(--rule-2); border-top: 0; transition: opacity .15s; }
.review-row::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--gold); }
.review-row.excluded { opacity: .45; }
.review-row.excluded::before { background: var(--rule-2); }
.review-row.excluded .review-thumb { filter: grayscale(1); }
.review-thumb { width: 64px; height: 93px; object-fit: cover; background: var(--panel-2); cursor: zoom-in; border: 0; padding: 0; box-shadow: 4px 4px 0 #000; }
.review-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.review-main { min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.review-name { font: 800 20px/1 var(--display); font-stretch: 72%; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.review-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: var(--dim); font: 500 11px/1.3 var(--mono); letter-spacing: .04em; }
.type-dot { display: inline-flex; align-items: center; gap: 7px; text-transform: uppercase; }
.type-dot::before { content: ''; width: 10px; height: 10px; background: var(--frame, var(--faint)); }
.printing-select { max-width: 100%; min-height: 34px; padding: 4px 26px 4px 10px; border: 1px solid var(--rule-2) !important; background-color: var(--ink) !important; color: var(--bone); }
.review-actions { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.review-actions .text-button { padding: 2px 0; color: var(--dim); }
.review-actions .text-button:hover { color: var(--gold); }
.review-actions .danger:hover { color: var(--alert); }
.stepper { display: inline-flex; align-items: stretch; background: var(--ink); border: 1px solid var(--rule-2); }
.stepper button { width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: none; color: var(--bone); }
.stepper button:hover:not(:disabled) { background: var(--gold); color: var(--gold-ink); }
.stepper .icon { width: 16px; height: 16px; stroke-width: 2.6; }
.stepper output { display: grid; place-items: center; min-width: 34px; border-left: 1px solid var(--rule-2); border-right: 1px solid var(--rule-2); font: 700 14px/1 var(--mono); font-variant-numeric: tabular-nums; }
.review-footer { position: sticky; bottom: 16px; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 20px; padding: 12px; background: var(--ink); border: 1px solid var(--rule-2); box-shadow: 0 -12px 30px #0a0a0bcc; }
.review-footer .button-lg { flex: 1; min-width: 0; max-width: 440px; margin-left: auto; }
.review-footer .button-lg span { overflow: hidden; text-overflow: ellipsis; }

/* ---------- Collection ---------- */
.collection-toolbar { display: flex; gap: 0; margin-bottom: 18px; }
.collection-toolbar .search-field { flex: 1; }
.collection-toolbar .select-field { border-left-width: 0; }
.collection-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.collection-card { position: relative; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--rule-2); transition: transform .1s, box-shadow .1s, border-color .1s; }
.collection-card:hover { border-color: var(--gold); transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--gold); }
.collection-card-main { display: flex; flex-direction: column; gap: 8px; padding: 0 0 10px; border: 0; background: none; text-align: left; color: var(--bone); }
.collection-card-main img { width: 100%; aspect-ratio: 59 / 86; object-fit: cover; background: var(--panel-2); border-bottom: 1px solid var(--rule-2); }
.collection-card-main h3 { padding: 0 12px; font-size: 16px; font-weight: 800; font-stretch: 75%; line-height: 1.05; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.collection-card-main p { padding: 0 12px; color: var(--faint); font: 500 10px/1.3 var(--mono); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.copies-badge { position: absolute; top: -1px; left: -1px; min-width: 40px; height: 28px; padding: 0 8px; background: var(--gold); color: var(--gold-ink); font: 800 13px/1 var(--mono); display: grid; place-items: center; }
.collection-printing { width: calc(100% - 22px); min-height: 32px; margin: 0 10px 10px 12px; font-size: 10px !important; }
.collection-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 10px 10px 12px; margin-top: auto; }
.collection-card-footer .stepper button { width: 32px; height: 32px; }
.collection-card-footer .stepper output { min-width: 28px; }
.collection-card-footer .icon-button { width: 34px; height: 34px; }
/* ---------- Prices: gold for expensive, bone for ordinary, grey for commons ---------- */
.price { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; color: var(--bone); font: 500 11px/1.2 var(--mono); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.price b { font: 800 15px/1 var(--mono); }
.price small { color: var(--dim); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.price-expensive b { color: var(--gold); }
.price-common, .price-common b, .price-common small, .price-unknown { color: var(--faint); }
.price-common b { font-weight: 600; font-size: 13px; }
.price-unknown { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.value-flag { align-self: flex-start; padding: 4px 7px 3px; border: 1px solid var(--gold); color: var(--gold); font: 700 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
.value-flag.top { background: var(--gold); color: var(--gold-ink); }
.review-row.is-top, .review-row.is-expensive { background: linear-gradient(90deg, #ffc62914, transparent 55%), var(--panel); }
.review-row.is-top { box-shadow: inset 0 0 0 1px var(--gold); }
.collection-card .value-flag { position: absolute; top: -1px; right: -1px; max-width: calc(100% - 44px); overflow: hidden; text-overflow: ellipsis; background: var(--ink); }
.collection-card .value-flag.top { background: var(--gold); }
.collection-card.is-expensive { border-color: #ffc62999; }
.collection-card.is-top { border-color: var(--gold); box-shadow: 4px 4px 0 var(--gold); }
.collection-card-main .price { padding: 0 12px; }
.price-note { margin-top: 14px; color: var(--faint); font: 500 10px/1.5 var(--mono); letter-spacing: .04em; }
.top-cards { margin-bottom: 24px; border: 1px solid var(--gold); background: var(--panel); }
.top-cards-title { padding: 10px 14px 9px; background: var(--gold); color: var(--gold-ink); font: 700 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; }
.top-cards-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); list-style: none; margin: 0; padding: 0; }
.top-card + .top-card { border-left: 1px solid var(--rule-2); }
.top-card-main { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; background: none; color: var(--bone); text-align: left; }
.top-card-main:hover { background: var(--panel-2); }
.top-card-main img { width: 44px; height: 64px; object-fit: cover; flex: none; background: var(--panel-2); box-shadow: 3px 3px 0 #000; }
.top-card-copy { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.top-card-copy small { color: var(--gold); font: 700 10px/1 var(--mono); letter-spacing: .14em; }
.top-card-copy strong { font: 800 16px/1.05 var(--display); font-stretch: 75%; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.top-card-price { font: 800 15px/1 var(--mono); font-variant-numeric: tabular-nums; }
.top-card.is-expensive .top-card-price { color: var(--gold); }
.no-saved-results { grid-column: 1 / -1; padding: 30px; text-align: center; color: var(--dim); font: 500 12px/1.5 var(--mono); text-transform: uppercase; }
.ledger { margin-top: 28px; background: var(--panel); border: 1px solid var(--rule-2); }
.ledger summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px; cursor: pointer; font: 800 20px/1 var(--display); font-stretch: 70%; text-transform: uppercase; list-style: none; }
.ledger summary::-webkit-details-marker { display: none; }
.ledger summary::after { content: ''; width: 9px; height: 9px; border: solid var(--gold); border-width: 0 2px 2px 0; transform: rotate(45deg); margin-left: 12px; }
.ledger[open] summary::after { transform: rotate(-135deg); }
.ledger summary .count-badge { margin-left: auto; }
.ledger-list { display: flex; flex-direction: column; padding: 0 18px 10px; }
.ledger-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--rule); font-size: 14px; }
.ledger-row strong { font-weight: 700; }
.ledger-row small { display: block; color: var(--faint); font: 500 11px/1.4 var(--mono); }
.ledger-row .ledger-count { margin-left: auto; color: var(--gold); font: 700 13px/1 var(--mono); white-space: nowrap; }

/* ---------- History ---------- */
.history-search { margin-bottom: 16px; }
.history-list { display: flex; flex-direction: column; border-top: 1px solid var(--rule); }
.history-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--rule); background: transparent; color: var(--bone); text-align: left; transition: background .1s; }
.history-row:hover { background: var(--panel); box-shadow: inset 3px 0 0 var(--gold); }
.history-thumb { width: 36px; height: 52px; flex: none; object-fit: cover; background: var(--panel-2); }
.history-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.history-name { font: 700 16px/1.1 var(--display); font-stretch: 80%; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-meta { color: var(--faint); font: 500 11px/1.3 var(--mono); letter-spacing: .02em; }
.history-chevron { color: var(--gold); width: 18px; height: 18px; }
.load-more { display: flex; margin: 18px auto 0; }

/* ---------- Dialogs ---------- */
.dialog { width: min(540px, calc(100vw - 24px)); max-height: min(860px, calc(100dvh - 24px)); padding: 0; border: 1px solid var(--rule-2); border-top: 4px solid var(--gold); background: var(--panel); color: var(--bone); box-shadow: 10px 10px 0 #000; overflow: auto; overscroll-behavior: contain; }
.dialog::backdrop { background: #050506e0; }
.dialog[open] { animation: pop .18s ease-out; }
@keyframes pop { from { transform: translateY(14px); opacity: 0; } }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 20px 16px; }
.dialog-header h2 { font-size: 34px; font-weight: 900; font-stretch: 64%; }
.search-dialog .search-field { margin: 0 20px; }
.search-meta { padding: 12px 20px 8px; color: var(--faint); font: 500 11px/1.4 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.search-results { display: flex; flex-direction: column; padding: 4px 20px 20px; }
.candidate-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; border: 0; border-bottom: 1px solid var(--rule); background: none; color: var(--bone); text-align: left; }
.candidate-row:hover { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--gold); }
.candidate-row img { width: 40px; height: 58px; object-fit: cover; flex: none; background: var(--panel-2); }
.candidate-row div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.candidate-row strong { font: 700 16px/1.1 var(--display); font-stretch: 80%; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.candidate-row small { color: var(--faint); font: 500 11px/1.3 var(--mono); }
.candidate-row > .icon { color: var(--gold); width: 18px; }

.panel-heading { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 20px; background: var(--panel); border-bottom: 1px solid var(--rule); }
.panel-heading .eyebrow { margin: 0; }
.result-state { color: var(--dim); font: 600 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.result-state.matched { color: #04150b; background: var(--lock); padding: 4px 6px; }
.close-result { margin-left: auto; }
.result-empty { padding: 30px 20px; color: var(--dim); }
.card-result { display: flex; flex-direction: column; gap: 18px; padding: 20px 20px 24px; }
.result-identity { display: grid; grid-template-columns: 128px 1fr; gap: 18px; align-items: start; }
.result-card-image { width: 128px; aspect-ratio: 59 / 86; object-fit: cover; background: var(--panel-2); box-shadow: 6px 6px 0 #000, 0 0 0 1px var(--rule-2); }
.result-identity h2 { font-size: clamp(32px, 8vw, 42px); font-weight: 900; font-stretch: 62%; line-height: .9; margin-top: 12px; overflow-wrap: anywhere; }
.type-chip { display: inline-flex; padding: 4px 7px; background: var(--bone); color: var(--ink); font: 700 10px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.result-passcode { margin-top: 12px; color: var(--gold); font: 600 13px/1 var(--mono); letter-spacing: .14em; font-variant-numeric: tabular-nums; }
.result-passcode::before { content: 'NO. '; color: var(--faint); letter-spacing: .08em; }
.result-tags { display: flex; flex-wrap: wrap; gap: 0; }
.result-tag { padding: 6px 10px; border: 1px solid var(--rule-2); margin: 0 -1px -1px 0; color: var(--bone); font: 600 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.result-stats { display: flex; gap: 0; border: 1px solid var(--rule-2); }
.result-stats > div { flex: 1; padding: 12px 16px; background: var(--ink-2); }
.result-stats > div + div { border-left: 1px solid var(--rule-2); }
.stat-label { display: block; color: var(--gold); font: 600 10px/1 var(--mono); letter-spacing: .16em; }
.stat-value { display: block; margin-top: 6px; font: 900 44px/.9 var(--display); font-stretch: 62%; font-variant-numeric: tabular-nums; }
.result-description { background: var(--ink-2); border: 1px solid var(--rule-2); padding: 14px 16px; }
.result-description summary { cursor: pointer; font: 600 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--bone); }
.result-description summary::marker { color: var(--gold); }
.result-description p { margin-top: 12px; color: var(--dim); font-size: 14px; white-space: pre-line; }
.result-method { display: flex; align-items: center; gap: 8px; color: var(--dim); font: 500 11px/1.4 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.result-method .icon { color: var(--lock); width: 16px; height: 16px; }
.result-footnote { color: var(--faint); font-size: 12px; }
.result-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.result-buttons .button { flex: 1; }
.sample-note { padding: 10px 14px; background: #a48bff14; border-left: 4px solid var(--violet); color: #d8ceff; font-size: 13px; }
.candidate-block { display: flex; flex-direction: column; gap: 12px; padding: 20px 20px 24px; }
.candidate-block h3 { font-size: 32px; font-weight: 900; font-stretch: 64%; }
.candidate-block > p { color: var(--dim); }
.pending-card { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 44px 20px; color: var(--dim); text-align: center; font: 500 12px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.spinner { width: 30px; height: 30px; border: 3px solid var(--panel-3); border-top-color: var(--gold); border-right-color: var(--gold); animation: spin .9s steps(8) infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.about-dialog { padding-bottom: 18px; counter-reset: step; }
.steps { margin: 0; padding: 0 20px; list-style: none; display: flex; flex-direction: column; gap: 0; color: var(--dim); border-top: 1px solid var(--rule); }
.steps li { position: relative; padding: 14px 0 14px 52px; border-bottom: 1px solid var(--rule); }
.steps li::before { counter-increment: step; content: '0' counter(step); position: absolute; left: 0; top: 12px; font: 900 32px/1 var(--display); font-stretch: 62%; color: var(--gold); }
.steps strong { color: var(--bone); font: 800 16px/1 var(--display); font-stretch: 80%; text-transform: uppercase; letter-spacing: .02em; }
.help-list { display: grid; gap: 0; margin: 18px 20px 6px; border: 1px solid var(--rule-2); }
.help-list div { padding: 12px 14px; background: var(--ink-2); }
.help-list div + div { border-top: 1px solid var(--rule-2); }
.help-list h3 { font-size: 17px; font-stretch: 78%; margin-bottom: 6px; }
.help-list p { color: var(--dim); font-size: 14px; }
.menu-row { display: flex; align-items: center; gap: 12px; width: calc(100% - 40px); margin: 14px 20px 4px; padding: 12px 14px; border: 1px solid var(--gold); background: transparent; color: var(--bone); text-align: left; }
.menu-row:hover { background: #ffc6290f; }
.menu-icon { display: grid; place-items: center; width: 38px; height: 38px; background: var(--gold); color: var(--gold-ink); }
.menu-copy { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.menu-copy strong { font: 800 17px/1 var(--display); font-stretch: 78%; text-transform: uppercase; }
.menu-copy small { color: var(--faint); font: 500 11px/1.3 var(--mono); }
.menu-row > .icon { color: var(--gold); }
.source-disclosure { margin: 14px 20px 0; color: var(--dim); font-size: 13px; }
.source-disclosure summary { cursor: pointer; font: 600 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--bone); padding: 10px 0; }
.source-disclosure summary::marker { color: var(--gold); }
.source-note { display: grid; gap: 10px; padding-bottom: 6px; }
.legal-note { margin: 12px 20px 20px; color: var(--faint); font-size: 12px; line-height: 1.5; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: calc(24px + var(--tabbar-h) + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: 14px; width: max-content; max-width: calc(100vw - 32px); padding: 12px 12px 12px 16px; background: var(--bone); color: var(--ink); font-weight: 600; font-size: 14px; box-shadow: var(--hard); border-left: 6px solid var(--gold); animation: rise .18s ease-out; }
.toast-undo, .toast .text-button { padding: 7px 10px; border: 0; background: var(--ink); color: var(--gold); font: 700 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }

/* Quick edit: one session card with Review's controls, opened from the rail. */
.quick-edit-body { padding: 0 20px; }
.quick-edit-body .review-row { grid-template-columns: 72px minmax(0, 1fr); grid-template-areas: 'thumb main' 'thumb qty'; border-top: 1px solid var(--rule-2); row-gap: 12px; }
.quick-edit-body .row-check { display: none; }
.quick-edit-body .review-thumb { grid-area: thumb; align-self: start; width: 72px; height: 105px; }
.quick-edit-body .review-main { grid-area: main; }
.quick-edit-body .stepper { grid-area: qty; justify-self: start; }
.quick-edit-foot { display: flex; gap: 12px; padding: 18px 20px 22px; }
.quick-edit-foot .button { flex: 1; }

/* Photo cropper: same system */
.duel-cropper { --crop-ink: var(--bone); background: var(--panel) !important; color: var(--bone) !important; border: 1px solid var(--rule-2) !important; border-top: 4px solid var(--gold) !important; box-shadow: 10px 10px 0 #000 !important; font-family: var(--body) !important; }
.duel-cropper::backdrop { background: #050506e0 !important; }
.duel-cropper h2 { font-family: var(--display); font-stretch: 64%; font-weight: 900 !important; text-transform: uppercase; letter-spacing: 0 !important; font-size: 34px !important; line-height: .95 !important; }
.duel-cropper__eyebrow { color: var(--gold) !important; font-family: var(--mono) !important; }
.duel-cropper__intro, .duel-cropper__status, .duel-cropper__keyboard-hint { color: var(--dim) !important; }
.duel-cropper__stage { background: var(--ink) !important; border: 1px solid var(--rule-2); }
.duel-cropper__close, .duel-cropper__tool, .duel-cropper__cancel { border-color: var(--rule-2) !important; color: var(--bone) !important; }
.duel-cropper__tool, .duel-cropper__cancel, .duel-cropper__submit { font-family: var(--mono) !important; text-transform: uppercase; letter-spacing: .06em; font-size: 12px !important; }
.duel-cropper__tool:hover, .duel-cropper__close:hover, .duel-cropper__cancel:hover { background: var(--panel-2) !important; }
.duel-cropper__submit { background: var(--gold) !important; border-color: var(--gold) !important; color: var(--gold-ink) !important; box-shadow: var(--hard); }
.duel-cropper__submit span { color: var(--gold-ink) !important; }
.duel-cropper__corner span { background: var(--gold) !important; border-color: var(--ink) !important; color: var(--gold-ink) !important; box-shadow: 0 0 0 2px var(--gold), 3px 3px 0 #000 !important; font-family: var(--mono); }
.duel-cropper__corner.is-invalid span { background: var(--alert) !important; }

/* ---------- Camera-first live mode ----------
 * While the camera runs, the feed is the interface: controls shrink to small translucent squares
 * on the edges, duplicate chrome is hidden and the viewfinder thins out. */
.camera-stage.live .pill { height: 28px; padding: 0 10px; background: #0a0a0b8c; border-color: #ffffff26; font-size: 10px; }
.camera-stage.live .stage-top { top: 10px; left: 10px; right: 10px; }
.camera-stage.live .viewfinder i { width: 24px; height: 24px; border-color: #ffc629cc; }
.camera-stage.live .viewfinder i:nth-child(1) { border-width: 2px 0 0 2px; }
.camera-stage.live .viewfinder i:nth-child(2) { border-width: 2px 2px 0 0; }
.camera-stage.live .viewfinder i:nth-child(3) { border-width: 0 0 2px 2px; }
.camera-stage.live .viewfinder i:nth-child(4) { border-width: 0 2px 2px 0; }
.camera-stage.live::after { background: linear-gradient(180deg, #0008, transparent 12%, transparent 84%, #0009); }
.camera-stage.live .camera-tools { left: 10px; right: 10px; bottom: 10px; justify-content: space-between; align-items: flex-end; pointer-events: none; }
.camera-stage.live .stage-tool { pointer-events: auto; min-width: 44px; height: 44px; padding: 0; background: #0a0a0b8c; border: 1px solid #ffffff2e; }
.camera-stage.live .stage-tool + .stage-tool { border-left-width: 1px; }
.camera-stage.live .stage-tool > span:not(.tool-count) { display: none; }
.camera-stage.live .stage-tool .icon { width: 18px; height: 18px; }
.camera-stage.live .stop-tool { order: -2; font-size: 0; gap: 0; }
.camera-stage.live #resetFocus, .camera-stage.live .torch-tool { order: -1; margin-right: auto; margin-left: 8px; }
.camera-stage.live #resetFocus + .torch-tool { margin-left: 0; }
.camera-stage.live .review-tool { background: #ffc629d9; border-color: var(--gold); color: var(--gold-ink); }
.camera-stage.live .tool-count { top: -7px; right: -7px; min-width: 18px; height: 16px; font-size: 10px; border-width: 1px; }
.camera-stage.live .live-hint { bottom: 64px; padding: 5px 9px; gap: 7px; background: #0a0a0b8c; border-color: #ffffff1f; font-size: 9px; color: #f1ece1cc; }
.camera-stage.live .live-match-banner { bottom: 64px; max-width: 360px; padding: 6px 10px 6px 6px; box-shadow: none; }
.camera-stage.live .live-match-image { width: 32px; height: 46px; }
.camera-stage.live .live-match-copy strong { font-size: 15px; }
.camera-stage.live .match-check { width: 28px; height: 28px; }
.camera-stage.live .match-flash-badge { font-size: 26px; padding: 10px 18px 8px; }
.camera-stage.live .match-flash { background: #3ef08a1f; box-shadow: inset 0 0 0 5px var(--lock); }

/* ---------- Mobile (Pixel 7a/8a and friends) ---------- */
@media (max-width: 860px) {
  :root { --tabbar-h: 64px; }
  body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); background-size: 32px 32px; }
  .topbar { height: 56px; padding: 0 12px 0 14px; padding-top: env(safe-area-inset-top); }
  .main-nav { display: none; }
  .header-tools { margin-left: auto; gap: 6px; }
  .tabbar { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding: 0 0 env(safe-area-inset-bottom); background: var(--ink); border-top: 1px solid var(--rule-2); counter-reset: tab; }
  .tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: 0; border-right: 1px solid var(--rule); background: none; color: var(--faint); font: 600 10px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
  .tab:last-child { border-right: 0; }
  .tab::before { counter-increment: tab; content: '0' counter(tab); position: absolute; top: 7px; left: 8px; font-size: 9px; color: var(--rule-2); }
  .tab::after { content: ''; position: absolute; left: -1px; right: 0; top: -1px; height: 3px; background: transparent; }
  .tab .icon { width: 22px; height: 22px; }
  .tab.active { color: var(--gold); background: #ffc6290d; }
  .tab.active::before { color: var(--gold); }
  .tab.active::after { background: var(--gold); }
  .tab-count { top: 6px; right: calc(50% - 26px); }
  .view { padding: 22px 16px 32px; }
  .view-heading { flex-direction: column; align-items: stretch; gap: 14px; margin-bottom: 18px; padding-bottom: 16px; }
  .view-heading h1 { font-size: clamp(46px, 14vw, 64px); }
  .heading-tools { justify-content: flex-start; }
  .scan-view { display: block; padding: 0; }
  .camera-stage { height: calc(100dvh - 56px - var(--tabbar-h) - env(safe-area-inset-bottom) - env(safe-area-inset-top) - 92px); min-height: 380px; max-height: none; border-width: 0 0 1px; }
  .scan-view.has-session .camera-stage { height: calc(100dvh - 56px - var(--tabbar-h) - env(safe-area-inset-bottom) - env(safe-area-inset-top) - 206px); min-height: 340px; }
  .video-controls { margin: 10px 14px 0; }
  .session-dock { position: static; max-height: none; margin: 0; border: 0; background: transparent; }
  .dock-head { padding: 14px 16px 10px; border: 0; }
  .dock-head h2 { font-size: 22px; }
  .dock-meta { margin-top: 4px; }
  .session-tray { flex-direction: row; overflow-x: auto; overflow-y: hidden; min-height: 0; padding: 4px 16px 12px; gap: 10px; scroll-snap-type: x proximity; scroll-padding-inline: 16px; scrollbar-width: none; }
  .session-tray::-webkit-scrollbar { display: none; }
  .tray-item { flex-direction: column; flex: none; width: 74px; gap: 6px; padding: 0; border: 0; background: none; scroll-snap-align: start; }
  .tray-item.fresh { background: none; box-shadow: none; }
  .tray-item.fresh img { outline: 3px solid var(--lock); outline-offset: -3px; }
  .tray-item img { width: 74px; height: 108px; box-shadow: 3px 3px 0 #000; }
  .tray-copy { width: 100%; }
  .tray-copy strong { font-size: 11px; line-height: 1.1; text-align: center; white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 2.2em; }
  .tray-copy small { display: none; }
  .tray-qty { position: absolute; top: 0; left: 0; min-width: 26px; height: 20px; font-size: 11px; }
  .tray-empty { flex-direction: row; min-height: 60px; height: auto; padding: 10px 0; justify-content: flex-start; text-align: left; }
  .tray-empty .icon { width: 22px; height: 22px; }
  .dock-foot { padding: 8px 16px 16px; border: 0; border-top: 1px solid var(--rule); background: transparent; }
  .review-row { grid-template-columns: auto 56px minmax(0, 1fr); grid-template-areas: 'check thumb main' 'check thumb qty'; row-gap: 10px; padding: 12px 12px 12px 16px; }
  .review-row .row-check { grid-area: check; }
  .review-row .review-thumb { grid-area: thumb; width: 56px; height: 82px; }
  .review-row .review-main { grid-area: main; }
  .review-row .stepper { grid-area: qty; justify-self: start; }
  .review-name { font-size: 19px; }
  .review-footer { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 10px); margin: 16px 0 0; padding: 10px; }
  .review-footer .button-lg { min-height: 52px; padding: 10px 16px; font-size: 16px; }
  .collection-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .collection-toolbar { flex-wrap: wrap; }
  .collection-toolbar .search-field { flex: 1 1 100%; }
  .collection-toolbar .select-field { flex: 1 1 auto; border-left-width: 1px; border-top-width: 0; }
  .collection-toolbar .select-field select { width: 100%; }
  .review-stats, .stat-row { grid-template-columns: repeat(2, 1fr); }
  .review-stats .stat:nth-child(2), .stat-row .stat:nth-child(2) { border-right: 0; }
  .review-stats .stat:nth-child(-n+2), .stat-row .stat:nth-child(-n+2) { border-bottom: 1px solid var(--rule-2); }
  .top-cards-list { grid-template-columns: 1fr; }
  .top-card + .top-card { border-left: 0; border-top: 1px solid var(--rule-2); }
  .stat { padding: 12px 12px 10px; }
  .stat b { font-size: 34px; }
  .dialog { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-width: 4px 0 0; box-shadow: 0 -10px 40px #000; }
  .dialog[open] { animation: sheet .22s ease-out; }
  @keyframes sheet { from { transform: translateY(40px); opacity: .4; } }
  .result-identity { grid-template-columns: 108px 1fr; gap: 16px; }
  .result-card-image { width: 108px; }
  /* Live: hide the top bar and the session header, give the feed everything above a slim tray. */
  body:has(#cameraStage.live) .topbar, body:has(#cameraStage.live) .storage-notice { display: none; }
  body:has(#cameraStage.live) .camera-stage { height: calc(100dvh - var(--tabbar-h) - env(safe-area-inset-bottom)); min-height: 0; padding-top: env(safe-area-inset-top); border-width: 0; }
  body:has(#cameraStage.live) .scan-view.has-session .camera-stage { height: calc(100dvh - var(--tabbar-h) - env(safe-area-inset-bottom) - 72px); }
  body:has(#cameraStage.live) .dock-head, body:has(#cameraStage.live) .dock-foot, body:has(#cameraStage.live) .scan-view:not(.has-session) .session-dock { display: none; }
  body:has(#cameraStage.live) .session-tray { height: 72px; padding: 8px 12px; gap: 6px; scroll-padding-inline: 12px; }
  body:has(#cameraStage.live) .tray-item { width: 38px; }
  body:has(#cameraStage.live) .tray-item img { width: 38px; height: 56px; box-shadow: none; }
  body:has(#cameraStage.live) .tray-copy { display: none; }
  body:has(#cameraStage.live) .tray-qty { min-width: 18px; height: 14px; font-size: 9px; padding: 0 3px; }
  body:has(#cameraStage.live) .video-controls { margin: 0; border-width: 1px 0; }
  body:has(#cameraStage.live) .camera-stage.live .stage-top { top: calc(10px + env(safe-area-inset-top)); }
}
@media (max-width: 380px) {
  .stage-tool span:not(.tool-count) { display: none; }
  .collection-grid { grid-template-columns: repeat(2, 1fr); }
  .brand-tag { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}

/* Summon mode (easter egg). Everything sits under the stage controls and only shows while live. */
.toggle-state { min-width: 44px; padding: 5px 8px; border: 1px solid var(--rule-2); color: var(--dim); font: 700 12px/1 var(--mono); text-align: center; text-transform: uppercase; letter-spacing: .08em; }
.summon-row[aria-pressed='true'] { background: #ffc6291a; }
.summon-row[aria-pressed='true'] .toggle-state { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.summon-canvas, .summon-labels, .summon-badge { display: none; }
.camera-stage.live.summon-on .summon-canvas { display: block; position: absolute; z-index: 3; pointer-events: none; }
.camera-stage.live.summon-on .summon-labels { display: block; position: absolute; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
.camera-stage.live.summon-on .summon-badge { display: block; position: absolute; z-index: 5; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 4px 8px; background: #0a0a0bb3; border: 1px solid #ffc62966; color: var(--gold); font: 700 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; pointer-events: none; }
.camera-stage.summon-on .detection-overlay, .camera-stage.summon-on .match-flash, .camera-stage.summon-on .live-match-banner { display: none !important; }
.summon-tag { --attr: var(--gold); position: absolute; left: 0; top: 0; min-width: 116px; max-width: 188px; padding: 6px 9px 7px; background: #0a0a0bd9; border: 1px solid #ffffff26; border-left: 3px solid var(--attr); color: var(--bone); box-shadow: 0 0 18px -4px var(--attr); will-change: transform; transition: opacity .2s; }
.summon-tag[data-kind='reading'] { min-width: 0; padding: 4px 7px; box-shadow: none; }
.summon-tag-head { display: flex; justify-content: space-between; gap: 10px; color: var(--attr); font: 700 10px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.summon-tag[data-kind='reading'] .summon-tag-head { color: var(--dim); }
.summon-name { display: block; margin-top: 4px; font: 800 15px/1.05 var(--display); font-stretch: 80%; text-transform: uppercase; overflow-wrap: anywhere; }
.summon-level { margin-top: 3px; color: var(--gold); font-size: 10px; letter-spacing: .5px; }
.summon-stats { display: flex; gap: 12px; margin-top: 5px; font: 700 15px/1 var(--mono); }
.summon-stats small { margin-right: 4px; color: var(--dim); font-size: 9px; letter-spacing: .1em; }
.summon-note { display: block; margin-top: 4px; color: var(--faint); font: 500 9px/1.2 var(--mono); }

/* ---------- Price on scan: "Matched" steps back, the value leads, and the treatment climbs with it ---------- */
.match-flash-text { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.match-flash-text small { font: 700 11px/1 var(--mono); letter-spacing: .18em; opacity: .75; }
.match-flash-badge.priced { font-family: var(--mono); font-stretch: 100%; font-weight: 800; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.match-flash-badge.tier-common { background: var(--panel-2); color: var(--dim); font-size: 22px; box-shadow: 4px 4px 0 #000; }
.match-flash-badge.tier-common .icon { color: var(--faint); width: 20px; height: 20px; }
.match-flash-badge.tier-unknown { font-size: 22px; }
.match-flash-badge.tier-expensive { background: var(--gold); color: var(--gold-ink); font-size: 40px; }
.match-flash-badge.tier-jackpot { background: var(--gold); color: var(--gold-ink); font-size: 52px; padding: 16px 26px 14px; box-shadow: 0 0 0 4px var(--ink), 0 0 0 8px var(--gold), 10px 10px 0 8px #000; }
.camera-stage.live .match-flash-badge.tier-expensive { font-size: 32px; }
.camera-stage.live .match-flash-badge.tier-jackpot { font-size: 42px; padding: 12px 20px 10px; }
.camera-stage.live .match-flash-badge.tier-common, .camera-stage.live .match-flash-badge.tier-unknown { font-size: 20px; }
.match-flash:has(.tier-expensive), .match-flash:has(.tier-jackpot) { box-shadow: inset 0 0 0 5px var(--gold) !important; }
.match-flash:has(.tier-common) { box-shadow: inset 0 0 0 3px var(--rule-2) !important; }

.live-match-price { flex: none; margin-left: auto; padding-left: 8px; color: var(--bone); font: 800 20px/1 var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.live-match-banner.priced .live-match-copy strong { font-size: 13px; }
.live-match-banner.priced .live-match-copy > span { font-size: 9px; }
.live-match-banner.tier-common { border-left-color: var(--faint); background: #111113e8; }
.live-match-banner.tier-common .live-match-price, .live-match-banner.tier-unknown .live-match-price { color: var(--faint); font-size: 14px; }
.live-match-banner.tier-common .live-match-copy > span { color: var(--faint); }
.live-match-banner.tier-expensive { border-left-color: var(--gold); background: #1a1405f0; box-shadow: 4px 4px 0 #000, inset 0 0 0 1px var(--gold); }
.live-match-banner.tier-expensive .live-match-price { color: var(--gold); font-size: 26px; }
.live-match-banner.tier-expensive .live-match-copy > span { color: var(--gold); }
.live-match-banner.tier-jackpot { border-left-color: var(--ink); background: var(--gold); color: var(--gold-ink); box-shadow: 0 0 0 3px var(--ink), 6px 6px 0 3px #000; }
.live-match-banner.tier-jackpot .live-match-price { color: var(--gold-ink); font-size: 30px; }
.live-match-banner.tier-jackpot .live-match-copy > span { color: #110c00b3; }
.live-match-banner.tier-jackpot::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, #ffffff8c 50%, transparent 65%) -200% 0 / 200% 100% no-repeat; animation: jackpot-shine 1.2s ease-out .15s 2; pointer-events: none; }
@keyframes jackpot-shine { to { background-position: 200% 0; } }
@media (prefers-reduced-motion: reduce) { .live-match-banner.tier-jackpot::after { animation: none; } }

/* A range means the printing matters: the dearest printing sets the colour, the flag asks for a check. */
.price-varies b { font-size: 13px; }
.price-varies small { color: var(--gold); }
.price-common.price-varies small { color: var(--faint); }
.value-flag.check { border-color: var(--gold); border-left-width: 4px; background: var(--ink); color: var(--gold); }
.match-flash-badge.varies.priced { font-size: 26px; }
.camera-stage.live .match-flash-badge.varies.priced { font-size: 22px; }
.live-match-banner.varies .live-match-price { font-size: 15px; }
/* Prices on scan: a quiet square tool. Gold when on, dim when off, never a filled block over the feed. */
.stage-tool.price-tool[aria-pressed='true'] { background: #0a0a0bf0; color: var(--gold); border-color: var(--rule-2); }
.stage-tool.price-tool[aria-pressed='false'] { color: var(--faint); }
.camera-stage.live .stage-tool.price-tool[aria-pressed='true'] { background: #0a0a0b8c; color: var(--gold); border-color: #ffc62966; }

/* ---- Account: sign-in page, account row and sync state ---- */
.signin-page { display: grid; place-items: center; min-height: 100dvh; padding: 24px 16px; }
.signin-panel { width: min(460px, 100%); padding: 28px 24px 24px; border: 1px solid var(--rule-2); border-top: 4px solid var(--gold); background: var(--panel); box-shadow: 10px 10px 0 #000; }
.signin-panel .brand { margin-bottom: 28px; }
.signin-panel h1 { margin: 0 0 12px; font: 900 40px/0.95 var(--display); font-stretch: 64%; text-transform: uppercase; }
.signin-copy { margin: 0 0 22px; color: var(--dim); }
.signin-google { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 54px; padding: 0 18px 0 0; border: 2px solid var(--bone); background: var(--bone); color: var(--ink); font: 800 16px/1 var(--display); font-stretch: 85%; letter-spacing: .05em; text-transform: uppercase; box-shadow: var(--hard); cursor: pointer; }
.signin-google svg { flex: none; width: 50px; height: 50px; padding: 13px; background: #fff; border-right: 2px solid var(--ink); }
.signin-google:hover:not(:disabled) { background: #fff; }
.signin-google:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #000; }
.signin-google:disabled { opacity: .55; cursor: default; }
.signin-status { margin: 14px 0 0; padding: 10px 12px; border-left: 3px solid var(--gold); background: var(--ink-2); font: 500 12px/1.4 var(--mono); }
.signin-status.is-error { border-left-color: var(--alert); color: #ffb3ac; }
.signin-panel .text-button { margin-top: 16px; }
.signin-fine { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--rule); color: var(--faint); font: 500 11px/1.45 var(--mono); }
.account-avatar { display: grid; place-items: center; width: 38px; height: 38px; flex: none; background: var(--gold); color: var(--gold-ink); font: 900 18px/1 var(--display); object-fit: cover; }
.sync-state { font: 700 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.sync-state[data-status="synced"] { color: var(--lock); }
.sync-state[data-status="syncing"], .sync-state[data-status="connecting"] { color: var(--gold); }
.sync-state[data-status="offline"], .sync-state[data-status="error"] { color: var(--alert); }
.sync-button[data-status="synced"] .icon { color: var(--lock); }
@media (min-width: 861px) { .account-dialog { width: min(440px, calc(100vw - 24px)); } }
.account-body { display: flex; flex-direction: column; gap: 14px; padding: 0 20px 20px; }
.account-who { display: flex; align-items: center; gap: 12px; }
.account-who .account-avatar { width: 48px; height: 48px; font-size: 22px; }
.account-who strong { display: block; font: 800 20px/1.1 var(--display); font-stretch: 78%; text-transform: uppercase; }
.account-who small { color: var(--faint); font: 500 12px/1.3 var(--mono); word-break: break-all; }
.account-note { margin: 0; color: var(--dim); font-size: 13px; }

/* Collection: the printing filter, per-session delete and the danger zone. */
.filter-chip { display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; min-height: 48px; border: 1px solid var(--gold); border-left-width: 0; background: transparent; color: var(--gold); font: 600 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.filter-chip[aria-pressed='true'] { background: var(--gold); color: var(--gold-ink); }
.filter-chip .count-badge { min-width: 0; }
.ledger-row .ledger-delete { width: 36px; height: 36px; flex: none; color: var(--faint); }
.ledger-row .ledger-delete:hover { color: var(--alert); border-color: var(--alert); }
.danger-zone { margin-top: 40px; padding-top: 20px; border-top: 1px dashed var(--rule-2); display: flex; justify-content: center; }
.delete-confirm { display: flex; flex-direction: column; gap: 8px; color: var(--dim); font: 600 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.delete-confirm input { min-height: 48px; padding: 0 14px; border: 1px solid var(--rule-2); background: var(--ink); color: var(--bone); font: 700 18px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; }
.delete-confirm input:focus { outline: 2px solid var(--alert); outline-offset: -2px; }
.delete-dialog { border-top-color: var(--alert); }
@media (max-width: 720px) { .collection-toolbar .filter-chip { flex: 1 1 100%; justify-content: center; border-left-width: 1px; border-top-width: 0; } }

/* ---------- Game switch ----------
 * One game is live at a time. The top bar carries a hard-edged switch (gold code block + name); while
 * the camera runs, a small code tag on the feed is the only reminder, and both open the same picker. */
.game-switch { display: inline-flex; align-items: stretch; height: 34px; padding: 0; border: 1px solid var(--rule-2); background: var(--ink-2); color: var(--bone); cursor: pointer; }
.game-switch:hover, .game-switch:focus-visible { border-color: var(--gold); }
.game-switch-code { display: grid; place-items: center; min-width: 46px; padding: 0 8px; background: var(--gold); color: var(--gold-ink); font: 800 12px/1 var(--mono); letter-spacing: .08em; }
.game-switch-name { display: flex; align-items: center; padding: 0 0 0 10px; font: 800 15px/1 var(--display); font-stretch: 70%; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; }
.game-switch .beta-tag { align-self: center; margin-left: 8px; }
.game-switch .icon { align-self: center; width: 15px; height: 15px; margin: 0 9px 0 10px; color: var(--gold); }
/* Deck check reads Yu-Gi-Oh! decklists only. */
html:not([data-game="ygo"]) [data-view="decks"] { display: none !important; }
.game-switch.beta .game-switch-code { box-shadow: inset 0 -4px 0 var(--violet); }
.beta-tag { padding: 3px 4px; border: 1px solid var(--violet); color: var(--violet); font: 700 9px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.stage-top-left { display: inline-flex; gap: 8px; }
.game-pill { display: none; gap: 6px; padding: 0 9px; cursor: pointer; }
.game-pill b { color: var(--gold); font-weight: 800; letter-spacing: .1em; }
.game-pill .beta-dot { color: var(--violet); font-weight: 700; }
.camera-stage.live .game-pill { display: inline-flex; }

.dialog-kicker { margin: 0 0 8px; color: var(--gold); font: 700 10px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; }
@media (min-width: 861px) { .game-dialog { width: min(560px, calc(100vw - 24px)); } }
.game-dialog .dialog-header { align-items: flex-start; }
.game-list { display: grid; margin: 0 20px; border: 1px solid var(--rule-2); counter-reset: game; }
.game-tile { position: relative; display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; align-items: stretch; min-height: 88px; padding: 0; border: 0; border-bottom: 1px solid var(--rule-2); background: var(--panel); color: var(--bone); text-align: left; cursor: pointer; counter-increment: game; }
.game-tile:last-child { border-bottom: 0; }
.game-tile:hover, .game-tile:focus-visible { background: var(--panel-2); outline: none; }
.game-tile:focus-visible { box-shadow: inset 0 0 0 2px var(--gold); }
.game-mark { position: relative; display: grid; place-items: center; border-right: 1px solid var(--rule-2); background: repeating-linear-gradient(135deg, #ffffff07 0 2px, transparent 2px 9px), var(--ink-2); overflow: hidden; }
.game-mark::before { content: '0' counter(game); position: absolute; top: 7px; left: 8px; color: var(--faint); font: 600 9px/1 var(--mono); letter-spacing: .1em; }
.game-mark b { font: 900 30px/1 var(--display); font-stretch: 62%; letter-spacing: .02em; color: var(--bone); }
.game-copy { display: flex; flex-direction: column; justify-content: center; gap: 7px; min-width: 0; padding: 14px 16px; }
.game-copy strong { font: 800 21px/1.05 var(--display); font-stretch: 66%; letter-spacing: .02em; text-transform: uppercase; }
.game-copy small { color: var(--dim); font: 500 11px/1.35 var(--mono); letter-spacing: .03em; }
.game-state { align-self: center; margin-right: 16px; padding: 5px 7px; border: 1px solid var(--rule-2); color: var(--faint); font: 700 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.game-state.beta { border-color: var(--violet); color: var(--violet); }
.game-state.on { border-color: var(--gold); background: var(--gold); color: var(--gold-ink); }
.game-tile.active { background: #ffc6290b; }
.game-tile.active::before { content: ''; position: absolute; z-index: 1; left: 0; top: 0; bottom: 0; width: 5px; background: var(--gold); }
.game-tile.active .game-mark { background: repeating-linear-gradient(135deg, #0000000f 0 2px, transparent 2px 9px), var(--gold); border-right-color: var(--gold); }
.game-tile.active .game-mark b, .game-tile.active .game-mark::before { color: var(--gold-ink); }
.game-list.switching .game-tile { pointer-events: none; }
.game-list.switching .game-tile:not(.loading) { opacity: .4; }
.game-tile.loading .game-state { border-color: var(--gold); color: var(--gold); animation: rec 1s steps(2) infinite; }
.game-tile.loading .game-state::after { content: ' · loading'; }
.game-note { margin: 14px 20px 22px; color: var(--faint); font: 500 11px/1.5 var(--mono); }
@media (max-width: 860px) {
  .game-switch { height: 32px; margin-left: 2px; }
  .game-switch-name { font-size: 14px; }
}
@media (max-width: 420px) {
  .game-switch-name, .game-switch .beta-tag { display: none; }
  .game-switch .icon { margin: 0 7px; }
  .brand { gap: 9px; }
  .game-tile { grid-template-columns: 70px minmax(0, 1fr) auto; min-height: 82px; }
  .game-mark b { font-size: 26px; }
  .game-copy { padding: 12px 12px; }
  .game-copy strong { font-size: 19px; }
  .game-state { margin-right: 12px; }
  .game-list, .game-note { margin-left: 16px; margin-right: 16px; }
}
/* Running session value: a small pill beside the camera state that ticks up as cards match. */
.stage-top .session-value { display: none; margin-left: auto; position: relative; gap: 8px; border-color: var(--rule-2); font-variant-numeric: tabular-nums; }
/* Only while the camera runs; the session dock carries the value otherwise. */
.camera-stage.live .stage-top .session-value:not([hidden]) { display: inline-flex; }
.session-value-label { color: var(--dim); }
.session-value b { color: var(--gold); font: 800 13px/1 var(--mono); letter-spacing: .02em; }
.session-value-gain { position: absolute; right: 0; top: calc(100% + 6px); padding: 4px 7px 3px; background: var(--gold); color: var(--gold-ink); font: 800 12px/1 var(--mono); opacity: 0; pointer-events: none; white-space: nowrap; }
.session-value.tick b { animation: value-tick .7s ease-out; }
.session-value.big { border-color: var(--gold); }
.session-value.big .session-value-gain { animation: value-gain 1.8s ease-out forwards; }
.session-value.big b { animation: value-tick 1s ease-out; }
@keyframes value-tick { 0% { color: var(--bone); transform: translateY(-2px); } 100% { color: var(--gold); transform: none; } }
@keyframes value-gain { 0% { opacity: 0; transform: translateY(-6px); } 12%, 70% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.camera-stage.live .session-value { height: 28px; padding: 0 10px; background: #0a0a0b8c; border-color: #ffffff26; }
.camera-stage.live .session-value b { font-size: 12px; }
.camera-stage.live .session-value.big { border-color: var(--gold); }
@media (prefers-reduced-motion: reduce) { .session-value b, .session-value .session-value-gain { animation: none !important; } }
/* Deck check */
.deck-input { display: grid; gap: 10px; margin-bottom: 24px; }
.deck-input-label { color: var(--dim); font: 600 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.deck-input textarea { width: 100%; min-height: 150px; padding: 14px; resize: vertical; background: var(--ink-2); border: 1px solid var(--rule-2); color: var(--bone); font: 500 13px/1.5 var(--mono); outline: none; }
.deck-input textarea:focus { border-color: var(--gold); box-shadow: inset 3px 0 0 var(--gold); }
.deck-input textarea::placeholder { color: var(--faint); }
.deck-input-tools { display: flex; flex-wrap: wrap; gap: 10px; }
.deck-recent { margin-bottom: 28px; }
.deck-recent-title, .deck-section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; font: 800 20px/1 var(--display); font-stretch: 70%; text-transform: uppercase; }
.deck-section-title small { color: var(--dim); font: 600 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.deck-recent-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.deck-recent-row { display: flex; border: 1px solid var(--rule-2); background: var(--panel); }
.deck-recent-open { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 0; background: none; color: var(--bone); text-align: left; }
.deck-recent-open:hover { background: var(--panel-2); }
.deck-recent-open strong { font: 700 14px/1.1 var(--body); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-recent-open small { color: var(--faint); font: 500 10px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.deck-recent-delete { width: 40px; height: auto; border-width: 0 0 0 1px; color: var(--faint); }
.deck-result { padding-top: 20px; border-top: 1px solid var(--rule); scroll-margin-top: 80px; }
.deck-result-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.deck-result-head h2 { font: 900 clamp(32px, 6vw, 48px)/.9 var(--display); font-stretch: 62%; text-transform: uppercase; overflow-wrap: anywhere; }
.deck-verdict { margin-top: 8px; color: var(--dim); }
.deck-bar { --done: 0%; position: relative; height: 28px; margin-bottom: 16px; border: 1px solid var(--rule-2); background: repeating-linear-gradient(90deg, var(--ink-2) 0 10px, var(--panel) 10px 11px); }
.deck-bar span { position: absolute; inset: 0 auto 0 0; width: var(--done); background: var(--gold); transition: width .3s ease; }
.deck-bar b { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font: 800 12px/1 var(--mono); color: var(--bone); mix-blend-mode: difference; }
.deck-actions { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; margin-bottom: 24px; }
.deck-actions .filter-chip { margin-left: auto; border-left-width: 1px; }
.deck-sections { display: grid; gap: 28px; }
.deck-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule-2); }
.deck-row { display: grid; grid-template-columns: minmax(0, 1fr) 72px 104px; align-items: center; border-bottom: 1px solid var(--rule); }
.deck-row.is-missing { box-shadow: inset 3px 0 0 var(--gold); }
.deck-row-main { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 8px 12px; border: 0; background: none; color: var(--bone); text-align: left; }
.deck-row-main:hover { background: var(--panel-2); }
.deck-row-main img { width: 36px; height: 52px; object-fit: cover; flex: none; background: var(--panel-2); box-shadow: 3px 3px 0 #000; }
.deck-row.is-owned .deck-row-main img { opacity: .55; }
.deck-row-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.deck-row-copy strong { font: 800 15px/1.05 var(--display); font-stretch: 78%; text-transform: uppercase; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.deck-row-copy small { color: var(--faint); font: 500 10px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-row-have, .deck-row-price { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; padding-right: 12px; font-variant-numeric: tabular-nums; }
.deck-row-have b { font: 800 16px/1 var(--mono); }
.deck-row.is-missing .deck-row-have small { color: var(--gold); }
.deck-row-have small, .deck-row-price small { color: var(--faint); font: 500 10px/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.deck-row-price b { font: 800 15px/1 var(--mono); }
.deck-row-price .price-unknown { color: var(--faint); font-size: 11px; }
.deck-tick { color: var(--lock); }
.deck-empty-line { padding: 14px 12px; color: var(--faint); font: 500 12px/1.4 var(--mono); }
.deck-unresolved { margin-top: 24px; border: 1px solid var(--rule-2); background: var(--panel); }
.deck-unresolved summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; cursor: pointer; font: 600 12px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.deck-unresolved ul { margin: 0; padding: 0 14px 14px 32px; color: var(--dim); font: 500 13px/1.6 var(--mono); }
@media (max-width: 720px) {
  .deck-row { grid-template-columns: minmax(0, 1fr) 56px 84px; }
  .deck-row-main { padding: 8px 8px 8px 10px; gap: 10px; }
  .deck-row-have, .deck-row-price { padding-right: 8px; }
  .deck-actions .button { flex: 1 1 auto; justify-content: center; }
  .deck-actions .filter-chip { margin-left: 0; flex: 1 1 100%; justify-content: center; }
}

/* Rip video: REC on the camera, and the export sheet. */
.stage-tool.rec-tool[aria-pressed='true'] { background: #0a0a0bf0; color: var(--alert); border-color: #ff4a3d99; }
.camera-stage.live .stage-tool.rec-tool[aria-pressed='true'] { background: #0a0a0b8c; color: var(--alert); border-color: #ff4a3d99; padding: 0 10px 0 8px; gap: 6px; }
.stage-tool.rec-tool.recording .icon { animation: rec-blink 1s steps(2, jump-none) infinite; }
.rec-time { font: 700 12px/1 var(--mono); letter-spacing: 0; color: var(--alert); }
@keyframes rec-blink { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .stage-tool.rec-tool.recording .icon { animation: none; } }
@media (min-width: 861px) { .rip-dialog { width: min(480px, calc(100vw - 24px)); } }
.rip-stats { margin: 0 20px 14px; color: var(--dim); font: 600 12px/1.5 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.rip-stats strong { color: var(--gold); font-weight: 800; }
.rip-stage { margin: 0 20px; background: var(--ink); border: 1px solid var(--rule-2); display: grid; place-items: center; }
.rip-stage canvas, .rip-stage video { display: block; width: 100%; height: auto; max-height: 52dvh; object-fit: contain; }
.rip-stage canvas[hidden], .rip-stage video[hidden] { display: none; }
.rip-progress { margin: 0 20px; height: 6px; background: var(--panel-3); }
.rip-progress span { display: block; height: 100%; width: 0; background: var(--gold); }
.rip-note { margin: 12px 20px 0; color: var(--faint); font: 500 11px/1.5 var(--mono); }
.rip-actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 16px 20px 22px; }
.rip-actions .button { flex: 1 1 auto; }
.rip-stage { position: relative; }
.rip-tag { position: absolute; top: 10px; right: 10px; padding: 6px 9px 5px; background: var(--ink); border: 1px solid var(--gold); color: var(--gold); font: 700 10px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; }
.rip-tag[hidden] { display: none; }
/* Currency picker: asked on the first price scan, then from the ? menu. Big symbols, one tap. */
.currency-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 20px; border: 1px solid var(--rule-2); border-width: 1px 0 0 1px; }
.currency-tile { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; min-height: 72px; padding: 0; border: 0; border-right: 1px solid var(--rule-2); border-bottom: 1px solid var(--rule-2); background: var(--panel); color: var(--bone); text-align: left; cursor: pointer; }
.currency-tile:hover, .currency-tile:focus-visible { background: var(--panel-2); outline: none; }
.currency-tile:focus-visible { box-shadow: inset 0 0 0 2px var(--gold); }
.currency-symbol { display: grid; place-items: center; align-self: stretch; border-right: 1px solid var(--rule-2); background: var(--ink-2); font: 900 26px/1 var(--display); font-stretch: 62%; }
.currency-copy { display: flex; flex-direction: column; gap: 5px; min-width: 0; padding: 10px 12px; }
.currency-copy strong { font: 800 20px/1 var(--display); font-stretch: 66%; letter-spacing: .04em; }
.currency-copy small { color: var(--dim); font: 500 10px/1.3 var(--mono); letter-spacing: .03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.currency-tile.active { background: #ffc6290b; }
.currency-tile.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--gold); }
.currency-tile.active .currency-symbol { background: var(--gold); color: var(--gold-ink); border-right-color: var(--gold); }
@media (max-width: 420px) { .currency-list { margin: 0 16px; } .currency-tile { grid-template-columns: 52px minmax(0, 1fr); min-height: 66px; } }

/* An uploaded clip: play/replay on the left (not the red stop), Rip video centred once the clip is
   done, prices and review together on the right. */
.camera-stage.live.video-source .camera-tools { justify-content: flex-start; gap: 8px; }
.camera-stage.live.video-source .stop-tool .icon { color: var(--bone); fill: var(--bone); }
.camera-stage.live.video-source .price-tool { margin-left: auto; }
.camera-stage.live.video-source .rip-tool:not([hidden]) { margin-left: auto; }
.stage-tool.rip-tool { color: var(--gold); border-color: var(--gold); }
.camera-stage.live .stage-tool.rip-tool { padding: 0 14px 0 12px; gap: 8px; border-color: var(--gold); color: var(--gold); background: #0a0a0bd9; }
.camera-stage.live .stage-tool.rip-tool > span, .stage-tool.rip-tool > span { display: inline; }

/* Export, import and set lock */
.export-tile { cursor: default; }
.export-tile .game-mark b { font-size: 24px; }
.export-actions { display: flex; flex-direction: column; justify-content: center; align-items: flex-end; gap: 2px; padding-right: 14px; }
.import-body { display: grid; gap: 12px; padding: 0 20px 22px; }
.import-hint { color: var(--dim); font-size: 14px; }
.import-file { justify-content: center; }
.import-text { width: 100%; min-height: 110px; padding: 12px; resize: vertical; background: var(--ink-2); border: 1px solid var(--rule-2); color: var(--bone); font: 500 13px/1.5 var(--mono); outline: none; }
.import-text:focus { border-color: var(--gold); box-shadow: inset 3px 0 0 var(--gold); }
.import-stats { margin-bottom: 0; }
.import-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.import-actions .button-primary { flex: 1 1 auto; justify-content: center; }
.import-body .deck-unresolved { margin-top: 0; }
#emptyImport { margin-top: 6px; }
.set-pill { gap: 6px; border-color: var(--gold); color: var(--gold); }
.set-pill-label { color: var(--dim); font: 600 10px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.set-pill b { font: 800 12px/1 var(--mono); letter-spacing: .04em; }
.set-lock-button.on { border-color: var(--gold); color: var(--gold); }
.set-lock-button span { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-note { margin-top: 0; }
.set-search { margin: 0 20px 12px; }
.set-list { display: grid; margin: 0 20px; border: 1px solid var(--rule-2); max-height: 50dvh; overflow: auto; }
.set-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px 8px 0; border: 0; border-bottom: 1px solid var(--rule); background: var(--panel); color: var(--bone); text-align: left; }
.set-row:last-child { border-bottom: 0; }
.set-row:hover { background: var(--panel-2); }
.set-row.active { background: #ffc6290f; box-shadow: inset 5px 0 0 var(--gold); }
.set-code { align-self: stretch; display: grid; place-items: center; border-right: 1px solid var(--rule); color: var(--gold); font: 800 12px/1 var(--mono); letter-spacing: .04em; }
.set-name { font: 700 15px/1.2 var(--body); }
.set-count { color: var(--faint); font: 500 10px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.set-empty { padding: 16px 14px; color: var(--faint); font: 500 12px/1.4 var(--mono); }
.set-clear { margin: 14px 20px 22px; width: calc(100% - 40px); justify-content: center; }
.review-toolbar { flex-wrap: wrap; }
.review-set-field { order: 3; flex: 1 1 100%; min-height: 44px; border-color: var(--gold); }
.review-set-field select { width: 100%; color: var(--gold); text-overflow: ellipsis; }
@media (max-width: 420px) {
  .import-body { padding: 0 16px 20px; }
  .set-search, .set-list { margin-left: 16px; margin-right: 16px; }
  .set-clear { margin-left: 16px; margin-right: 16px; width: calc(100% - 32px); }
  .export-actions { padding-right: 10px; }
}
/* Start, Upload and One set form one block of equal width; the stage's status pills wait until
 * the camera is on, so the welcome screen carries the set lock once. */
.camera-welcome .button-lg { width: min(100%, 340px); min-width: 0; }
.welcome-alt { display: grid; grid-template-columns: 1fr 1fr; width: min(100%, 340px); margin-top: 0; }
.welcome-alt .chip-button { justify-content: center; min-width: 0; }
.welcome-alt .chip-button + .chip-button { border-left-width: 0; }
.welcome-alt .upload-button { min-width: 0; }
.camera-stage:has(#cameraWelcome:not([hidden])) .stage-top-left { display: none; }
.dock-head > div { min-width: 0; }
/* QUICKDRAW is wider than the old wordmark: keep the whole header on 360px phones. */
@media (max-width: 380px) {
  .brand { gap: 7px; }
  .brand-mark { width: 30px; height: 30px; }
  .brand-mark .icon { width: 19px; height: 19px; }
  .brand-word { font-size: 20px; }
  .header-tools { gap: 4px; }
}
/* Check printing filter: the count leads in a gold block (like the game switch), a square on the
 * right fills when the filter is on. Card flags use a solid gold edge rather than a dashed outline. */
.printing-filter { gap: 0; padding: 0; align-items: stretch; border-left-width: 1px; }
.printing-filter-count { display: grid; place-items: center; min-width: 48px; padding: 0 10px; background: var(--gold); color: var(--gold-ink); font: 900 22px/1 var(--display); font-stretch: 70%; letter-spacing: .02em; }
.printing-filter-label { display: flex; align-items: center; padding: 0 14px; }
.printing-filter-box { display: grid; place-items: center; align-self: center; width: 20px; height: 20px; margin: 0 14px 0 auto; border: 1px solid var(--gold); }
.printing-filter-box .icon { width: 14px; height: 14px; stroke-width: 3; opacity: 0; }
.printing-filter:hover { background: #ffc62914; }
.printing-filter[aria-pressed='true'] { background: #ffc6291f; color: var(--gold); box-shadow: inset 0 -3px 0 var(--gold); }
.printing-filter[aria-pressed='true'] .printing-filter-box { background: var(--gold); color: var(--gold-ink); }
.printing-filter[aria-pressed='true'] .printing-filter-box .icon { opacity: 1; }
.collection-toolbar .printing-filter { margin-left: -1px; }
@media (max-width: 720px) { .collection-toolbar .printing-filter { justify-content: flex-start; margin-left: 0; border-left-width: 1px; } }
/* Joined button groups: every button keeps all four borders and overlaps its neighbour by 1px,
 * and a gold-edged button sits on top, so a gold outline is never cut by a dark neighbour. */
.welcome-alt .chip-button + .chip-button { border-left-width: 1px; margin-left: -1px; }
.stage-tool + .stage-tool { border-left-width: 1px; margin-left: -1px; }
.camera-stage.live .stage-tool + .stage-tool { margin-left: 0; }
.collection-toolbar .select-field { border-left-width: 1px; margin-left: -1px; }
.welcome-alt .chip-button, .collection-toolbar > * { position: relative; }
.welcome-alt .chip-button:hover, .welcome-alt .set-lock-button.on, .stage-tool:hover, .stage-tool.rip-tool, .review-tool,
.collection-toolbar .search-field:focus-within, .collection-toolbar .printing-filter { z-index: 1; }
@media (max-width: 860px) {
  .collection-toolbar .select-field { margin-left: 0; border-top-width: 1px; margin-top: -1px; }
}
@media (max-width: 720px) {
  .collection-toolbar .printing-filter { border-top-width: 1px; margin-top: -1px; }
}
/* Set suggestion: a quiet question under the camera pills once a session clearly fits one set. */
.set-suggest { position: absolute; z-index: 8; top: 58px; left: 14px; display: flex; max-width: calc(100% - 28px); border: 1px solid var(--gold); background: #0a0a0bf0; box-shadow: var(--hard); animation: rise .18s ease-out; }
.camera-stage.live .set-suggest { top: 52px; left: 10px; }
.set-suggest { align-items: stretch; color: var(--bone); font: 600 11px/1.2 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.set-suggest-copy { padding: 11px 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 230px; }
.set-suggest-choices { display: flex; }
.set-suggest-go + .set-suggest-go { border-left: 1px solid var(--gold-ink); }
.set-suggest-copy strong { color: var(--gold); font-weight: 700; }
.set-suggest-go { display: flex; align-items: center; padding: 0 14px; border: 0; background: var(--gold); color: var(--gold-ink); font: 800 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.set-suggest-no { display: grid; place-items: center; width: 38px; border: 0; border-left: 1px solid var(--rule-2); background: none; color: var(--dim); }
.set-suggest-no .icon { width: 14px; height: 14px; }
@media (max-width: 860px) { body:has(#cameraStage.live) .camera-stage.live .set-suggest { top: calc(52px + env(safe-area-inset-top)); } }
