/* Skeleton only: position and flow. No colour, font or size literal that a direction would argue about.
   Every direction sets the tokens below in :root and adds its own signature CSS after this file. */
:root {
  --bg: #eee; --surface: #fff; --surface-2: #f6f6f6; --ink: #111; --ink-2: #444; --ink-3: #777; --line: #ddd;
  --accent: #333; --on-accent: #fff; --accent-ink: #333;
  --support: #b3261e; --approaching: #8a5a00; --mastered: #1f6f3f;
  --support-bg: #fbe9e7; --approaching-bg: #fbf0d6; --mastered-bg: #e3f2e8;
  --font-display: system-ui, sans-serif; --font-body: system-ui, sans-serif; --font-mono: ui-monospace, monospace;
  --radius: 10px; --radius-sm: 6px; --gap: 12px; --pad: 16px;
  --stage: #ddd; --frame: #111;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--stage); font-family: var(--font-body); color: var(--ink); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
svg { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* page header (outside the phones) */
.dhead { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px clamp(12px, 3vw, 32px); background: var(--stage); border-bottom: 1px solid rgba(0,0,0,.08); font-family: system-ui, sans-serif; font-size: 13px; color: #333; }
.dhead a { color: inherit; }
.dhead .dname { font-weight: 600; }
.dhead .views { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.dhead .views a { text-decoration: none; padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,.6); }
.dhead .views a[aria-current] { background: #111; color: #fff; }
.dhead .namepick select { font: inherit; padding: 4px 6px; border-radius: 6px; border: 1px solid #bbb; background: #fff; }

/* the stage: phones side by side */
.stage { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 32px 28px; padding: 28px 16px 64px; }
.phone { margin: 0; width: min(390px, 100%); }
.phone figcaption { font-family: system-ui, sans-serif; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #555; margin: 0 0 8px 4px; }
.screen { position: relative; height: 844px; overflow-y: auto; overflow-x: hidden; background: var(--bg); border: 10px solid var(--frame); border-radius: 36px; padding: 14px var(--pad) 28px; scrollbar-width: none; }
.screen::-webkit-scrollbar { display: none; }
@media (max-width: 480px) { .stage { padding: 12px 8px 40px; } .screen { height: auto; min-height: 80vh; border-width: 0; border-radius: 0; } }

/* inside the phone */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand .mark { width: 22px; height: 22px; display: inline-block; flex: none; }
.net { display: inline-flex; align-items: center; gap: 5px; }
.proto, .crumb, .eyebrow { margin: 0; }
.head { margin: 14px 0 10px; }
.title { margin: 2px 0 0; }
.sub { margin: 6px 0 0; }
.actions { display: flex; gap: 10px; margin-top: 18px; }
.actions .btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 16px; }
.actions .btn.ghost { flex: 0 1 auto; }

/* Quick tap */
.progress { height: 6px; overflow: hidden; }
.progress span { display: block; height: 100%; width: calc(var(--p) * 100%); }
.items { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin-top: 14px; }
.it { position: relative; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 4px; }
.it .tick { display: flex; }
.tally { display: flex; gap: 14px; margin-top: 14px; align-items: baseline; }
.tally .t-pct { margin-left: auto; }

/* Scan */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; }
.seg button { min-height: 40px; padding: 0 8px; }
.viewfinder { position: relative; margin-top: 12px; padding: 22px 34px; overflow: hidden; }
.viewfinder .sheet { width: 100%; height: auto; display: block; transform: rotate(-1.4deg); }
.lock { position: absolute; width: 26px; height: 26px; }
.lock.tl { top: 10px; left: 22px; } .lock.tr { top: 10px; right: 22px; } .lock.bl { bottom: 10px; left: 22px; } .lock.br { bottom: 10px; right: 22px; }
.scanline { position: absolute; left: 0; right: 0; height: 2px; top: 40%; }
.vf-note { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); white-space: nowrap; }
.review { margin-top: 14px; padding: 12px 14px; }
.flag-row { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; padding: 10px 0; }
.flag-row .chips { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.flag-row .chips button { min-height: 44px; }

/* Results */
.kpi { display: grid; gap: 2px; padding: 16px; }
.spread { display: flex; align-items: flex-end; gap: 4px; height: 64px; margin-top: 12px; }
.spread .bin { flex: 1; height: calc(var(--h) * 100%); min-height: 3px; position: relative; }
.spread .bin i { position: absolute; top: -16px; left: 0; right: 0; text-align: center; font-style: normal; }
.spread-ax { display: flex; justify-content: space-between; margin-top: 4px; }
.least { margin-top: 16px; }
.least ol { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.lm { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; padding: 12px 14px; }
.lm-body { display: grid; gap: 2px; min-width: 0; }
.lm-bar { grid-column: 1 / -1; position: relative; height: 6px; overflow: visible; }
.lm-bar > span { display: block; height: 100%; width: calc(var(--p) * 100%); }
.lm-bar > i { position: absolute; top: -3px; bottom: -3px; left: calc(var(--c) * 100%); width: 2px; }
.groups { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.grp { display: grid; gap: 2px; padding: 12px; }
.itemflags { margin: 12px 0 0; }

/* Plan */
.draft { margin: 12px 0 0; padding: 8px 12px; }
.queue { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-top: 10px; }
.ilaw { display: grid; gap: 12px; margin-top: 14px; }
.part { padding: 14px; }
.part h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; }
.part .letter { display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; }
.part ul, .part ol { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }
.keyidea { margin: 0 0 10px; }
.group { padding: 12px; margin-top: 8px; }
.g-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin: 0; }
.g-min { width: 100%; }
.g-title { margin: 6px 0 4px; }
.note { margin: 8px 0 0; }

/* the drawn answer sheet: sizes are geometry, the direction sets colour */
.sheet .sv-n { font: 600 6.5px var(--font-mono); }
.sheet .sv-t { font: 500 6px var(--font-body); }
.sheet .sv-big { font: 700 12px var(--font-mono); }
.sheet .sv-b { fill: none; stroke-width: .8; }
.sheet .sv-rule { stroke-width: .6; }
.sheet text { stroke: none; }
