:root {
  --bg: #FFFFFF; --ink: #13202E; --muted: #4D5B6A; --line: #D8DEE4; --navy: #1F4E79; --gold: #C79528;
  --ok: #1E6B45; --bad: #A12C2C; --r: 6px;
  --f-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0D151F; --ink: #E3E9F0; --muted: #A3B0BE; --line: #26364B; --navy: #8FB8E3; --gold: #E2B24C; --ok: #6FCF97; --bad: #F08A8A; color-scheme: dark; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 1rem; line-height: 1.6; }
a { color: var(--navy); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, .drop:focus-within { outline: 2px solid var(--navy); outline-offset: 3px; }
h1, h2 { font-weight: 700; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.4vw, 2.9rem); line-height: 1.1; }
h2 { font-size: 1.375rem; line-height: 1.25; }
p { margin: 0; }
.wrap { max-width: 820px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.top { padding-block: 20px; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.25rem; }
.dot-off { fill: var(--line); } .dot-on { fill: var(--gold); }
.back { color: var(--muted); text-decoration: none; font-size: 0.9375rem; }
.intro { display: grid; gap: 16px; padding-block: 24px 8px; }
.lead { font-size: 1.125rem; color: var(--muted); max-width: 62ch; }
.small { font-size: 0.9375rem; color: var(--muted); }
.step { display: grid; gap: 14px; padding-block: 28px; border-bottom: 1px solid var(--line); }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
input[type="text"], textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 11px 12px; }
input#code { font-family: var(--f-mono); letter-spacing: 0.04em; width: min(100%, 27ch); text-transform: uppercase; }
textarea { width: 100%; resize: vertical; }
.field-label { font-weight: 600; font-size: 0.9375rem; }
.btn { display: inline-flex; align-items: center; padding: 11px 18px; border-radius: var(--r); font: inherit; font-weight: 600; font-size: 0.9375rem; text-decoration: none; border: 1px solid transparent; cursor: pointer; }
.btn.primary { background: var(--navy); color: var(--bg); }
.btn.ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.msg { min-height: 1.6em; font-size: 0.9375rem; }
.msg[data-kind="bad"] { color: var(--bad); }
.msg[data-kind="ok"] { color: var(--ok); }
.drop { display: grid; gap: 6px; justify-items: start; padding: 26px 20px; border: 1.5px dashed var(--line); border-radius: var(--r); cursor: pointer; }
.drop.over { border-color: var(--navy); }
.drop-main { font-weight: 600; }
.link { color: var(--navy); text-decoration: underline; text-underline-offset: 3px; }
.tbl { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); }
th { text-align: left; font-weight: 600; padding: 9px 16px 9px 0; border-bottom: 1px solid var(--ink); white-space: nowrap; }
td { padding: 9px 16px 9px 0; vertical-align: top; }
tr + tr td { border-top: 1px solid var(--line); }
td.name, td.ref { font-family: var(--f-mono); font-size: 0.8125rem; overflow-wrap: anywhere; }
.num { text-align: right; white-space: nowrap; }
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; min-width: 120px; margin-top: 6px; }
.bar > span { display: block; height: 100%; width: 0; background: var(--navy); }
.bar.done > span { background: var(--ok); }
.bar.fail > span { background: var(--bad); }
.state { font-size: 0.875rem; color: var(--muted); }
.state.bad { color: var(--bad); }
.safety { display: grid; gap: 16px; padding-block: 32px 40px; }
dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 40px; }
dl div { display: grid; gap: 4px; align-content: start; }
dt { font-weight: 600; }
dd { margin: 0; color: var(--muted); font-size: 0.9375rem; }
footer { padding-block: 28px; font-size: 0.8125rem; color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (max-width: 640px) { dl { grid-template-columns: minmax(0, 1fr); } .bar { min-width: 80px; } }
