/* Stepwise v2: the progress-pie look (ui-samples/6-progress-pie.html) on every screen.
   Loaded after css/style.css (the shared stylesheet, copied in by tools/export_web.py) and overrides it.
   Layout: an open "Up next" heading with its button, then the pie beside the Your week, Overall and By stage panels;
   the results page opens with the same kind of heading. */
:root{
  --line:#D3DBD9; --empty:#E1E7E4;
  --skill:#0D5C6B; --skill-bg:#DCECEE; --skill-line:#9CC7CD;  /* petrol: skill names, everywhere */
  --refresh-bg:#D2EEDA; --refresh-dot:#7FC796;  /* "needs a refresh": green dots on this pale mint */
  --panel:#18282C; --panel-ink:#EEF1EE; --panel-muted:#A9B7B5;
}
@media (prefers-color-scheme: dark){
  :root{--line:#2C3D3F; --empty:#253537; --skill:#7CC9D5; --skill-bg:#163339; --skill-line:#2E6A73; --refresh-bg:#1F3B2D; --refresh-dot:#4E9A6A; --panel:#0E1819; --panel-ink:#E7EDEA; --panel-muted:#8FA09E}
}
body{font-size:16px}
.wrap{max-width:1200px;padding:20px 16px 64px}
.wrap.narrow{max-width:760px}
.top{margin-bottom:22px}
.eyebrow{font-size:.74rem;font-weight:700;letter-spacing:.09em;text-transform:uppercase;color:var(--muted);margin:0}
.muted{color:var(--muted);font-size:.93rem;margin:0}
.btn{border-radius:10px}
.start{display:inline-flex;align-items:center;justify-content:center;min-height:52px;padding:0 26px;border-radius:10px;border:0;
  background:var(--marker);color:#18282C;font:700 1.05rem var(--sans);cursor:pointer;text-decoration:none}
.start:hover{filter:brightness(1.05)}
.panel{background:var(--paper);border:1px solid var(--line);border-radius:14px;padding:18px;display:grid;gap:14px;min-width:0}
.panel h3{font-size:.76rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin:0}

/* highlighter marks sit behind the body of the letters (the serif's deep descenders pulled the old band low) */
mark{background:linear-gradient(transparent 14%,var(--marker) 14%,var(--marker) 76%,transparent 76%);padding:0 3px;
  -webkit-box-decoration-break:clone;box-decoration-break:clone}
@media (prefers-color-scheme: dark){
  mark{background:linear-gradient(transparent 14%,color-mix(in srgb,var(--marker) 45%,transparent) 14%,color-mix(in srgb,var(--marker) 45%,transparent) 76%,transparent 76%)}
}

/* "needs a refresh" everywhere (tags, tiles, blocks, swatches): green dots on pale mint, like its pie sector */
.dotted,.t-refresh i,i.t-refresh,.sw-refresh,.popup-kicker.refresh{
  background-color:var(--refresh-bg);
  background-image:radial-gradient(circle,var(--refresh-dot) 1.3px,transparent 1.6px);background-size:6px 6px;box-shadow:none}
/* where text sits on the dots (the progress tile, the By Stage block): lighter dots, and a mint halo round the text */
.lv-refresh,.blk.refresh{background-color:var(--refresh-bg);box-shadow:none;
  background-image:radial-gradient(circle,var(--refresh-dot) 1.3px,transparent 1.7px);background-size:6px 6px}
.blk.refresh{color:var(--ink)}
.lv-refresh b,.lv-refresh span,.blk.refresh{text-shadow:0 0 3px var(--refresh-bg),0 0 3px var(--refresh-bg),0 0 2px var(--refresh-bg)}
#pie .dots-bg{fill:var(--refresh-bg)} #pie .dots-dot{fill:var(--refresh-dot)}

/* skill names: one colour of their own wherever they appear (headlines, popups, questions, results) */
.sk{color:var(--skill)}
.sk .code{color:inherit}

/* ---------- dashboard ---------- */
/* Two columns: the pie (with Your progress under it) on the left from the top of the page; on the right, the
   round to play (Up next, the round, its button, tags and key, one under the other), then This week and By Stage.
   On a phone: the round, the pie and progress, then the panel. */
.grid{display:grid;gap:24px;grid-template-columns:minmax(0,1fr);grid-template-areas:"next" "pie" "side"}
.nx{grid-area:next} .pie-card{grid-area:pie} .side{grid-area:side}
@media (min-width:980px){
  .grid{grid-template-columns:minmax(0,1fr) 380px;grid-template-areas:"pie next" "pie side";grid-template-rows:auto 1fr;align-items:start;column-gap:40px}
}

/* Up next */
.nx{display:grid;justify-items:start;gap:14px;padding:2px 2px 6px}
.nx h1.kicker{margin:0;font-family:var(--sans);font-weight:500;font-size:1rem;line-height:1.3;color:var(--muted)}
.nx-line{margin:0;color:var(--muted)}
.nx .start{min-width:260px;min-height:62px;padding:0 32px;font-size:1.25rem;border-radius:14px;box-shadow:inset 0 0 0 1.5px #18282C,0 2px 0 #18282C}
.nx .start:hover{filter:none;transform:translateY(-1px);box-shadow:inset 0 0 0 1.5px #18282C,0 3px 0 #18282C}
.nx .start:active{transform:translateY(1px);box-shadow:inset 0 0 0 1.5px #18282C,0 1px 0 #18282C}
@media (prefers-reduced-motion: reduce){.nx .start:hover,.nx .start:active{transform:none}}
@media (max-width:560px){.nx .start{width:100%}}
/* every skill in the next round as a tag; the square shows why it's there, in the pie's colours */
.nx-tags{display:grid;gap:10px}
.nx .sktag{font-size:.82rem;padding:4px 11px 4px 9px}
.sktag .code{font-weight:800;font-size:.85em;letter-spacing:.02em;margin-right:-2px}
.sktags{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:8px}
.sktag{display:inline-flex;align-items:center;gap:7px;font-size:.88rem;font-weight:600;border-radius:999px;padding:4px 12px 4px 10px;
  background:var(--skill-bg);color:var(--skill);border:1px solid var(--skill-line)}
.sktag i,.tag-key i{width:10px;height:10px;border-radius:3px;flex:none;display:inline-block}
.t-learning i,i.t-learning{background:var(--marker);box-shadow:inset 0 0 0 1px var(--ink)}
.t-learned i,i.t-learned{background:var(--learned);box-shadow:inset 0 0 0 1px var(--ink)}
.t-mastered i,i.t-mastered{background:var(--mastered);box-shadow:inset 0 0 0 1px var(--ink)}
.tag-key{display:flex;flex-wrap:wrap;gap:4px 16px;font-size:.84rem;color:var(--muted);margin:0}
.tag-key span{display:inline-flex;align-items:center;gap:6px}

/* the pie, on the open page */
.pie-card{display:grid;gap:6px;justify-items:center;min-width:0}
#pie{width:100%;max-width:620px;height:auto;display:block}
#pie .track{fill:var(--empty);stroke:var(--ground);stroke-width:2.5}
#pie .fill{stroke:var(--ground);stroke-width:2.5;pointer-events:none}
#pie .seg{fill:transparent;stroke:transparent;stroke-width:3;cursor:pointer}
#pie .seg:focus{outline:none}
#pie .seg:hover,#pie .seg:focus-visible,#pie .seg.sel{stroke:var(--ink)}
#pie .hub{fill:var(--paper);stroke:var(--line)}
#pie .slice-lab{font:600 15px var(--serif);fill:var(--ink)}
#pie .slice-sub{font:500 12.5px var(--sans);fill:var(--muted)}
#pie .c-big{font:500 66px var(--serif);fill:var(--ink)}
#pie .c-sub{font:500 13px var(--sans);fill:var(--muted)}
.caption{min-height:4.2em;text-align:center;max-width:52ch;margin:0;color:var(--muted)}
.caption strong{font-family:var(--serif);font-size:1.25rem;font-weight:600}
.caption .code{font-family:var(--sans);font-size:.75em;margin-right:2px}
.caption .hint{font-size:.85rem}
.sw{width:12px;height:12px;border-radius:3px;display:inline-block;flex:none;margin-right:6px;vertical-align:-1px}
.sw-mastered{background:var(--mastered);box-shadow:inset 0 0 0 1.5px var(--ink)}
.sw-learned{background:var(--learned);box-shadow:inset 0 0 0 1.5px var(--ink)}
.sw-learning{background:var(--marker);box-shadow:inset 0 0 0 1.5px var(--ink)}
.sw-locked{background:var(--empty)}

/* Your progress, under the pie: five level tiles (also the pie's key), then rounds and accuracy */
.my-progress{width:100%;max-width:640px;display:grid;gap:14px;justify-items:center;margin-top:4px;padding-top:18px;border-top:1px solid var(--line)}
.my-progress h2,.side h2{font-family:var(--serif);font-weight:500;font-size:1.35rem;line-height:1.15;margin:0}
.levels{list-style:none;margin:0;padding:0;width:100%;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}
@media (max-width:520px){.levels{grid-template-columns:repeat(3,minmax(0,1fr))}}
/* each tile in its level's colour, as in the pie: just the count and the level */
.levels li{display:grid;justify-items:center;gap:3px;padding:12px 6px 10px;border-radius:12px;text-align:center;color:#18282C}
.levels b{font-family:var(--serif);font-weight:500;font-size:1.6rem;line-height:1;font-variant-numeric:tabular-nums}
.levels span{font-size:.85rem;font-weight:600;line-height:1.2}
.lv-mastered{background:var(--mastered)}
.lv-learned{background:var(--learned)}
.lv-learning{background:var(--marker)}
.levels .lv-refresh,.levels .lv-locked{color:var(--ink)}
.lv-locked{background:var(--empty)}
.stats{display:flex;gap:40px;justify-content:center;text-align:center;margin:0}
.stats div{display:flex;flex-direction:column-reverse}
.stats dt{font-size:.84rem;color:var(--muted)}
.stats dd{margin:0;font-family:var(--serif);font-size:1.7rem;line-height:1.1;font-variant-numeric:tabular-nums}

/* This week and By Stage, in one panel */
.side{min-width:0;border-radius:16px;padding:20px 20px 18px}
.side .divider{height:1px;background:var(--line)}
.by-hint{margin-top:-8px;font-size:.85rem}
.today{display:flex;align-items:center;justify-content:space-between;gap:14px}
.today p{margin:0}
.dots{display:flex;gap:6px;align-items:center}
.dot{width:14px;height:14px;border-radius:50%;border:2px solid var(--faint)}
.dot.on{background:var(--marker);border-color:var(--ink)}
.dots .more{font-size:.8rem;font-weight:700}
.side .nudge{margin:0}
.week{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px;text-align:center;font-size:.72rem;color:var(--muted)}
.week .d{height:30px;border-radius:7px;background:var(--empty);margin-bottom:4px;display:flex;align-items:center;justify-content:center;font-size:.82rem;font-weight:700;color:#18282C}
.week .wd,.week .dt{display:block;line-height:1.25}
.week .wd{font-weight:600;white-space:nowrap}
.week > div:first-child .wd{color:var(--ink)}
.week .d.on{background:var(--marker);box-shadow:inset 0 0 0 1.5px var(--ink)}
.week .d.now{background:transparent;box-shadow:inset 0 0 0 2px var(--ink)}
.stages{display:grid;gap:14px}
.stage{display:grid;gap:6px}
.stage-top{display:flex;justify-content:space-between;gap:10px;font-size:.95rem}
.stage-top b{font-weight:600}
.stage-top span{color:var(--muted);font-variant-numeric:tabular-nums}
.blocks{display:grid;grid-template-columns:repeat(10,minmax(0,1fr));gap:4px}
.blk{height:28px;border-radius:6px;background:var(--empty);border:0;padding:0;display:flex;align-items:center;justify-content:center;
  font:700 .72rem var(--sans);color:#18282C;cursor:pointer}
.blk.locked{color:var(--muted);font-weight:600}
.blk:hover,.blk.sel{outline:2px solid var(--ink);outline-offset:1px}
.blk.mastered{background:var(--mastered)}
.blk.learned{background:var(--learned)}
.blk.learning{background:var(--marker)}
.saved-note{margin-top:28px}
.devtools{margin-top:40px}

/* the skill popup shows the skill's status above its tabs */
.skill-popup .progress{margin-top:16px;padding-top:14px}

/* ---------- a round ---------- */
.q-head{background:var(--paper);border:1px solid var(--line);border-radius:14px;padding:14px 18px;margin-bottom:14px;gap:10px}
.q-head .round{font-family:var(--serif);font-size:1.15rem;font-weight:600}
.bar i{height:9px;border-radius:5px;background:var(--empty);opacity:1}
.bar .now{box-shadow:inset 0 0 0 2px var(--ink);background:transparent}
.q-card{background:var(--paper);border:1px solid var(--line);border-radius:14px;padding:26px 28px 24px}
@media (max-width:560px){.q-card{padding:20px 16px 18px}}
.q-card .skill{margin-bottom:14px;flex-wrap:wrap;gap:8px}
.q-card .skill .code{font-weight:700;color:var(--ink)}
.q-card .skill .fmt{font-size:.8rem;font-weight:600;border:1px solid var(--line);border-radius:999px;padding:1px 9px;margin-left:auto}
.option{background:var(--ground);border-color:var(--line);border-radius:10px}
label.option:hover{border-color:var(--ink)}
.option:has(input:checked){background:color-mix(in srgb,var(--marker) 22%,var(--paper))}
.explain{border-top-color:var(--line)}
.refresher-tag{background:var(--paper);box-shadow:inset 0 0 0 2px var(--refresh)}

/* ---------- round results: an open heading like the dashboard's, no box ---------- */
.score{display:grid;gap:14px;padding:4px 2px 22px}
.score h1{font-family:var(--serif);font-weight:500;font-size:clamp(2.2rem,6vw,3.1rem);line-height:1.05;letter-spacing:-.01em}
.score .bar i.ok{background:var(--ok)}
.score .bar i.no{background:var(--no)}
.score .go{margin-top:6px}
.score .start{box-shadow:inset 0 0 0 1.5px #18282C}
.score .nudge{margin:0}
.wrap.narrow > .panel + .panel{margin-top:18px}
.changes{margin:0;font-size:1.15rem}
.changes li{display:flex;align-items:baseline;gap:4px}
.changes li.kept{display:block}
.changes .sw{transform:translateY(1px)}
.round-review{margin-top:18px;padding-top:18px;border-top:1px solid var(--line)}
.round-review h2{font-size:1.5rem}

/* prototype tools under a question (only with ?tools in the address) */
.dev-round{margin-top:28px}

/* ---------- past rounds ---------- */
.rounds-link{color:inherit;text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:5px;text-decoration-color:var(--marker)}
.rounds-link:hover{text-decoration-color:var(--ink)}
.round-nav{gap:10px 12px}
.btn.ghost{background:var(--paper);color:var(--ink);box-shadow:inset 0 0 0 1.5px var(--ink);min-height:48px;padding:0 20px;font-size:.95rem}
.btn.ghost.off{opacity:.35;cursor:default}
.rounds-strip{display:flex;flex-wrap:wrap;gap:5px}
.rs{min-width:34px;height:30px;padding:0 6px;border-radius:6px;display:inline-flex;align-items:center;justify-content:center;
  font-size:.8rem;font-weight:700;color:#18282C;text-decoration:none;font-variant-numeric:tabular-nums}
.rs.good,.rs-k.good{background:var(--mastered)}
.rs.mid,.rs-k.mid{background:var(--marker)}
.rs.low,.rs-k.low{background:color-mix(in srgb,var(--no) 30%,var(--paper))}
.rs:hover{box-shadow:inset 0 0 0 1.5px var(--ink)}
.rs.here{box-shadow:0 0 0 2px var(--paper),0 0 0 4px var(--ink)}
.rs-key{display:flex;flex-wrap:wrap;gap:4px 16px;font-size:.8rem;color:var(--muted);margin:0}
.rs-key span{display:inline-flex;align-items:center;gap:6px}
.rs-k{width:12px;height:12px;border-radius:3px;display:inline-block}

/* decision notes and the next-round preview (prototype tools only) */
.decisions{gap:12px}
.dec-group{display:grid;gap:4px;padding-top:10px;border-top:1px solid var(--line)}
.dec-group h4{margin:0;font-size:.85rem;font-weight:700}
.dec-group ul,.preview{margin:0;padding-left:1.2em;display:grid;gap:3px;font-size:.88rem;color:var(--ink)}
.dev-preview{margin:12px 0;padding:12px 14px;border:1px dashed var(--faint);border-radius:10px;display:grid;gap:6px;color:var(--ink)}

/* the welcome popup (the coach's "fill your pie" message) */
.welcome .how li{color:var(--ink)}
.w-row{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:6px}
.w-slice{border-radius:999px;padding:2px 11px;font-size:.85rem;font-weight:600;background:var(--skill-bg);color:var(--skill);border:1px solid var(--skill-line)}
.w-chip{display:inline-flex;align-items:center;border-radius:999px;padding:1px 10px;font-size:.85rem;font-weight:700;color:#18282C;white-space:nowrap;vertical-align:1px}
.w-chip.lv-refresh{color:var(--ink)}
.w-arrow{color:var(--muted);font-weight:700}
.welcome .start{min-height:52px;padding:0 26px;border-radius:12px;box-shadow:inset 0 0 0 1.5px #18282C,0 2px 0 #18282C}
/* Prototype tools 2 (v3): the note on its last run, and the accuracy popup */
.tools2{margin-top:18px}
.dev2-note{color:var(--ink);border:1px dashed var(--faint);border-radius:8px;padding:8px 12px}
.dev2-popup{max-width:460px}
.dev2-sets{display:flex;flex-wrap:wrap;gap:6px 18px}
.dev2-use .muted{margin:2px 0 0;font-size:.82rem}
.scen-wrap{overflow-x:auto}
.scen{border-collapse:collapse;width:100%;font-size:.82rem}
.scen th,.scen td{border:1px solid var(--line);padding:8px 10px;text-align:left;vertical-align:top}
.scen thead th{font-weight:600}
.scen tbody th{font-weight:600;white-space:nowrap}
.dev2-scen .muted{margin:2px 0}
