/* CST Challenge layout and components. Colors come only from theme variables (themes/<id>/theme.css).
   Sizes are rem based: 1rem = 16px at 1920x1080 and the whole TV view scales with the window. */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("../fonts/AtkinsonHyperlegibleNext.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --ui-scale: 1;
  font-size: calc(min(100vw / 120, 100vh / 67.5) * var(--ui-scale));

  --font-display: Bahnschrift, "DIN Alternate", "Avenir Next", "Segoe UI", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible Next", "Segoe UI", "Avenir Next", Verdana, system-ui, sans-serif;

  --fs-display: 7rem; --fs-score: 9rem; --fs-title: 4rem; --fs-tip: 5rem;
  --fs-q: 4.5rem; --fs-q-md: 3.75rem; --fs-q-sm: 3.125rem;
  --fs-a: 3.25rem; --fs-a-md: 2.75rem; --fs-a-sm: 2.375rem;
  --fs-body-l: 2.5rem; --fs-meta: 2rem; --fs-hint: 1.75rem;
  --lh-tight: 1.05; --lh-q: 1.15; --lh-body: 1.35;

  --sp-1: .5rem; --sp-2: 1rem; --sp-3: 1.5rem; --sp-4: 2rem; --sp-5: 3rem; --sp-6: 4.5rem;
  --safe-x: 6rem; --safe-y: 3.375rem;
  --r-sm: .5rem; --r-md: 1rem; --r-lg: 1.5rem; --r-pill: 999px;
  --stroke: .375rem; --hit: 4.5rem;

  --ans-a: #0072B2; --ans-a-ink: #FFFFFF;
  --ans-b: #E69F00; --ans-b-ink: #101418;
  --ans-c: #009E73; --ans-c-ink: #101418;
  --ans-d: #CC79A7; --ans-d-ink: #101418;
  --ans-ring: var(--text);

  --ok-bg: #0F4A33; --ok-line: #5BE3A0; --ok-ink: #FFFFFF;
  --bad-bg: #5A2320; --bad-line: #FF9B8A; --bad-ink: #FFFFFF;

  --dur-fast: 150ms; --dur: 300ms; --dur-slide: 700ms;
  --ease: cubic-bezier(.2, .7, .2, 1);

  /* Fallback palette (Everyday Safety) so the page is readable even if no theme file loads */
  --bg: #0E1B2A; --bg-2: #14283C; --surface: #1B3249; --surface-2: #244058;
  --text: #F4F8FB; --text-muted: #B7C6D4; --accent: #FFC53D; --on-accent: #14181D;
  --line: #5C7C99; --focus: #FFFFFF; --deco-a: #FFC53D; --deco-b: #6FB1E0; --deco-c: #14283C;
  --page-bg: linear-gradient(165deg, var(--bg-2), var(--bg) 60%);
}
html[data-size="large"] { --ui-scale: 1.15; }
html[data-view="desk"] { font-size: 18px; }
html[data-view="desk"] body { font-size: 1rem; }
@media (prefers-reduced-motion: reduce) { :root { --dur: 1ms; --dur-fast: 1ms; --dur-slide: 1ms; } }
html[data-motion="calm"] { --dur: 1ms; --dur-fast: 1ms; --dur-slide: 1ms; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); background-image: var(--page-bg); background-attachment: fixed;
  color: var(--text); font: var(--fw-body, 500) var(--fs-meta)/var(--lh-body) var(--font-body);
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 800; line-height: var(--lh-tight); margin: 0; }
p { margin: 0; }
.muted { color: var(--text-muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- decoration layer (themes fill the slots) ---------- */
.deco { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.deco > i { position: absolute; display: block; background-repeat: repeat-x; }
.deco .d-top { left: 0; right: 0; top: 0; height: 3rem; }
.deco .d-bottom { left: 0; right: 0; bottom: 0; height: 2.5rem; }
.deco .d-rail-l, .deco .d-rail-r { top: 0; bottom: 0; width: 6rem; background-repeat: no-repeat; overflow: hidden; }
.deco .d-rail-l { left: 0; } .deco .d-rail-r { right: 0; }
.deco .d-foot-l, .deco .d-foot-r { bottom: 3.5rem; width: 13rem; height: 13rem; display: none; background-repeat: no-repeat; background-size: contain; }
.deco .d-foot-l { left: 0; } .deco .d-foot-r { right: 0; }
html[data-screen="attract"] .deco .d-top { height: 4.5rem; }
html[data-screen="attract"] .deco .d-bottom { height: 3.5rem; }
html[data-screen="attract"] .deco .d-foot-l, html[data-screen="attract"] .deco .d-foot-r { display: block; }
.deco .p { position: absolute; top: -10vh; left: 50%; width: 1.5rem; height: 1.5rem; background-repeat: no-repeat; background-size: contain; }
html[data-view="desk"] .deco { display: none; }
/* Motion only on attract, never with calm or reduced motion */
html:not([data-screen="attract"]) .deco *, html[data-motion="calm"] .deco *, html[data-motion="calm"] .anim { animation: none !important; }
@media (prefers-reduced-motion: reduce) { .deco *, .anim { animation: none !important; } }

/* ---------- stage and screens ---------- */
.stage { position: relative; z-index: 1; height: 100%; }
.screen { display: none; position: absolute; inset: 0; padding: var(--safe-y) var(--safe-x); flex-direction: column; gap: var(--sp-3); }
.screen.active { display: flex; }
html[data-view="desk"] body { overflow: auto; background-attachment: scroll; }
html[data-view="desk"] .stage { height: auto; min-height: 100%; }
html[data-view="desk"] .screen { position: static; min-height: 100vh; padding: 1.5rem 2rem 3rem; gap: 1rem; }

.banner { position: fixed; z-index: 5; left: 50%; transform: translateX(-50%); top: .5rem; max-width: 90vw;
  background: var(--surface-2); color: var(--text); border: .125rem solid var(--accent); border-radius: var(--r-md);
  padding: .5rem 1rem; font-size: 1.25rem; display: flex; gap: 1rem; align-items: center; }
html[data-view="desk"] .banner { position: sticky; transform: none; left: auto; top: 0; margin: 0 auto; width: fit-content; font-size: .9rem; }

/* header row on TV screens */
.bar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: 5rem; }
.bar .grow { flex: 1; }
.lockup { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.lockup .org { font: 800 2.5rem/1.1 var(--font-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60rem; }
.lockup .org-sub { font-size: 1.75rem; color: var(--text-muted); }
.logo-chip { background: #FFFFFFEB; border: .125rem solid var(--line); border-radius: var(--r-md); padding: .5rem;
  max-height: 6rem; max-width: 15rem; display: flex; align-items: center; justify-content: center; }
.logo-chip img { max-height: 5rem; max-width: 14rem; object-fit: contain; display: block; }
.monogram { width: 6rem; height: 6rem; border-radius: 50%; background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center; font: 800 2.5rem/1 var(--font-display); flex: none; }
.wordmark { font: 800 2rem/1 var(--font-display); color: var(--text-muted); }
.chip { display: inline-flex; align-items: center; gap: .5rem; border: .125rem solid var(--line); border-radius: var(--r-pill);
  padding: .25rem 1rem; font-size: var(--fs-meta); background: var(--surface); color: var(--text); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .75rem; min-height: var(--hit);
  padding: .75rem 2rem; border-radius: var(--r-lg); border: .25rem solid var(--line); background: var(--surface-2);
  color: var(--text); font: 800 var(--fs-meta)/1.1 var(--font-display); text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.big { min-height: 6rem; font-size: 3rem; padding: 1rem 3rem; }
.btn.danger { border-color: var(--bad-line); background: transparent; }
.btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn:focus-visible, .answer:focus-visible, .tile:focus-visible, .icon-btn:focus-visible, .row:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible, .dot:focus-visible {
  outline: var(--stroke) solid var(--focus); outline-offset: .1875rem; box-shadow: 0 0 0 .5625rem var(--bg);
}
.icon-btn { width: 4.5rem; height: 4.5rem; border-radius: 50%; border: .25rem solid var(--line); background: var(--surface);
  color: var(--text-muted); display: grid; place-items: center; padding: 0; }
.icon-btn svg { width: 2.5rem; height: 2.5rem; }
.hint { font-size: var(--fs-hint); color: var(--text-muted); }
html[data-view="desk"] .btn { min-height: 2.75rem; font-size: 1rem; padding: .4rem 1rem; border-radius: .6rem; border-width: .125rem; }
html[data-view="desk"] .btn.big { font-size: 1.15rem; min-height: 3.25rem; }

/* ---------- attract ---------- */
.attract-slide { flex: 1; position: relative; min-height: 0; }
.slide { position: absolute; inset: 0; display: flex; align-items: center; gap: var(--sp-5); opacity: 0;
  transition: opacity var(--dur-slide) var(--ease); }
.slide.on { opacity: 1; }
.slide .col { flex: 1; display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.headline { font: 800 var(--fs-display)/var(--lh-tight) var(--font-display); }
.headline.accent-bar { border-bottom: .5rem solid var(--accent); padding-bottom: .5rem; align-self: flex-start; }
.body-l { font-size: var(--fs-body-l); }
.markers { display: grid; grid-template-columns: repeat(2, 11rem); gap: 2rem; }
.markers .marker { width: 11rem; height: 11rem; }
.markers .marker:nth-child(odd) { animation: bob 4s ease-in-out infinite; }
.markers .marker:nth-child(even) { animation: bob 4s ease-in-out 2s infinite; }
@keyframes bob { 50% { transform: translateY(-.5rem); } }
.plate { background: var(--surface); border-radius: var(--r-lg); padding: var(--sp-5); border-left: .75rem solid var(--accent); }
.plate.full { width: 100%; }
.tip-head { display: flex; align-items: center; gap: 1rem; font: 800 var(--fs-title)/1 var(--font-display); }
.tip-head svg { width: 4rem; height: 4rem; flex: none; }
.tip-text { font: 700 var(--fs-tip)/1.15 var(--font-body); margin-top: var(--sp-3); }
.tip-text[data-size="md"] { font-size: 4rem; } .tip-text[data-size="sm"] { font-size: 3.25rem; }
.media-box { width: 100%; height: 100%; display: flex; flex-direction: column; border-radius: var(--r-lg); overflow: hidden; background: var(--bg-2); }
.media-box img, .media-box video { flex: 1; min-height: 0; width: 100%; object-fit: contain; background: var(--bg-2); }
.media-box .caption { background: var(--surface); color: var(--text); font-size: 2.25rem; padding: 1rem 2rem; min-height: 5.5rem; }
.recruit-plate { background: var(--accent); color: var(--on-accent); border-radius: var(--r-lg); padding: var(--sp-5);
  display: flex; align-items: center; gap: var(--sp-5); width: 100%; }
.recruit-plate .headline { font-size: 6.5rem; }
.qr-box { display: flex; flex-direction: column; align-items: center; gap: .75rem; flex: none; }
.qr-box canvas { width: 14rem; height: 14rem; background: #FFFFFF; padding: 1rem; border-radius: var(--r-md); image-rendering: pixelated; }
.qr-box .url { font-size: 1.5rem; max-width: 22rem; overflow-wrap: anywhere; text-align: center; }
.big-logo { background: #FFFFFFEB; border-radius: var(--r-lg); padding: 1rem; width: 14rem; height: 14rem; display: grid; place-items: center; flex: none; }
.big-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.attract-foot { display: flex; align-items: center; justify-content: center; gap: var(--sp-4); }
.play-btn { min-width: 48rem; min-height: 7rem; font-size: 3.5rem; }
.play-btn.anim { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.04); } }
.dots { display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; }
.dots .row-d { display: flex; gap: .5rem; }
.dots .d { width: 1.25rem; height: 1.25rem; border-radius: 50%; border: .2rem solid var(--line); }
.dots .d.on { background: var(--accent); border-color: var(--accent); }
.dots .prog { height: .375rem; width: 100%; background: var(--line); border-radius: 1rem; overflow: hidden; }
.dots .prog > i { display: block; height: 100%; width: 0; background: var(--accent); }
.dots .prog > i.run { width: 100%; transition-property: width; transition-timing-function: linear; }
html[data-motion="calm"] .dots .prog > i.run { transition: none; }

/* ---------- setup ---------- */
.setup-grid { display: grid; grid-template-columns: 1fr; gap: var(--sp-3); flex: 1; min-height: 0; }
.group h2 { font-size: 2.5rem; margin-bottom: .75rem; }
.tiles { display: grid; gap: 1rem; }
.tiles.t7 { grid-template-columns: repeat(7, 1fr); }
.tiles.t3 { grid-template-columns: repeat(3, 1fr); }
.tiles.t2 { grid-template-columns: repeat(2, 1fr); }
.tile { position: relative; text-align: left; border: .25rem solid var(--line); border-radius: var(--r-lg); background: var(--surface);
  padding: 1rem 1.25rem; min-height: 6rem; display: flex; flex-direction: column; gap: .4rem; justify-content: center; }
.tile strong { font: 800 2.25rem/1.05 var(--font-display); }
.tile span { font-size: 1.5rem; color: var(--text-muted); }
.tile[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); outline: var(--stroke) solid var(--text); outline-offset: -.1rem; }
.tile[aria-pressed="true"] span { color: var(--on-accent); }
.tile:disabled { cursor: default; }
.tile .check { position: absolute; top: .5rem; right: .5rem; width: 2rem; height: 2rem; display: none; }
.tile[aria-pressed="true"] .check { display: block; }
.tile .swatch { display: flex; gap: .25rem; }
.tile .swatch i { width: 1.5rem; height: 1.5rem; border-radius: .25rem; border: .1rem solid var(--line); display: block; }
.tile .season { font-size: 1.25rem; font-weight: 700; }
.meter { display: inline-flex; gap: .3rem; align-items: flex-end; height: 2rem; }
.meter i { width: .7rem; border: .15rem solid currentColor; border-radius: .15rem; display: block; }
.meter i:nth-child(1) { height: 40%; } .meter i:nth-child(2) { height: 70%; } .meter i:nth-child(3) { height: 100%; }
.meter i.on { background: currentColor; }
.setup-foot { display: flex; align-items: center; gap: var(--sp-3); }
.setup-note { flex: 1; font-size: 1.75rem; color: var(--text-muted); }

/* ---------- game ---------- */
.counter { font: 800 var(--fs-meta)/1 var(--font-display); }
.points { font: 800 var(--fs-meta)/1 var(--font-display); }
.pips { display: flex; gap: .6rem; justify-content: center; }
.pips i { width: 1.25rem; height: 1.25rem; border-radius: 50%; border: .2rem solid var(--line); display: block; }
.pips i.done { background: var(--accent); border-color: var(--accent); }
.pips i.now { border-color: var(--text); border-width: .3rem; }
.question { font: 800 var(--fs-q)/var(--lh-q) var(--font-body); max-height: 3.6em; overflow: hidden; }
.question[data-size="md"] { font-size: var(--fs-q-md); } .question[data-size="sm"] { font-size: var(--fs-q-sm); }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.answers[data-size="sm"] { grid-template-columns: 1fr; }
.answer { display: grid; grid-template-columns: 5.5rem 1fr auto; align-items: center; gap: var(--sp-3); min-height: 9.5rem;
  padding: var(--sp-3) var(--sp-4); background: var(--surface); color: var(--text); border: var(--stroke) solid var(--line);
  border-radius: var(--r-lg); font: 600 var(--fs-a)/1.15 var(--font-body); text-align: left; }
.answers[data-size="md"] .answer { font-size: var(--fs-a-md); }
.answers[data-size="sm"] .answer { font-size: var(--fs-a-sm); min-height: 6.5rem; }
.marker { width: 5.5rem; height: 5.5rem; display: block; }
.marker .shape-a { fill: var(--ans-a); } .marker .shape-b { fill: var(--ans-b); }
.marker .shape-c { fill: var(--ans-c); } .marker .shape-d { fill: var(--ans-d); }
.marker .mk-ring { stroke: var(--ans-ring); stroke-width: 4; }
.marker text { font: 800 46px var(--font-display); }
.marker .ink-a { fill: var(--ans-a-ink); } .marker .ink-b { fill: var(--ans-b-ink); }
.marker .ink-c { fill: var(--ans-c-ink); } .marker .ink-d { fill: var(--ans-d-ink); }
.answer[data-state="correct"] { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-ink); }
.answer[data-state="wrong"] { background-color: var(--bad-bg); border-style: dashed; border-color: var(--bad-line); color: var(--bad-ink);
  background-image: repeating-linear-gradient(45deg, rgb(255 255 255 / .10) 0 .75rem, transparent .75rem 1.5rem); }
.answer[data-state="quiet"] { background: var(--bg); border-color: var(--line); color: var(--text-muted); }
.answer .verdict { display: none; font: 800 var(--fs-meta)/1 var(--font-display); align-items: center; gap: .5rem; white-space: nowrap; }
.answer .verdict svg { width: 2.5rem; height: 2.5rem; }
.answer[data-state="correct"] .verdict, .answer[data-state="wrong"] .verdict { display: inline-flex; }
.answer[data-state="correct"] .marker { animation: pop var(--dur) var(--ease) 1; }
@keyframes pop { 50% { transform: scale(1.12); } }
.slab { background: var(--surface-2); border-radius: var(--r-lg); border-left: .75rem solid var(--ok-line);
  padding: var(--sp-3) var(--sp-4); display: flex; gap: var(--sp-4); align-items: center; }
.slab.bad { border-left-color: var(--bad-line); }
.slab .say { flex: 1; display: flex; flex-direction: column; gap: .5rem; }
.slab .verdict-big { font: 800 var(--fs-title)/1 var(--font-display); }
.slab .why { font-size: var(--fs-body-l); }
.slab .why[data-size="sm"] { font-size: 2.125rem; }
.game-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.spacer { flex: 1; }

/* ---------- results ---------- */
.results { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-5); align-items: center; flex: 1; }
.ring { width: 22rem; height: 22rem; position: relative; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring .track { stroke: var(--line); } .ring .fill { stroke: var(--accent); transition: stroke-dashoffset 1.2s var(--ease); }
html[data-motion="calm"] .ring .fill { transition: none; }
.ring .num { font: 800 var(--fs-score)/1 var(--font-display); text-align: center; }
.ring .of { font-size: 2.5rem; text-align: center; color: var(--text-muted); }
.encourage { font: 800 3.5rem/1.15 var(--font-display); }
.recruit { background: var(--accent); color: var(--on-accent); border-radius: var(--r-lg); padding: var(--sp-3) var(--sp-4); font-size: 2.5rem; }
.name-row { display: flex; gap: 1rem; align-items: center; }
.name-row input { font-size: 2.5rem; padding: .5rem 1rem; border-radius: var(--r-md); border: .25rem solid var(--line);
  background: var(--surface); width: 22rem; }
.btn-row { display: flex; gap: var(--sp-3); flex-wrap: wrap; }

/* ---------- review ---------- */
.review-q { font: 800 var(--fs-q-md)/var(--lh-q) var(--font-body); }
.review-dots { display: flex; gap: .6rem; }
.dot { width: 1.6rem; height: 1.6rem; border-radius: 50%; border: .2rem solid var(--line); background: transparent; padding: 0; }
.dot.on { background: var(--accent); border-color: var(--accent); }
.review-list .ri { border-bottom: .1rem solid var(--line); padding: 1rem 0; }

/* ---------- high scores ---------- */
.board { display: flex; flex-direction: column; gap: .5rem; overflow: auto; flex: 1; }
.board .srow { display: grid; grid-template-columns: 5rem 1fr 12rem 10rem 14rem auto; align-items: center; gap: 1rem;
  min-height: 4.5rem; padding: 0 1.25rem; background: var(--surface); border-radius: var(--r-md); font-size: 2.25rem; }
.board .srow.head { background: transparent; color: var(--text-muted); font-size: 1.5rem; min-height: 2.5rem; }
.rank-chip { width: 3rem; height: 3rem; display: block; }

/* ---------- dialog ---------- */
dialog.dlg { border: .25rem solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--text);
  padding: 2rem; max-width: min(90vw, 70rem); font-size: 2rem; }
dialog.dlg::backdrop { background: rgb(0 0 0 / .6); }
dialog.dlg h2 { font-size: 3rem; margin-bottom: 1rem; }
dialog.dlg .btn-row { margin-top: 1.5rem; justify-content: flex-end; }
html[data-view="desk"] dialog.dlg { font-size: 1rem; max-width: 40rem; padding: 1.5rem; }
html[data-view="desk"] dialog.dlg h2 { font-size: 1.4rem; }
.menu-list { display: grid; gap: 1rem; min-width: 40rem; }
.menu-list .btn { justify-content: flex-start; }
.pin-input { font-size: 3rem; letter-spacing: .3em; width: 16rem; padding: .5rem 1rem; border-radius: var(--r-md);
  border: .25rem solid var(--line); background: var(--bg); text-align: center; }
html[data-view="desk"] .pin-input { font-size: 1.5rem; width: 10rem; }
.error { color: var(--bad-line); font-weight: 700; }
.ok { color: var(--ok-line); font-weight: 700; }

/* ---------- desk screens (content manager, settings, first run) ---------- */
html[data-view="desk"] h1 { font-size: 1.8rem; }
html[data-view="desk"] h2 { font-size: 1.3rem; }
html[data-view="desk"] h3 { font-size: 1.1rem; }
.desk-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; position: sticky; top: 0; z-index: 2;
  background: var(--bg); padding: .5rem 0; border-bottom: .1rem solid var(--line); }
.desk-bar h1 { margin-right: auto; }
.panes { display: grid; grid-template-columns: 2fr 3fr; gap: 1.5rem; align-items: start; }
@media (max-width: 1100px) { .panes { grid-template-columns: 1fr; } }
.pane { background: var(--surface); border-radius: .8rem; padding: 1rem; display: flex; flex-direction: column; gap: .75rem; min-width: 0; }
.pane.sticky { position: sticky; top: 4.5rem; max-height: calc(100vh - 6rem); overflow: auto; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; }
.filters input, .filters select, .field input, .field select, .field textarea {
  background: var(--bg); border: .125rem solid var(--line); border-radius: .5rem; padding: .45rem .6rem; min-height: 2.5rem; }
.filters input { flex: 1; min-width: 12rem; }
.list { display: flex; flex-direction: column; gap: .3rem; max-height: 70vh; overflow: auto; }
.row { text-align: left; border: .125rem solid transparent; border-radius: .5rem; background: var(--surface-2); padding: .5rem .75rem;
  display: flex; flex-direction: column; gap: .25rem; min-height: 3.5rem; }
.row[aria-current="true"] { border-color: var(--accent); }
.row .q { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .tags { display: flex; flex-wrap: wrap; gap: .3rem; font-size: .8rem; }
.tag { border: .1rem solid var(--line); border-radius: 1rem; padding: 0 .5rem; color: var(--text-muted); }
.tag.warn { border-color: var(--bad-line); color: var(--text); border-style: dashed; }
.row.flagged { border-left: .4rem solid var(--bad-line); }
.field { display: flex; flex-direction: column; gap: .3rem; }
.field label, .field .lbl { font-weight: 700; }
.field textarea { min-height: 4.5rem; resize: vertical; }
.field .help { font-size: .85rem; color: var(--text-muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.ans-edit { display: grid; grid-template-columns: 2.5rem 1fr auto; gap: .5rem; align-items: center; }
.ans-edit .marker { width: 2.5rem; height: 2.5rem; }
.ans-edit label { font-size: .85rem; display: flex; gap: .3rem; align-items: center; white-space: nowrap; }
.notice { background: var(--surface-2); border-left: .4rem solid var(--accent); padding: .6rem .9rem; border-radius: .4rem; }
.notice.bad { border-left-color: var(--bad-line); }
.section { background: var(--surface); border-radius: .8rem; padding: 1rem; display: flex; flex-direction: column; gap: .75rem; }
.preview-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.preview-table td, .preview-table th { border-bottom: .1rem solid var(--line); padding: .35rem .4rem; text-align: left; vertical-align: top; }
.preview-wrap { max-height: 50vh; overflow: auto; }
.logo-preview { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.lock-preview { padding: .75rem 1rem; border-radius: .6rem; display: flex; gap: .75rem; align-items: center; }
.lock-preview .org { font: 800 1.3rem/1.1 var(--font-display); }
.qr-small canvas { width: 10rem; height: 10rem; background: #FFFFFF; padding: .5rem; border-radius: .5rem; image-rendering: pixelated; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; }
.mini { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.attract-hint { text-align: center; }
.ans-edit input[type="text"] { background: var(--bg); border: .125rem solid var(--line); border-radius: .5rem; padding: .45rem .6rem; min-height: 2.5rem; width: 100%; }
.row { line-height: 1.35; }
.row .q { display: block; line-height: 1.4; }
