@font-face{font-family:"Atkinson Hyperlegible";font-weight:400;font-style:normal;font-display:swap;src:url(fonts/atkinson-400.woff2) format("woff2")}
@font-face{font-family:"Atkinson Hyperlegible";font-weight:700;font-style:normal;font-display:swap;src:url(fonts/atkinson-700.woff2) format("woff2")}
@font-face{font-family:"Barlow Semi Condensed";font-weight:500;font-style:normal;font-display:swap;src:url(fonts/barlow-500.woff2) format("woff2")}
@font-face{font-family:"Barlow Semi Condensed";font-weight:600;font-style:normal;font-display:swap;src:url(fonts/barlow-600.woff2) format("woff2")}
@font-face{font-family:"Barlow Semi Condensed";font-weight:700;font-style:normal;font-display:swap;src:url(fonts/barlow-700.woff2) format("woff2")}

/* Layout: one column tool. Round bar on top, three tabs (Setup, Score, Results). The cut line in Results is the signature element. */
:root {
  --bg: #EEF2F7; --surface: #FFFFFF; --ink: #0B1F3A; --muted: #55677F; --line: #D3DCE8; --soft: #F4F7FB;
  --primary: #0B1F33; --accent: #5B3FD0; --on-primary: #FFFFFF; --bib: #F2B705; --bib-bg: #FFF3C4; --on-bib: #2B2100;
  --good: #17744E; --good-bg: #DDF2E8; --bad: #B03A1E; --bad-bg: #FBE5DE;
  --display: "Barlow Semi Condensed", "Arial Narrow", system-ui, sans-serif; --body: "Atkinson Hyperlegible", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0C1722; --surface: #14243A; --ink: #E8EEF6; --muted: #9FB0C6; --line: #29405F; --soft: #102034;
  --primary: #A78BFA; --accent: #A78BFA; --on-primary: #1b1240; --bib: #F2B705; --bib-bg: #3A3010; --on-bib: #2B2100;
  --good: #52C493; --good-bg: #123626; --bad: #F0937A; --bad-bg: #3B1C14; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0C1722; --surface: #14243A; --ink: #E8EEF6; --muted: #9FB0C6; --line: #29405F; --soft: #102034;
  --primary: #A78BFA; --accent: #A78BFA; --on-primary: #1b1240; --bib: #F2B705; --bib-bg: #3A3010; --on-bib: #2B2100;
  --good: #52C493; --good-bg: #123626; --bad: #F0937A; --bad-bg: #3B1C14; color-scheme: dark; }
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.45; margin: 0;
  padding-block: 16px 64px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wrap { max-width: 980px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
h1, h2, h3 { font-family: var(--display); margin: 0; text-wrap: balance; letter-spacing: .005em; }
h1 { font-size: 30px; line-height: 1.05; } h2 { font-size: 24px; } h3 { font-size: 19px; }
p { margin: 0; } .muted { color: var(--muted); } .sm { font-size: 14px; }
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--bib); outline-offset: 2px; }
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.brand.logo { align-items: center; }
.brand img.logo-i { border-radius: 9px; align-self: center; }
.brand-t { display: flex; flex-direction: column; line-height: 1.02; }
.brand-t small { font: 600 11px var(--body); letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.tag { font-family: var(--display); font-weight: 600; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; background: var(--bib); color: var(--on-bib); padding: 2px 8px; border-radius: 4px; }
.who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.who label { font-size: 14px; color: var(--muted); }
select, input[type=text], textarea { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; min-height: 44px; max-width: 100%; }
textarea { width: 100%; min-height: 84px; resize: vertical; }
.note { background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; color: var(--muted); font-size: 14px; }
.rounds { display: flex; gap: 8px; flex-wrap: wrap; }
.rd { flex: 1 1 180px; min-width: 0; text-align: left; background: var(--surface); border: 2px solid var(--line); border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.rd b { font-family: var(--display); font-size: 19px; }
.rd[aria-current=true] { border-color: var(--accent); }
.rd[disabled] { opacity: .55; cursor: not-allowed; }
.st { font-size: 13px; color: var(--muted); }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); }
.tab { background: none; border: 0; border-bottom: 4px solid transparent; margin-bottom: -2px; padding: 10px 16px; font-family: var(--display); font-weight: 600; font-size: 19px; color: var(--muted); min-height: 44px; }
.tab[aria-selected=true] { color: var(--ink); border-bottom-color: var(--accent); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.sp { justify-content: space-between; }
.btn { background: var(--surface); border: 1.5px solid var(--primary); color: var(--primary); border-radius: 10px; padding: 9px 16px; min-height: 44px; font-weight: 700; }
.btn.p { background: var(--primary); color: var(--on-primary); }
.btn.sm { min-height: 36px; padding: 5px 12px; font-size: 14px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.comp { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--soft); min-width: 0; }
.comp .row > input[type=text] { flex: 1 1 160px; min-width: 0; }
.share { font-family: var(--display); font-weight: 700; font-size: 18px; min-width: 52px; text-align: right; }
.kl { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.kb { text-align: left; background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; min-width: 0; }
.kb b { font-family: var(--display); font-size: 18px; overflow-wrap: anywhere; }
.kb.done { border-color: var(--good); background: var(--good-bg); }
.kb .st { overflow-wrap: anywhere; }
.bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; } .bar i { display: block; height: 100%; background: var(--good); }
.sc { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.sc:first-of-type { border-top: 0; padding-top: 0; }
.val { font-family: var(--display); font-weight: 700; font-size: 38px; line-height: 1; min-width: 74px; font-variant-numeric: tabular-nums; }
.val.none { color: var(--muted); }
.digits { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; }
.dg { min-height: 44px; border: 1.5px solid var(--line); background: var(--surface); border-radius: 8px; font-weight: 700; font-variant-numeric: tabular-nums; padding: 0; }
.dg[aria-pressed=true] { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.dg.half { background: var(--bib); color: var(--on-bib); border-color: var(--bib); }
details.pr summary { cursor: pointer; color: var(--muted); font-size: 14px; }
details.pr ul { margin: 6px 0 0; padding-left: 20px; color: var(--muted); font-size: 14px; }
.rr { border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); min-width: 0; }
.rr.in { border-color: var(--bib); border-left-width: 8px; }
.rr > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; }
.rr > summary::-webkit-details-marker { display: none; }
.rk { font-family: var(--display); font-weight: 700; font-size: 22px; color: var(--muted); }
.nm { min-width: 0; display: flex; flex-direction: column; } .nm b { font-family: var(--display); font-size: 19px; overflow-wrap: anywhere; }
.tot { font-family: var(--display); font-weight: 700; font-size: 26px; font-variant-numeric: tabular-nums; text-align: right; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.chip { font-size: 12.5px; border-radius: 999px; padding: 1px 9px; border: 1px solid var(--line); background: var(--soft); color: var(--muted); }
.chip.flag { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); font-weight: 700; }
.chip.in { background: var(--bib-bg); color: var(--ink); border-color: var(--bib); font-weight: 700; }
.det { padding: 4px 12px 14px; display: flex; flex-direction: column; gap: 12px; }
.tw { overflow-x: auto; } table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; } th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-weight: 700; } td.f { color: var(--bad); font-weight: 700; background: var(--bad-bg); }
.cut { display: flex; align-items: center; gap: 10px; color: var(--on-bib); font-family: var(--display); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: 14px; }
.cut::before, .cut::after { content: ""; flex: 1; border-top: 3px dashed var(--bib); } .cut span { background: var(--bib); padding: 2px 10px; border-radius: 4px; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.list { display: flex; flex-direction: column; gap: 8px; }
.sel-ok { color: var(--good); font-weight: 700; }
.foot { border-top: 1px dashed var(--line); padding-top: 14px; }
.mx { overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); max-height: 78vh; }
table.matrix { border-collapse: separate; border-spacing: 0; width: max-content; font-size: 15px; }
.matrix th, .matrix td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: normal; vertical-align: middle; }
.matrix thead th { position: sticky; top: 0; z-index: 2; background: var(--soft); vertical-align: top; }
.matrix .kn { position: sticky; left: 0; z-index: 1; background: var(--surface); min-width: 150px; max-width: 190px; border-right: 1px solid var(--line); }
.matrix thead .kn { z-index: 3; background: var(--soft); }
.matrix .kn b { display: block; font-family: var(--display); font-size: 17px; line-height: 1.15; } .matrix .kn .st { display: block; }
.ch { width: 150px; min-width: 150px; } .ch.tt { width: 84px; min-width: 84px; } .ch.nt { width: 220px; min-width: 220px; }
.cn { font-family: var(--display); font-weight: 700; font-size: 16px; line-height: 1.15; margin-bottom: 6px; }
.drill { width: 100%; min-height: 0; font-size: 13px; padding: 6px 8px; border-radius: 8px; line-height: 1.3; }
.drill.ro { color: var(--muted); border: 1px dashed var(--line); background: transparent; }
.cell { width: 100%; min-width: 64px; text-align: center; font-family: var(--display); font-weight: 700; font-size: 22px; padding: 6px 4px; min-height: 48px; font-variant-numeric: tabular-nums; }
.cell:disabled { background: var(--soft); } .cell.bad { border-color: var(--bad); background: var(--bad-bg); }
.nin { width: 100%; font-size: 14px; }
.matrix td.tt { text-align: right; font-family: var(--display); font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 3px solid var(--bib); box-shadow: 0 -8px 24px rgba(0,0,0,.18);
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); max-height: 68vh; overflow: auto; }
.sh-in { max-width: 980px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.sh-k { font-family: var(--display); font-size: 21px; }
.digits.half { grid-template-columns: repeat(9, minmax(0, 1fr)); }
.digits.half .dg { background: var(--bib-bg); } .digits.half .dg[aria-pressed=true] { background: var(--bib); color: var(--on-bib); border-color: var(--bib); }
.chk { display: flex; align-items: center; gap: 6px; } .chk input { width: 20px; height: 20px; }
body.sheet-open { padding-bottom: 340px; }
@media (max-width: 520px) { .digits, .digits.half { grid-template-columns: repeat(5, minmax(0, 1fr)); } .val { font-size: 34px; } h1 { font-size: 26px; } }
@media (prefers-reduced-motion: no-preference) { .bar i { transition: width .25s; } }

/* ---- v0.1 additions ---- */
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 99; }
a { color: var(--primary); } a.back { text-decoration: none; font-weight: 700; display: inline-flex; min-height: 44px; align-items: center; }
.tcard { text-align: left; background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 4px; text-decoration: none; color: var(--ink); min-width: 0; }
.tcard:hover { border-color: var(--accent); } .tcard b { font-family: var(--display); font-size: 22px; line-height: 1.1; overflow-wrap: anywhere; }
.tcard .meta { color: var(--muted); font-size: 14px; }
.btn.danger { border-color: var(--bad); color: var(--bad); } .btn.p.danger { background: var(--bad); color: #fff; }
.field { display: grid; gap: 4px; } .field > span { font-size: 14px; color: var(--muted); font-weight: 700; }
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; z-index: 60; display: grid; gap: 8px; width: min(92vw, 520px); pointer-events: none; }
body.sheet-open .toasts { bottom: 350px; }
.toast { background: var(--ink); color: var(--bg); border-radius: 10px; padding: 10px 14px; box-shadow: 0 6px 20px rgba(0,0,0,.25); pointer-events: none; font-size: 15px; }
.toast.warn { background: var(--bad); color: #fff; }
.veil { position: fixed; inset: 0; background: rgba(5,15,30,.55); z-index: 50; display: grid; place-items: center; padding: 16px; }
.dlg { background: var(--surface); color: var(--ink); border-radius: 16px; padding: 18px; width: min(94vw, 520px); max-height: 90vh; overflow: auto; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.banner { background: var(--bib-bg); color: var(--ink); border: 1.5px solid var(--bib); border-radius: 12px; padding: 10px 14px; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

.opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; }
.opt input { margin-top: 4px; width: 20px; height: 20px; }
.st-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .ok { color: var(--good); font-weight: 700; } .wait { color: var(--muted); } .bad { color: var(--bad); font-weight: 700; }
.guide details { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 4px 14px; } .guide summary { cursor: pointer; font-family: var(--display); font-weight: 700; font-size: 20px; padding: 10px 0; }
.guide .body { padding: 0 0 12px; display: flex; flex-direction: column; gap: 8px; } .guide ol, .guide ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.lock { color: var(--muted); font-size: 14px; }
@media print { .tabs, .rounds, .btn, .foot { display: none; } }

@media (max-width: 520px) {
  .rounds { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x proximity; }
  .rd { flex: 0 0 148px; padding: 8px 12px; scroll-snap-align: start; } .rd b { font-size: 17px; } .rd span { font-size: 13px; }
  .banner { padding: 8px 12px; font-size: 14px; }
}
