:root {
  --bg: #f4f2ee; --panel: #ffffff; --ink: #1d1c1a; --muted: #6b6760; --line: #d8d4cc;
  --accent: #b4441b; --accent-ink: #ffffff; --bad: #a3261b;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #151413; --panel: #1f1d1b; --ink: #ece8e1; --muted: #a29d94; --line: #3a3732;
          --accent: #e0703f; --accent-ink: #151413; --bad: #ff8a7a; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { display: grid; gap: 8px; padding: 8px 12px 16px; max-width: 1100px; margin: 0 auto; grid-template-columns: minmax(0, 1fr); }
#line { margin: 0; font-size: 14px; color: var(--muted); }
#line b { color: var(--ink); font-weight: 600; font-size: 15px; }
#line a { color: inherit; }

#stagebox { position: relative; background: var(--panel); border: 1.5px dashed var(--line); border-radius: 6px; overflow: hidden;
  display: grid; place-items: center; min-height: 240px; }
#stagebox.has { border-style: solid; background: #000; }
#stagebox.over { border-color: var(--accent); }
#stage { display: block; width: 100%; height: auto; max-height: 72vh; object-fit: contain; touch-action: pan-y; cursor: crosshair; }
#stagebox:not(.has) #stage { display: none; }
#ask { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px 24px 64px; color: var(--muted); pointer-events: none; }
#stagebox.has #ask { display: none; }
#tools { position: absolute; left: 8px; bottom: 8px; display: flex; gap: 8px; }
#tools button { width: 42px; height: 42px; display: grid; place-items: center; padding: 0; cursor: pointer; color: var(--ink);
  background: color-mix(in srgb, var(--panel) 88%, transparent); border: 1px solid var(--line); border-radius: 50%; }
#tools button:hover { border-color: var(--accent); color: var(--accent); }
#tools button[hidden] { display: none; }
#tools button.on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }

#status { margin: 0; min-height: 1.4em; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
#status.bad { color: var(--bad); }
#bar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; margin-top: -4px; }
#bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
#hint { margin: 0; font-size: 12px; color: var(--muted); }

#thumbs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
@media (max-width: 480px) { #thumbs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
#thumbs button { padding: 0; border: 2px solid transparent; border-radius: 5px; background: none; cursor: pointer; aspect-ratio: 1; overflow: hidden; }
#thumbs button.on { border-color: var(--accent); }
#thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 3px; }

#more { color: var(--muted); font-size: 13px; }
#more p { margin: 6px 0; }
summary { cursor: pointer; }
#wipe { font: inherit; min-height: 30px; padding: 0 12px; cursor: pointer; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 4px; }
a { color: var(--accent); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:where(button, input, summary, a, [tabindex]):focus-visible { outline: 2px solid var(--accent) !important; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0.01ms !important; } }
