/* Learner-app styles. Anything reusable belongs in /kit, not here. */

.q { font-size: var(--step-1); line-height: 1.45; margin: var(--space-3) 0 var(--space-4); }
.menu .sub { display: block; font-weight: 400; font-size: 14px; opacity: .85; margin-top: 2px; }

.nav { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-2) 0 var(--space-3); }
.nav button {
  flex: 1 1 30%; margin-top: 0; min-height: 44px; padding: 8px 10px; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.nav button svg { width: 18px; height: 18px; flex: 0 0 auto; }
.nav button[aria-current="page"] {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
}
@media (max-width: 679px) {
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  #nav.nav:not(.hide) {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; margin: 0;
    display: flex; flex-wrap: nowrap; gap: 0;
    background: var(--card); border-top: 1px solid var(--line);
    padding: 4px 2px calc(4px + env(safe-area-inset-bottom));
    box-shadow: 0 -10px 28px color-mix(in srgb, var(--ink) 7%, transparent);
  }
  .nav button {
    flex: 1 1 0; flex-direction: column; gap: 2px;
    min-width: 0; min-height: 52px; padding: 6px 2px;
    font-size: 11px; font-weight: 650; border: 0; background: transparent;
    color: var(--muted);
  }
  .nav button svg { width: 22px; height: 22px; }
  .nav button[aria-current="page"] {
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    color: var(--accent);
  }
}

.chooser {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2);
  margin: 0 0 var(--space-4);
}
.chooser .featured { grid-column: 1 / -1; min-height: 300px; }
.chooser.drills { margin-top: var(--space-2); }
button.scene {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  width: 100%; min-height: 230px; margin-top: 0; padding: 0; overflow: hidden;
  text-align: left; font-weight: 400; color: var(--ink);
  background: var(--card); border: 1px solid var(--line);
}
.chooser.drills button.scene { min-height: 230px; }
.scene-art {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; background: var(--tap-bg);
}
.scene.featured .scene-art { object-position: center 38%; }
.scene[data-kind="ultimate"] .scene-art { object-position: center 72%; }
.scene[data-kind="quick"] .scene-art { object-position: center 82%; }
.scene[data-kind="signs"] .scene-art { object-position: center 40%; }
.scene[data-kind="numbers"] .scene-art { object-position: center 58%; }
.scene[data-kind="weak"] .scene-art { object-position: center 78%; }
.scene[data-kind="misses"] .scene-art { object-position: center 62%; }
.scene-copy {
  position: relative; z-index: 1; display: block;
  padding: 48px 14px 14px;
  background: linear-gradient(
    to top,
    var(--card) 0%,
    color-mix(in srgb, var(--card) 92%, transparent) 55%,
    transparent 100%);
  color: var(--ink);
}
.scene-copy .chip { margin-bottom: 8px; color: var(--state-accent); border-color: var(--state-accent); }
.scene-copy strong { display: block; font-size: var(--step-1); font-weight: 650; letter-spacing: -0.02em; }
.scene-copy .sub, .scene-copy .fact {
  display: block; font-weight: 400; font-size: 14px; margin-top: 4px; line-height: 1.35;
}
.scene-copy .fact { color: var(--muted); }
button.scene.exam {
  grid-column: 1 / -1; min-height: 0;
  display: grid; grid-template-columns: 1fr;
  justify-content: stretch;
}
button.scene.exam .scene-art {
  position: relative; inset: auto; width: 100%; height: auto;
  aspect-ratio: 16 / 9; object-fit: cover;
}
button.scene.exam .scene-copy {
  padding: var(--space-4);
  background: var(--card);
  display: flex; flex-direction: column; justify-content: center;
}
#real-head { margin-top: var(--space-5); }
#real-head + .lede { margin-bottom: var(--space-3); }
button.scene.exam { margin: 0 0 var(--space-4); }
@media (max-width: 679px) {
  /* Title + what is enough on a two-column phone; the extra fact is for roomy. */
  .scene:not(.featured):not(.exam) .fact { display: none; }
  .scene-copy { padding: 40px 12px 12px; }
}
@media (hover: hover) {
  button.scene:hover, button.scene:focus-visible {
    border-color: var(--state-accent);
    box-shadow: 0 0 0 1px var(--state-accent);
  }
}
@media (min-width: 680px) {
  .chooser { grid-template-columns: 1.35fr 1fr; gap: var(--space-3); }
  .chooser .featured {
    grid-column: 1; grid-row: 1 / span 2; min-height: 0;
  }
  .chooser.drills { grid-template-columns: repeat(4, 1fr); }
  button.scene.exam {
    grid-template-columns: 1.1fr 1fr; align-items: stretch;
  }
  button.scene.exam .scene-art {
    height: 100%; aspect-ratio: auto; min-height: 220px;
  }
}

.signin-fields { max-width: 36rem; }
.signin-fields .date-field { margin-top: 0; }

.who-row { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.who-row #who { min-width: 0; overflow-wrap: anywhere; }
.who-row button { width: auto; margin-top: 0; min-height: 36px; padding: 6px 12px; font-size: 14px; }
/* The language control lives beside the email: present, never prominent. Styled
   as quiet text like its neighbour, not as a form field — it is a preference,
   not a step. */
.lang-toggle {
  appearance: none; -webkit-appearance: none;
  border: 0; background: transparent; color: var(--muted);
  font: inherit; font-size: 13px; padding: 2px 4px; cursor: pointer;
}
.lang-toggle:hover, .lang-toggle:focus-visible { color: var(--accent); }

.banner {
  display: block; width: 100%; height: auto; max-height: 280px; object-fit: cover;
  object-position: center 60%; border-radius: var(--radius-lg); margin: 0 0 var(--space-4);
  box-shadow: var(--shadow), 0 0 0 2px color-mix(in srgb, var(--state-accent) 40%, transparent);
}
html.exam .banner { display: none; }
html.exam #nav { display: none !important; }

.plans { display: grid; gap: var(--space-3); margin-top: var(--space-3); }
.plan h2 { margin: 0 0 var(--space-2); }
.plan.feature { border-color: var(--accent); }
@media (min-width: 680px) { .plans { grid-template-columns: repeat(3, 1fr); } }

.empty {
  text-align: center; padding: var(--space-4) var(--space-3);
}
.empty img { width: min(280px, 70%); height: auto; margin: 0 auto var(--space-3); display: block; }

.ready-head { display: flex; gap: var(--space-3); align-items: center; }
.ready-meter { position: relative; width: 72px; height: 72px; flex: 0 0 72px; }
.ready-meter svg { width: 72px; height: 72px; transform: rotate(-90deg); }
.ready-meter circle { fill: none; stroke-width: 3.2; }
.ready-meter .rg-track { stroke: var(--tap-bg); }
.ready-meter .rg-fill { stroke: var(--accent); stroke-linecap: round;
  transition: stroke-dasharray 500ms cubic-bezier(.2, .7, .2, 1); }
.readiness.ready .rg-fill { stroke: var(--right); }
.readiness.done .rg-fill { stroke: var(--state-accent); }
.readiness.done .ready-meter span { font-size: 11px; }
.ready-meter span {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 13px; font-weight: 650; letter-spacing: -0.02em;
}
@media (min-width: 680px) { .nav { justify-content: flex-start; } .nav button { flex: 0 0 auto; min-width: 96px; } }

/* Teaching figure on the question stage. No box reserved when it is absent. */
.quiz-stage.has-figure .figure {
  margin: 0 0 var(--space-3); max-width: none;
}
@media (min-width: 1024px) {
  .quiz-stage.has-figure {
    display: grid; grid-template-columns: minmax(240px, 38%) 1fr;
    gap: var(--space-4); align-items: start;
  }
  .quiz-stage.has-figure .figure { margin: 0; position: sticky; top: var(--space-3); }
}
html.exam .figure { display: none; }
.miss-note {
  margin: var(--space-3) 0 0; font-size: 14px; color: var(--muted);
  padding-top: var(--space-2); border-top: 1px solid var(--line);
}

.study-stage { display: grid; gap: var(--space-4); }
.study-topics { display: flex; flex-direction: column; gap: var(--space-2); }
.study-index { background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 14px 16px; }
.study-jump { display: block; margin: 0 0 var(--space-2); }
.study-jump select { margin-top: 4px; }
.study-toc { display: none; }
.study-toc, .study-toc ul { list-style: none; margin: 0; padding: 0; }
.study-toc > li { margin: 0 0 var(--space-3); }
.toc-ch { font-weight: 650; font-size: 14px; }
.toc-ch.done { color: var(--right); }
.toc-sec {
  display: flex; align-items: center; gap: 8px;
  width: 100%; margin-top: 4px; min-height: 36px; padding: 6px 8px;
  text-align: left; font-weight: 400; font-size: 14px; background: transparent;
  border: 0; color: var(--ink); border-radius: 6px;
}
.toc-sec.here { background: var(--tap-bg); font-weight: 650; }
.toc-check {
  flex: 0 0 18px; width: 18px; text-align: center;
  color: var(--right); font-weight: 700; line-height: 1;
}
.toc-check.on { color: var(--right); }
.study-page { background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: var(--space-4); box-shadow: var(--shadow); }
.study-page h1 { margin-top: var(--space-2); }
@media (min-width: 1024px) {
  .study-stage { grid-template-columns: 260px 1fr; align-items: start; }
  .study-topics {
    position: sticky; top: var(--space-3);
    max-height: calc(100vh - var(--space-3) - 80px);
  }
  .study-index { overflow: auto; flex: 1 1 auto; min-height: 0; padding-bottom: 72px; }
  .study-jump { display: none; }
  .study-toc { display: block; }
  #v-study #study-meter.float-meter {
    position: fixed;
    transform: none;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
}

.float-meter {
  position: fixed; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%); z-index: 5;
  /* Inset and translucent so it reads as floating *over* the lesson. At the card's
     exact width and solid colour it looked like a row inside the card, cutting the
     paragraph in half mid-sentence (persona review, plain-words). */
  width: min(calc(100% - 2 * var(--space-5)), var(--page));
  background: color-mix(in srgb, var(--card) 86%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 99px;
  padding: 8px 16px; box-shadow: var(--shadow);
}
.float-meter .bar-track { margin-top: 4px; }
#v-study:not(.hide), #v-signs:not(.hide) { padding-bottom: 104px; }
@media (min-width: 1024px) {
  #v-study:not(.hide) { padding-bottom: 0; }
}
.meter-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }

/* Road markings: a drawing, its name, and whether you may cross it. */
.mark-key { margin: var(--space-3) 0; }
.mark-key:empty { display: none; }
.mark-key h2 { margin: 0 0 var(--space-2); font-size: var(--step-1); }
.mark-key ul { margin: 0; padding-left: 1.1em; }
.mark-key li { margin: 4px 0; }
.mark-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: var(--space-3);
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
}
.mark-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  width: 100%; height: 100%; margin-top: 0; padding: 8px 8px 12px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); text-align: left; font-weight: 400;
  cursor: pointer; color: inherit;
}
.mark-card.seen { box-shadow: inset 0 0 0 2px var(--right); }
.mark-card img, .mark-hero { display: block; width: 100%; height: auto; border-radius: 10px; }
.mark-hero { max-width: 420px; margin: 0 auto var(--space-3); }
.mark-name { font-weight: 650; font-size: 14px; line-height: 1.3; padding: 0 4px; }
.mark-cross { display: inline-block; font-size: 12px; font-weight: 650; line-height: 1;
  padding: 5px 8px; border-radius: 99px; margin: 0 4px;
  background: color-mix(in srgb, var(--muted) 14%, transparent); color: var(--ink); }
.mark-cross.yes { background: color-mix(in srgb, var(--right) 16%, transparent); color: var(--right); }
.mark-cross.no { background: color-mix(in srgb, var(--wrong) 14%, transparent); color: var(--wrong); }
#marking-dialog-body .mark-cross { margin: 0 0 var(--space-2); font-size: 13px; }

.num-fam { margin-top: var(--space-4); }
.num-fam h2 { margin: 0 0 var(--space-1); }
.num-fam .lede { margin: 0 0 var(--space-3); }
.num-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: var(--space-2);
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
}
.num-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; margin-top: 0; min-height: 132px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 12px 14px;
  text-align: left; font-weight: 400; cursor: pointer; color: inherit;
}
.num-card.seen { box-shadow: inset 0 0 0 2px var(--right); }
.num-value { color: var(--state-accent); font-size: 32px; font-weight: 650;
             letter-spacing: -0.03em; line-height: 1.05; }
.num-unit { color: var(--muted); font-size: 13px; font-weight: 650; }
.num-prompt { color: var(--muted); font-size: 13px; line-height: 1.35; margin-top: 6px; }
.num-hero { color: var(--state-accent); font-size: clamp(40px, 8vw, 64px);
            font-weight: 650; letter-spacing: -0.03em; line-height: 1; margin: 0 0 var(--space-2); }
.num-hero span { display: block; font-size: 16px; color: var(--muted); font-weight: 650;
                 letter-spacing: 0; margin-top: 4px; }
.num-mix { color: var(--muted); }
.num-mix b { color: var(--state-accent); font-weight: 650; }

.sign-system { margin: var(--space-4) 0; }
.sign-system h2 { margin-bottom: var(--space-2); }
.sign-system h3 { margin: var(--space-4) 0 var(--space-2); font-size: var(--step-1); }
.shape-grid, .type-row {
  display: grid; gap: var(--space-2);
  grid-template-columns: 1fr;
}
@media (min-width: 680px) {
  .shape-grid { grid-template-columns: 1fr 1fr; }
  .type-row { grid-template-columns: 1fr 1fr 1fr; }
}
.shape-card, .type-chip {
  display: flex; gap: 12px; align-items: flex-start;
  width: 100%; margin-top: 0; min-height: 0;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 12px;
  text-align: left; font-weight: 400; cursor: pointer; color: inherit;
}
.shape-card.seen, .type-chip.seen { box-shadow: inset 0 0 0 2px var(--right); }
.arming {
  --ring: 0%;
  background:
    linear-gradient(var(--card), var(--card)) padding-box,
    conic-gradient(from -90deg, var(--accent) var(--ring), var(--line) 0) border-box;
  border: 2px solid transparent !important;
}
button.arming,
button.arming:disabled {
  opacity: 1;
  color: var(--accent);
}
button.inline.arming { color: var(--accent); background:
    linear-gradient(var(--card), var(--card)) padding-box,
    conic-gradient(from -90deg, var(--accent) var(--ring), var(--line) 0) border-box; }
.color-word { font-weight: 650; }
.color-red { color: #c45b5b; }
.color-white { color: var(--ink); }
.color-yellow { color: #d4a017; }
.color-fyg { color: #9aaa2a; }
.color-orange { color: #d06a1a; }
.color-pink { color: #d4789a; }
.color-green { color: var(--accent); }
.color-blue { color: #5a8ec4; }
.color-brown { color: #a07a4a; }
.shape-card p, .type-chip p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.shape-card strong, .type-chip strong { font-size: 14px; }
.sil {
  flex: 0 0 36px; width: 36px; height: 36px; margin-top: 2px;
  background: var(--state-accent); border: 2px solid var(--ink);
}
.sil-octagon { clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); background: #a4343a; border: 0; }
.sil-triangle { clip-path: polygon(50% 100%, 0 0, 100% 0); background: #a4343a; border: 0; }
.sil-circle { border-radius: 99px; background: #d4a017; border: 0; }
.sil-pennant { clip-path: polygon(0 20%, 100% 50%, 0 80%); background: #d4a017; border: 0; }
.sil-pentagon { clip-path: polygon(50% 0, 100% 38%, 82% 100%, 18% 100%, 0 38%); background: #c6d44a; border: 0; }
.sil-diamond { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); background: #d4a017; border: 0; }
.sil-rectangle { border-radius: 3px; background: var(--card); }
.sil-crossbuck { background: transparent; border: 0; position: relative; }
.sil-crossbuck::before, .sil-crossbuck::after {
  content: ""; position: absolute; left: 4px; right: 4px; top: 15px; height: 6px;
  background: var(--ink); border-radius: 1px;
}
.sil-crossbuck::before { transform: rotate(35deg); }
.sil-crossbuck::after { transform: rotate(-35deg); }
.sil-shield { clip-path: polygon(50% 0, 100% 18%, 100% 62%, 50% 100%, 0 62%, 0 18%); background: #3a6ea5; border: 0; }
.swatch {
  flex: 0 0 18px; width: 18px; height: 18px; margin-top: 4px;
  border-radius: 99px; border: 1px solid var(--line);
}
.swatch-red { background: #a4343a; }
.swatch-white { background: #fffdf8; }
.swatch-yellow { background: #d4a017; }
.swatch-fyg { background: #c6d44a; }
.swatch-orange { background: #d06a1a; }
.swatch-pink { background: #e08aa8; }
.swatch-green { background: #1f6f5c; }
.swatch-blue { background: #3a6ea5; }
.swatch-brown { background: #7a5430; }
.variant-row {
  display: grid; gap: var(--space-2); margin-top: var(--space-2);
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
}
.sign-tile.here { box-shadow: inset 0 0 0 2px var(--accent); }

.sign-fam { margin-top: var(--space-4); }
.sign-fam h2 { margin-bottom: var(--space-2); }
.sign-grid {
  display: grid; gap: var(--space-2);
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
}
.sign-tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  margin-top: 0; min-height: 0; padding: 10px 8px;
  background: var(--card); color: var(--ink); border: 1px solid var(--line);
  font-weight: 400; font-size: 12px; text-align: center; line-height: 1.3;
}
.sign-tile img { width: 72px; height: 72px; object-fit: contain; }
.sign-official { text-align: center; margin: 0 0 var(--space-3); }
.sign-official img { width: min(200px, 70%); height: auto; }
.sign-tile.seen { box-shadow: inset 0 0 0 2px var(--right); }
.sign-dialog {
  position: relative; max-width: 560px; max-height: calc(100vh - 32px);
  overflow: auto; padding: var(--space-4) var(--space-4) var(--space-3);
}
.sign-dialog .x {
  position: absolute; top: 8px; right: 8px;
  width: 36px; min-width: 36px; height: 36px; min-height: 36px;
  margin: 0; padding: 0; line-height: 1; font-size: 22px; font-weight: 400;
  border: 0; background: transparent; color: var(--muted);
}
.sign-dialog #sign-count { margin: 0 40px 0 0; }
.sign-dialog-nav { margin-top: var(--space-3); justify-content: space-between; }
.sign-dialog-nav button { width: auto; min-width: 108px; }
.sign-context { position: relative; margin: 0 0 var(--space-3); }
.sign-context .place {
  display: block; width: 100%; height: 120px; object-fit: cover; border-radius: var(--radius);
}
@media (min-width: 680px) {
  .sign-context .place { height: 160px; }
}
.sign-context .glyph {
  position: absolute; left: 12px; bottom: 36px; width: 72px; height: 72px;
  background: var(--card); border-radius: 8px; padding: 4px;
  box-shadow: var(--shadow);
}
.sign-context figcaption {
  font-size: 13px; color: var(--muted); margin-top: 8px;
}
.sign-detail h3 { font-size: 15px; margin: var(--space-3) 0 var(--space-1); }
.sign-detail ul { margin: 0; padding-left: 1.2em; }

.badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin: var(--space-3) 0; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; padding: 4px 10px; border-radius: 99px;
  border: 1px solid var(--line); color: var(--muted); background: var(--card);
}
.badge.earned { color: var(--ink); border-color: color-mix(in srgb, var(--state-accent) 55%, var(--line));
                align-items: flex-start; max-width: 100%; }
.badge b { font-weight: 650; color: var(--state-accent); }
.badge-copy { display: flex; flex-direction: column; gap: 1px; line-height: 1.3; }
.badge-copy strong { font-weight: 650; }
.badge-copy em { font-style: normal; font-size: 12px; color: var(--muted); }
.badge-next { margin: 6px 0 0; }
.badge-row.tight { margin: 4px 0 0; }
.badge-row.tight .badge { font-size: 11px; padding: 2px 8px; align-items: center; }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  z-index: 20; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
  max-width: min(520px, calc(100vw - 32px));
  padding: 10px 14px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.toast.hide { display: none; }

#quiz-foot { margin-top: var(--space-4); gap: var(--space-2); }
#quiz-foot #flag { font-size: 14px; min-height: 44px; opacity: .75; }

/* the endless run — the panels' wheel, live, close to the top */
.ult-bar { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-2) 0 0; }
.ult-bar.hide { display: none; }
.ult-bar .ring, .ult-bar .ring svg { width: 72px; height: 72px; }
.ult-bar .ring-mid b { font-size: 16px; }
.ult-mid { display: flex; flex-direction: column; gap: 2px; }
#ult-done { font-size: var(--step-1); font-weight: 650; line-height: 1.1; }
#ult-stop { margin-left: auto; margin-top: 0; width: auto; }

/* exam mode: the error budget is the only feedback the real test gives you */
.exam-bar { margin: var(--space-2) 0 0; font-size: 14px; color: var(--muted); }
.exam-bar #exam-part:not(:empty)::after { content: " · "; }
.exam-bar #time-left { float: right; font-variant-numeric: tabular-nums; }
.exam-bar .track { height: 4px; background: var(--tap-bg); border-radius: 99px; margin-top: 6px; overflow: hidden; }
.exam-bar #track-fill { height: 100%; background: var(--accent); width: 0%; }
.exam-bar.spent #track-fill { background: var(--wrong); }

.readiness { border-left: 3px solid var(--state-accent); }
.readiness.ready { border-left-color: var(--right); }
.readiness.done { border-left-color: var(--state-accent); }
.readiness .verdict-line { font-size: var(--step-1); font-weight: 600; margin: 0 0 var(--space-1); }
.readiness .rule { color: var(--muted); font-size: 14px; margin: var(--space-2) 0 0; }
.recent { display: flex; gap: var(--space-1); margin-top: var(--space-3); flex-wrap: wrap; }
.recent span { font-size: 13px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.recent span.ok { color: var(--right); border-color: var(--right); }
.exam-list { list-style: none; margin: var(--space-3) 0 0; padding: 0; }
.exam-list li { display: flex; align-items: baseline; gap: var(--space-2);
  padding: 6px 0; border-top: 1px solid var(--line); color: var(--muted); }
.exam-list li span:first-child { min-width: 5.5em; }
.exam-list li b { margin-left: auto; color: var(--ink); }
.exam-list li.ok b { color: var(--right); }

.exam-map { margin-top: var(--space-4); }
.map-list { list-style: none; padding: 0; margin: var(--space-2) 0 0; }
.map-row { display: grid; grid-template-columns: minmax(7em, 1fr) minmax(4rem, 1.2fr) auto auto;
  gap: var(--space-2); align-items: center;
  padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; }
.map-name { font-weight: 600; }
.map-worth, .map-result { color: var(--muted); }
.map-row.cold .map-result { color: var(--muted); }
.map-row.weak .map-result { color: var(--pending); }
.map-row.ok .map-result { color: var(--right); }
@media (max-width: 520px) {
  .map-row { grid-template-columns: 1fr auto; }
  .map-result { grid-column: 1 / -1; }
}
.spark { display: block; width: min(240px, 100%); height: 56px; margin: var(--space-3) 0 0; }
.spark rect { fill: var(--muted); }
.spark rect.ok { fill: var(--right); }
.spark line.rule { stroke: var(--state-accent); stroke-dasharray: 3 3; stroke-width: 1; }

.map-bar {
  display: block; height: 8px; background: var(--tap-bg); border-radius: 99px;
  overflow: hidden; min-width: 4rem;
}
.map-bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.map-row.cold .map-bar i { background: var(--line); }
.map-row.weak .map-bar i { background: var(--pending); }
.map-row.ok .map-bar i { background: var(--right); }
@media (max-width: 520px) {
  .map-bar { grid-column: 1 / -1; }
}

#progress-stats h2 { margin: var(--space-3) 0 var(--space-1); }
#progress-stats > .count { margin: 0 0 var(--space-3); }

.dash-mid { margin-top: var(--space-4); }
@media (min-width: 1024px) {
  .dash-mid { display: grid; grid-template-columns: 1.4fr minmax(240px, .8fr); gap: var(--space-4); align-items: start; }
  .dash-mid .exam-map { margin-top: 0; }
}
.next-band h2, .guess h2 { margin-top: 0; }
.guess { margin-top: var(--space-4); color: var(--muted); }
.today-why { margin-top: var(--space-2); }
.cover-row { display: grid; gap: var(--space-3); margin-top: var(--space-4); }
@media (min-width: 680px) { .cover-row { grid-template-columns: repeat(3, 1fr); } }
.work-band { display: grid; gap: var(--space-4); margin-top: var(--space-4); }
@media (min-width: 1024px) {
  .work-band { grid-template-columns: 1fr 1fr; }
}
.cover-detail h2 { margin: 0 0 var(--space-1); }
.cover h3 { margin: 0; font-size: var(--step-0); }
.cover .track { height: 6px; background: var(--tap-bg); border-radius: 99px; margin-top: 8px; overflow: hidden; }
.cover .track i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

#members {
  display: grid; gap: var(--space-2);
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
}
.family-glance, #invite-card, #family-pitch { grid-column: 1 / -1; }
#pending-card {
  margin: 0; padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
#pending-card h3 {
  margin: 0; font-size: 14px; line-height: 1.25;
}
.pending-list { display: flex; flex-direction: column; gap: 10px; }
.pending-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-3);
}
.pending-row .count { margin: 0; }
.pending-row .family-revoke {
  flex: 0 0 auto; width: auto; min-height: 36px;
  margin-top: 0; padding: 6px 10px; font-size: 13px;
}
.family-glance { padding: 12px 14px; }
.family-glance p { margin: 0; }
.family-glance .count { margin-top: var(--space-1); }
.watch-toggle {
  display: inline-flex; align-items: center; gap: var(--space-2);
  margin-top: var(--space-2); font-weight: 600; cursor: pointer; font-size: 13px;
}
.watch-toggle input { width: 18px; height: 18px; accent-color: var(--accent); }
.member { margin: 0; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.member-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 4px; }
.member h3 {
  margin: 0; font-size: 14px; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.member .you { display: block; color: var(--state-accent); font-size: 11px;
  margin-top: 2px; }
.member-top .chip {
  margin-top: 4px; font-size: 10px; padding: 2px 8px;
  text-transform: none; letter-spacing: 0;
  max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.member .body { display: grid; gap: 8px; }
.member .score { display: flex; flex-direction: column; align-items: center; }
.member .ready-meter { width: 64px; height: 64px; flex: 0 0 64px; }
.member .ready-meter svg { width: 64px; height: 64px; }
.member .ready-meter span { font-size: 13px; }
.member.ready .rg-fill { stroke: var(--right); }
.member .score em { font-style: normal; font-size: 11px; color: var(--muted); margin-top: 2px; }
.run { display: flex; gap: 4px; margin-top: 6px; }
.run i { width: 8px; height: 8px; border-radius: 99px; background: var(--line); }
.run i.ok { background: var(--right); }
.run i.miss { background: var(--wrong); }
.member .meters { display: grid; gap: 8px; }
.member .meter {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: baseline;
}
.member .meter .lbl { font-size: 11px; color: var(--muted); }
.member .meter .frac { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.member .meter .track {
  grid-column: 1 / -1; height: 6px; background: var(--tap-bg);
  border-radius: 99px; overflow: hidden;
}
.member .meter .track i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.member .count.hole { margin: 0; font-size: 12px; line-height: 1.3; }
.member .date-trigger {
  --date-pad-y: 6px; --date-pad-x: 8px;
  min-height: 36px; font-size: 12px; margin-top: 0;
}
.member .pass-row { margin: 0; }
.member .family-passed {
  min-height: 36px; padding: 6px 10px; font-size: 13px; margin-top: 0;
}
/* Pass is the point of the board. Once it is marked, the lower half of the
   card is the celebration — the meters stay, but they sit under the wash so
   the household reads Congratulations first. Undo is a recycle in the corner,
   not a sentence that says they failed. */
.member.passed {
  position: relative; overflow: hidden; min-height: 260px;
}
.member.passed .body,
.member.passed .count.hole,
.member.passed .badge-row { opacity: .42; }
.member-pass {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  height: 54%;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding: 0 10px 12px; pointer-events: none;
}
.member-pass img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center 82%;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 36%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 36%);
}
.member-pass-say {
  position: relative; z-index: 1; margin: 0 8px 2px;
  color: #fff; font-size: clamp(16px, 4.2vw, 24px); font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.15; text-align: center;
  text-shadow: 0 1px 2px rgb(26 29 31 / .4);
}
.pass-undo {
  pointer-events: auto;
  position: absolute; right: 8px; top: 22%; z-index: 1;
  width: 44px; min-height: 44px; margin: 0; padding: 0;
  border: 0; border-radius: 99px;
  background: color-mix(in srgb, var(--card) 62%, transparent);
  font-size: 20px; line-height: 1;
}
.pass-undo:hover,
.pass-undo:focus-visible {
  background: color-mix(in srgb, var(--card) 88%, transparent);
}
.date-card.is-done { padding: 0; overflow: hidden; }
.progress-pass {
  position: relative; min-height: 200px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding: 28px 16px 22px;
}
.progress-pass img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center 78%;
}
.progress-pass .member-pass-say { margin: 0; }
.progress-pass .pass-undo { top: 12px; right: 12px; }

.icon-btn {
  flex: 0 0 40px; width: 40px; height: 40px; min-height: 40px;
  margin: 0; padding: 0; border: 0; background: transparent;
  color: var(--ink); display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px; line-height: 1; border-radius: var(--radius);
}
.icon-btn:hover, .icon-btn:focus-visible {
  background: color-mix(in srgb, var(--wrong) 14%, transparent);
}
.member-actions { margin-top: 0; }
.member-actions button.ghost { width: auto; min-height: 36px; padding: 6px 10px; font-size: 13px; }
@media (min-width: 680px) {
  #members { gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
  .member { padding: var(--space-3); gap: 10px; }
  .member h3 { font-size: var(--step-0); }
  #pending-card { padding: var(--space-3); gap: 10px; }
  #pending-card h3 { font-size: var(--step-0); }
  .member .body { grid-template-columns: auto 1fr; gap: 12px 16px; align-items: center; }
  .member .ready-meter { width: 72px; height: 72px; flex-basis: 72px; }
  .member .ready-meter svg { width: 72px; height: 72px; }
}

#review-list {
  display: flex; flex-direction: column; gap: var(--space-3);
  margin-top: var(--space-3);
}
.review-item {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  box-shadow: var(--shadow);
}
.review-item.right {
  border-color: var(--right);
  background: color-mix(in srgb, var(--right) 8%, var(--card));
}
.review-item.wrong {
  border-color: var(--wrong);
  background: color-mix(in srgb, var(--wrong) 8%, var(--card));
}
.review-item.skip {
  border-color: var(--skip);
  background: color-mix(in srgb, var(--skip) 10%, var(--card));
}
.review-item .review-tags { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.review-item .review-mark { font-weight: 650; }
.review-item.right .review-mark { color: var(--right); border-color: var(--right); }
.review-item.wrong .review-mark { color: var(--wrong); border-color: var(--wrong); }
.review-item.skip .review-mark { color: var(--skip); border-color: var(--skip); }
.review-item .q { margin: var(--space-2) 0 var(--space-2); }
.review-item figure.device { margin: var(--space-2) 0; }
.review-item figure.device img { width: 120px; }
.review-item .figure-thumb { margin: var(--space-2) 0; }
.review-opts { list-style: none; margin: 0; padding: 0; }
.review-opts li {
  margin-top: 6px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card);
}
.review-opts li.key { border-color: var(--right); color: var(--right); font-weight: 600; }
.review-opts li.picked:not(.key) { border-color: var(--wrong); color: var(--wrong); }

dialog {
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--card);
  color: var(--ink); max-width: 460px; width: calc(100vw - 2 * var(--space-4)); padding: var(--space-4);
}
dialog::backdrop { background: rgb(0 0 0 / .5); }
dialog .pair {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); align-items: stretch;
}
dialog .pair button { margin-top: 0; width: 100%; }

/* the 12 sample tests — two across on a phone, colour says how it went */
.papers { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); margin-top: var(--space-3); }
@media (min-width: 680px) { .papers { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--space-3); } }
.paper {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: 100%; margin: 0; padding: 12px 10px 14px; cursor: pointer; font: inherit;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.paper.pass { background: color-mix(in srgb, var(--right) 10%, var(--card)); border-color: color-mix(in srgb, var(--right) 45%, var(--line)); }
.paper.fail { background: color-mix(in srgb, var(--wrong) 10%, var(--card)); border-color: color-mix(in srgb, var(--wrong) 45%, var(--line)); }
.paper.open { background: color-mix(in srgb, var(--pending) 10%, var(--card)); border-color: color-mix(in srgb, var(--pending) 45%, var(--line)); }
.paper-head { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.paper-n { font-weight: 650; font-size: var(--step-1); line-height: 1.1; }
.paper-tag { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.paper.pass .paper-tag { color: var(--right); }
.paper.fail .paper-tag { color: var(--wrong); }

.ring { position: relative; width: 92px; height: 92px; margin: 2px 0; }
.ring svg { width: 92px; height: 92px; transform: rotate(-90deg); }
.ring .seg { fill: none; stroke-width: 3.4; }
.ring .track { stroke: var(--tap-bg); }
.ring .seg.right { stroke: var(--right); stroke-linecap: butt; }
.ring .seg.wrong { stroke: var(--wrong); stroke-linecap: butt; }
.ring-mid {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1px; line-height: 1.05;
}
.ring-mid b { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; }
.ring-mid i { font-style: normal; font-size: 11px; color: var(--muted); }
.paper.new .ring-mid b { color: var(--muted); }

.tally { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 8px; font-size: 12px; }
.tally .t { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.tally .t::before { content: ""; width: 7px; height: 7px; border-radius: 99px; background: currentColor; }
.tally .t.right { color: var(--right); }
.tally .t.wrong { color: var(--wrong); }
.paper-foot { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.3; }

#tests-head { margin-top: var(--space-4); }
.tests-foot { margin-top: var(--space-3); flex-wrap: wrap; gap: var(--space-2); }

/* the tests summary sits above the panels: three across even on a phone, so the
   panels are not pushed a screen and a half down */
#tests-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); margin-top: var(--space-3); }
#tests-stats orr-stat { padding: 12px 10px; }
#tests-stats .stat-value { font-size: 21px; }
#tests-stats .stat-label { font-size: 12px; }
@media (min-width: 680px) {
  #tests-stats { gap: var(--space-3); }
  #tests-stats .stat-value { font-size: 28px; }
  #tests-stats .stat-label { font-size: 14px; }
}

/* The road to the permit: a track of stops, one of them "now". The line down the
   left is the road; the marks are the cairns the brand already stacks. */
.route { margin: var(--space-3) 0 var(--space-2); padding: var(--space-3); }
.route-head { margin: 0 0 var(--space-2); font-weight: 600; }
.route-stops { list-style: none; margin: 0; padding: 0; position: relative; }
.route-stops::before {
  content: ""; position: absolute; left: 15px; top: 16px; bottom: 16px;
  width: 2px; background: var(--line);
}
.stop { position: relative; }
.stop-row {
  display: grid; grid-template-columns: 32px 1fr auto; align-items: center;
  gap: var(--space-2); width: 100%; min-height: 44px; padding: 6px 0;
  background: none; border: 0; color: var(--ink); font: inherit; text-align: left;
  cursor: pointer;
}
.stop-mark {
  position: relative; z-index: 1; display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--card); border: 2px solid var(--line);
  color: var(--muted); font-size: 14px; font-weight: 600;
}
.stop-count { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.stop.done .stop-mark { background: var(--accent); border-color: var(--accent); color: var(--accent-ink, #fff); }
.stop.done .stop-title, .stop.skipped .stop-title { color: var(--muted); }
.stop.now .stop-mark { border-color: var(--state-accent); color: var(--state-accent); }
.stop.now .stop-title { font-weight: 700; }
.stop-now, .stop-skipped { margin: 0 0 var(--space-2) 42px; }
.stop-now p { margin: 0 0 var(--space-2); }
.stop-now .auto { margin-right: var(--space-2); }

/* What a state adds to a screen (web/app/slots.js). */
.pack-card { margin: var(--space-3) 0; padding: var(--space-3); border-left: 3px solid var(--state-accent); }
.pack-card h3 { margin: 0 0 var(--space-1); }
.pack-card ul { margin: var(--space-1) 0 0; padding-left: 1.2em; }
