:root {
  --bg: #f6f7f9; --card: #fff; --fg: #1d2330; --muted: #667085; --line: #d8dde6;
  --accent: #2f6fed; --accent-fg: #fff; --ok: #12805c; --err: #c4320a; --sel: rgba(47, 111, 237, .45);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #11141a; --card: #1a1f28; --fg: #e6e9ef; --muted: #98a2b3; --line: #2e3542; --accent: #5b8cff; --ok: #3ccf91; --err: #ff7a59; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); line-height: 1.5; }
main { max-width: 640px; margin: 32px auto; padding: 0 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
h1 { font-size: 1.4rem; margin: 0 0 4px; }
.muted, .meta { color: var(--muted); font-size: .9rem; }
.meta { margin: 0 0 16px; }
.stack { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.stack.center { align-items: center; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 500; }
input:not([type=range]):not([type=checkbox]), textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); min-width: 240px; }
button { font: inherit; padding: 8px 18px; border: 0; border-radius: 8px; background: var(--accent); color: var(--accent-fg); cursor: pointer; }
button.secondary { background: transparent; color: var(--fg); border: 1px solid var(--line); }
a { color: var(--accent); }
.status { min-height: 1.5em; margin-top: 16px; font-weight: 500; }
.status.ok { color: var(--ok); }
.status.err { color: var(--err); }
.prompt { font-weight: 600; margin: 0; }
.captcha-img { border: 1px solid var(--line); border-radius: 6px; max-width: 100%; }
.grid-wrap { position: relative; line-height: 0; }
.grid-overlay { position: absolute; inset: 0; display: grid; }
.grid-overlay.gap { gap: 6px; }
.tile { background: transparent; border: 0; border-radius: 0; padding: 0; }
.tile[aria-pressed=true] { background: var(--sel); outline: 3px solid var(--accent); outline-offset: -3px; }
.click-area { position: relative; cursor: crosshair; line-height: 0; }
.mark { position: absolute; transform: translate(-50%, -50%); width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font: 600 13px/24px system-ui; text-align: center; pointer-events: none; }
.round { border-radius: 50%; transition: transform .05s; }
.puzzle { position: relative; line-height: 0; }
.piece { position: absolute; top: 0; left: 0; filter: drop-shadow(0 0 3px rgba(0,0,0,.6)); }
.track { position: relative; height: 44px; border-radius: 22px; background: var(--bg); border: 1px solid var(--line); user-select: none; }
.track-hint { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: .85rem; }
.handle { position: absolute; top: 1px; left: 0; width: 56px; height: 40px; border-radius: 20px; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: grab; touch-action: none; font-size: 20px; }
.hold { position: relative; width: 260px; height: 56px; overflow: hidden; user-select: none; touch-action: none; }
.hold span { position: relative; z-index: 1; }
.bar { position: absolute; inset: 0; }
.bar-fill { height: 100%; width: 0; background: rgba(255,255,255,.3); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.vendor-box { min-height: 78px; }
#skip { font-size: .85rem; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
td.num { font-variant-numeric: tabular-nums; }
ol.list li { margin: 4px 0; }
.wide { max-width: 1200px; }
.scroll { overflow-x: auto; }
.cell-good { background: color-mix(in srgb, var(--ok) 20%, transparent); }
.cell-mid { background: color-mix(in srgb, #e0a100 22%, transparent); }
.cell-bad { background: color-mix(in srgb, var(--err) 18%, transparent); }
