/* l1-hub.css — the three pages that are not the course itself.
   ---------------------------------------------------------------------------
     index.html            the Level 1 front door
     revision.html         the revision area
     l1-key-revision.html  the spaced drill for questions you got wrong

   ONE FILE, not three inline <style> blocks. The Level 2 pages each carry
   their own copy of a near-identical block, which is how thirty of them
   drifted apart and how an invalid `font:` shorthand survived across all of
   them. Everything here is longhand.

   The modals on these pages are the course page's own, so l1-course.css loads
   alongside this and owns .gx-* and .cs-*. Nothing here touches them.
   --------------------------------------------------------------------------- */

:root {
  --navy: #1a2744;
  --navy-dark: #111c33;
  --ink: #1e293b;
  --ink-mid: #475569;
  --ink-light: #64748b;
  --paper: #f1f5f9;
  --line: #cbd5e1;
  --line-soft: #e2e8f0;
  --accent: #1d4ed8;
  --accent-soft: #eff6ff;
  --good: #15803d;
  --good-soft: #f0fdf4;
  --bad: #b91c1c;
  --bad-soft: #fef2f2;
  --warn-soft: #fffbeb;
  --warn-line: #fde68a;
  --warn-ink: #78350f;
  --radius: 16px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

/* The page colour sits on html rather than body, so the unit background layer
   can sit behind the content at z-index -1 and still be seen. An opaque body
   would paint straight over it. This stylesheet loads last, so it is the one
   that has to say it. */
html { background: var(--paper); }

body {
  margin: 0;
  background: transparent;
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

/* Form controls do not inherit the family unless told to. Without this the
   buttons on these pages render in the browser's own UI face. */
button, input, select, textarea { font-family: inherit; }

.skip-link {
  position: absolute; top: -100%; left: 0; z-index: 999;
  background: var(--navy); color: #fff; padding: 10px 20px;
  font-weight: 700; font-size: 14px;
}
.skip-link:focus { top: 0; }

/* ---- header -------------------------------------------------------------- */

.hub-head { background: var(--navy); color: #fff; }
.hub-head-in {
  max-width: 1080px; margin: 0 auto; padding: 14px 18px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.hub-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.hub-logo-ico {
  width: 36px; height: 36px; display: grid; place-items: center;
  background: rgba(255,255,255,.12); border-radius: 10px; font-size: 19px;
}
.hub-logo h1 { font-family: 'Outfit', system-ui, sans-serif; font-size: 21px; font-weight: 800; margin: 0; }
.hub-tag {
  font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  background: rgba(255,255,255,.16); border-radius: 999px; padding: 3px 10px;
}
.hub-head .spacer { flex: 1 1 auto; }

/* The Help link in the header: the way back to the guided tours and the
   written guide. Sized and coloured like .backbtn so the header reads as one
   row of controls rather than a button and a stray link. */
.hub-help {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.14); color: #fff;
  border: 1px solid rgba(255,255,255,.3); border-radius: 8px;
  padding: 7px 12px; font-size: 13px; font-weight: 600;
  text-decoration: none; line-height: 1;
}
.hub-help:hover { background: rgba(255,255,255,.24); }
.hub-help:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.backbtn {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.14); color: #fff;
  border: 1px solid rgba(255,255,255,.3); border-radius: var(--radius-sm);
  padding: 8px 13px; font-size: 13px; font-weight: 600;
  text-decoration: none; line-height: 1; cursor: pointer;
}
.backbtn:hover { background: rgba(255,255,255,.24); }
.backbtn:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }

/* z-index:1 puts the page above the blueprint background, which is
   position:fixed at z-index 0. Without this the watermark paints over
   the content instead of behind it. */
.wrap { max-width: 1080px; margin: 0 auto; padding: 22px 18px 60px;
        position: relative; z-index: 1; }

/* The welcome row. The badge inside it is styled by the shared
   pm-streak.css; this is only the card it sits in, matched to the
   other cards on this page rather than to Level 2's. */
.l1-welcome {
  background: #fff; border: 1px solid var(--line, #e2e8f0);
  border-radius: 16px; padding: 18px 22px; margin-bottom: 18px;
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.l1-welcome .welcome-text h2 {
  font-family: 'Outfit', sans-serif; font-size: 1.35em; font-weight: 800;
  color: var(--navy, #1a2744); margin: 0 0 4px;
}
.l1-welcome .welcome-text p { margin: 0; color: var(--muted, #64748b); font-size: 0.92em; }

/* The ring and the tallies now sit inside the welcome card rather than in
   a card of their own further down, so the page opens the way Level 2's
   does. .l1-track keeps its own layout; these only strip the card it used
   to be and rule it off from the greeting above. */
.l1-welcome .l1-track {
  background: none; border: 0; box-shadow: none; border-radius: 0;
  margin: 16px 0 0; padding: 16px 0 0;
  border-top: 1px solid var(--line, #e8edf3);
}

/* The day's tip, same strip and same colours as Level 2's. The unit pages
   style .banner-tip-strip as a card of its own in l1-course.css, which this
   page also loads — so the card is explicitly undone here, or the tip would
   sit in a bordered white box inside the white welcome card. */
.l1-welcome .banner-tip-strip {
  display: flex; gap: 12px; align-items: flex-start;
  background: none; border: 0; border-radius: 0;
  margin: 16px 0 0; padding: 14px 0 0;
  border-top: 1px solid var(--line, #e8edf3);
}
.banner-tip-dot {
  width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
  margin-top: 5px; background: #3b82f6;
}
.banner-tip-inner { flex: 1; min-width: 0; }
.banner-tip-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.banner-tip-badge {
  font-size: 0.68em; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.6px; padding: 3px 9px; border-radius: 999px;
}
.banner-tip-text { font-size: 0.88em; color: var(--ink-soft, #475569); line-height: 1.6; margin: 0; }
.banner-tip-badge.badge-content { background: #dbeafe; color: #1e40af; }
.banner-tip-badge.badge-study   { background: #dcfce7; color: #15803d; }
.banner-tip-badge.badge-exam    { background: #fef9c3; color: #854d0e; }
.banner-tip-badge.badge-mindset { background: #f3e8ff; color: #6b21a8; }
@media (max-width: 640px) {
  .l1-welcome { padding: 16px; }
  .l1-welcome .welcome-left { width: 100%; }
}

/* ---- hero ---------------------------------------------------------------- */

.hero {
  background: linear-gradient(135deg, var(--navy) 0%, #24365c 100%);
  color: #fff; border-radius: var(--radius);
  padding: 30px 32px; margin: 0 0 26px;
}
.hero-pill {
  display: inline-block; background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.22); border-radius: 999px;
  padding: 4px 13px; margin-bottom: 12px;
  font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}
.hero h2 {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 34px; font-weight: 800; line-height: 1.15;
  margin: 0 0 12px; text-wrap: balance;
}
.hero p { margin: 0; font-size: 15.5px; line-height: 1.65; color: #cbd7ea; max-width: 62ch; }
.hero-stats {
  display: flex; flex-wrap: wrap; gap: 26px; margin: 22px 0 0;
  padding-top: 20px; border-top: 1px solid rgba(255,255,255,.14);
}
.hero-stat strong {
  display: block; font-family: 'Outfit', sans-serif;
  font-size: 25px; font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.hero-stat span {
  display: block; margin-top: 4px; font-size: 11.5px; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase; color: #9fb2cf;
}
@media (max-width: 620px) {
  .hero { padding: 24px 20px; }
  .hero h2 { font-size: 27px; }
  .hero-stats { gap: 18px; }
}

/* ---- progress strip ------------------------------------------------------ */

.hub-prog {
  background: #fff; border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 16px 20px; margin: 0 0 26px;
}
.hub-prog-top {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 11px;
}
.hub-prog-top h3 { font-family: 'Outfit', sans-serif; font-size: 15px; margin: 0; color: var(--navy); }
.hub-prog-top .n { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.hub-bar { height: 9px; background: var(--line-soft); border-radius: 5px; overflow: hidden; }
.hub-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #3b82f6); border-radius: 5px; }
.hub-prog-note { margin: 10px 0 0; font-size: 12.5px; color: var(--ink-light); line-height: 1.5; }

/* ---- section headings ---------------------------------------------------- */

.group {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 19px; font-weight: 700; color: var(--navy);
  margin: 30px 0 6px;
}
.group-sub { margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: var(--ink-mid); max-width: 70ch; }

/* ---- module cards -------------------------------------------------------- */

.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 15px; }
.mcard {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line-soft);
  border-top: 4px solid var(--ac, var(--accent));
  border-radius: var(--radius); padding: 18px 19px;
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
  scroll-margin-top: 18px;
}
.mcard-top { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.mcard-ico {
  flex: 0 0 44px; height: 44px; display: grid; place-items: center;
  background: var(--acs, var(--accent-soft)); border-radius: 12px; font-size: 22px;
}
.mcard-unit {
  font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ac, var(--accent));
}
.mcard h3 {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 16.5px; font-weight: 700; color: var(--navy);
  margin: 3px 0 0; line-height: 1.3;
}
.mcard p { margin: 0 0 14px; font-size: 13.5px; line-height: 1.6; color: var(--ink-mid); }
.mcard-meta {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px;
}
.mchip {
  font-size: 11px; font-weight: 700; color: var(--ink-mid);
  background: var(--paper); border: 1px solid var(--line-soft);
  border-radius: 999px; padding: 3px 10px;
}
.mcard-acts { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.mbtn {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--radius-sm); padding: 9px 14px;
  font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; line-height: 1.2;
}
.mbtn.go { background: var(--ac, var(--accent)); color: #fff; }
.mbtn.go:hover { filter: brightness(.92); }
.mbtn.ghost { background: #fff; border-color: var(--line); color: var(--ink-mid); }
.mbtn.ghost:hover { border-color: var(--ac, var(--accent)); color: var(--ac, var(--accent)); }
.mbtn:focus-visible { outline: 3px solid var(--ac, var(--accent)); outline-offset: 2px; }

/* the per-module progress pip on the index */
.mprog { display: flex; align-items: center; gap: 8px; margin: 0 0 13px; }
.mprog .bar { flex: 1 1 auto; height: 6px; background: var(--line-soft); border-radius: 4px; overflow: hidden; }
.mprog .bar i { display: block; height: 100%; background: var(--ac, var(--accent)); border-radius: 4px; }
.mprog .pc { font-size: 11.5px; font-weight: 700; color: var(--ink-light); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }

/* the collapsible task list inside a unit's revision card */
.mtasks { margin-top: 14px; border-top: 1px solid var(--line-soft); padding-top: 12px; }
.mtasks > summary {
  list-style: none; cursor: pointer;
  font-size: 12.5px; font-weight: 700; color: var(--ac, var(--accent));
}
.mtasks > summary::-webkit-details-marker { display: none; }
.mtasks > summary::after { content: " ▸"; }
.mtasks[open] > summary::after { content: " ▾"; }
.mtasks > summary:focus-visible { outline: 3px solid var(--ac, var(--accent)); outline-offset: 2px; border-radius: 4px; }
.mtask-list { display: flex; flex-direction: column; margin-top: 8px; }
.mtask-list a {
  display: block; padding: 9px 2px; border-bottom: 1px solid var(--line-soft);
  color: var(--navy); text-decoration: none; font-size: 13px; font-weight: 700; line-height: 1.4;
}
.mtask-list a:last-child { border-bottom: none; }
.mtask-list a:hover { color: var(--ac, var(--accent)); }
.mtask-list a:focus-visible { outline: 3px solid var(--ac, var(--accent)); outline-offset: 2px; border-radius: 4px; }
.mtask-list a small { display: block; font-weight: 400; color: var(--ink-light); font-size: 12px; margin-top: 2px; }

/* ---- tool cards (the row at the bottom) ---------------------------------- */

.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; }
.tcard {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line-soft);
  border-left: 4px solid var(--ac, var(--accent));
  border-radius: var(--radius); padding: 16px 17px;
  text-decoration: none; color: inherit; cursor: pointer; text-align: left;
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
  transition: transform .15s ease, box-shadow .15s ease;
  min-height: 152px; font-size: inherit;
}
.tcard:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(16,24,40,.1); }
.tcard:focus-visible { outline: 3px solid var(--ac, var(--accent)); outline-offset: 2px; }
.tcard .ico { font-size: 24px; line-height: 1; margin-bottom: 9px; }
.tcard h3 { font-family: 'Outfit', sans-serif; font-size: 15.5px; font-weight: 700; margin: 0 0 5px; color: var(--navy); }
.tcard p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--ink-mid); }
.tcard .pill {
  margin-top: auto; padding-top: 11px; align-self: flex-start;
  font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ac, var(--accent));
}
.ext::after { content: " \2197"; opacity: .65; }


/* ══ Clickable cards, matching the Level 2 dashboard ═══════════════════════
   Used by index.html only. revision.html keeps .mcard/.tcard, because its
   cards carry three real buttons (unit revision, flashcards, the lessons) and
   a card that is itself a link cannot hold buttons.

   THE STRETCHED LINK. The whole card is clickable, but the card is NOT an
   <a>: the title holds a real link whose ::after covers the card. That keeps
   the markup valid and the card keyboard-operable — one tab stop, on the
   thing that says where it goes — and it leaves room for a second link
   (Revise) to sit above the overlay and stay independently clickable. An <a>
   wrapping the whole card cannot contain another link at all, which is why
   the Level 2 cards have no secondary action. */

.ugrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }

.ucard {
  position: relative; overflow: hidden;
  display: flex; gap: 15px; align-items: flex-start;
  background: #fff;
  border: 1px solid rgba(42, 82, 152, .09);
  border-radius: var(--radius);
  padding: 20px 21px 24px;
  box-shadow: 0 2px 8px rgba(42, 82, 152, .07), 0 1px 3px rgba(0, 0, 0, .05);
  transition: transform .3s cubic-bezier(.4, 0, .2, 1), box-shadow .3s, border-color .3s;
}
.ucard:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 44px rgba(42, 82, 152, .15), 0 4px 12px rgba(0, 0, 0, .07);
  border-color: rgba(42, 82, 152, .16);
}
.ucard:focus-within { border-color: var(--ac, var(--accent)); }

/* the ring, drawn like the Level 2 dashboard's */
.ucard-ring { flex: 0 0 54px; width: 54px; height: 54px; position: relative; }
.ucard-ring svg { width: 54px; height: 54px; transform: rotate(-90deg); }
.ucard-ring .bg { fill: none; stroke: #e8edf4; stroke-width: 5; }
.ucard-ring .fill {
  fill: none; stroke: var(--ac, var(--accent)); stroke-width: 5; stroke-linecap: round;
  stroke-dasharray: 157; stroke-dashoffset: 157; transition: stroke-dashoffset .6s ease;
}
.ucard-ring .pct {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 12px; font-weight: 800; color: var(--ink-mid);
  font-variant-numeric: tabular-nums;
}

.ucard-icon {
  flex: 0 0 52px; height: 52px; display: grid; place-items: center;
  background: var(--acs, var(--accent-soft)); border-radius: 14px; font-size: 26px;
}

/* The tool cards that open a modal are <button>s, so their inner elements
   have to be spans — a <div> or <p> inside a button is invalid. Spans are
   inline, which laid the label, title and description out on one line. Every
   part is therefore told to be a block rather than relying on the element it
   happens to be. Caught by looking at it, not by reading it. */
.ucard-body { display: block; flex: 1 1 auto; min-width: 0; }
.ucard-num {
  display: block;
  font-family: 'Outfit', sans-serif; font-size: 12px; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ac, var(--accent));
}
.ucard-title {
  display: block;
  font-family: 'Outfit', sans-serif; font-size: 16.5px; font-weight: 700;
  color: var(--navy); line-height: 1.3; margin: 2px 0 5px;
}
.ucard-title a { color: inherit; text-decoration: none; }
/* the overlay that makes the whole card clickable */
.ucard-title a::after { content: ''; position: absolute; inset: 0; }
.ucard-title a:focus-visible { outline: 3px solid var(--ac, var(--accent)); outline-offset: 3px; border-radius: 4px; }
.ucard-desc {
  display: block; font-size: 13px; color: var(--ink-mid); line-height: 1.5; margin: 0 0 9px; }
.ucard-stats {
  display: block; font-size: 12px; color: var(--ink-light); font-weight: 600; }

/* a second action, above the overlay so it stays independently clickable */
.ucard-alt {
  position: relative; z-index: 1;
  display: inline-block; margin-top: 9px;
  font-size: 12.5px; font-weight: 700; color: var(--ac, var(--accent));
  text-decoration: none;
}
.ucard-alt:hover { text-decoration: underline; }
.ucard-alt:focus-visible { outline: 3px solid var(--ac, var(--accent)); outline-offset: 2px; border-radius: 4px; }

.ucard-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: #eef2f7; }
.ucard-bar i { display: block; height: 100%; width: 0; background: var(--ac, var(--accent)); transition: width .6s ease; }

/* A tool card opens a modal rather than navigating, so it is a <button>. It
   has to be told to look like the cards around it — a button inherits none of
   the type, alignment or cursor it needs. */
button.ucard {
  width: 100%; text-align: left; cursor: pointer;
  font-family: inherit; font-size: inherit; color: inherit;
}
button.ucard:focus-visible { outline: 3px solid var(--ac, var(--accent)); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .ucard, .ucard-ring .fill, .ucard-bar i { transition: none; }
}


/* the strip of unit numbers on a unit page, so you can move on without going
   back to the index every time */
.unit-hop { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 22px; }
.unit-hop-link {
  display: inline-grid; place-items: center; min-width: 44px; padding: 7px 10px;
  background: #fff; border: 1.5px solid var(--line-soft); border-radius: 9px;
  font-size: 12.5px; font-weight: 800; color: var(--ink-mid); text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.unit-hop-link:hover { border-color: var(--accent); color: var(--accent); }
.unit-hop-link.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.unit-hop-link:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---- the spaced-revision explainer --------------------------------------- */

.spaced-note {
  background: var(--warn-soft); border: 1px solid var(--warn-line);
  border-radius: var(--radius); padding: 15px 18px; margin: 0 0 22px;
  font-size: 13.5px; line-height: 1.65; color: var(--warn-ink);
}
.spaced-note strong { color: #92400e; }
.spaced-note p { margin: 0 0 8px; }
.spaced-note p:last-child { margin-bottom: 0; }

/* ---- key revision drill -------------------------------------------------- */

.kr-tabs {
  display: flex; gap: 4px; background: #e8eef6;
  border: 1px solid var(--line-soft); border-radius: 12px;
  padding: 5px; margin: 0 0 18px;
}
.kr-tab {
  flex: 1 1 auto; padding: 10px 12px; border: none; border-radius: 8px;
  font-size: 13.5px; font-weight: 700; cursor: pointer;
  color: var(--ink-mid); background: transparent;
}
.kr-tab.on { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(16,24,40,.13); }
.kr-tab:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.kr-panel { display: none; }
.kr-panel.on { display: block; }

.kr-pill {
  display: inline-block; background: #e5edf8; color: #1e3a5f;
  font-size: 12px; font-weight: 700; padding: 5px 12px;
  border-radius: 999px; margin: 0 0 13px;
}
.kr-pill.clear { background: var(--good-soft); color: var(--good); }

.kr-counter {
  font-size: 11.5px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--ink-light); margin: 0 0 10px;
}
.kr-card { background: #fff; border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 20px; }
.kr-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.kr-src { font-size: 11.5px; font-weight: 700; padding: 3px 11px; border-radius: 999px; background: #dbeafe; color: #1e40af; }
.kr-src.rev { background: #f3e8ff; color: #6b21a8; }
.kr-where { font-size: 11.5px; font-weight: 600; color: var(--ink-light); }
.kr-dots { display: flex; align-items: center; gap: 5px; margin-left: auto; }
.krdot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); background: transparent; }
.krdot.on { background: var(--accent); border-color: var(--accent); }
.krdot.done { background: #22c55e; border-color: #22c55e; }
.kr-dl { font-size: 11.5px; color: var(--ink-light); margin-left: 4px; }
.kr-q { font-size: 16px; font-weight: 600; color: var(--ink); margin-bottom: 15px; line-height: 1.5; }
.kr-opts { display: flex; flex-direction: column; gap: 8px; }
.kr-opt {
  padding: 12px 15px; border: 1.5px solid var(--line); border-radius: 9px;
  text-align: left; font-size: 14.5px; color: var(--ink); background: #fff;
  cursor: pointer; line-height: 1.45; width: 100%;
}
.kr-opt:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.kr-opt:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.kr-opt.correct { border-color: #22c55e; background: var(--good-soft); color: var(--good); font-weight: 700; }
.kr-opt.incorrect { border-color: #ef4444; background: var(--bad-soft); color: var(--bad); }
.kr-opt:disabled { cursor: default; }
.kr-fb { display: none; margin-top: 14px; font-size: 14px; font-weight: 700; padding: 11px 15px; border-radius: 9px; line-height: 1.5; }
.kr-fb.show { display: block; }
.kr-fb.ok { background: var(--good-soft); color: var(--good); }
.kr-fb.no { background: var(--bad-soft); color: var(--bad); }
.kr-fb.same { background: var(--warn-soft); color: var(--warn-ink); }
.kr-why {
  display: none; margin-top: 13px; padding: 14px 16px;
  background: var(--accent-soft); border-left: 3px solid var(--accent);
  border-radius: 0 9px 9px 0; font-size: 13.5px; color: var(--ink-mid); line-height: 1.65;
}
.kr-why.show { display: block; }
.kr-why-l {
  display: block; font-size: 11px; font-weight: 800; color: var(--accent);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 5px;
}
.kr-actions { margin-top: 17px; display: flex; gap: 10px; flex-wrap: wrap; }
.kr-next {
  display: none; padding: 11px 22px; border-radius: 9px; border: none;
  background: var(--navy); color: #fff; font-weight: 700; font-size: 14px; cursor: pointer;
}
.kr-next.show { display: inline-block; }
.kr-skip {
  padding: 11px 18px; border-radius: 9px; border: 1.5px solid var(--line);
  background: #fff; color: var(--ink-mid); font-weight: 600; font-size: 14px; cursor: pointer;
}
.kr-next:focus-visible, .kr-skip:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.kr-empty {
  background: #fff; border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 44px 26px; text-align: center;
}
.kr-empty .em-ic { font-size: 40px; margin-bottom: 13px; }
.kr-empty h3 { font-family: 'Outfit', sans-serif; margin: 0 0 9px; font-size: 19px; color: var(--navy); }
.kr-empty p { margin: 0 auto 18px; max-width: 46ch; font-size: 14px; color: var(--ink-mid); line-height: 1.6; }
.em-btn {
  display: inline-block; padding: 11px 20px; background: var(--navy); color: #fff;
  border: 1px solid var(--navy); border-radius: 9px; text-decoration: none;
  font-weight: 700; font-size: 13.5px; margin: 4px; cursor: pointer;
}
.em-btn.ghost { background: var(--accent-soft); color: var(--navy); border-color: var(--line); }

/* revise-first list */
.kr-study { background: #fff; border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 17px 19px; margin: 0 0 12px; }
.kr-study-q { font-size: 15px; font-weight: 600; color: var(--ink); margin: 8px 0 9px; line-height: 1.5; }
.kr-study-a { font-size: 13.5px; color: var(--good); font-weight: 700; margin-bottom: 10px; }
.kr-study-why {
  padding: 12px 15px; background: var(--accent-soft); border-left: 3px solid var(--accent);
  border-radius: 0 9px 9px 0; font-size: 13.5px; color: var(--ink-mid); line-height: 1.65;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---- overall progress, in the shape the Level 2 index uses ----
   A ring for the headline figure and a breakdown beside it. Hidden until the
   course engine has published something, because a ring reading 0% to a
   learner who is halfway through looks like lost work rather than no work. */
.l1-track {
  display: flex; align-items: center; gap: 26px; flex-wrap: wrap;
  background: #fff; border: 1.5px solid var(--line-soft, #eef1f5);
  border-radius: 18px; padding: 22px 26px; margin: 0 0 30px;
}
.l1-track[hidden] { display: none; }
.l1-track-ring { position: relative; flex: none; width: 104px; height: 104px; }
.l1-track-ring svg { display: block; }
.l1-track-ring circle { transition: stroke-dashoffset 0.6s ease; }
.l1-track-ring-label {
  position: absolute; inset: 0; display: grid; place-content: center;
  text-align: center; line-height: 1.1;
}
.l1-track-pct {
  display: block; font-family: 'Outfit', sans-serif; font-weight: 900;
  font-size: 1.5em; color: var(--ink, #0f172a); font-variant-numeric: tabular-nums;
}
.l1-track-sub {
  display: block; font-size: 0.72em; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-soft, #64748b);
}
.l1-track-body { flex: 1 1 300px; min-width: 0; }
.l1-track-head {
  font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 1.15em;
  color: var(--ink, #0f172a); margin-bottom: 4px;
}
.l1-track-msg { margin: 0 0 14px; font-size: 0.92em; color: var(--ink-soft, #64748b); line-height: 1.5; }
.l1-track-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}
.l1-stat {
  background: var(--ground, #f6f8fb); border-radius: 11px; padding: 10px 13px;
}
.l1-stat-label {
  display: block; font-size: 0.75em; font-weight: 700; letter-spacing: 0.03em;
  text-transform: uppercase; color: var(--ink-soft, #64748b); margin-bottom: 2px;
}
.l1-stat-value {
  display: block; font-family: 'Outfit', sans-serif; font-weight: 800;
  font-size: 1.1em; color: var(--ink, #0f172a); font-variant-numeric: tabular-nums;
}

/* ---- the per-unit figure on a card ---- */
.ucard-prog {
  display: flex; align-items: baseline; gap: 8px; margin: 8px 0 0;
}
.ucard-prog[hidden] { display: none; }
.ucard-prog-pct {
  font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 0.95em;
  color: var(--ac, #4338ca); font-variant-numeric: tabular-nums;
}
.ucard-prog-sub { font-size: 0.82em; color: var(--ink-soft, #64748b); }

@media (max-width: 560px) {
  .l1-track { gap: 18px; padding: 18px; }
}

/* the one line across to the unit's teaching, from its revision page */
.unit-jump {
  margin: 26px 0 0; padding: 16px 20px; border-radius: 12px;
  background: #fff; border: 1.5px solid var(--line-soft, #eef1f5);
  color: var(--ink-soft, #64748b); font-size: 0.95em; line-height: 1.6;
}
.unit-jump a { font-weight: 700; color: var(--accent, #4338ca); }

/* ---- the four figures on a unit card ----
   Passed out of available, for lesson quizzes, short answers, the numbered
   revision tests and the final challenge. Same shape as the Level 2 cards. */
.ucard-mini { display: grid; gap: 5px; margin: 10px 0 0; }
.mini-stat { display: flex; align-items: center; gap: 7px; font-size: 0.75em; }
.mini-stat-label {
  min-width: 74px; flex: none; font-weight: 600; color: var(--ink-soft, #64748b);
}
.mini-stat-bar {
  flex: 1 1 auto; height: 5px; border-radius: 999px;
  background: var(--line-soft, #eef1f5); overflow: hidden;
}
.mini-stat-bar i {
  display: block; height: 100%; width: 0; border-radius: 999px;
  background: var(--ac, #4338ca); transition: width 0.6s ease-out;
}
.mini-stat-count {
  min-width: 30px; flex: none; text-align: right;
  font-weight: 700; color: var(--ink-mid, #475569);
  font-variant-numeric: tabular-nums;
}
.mini-stat-count.done { color: #16a34a; }

/* ---- continue where you left off ---- */
.l1-resume {
  display: flex; align-items: center; gap: 16px; text-decoration: none;
  background: linear-gradient(135deg, #1a2744, #4338ca); color: #fff;
  border-radius: 16px; padding: 18px 22px; margin: 0 0 20px;
}
.l1-resume[hidden] { display: none; }
.l1-resume:hover { filter: brightness(1.08); }
.l1-resume:focus-visible { outline: 3px solid #c7d2fe; outline-offset: 3px; }
.l1-resume-ico {
  flex: none; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 12px; font-size: 1.35em;
  background: rgba(255,255,255,0.16);
}
.l1-resume-body { flex: 1 1 auto; min-width: 0; }
.l1-resume-lead {
  display: block; font-size: 0.76em; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.82;
}
.l1-resume-name {
  display: block; font-family: 'Outfit', sans-serif; font-weight: 800;
  font-size: 1.06em; line-height: 1.3; margin: 2px 0 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.l1-resume-when { display: block; font-size: 0.84em; opacity: 0.78; }
.l1-resume-go { flex: none; font-size: 1.3em; opacity: 0.85; }

/* ---- the study plan ---- */
.l1-plan {
  background: #fff; border: 1.5px solid var(--line-soft, #eef1f5);
  border-radius: 18px; padding: 22px 26px; margin: 0 0 30px;
}
.l1-plan-head {
  display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap;
}
.l1-plan-head > div { flex: 1 1 320px; min-width: 0; }
.l1-plan h2 {
  font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 1.2em;
  margin: 0 0 6px; color: var(--ink, #0f172a);
}
.l1-plan-head p { margin: 0; font-size: 0.93em; line-height: 1.6; color: var(--ink-soft, #64748b); }
.l1-plan-btn {
  flex: none; cursor: pointer; border: 0; border-radius: 12px;
  padding: 13px 20px; background: var(--accent, #4338ca); color: #fff;
  font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 0.95em;
}
.l1-plan-btn:hover:not(:disabled) { background: #3730a3; }
.l1-plan-btn:disabled { opacity: 0.65; cursor: default; }
.l1-plan-btn:focus-visible { outline: 3px solid #c7d2fe; outline-offset: 3px; }
.l1-plan-out {
  margin: 18px 0 0; padding: 18px 20px; border-radius: 13px;
  background: var(--ground, #f6f8fb); border: 1px solid var(--line-soft, #eef1f5);
  color: var(--ink-mid, #475569); line-height: 1.65;
}
.l1-plan-out[hidden] { display: none; }
.l1-plan-out ul { margin: 0; padding-left: 20px; }
.l1-plan-out li { margin: 9px 0; }
.l1-plan-out p { margin: 0 0 10px; }
.l1-plan-out p:last-child { margin-bottom: 0; }
.l1-plan-out strong { color: var(--ink, #0f172a); }
.l1-plan-out a { color: var(--accent, #4338ca); font-weight: 600; }
.l1-plan-err { color: #9a3412; margin: 0; }
.l1-plan-meta { margin: 10px 0 0; font-size: 0.85em; color: var(--ink-soft, #64748b); }
.l1-plan-meta[hidden] { display: none; }

/* The dashboard's study plan is a single full-width button, the same shape and
   gradient as Level 2's. Scoped to .trigger on purpose: the ten unit pages use
   .l1-plan-btn in its original pill form for their unit-scoped plans, and must
   not be dragged along by this. */
.l1-plan.trigger {
  background: none; border: 0; border-radius: 0; padding: 0; margin: 0 0 20px;
}
.l1-plan.trigger .l1-plan-btn {
  display: flex; width: 100%; box-sizing: border-box;
  align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 12px 18px; border-radius: 12px;
  background: linear-gradient(135deg, #1e293b 0%, #2563eb 100%);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
  transition: transform 0.08s ease, box-shadow 0.15s ease;
}
.l1-plan.trigger .l1-plan-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #1e293b 0%, #2563eb 100%);
  transform: translateY(-1px); box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}
@media (prefers-reduced-motion: reduce) {
  .l1-plan.trigger .l1-plan-btn { transition: none; }
  .l1-plan.trigger .l1-plan-btn:hover:not(:disabled) { transform: none; }
}

/* Revealed with the plan rather than shown on arrival. */
.l1-plan-intro {
  margin: 14px 0 0; font-size: 0.9em; line-height: 1.6;
  color: var(--ink-soft, #64748b);
}
.l1-plan-intro[hidden] { display: none; }

/* ---- progress at the top of a unit ----
   This IS the contents list, not a block above it: the same lesson links,
   under a progress header and each marked with where the learner got to.
   A separate tracker on top would have said the same thing twice. */
.unit-track-head {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 0 0 16px; margin: 0 0 14px;
  border-bottom: 1px solid var(--line-soft, #eef1f5);
}
.unit-track-ring { position: relative; flex: none; width: 86px; height: 86px; }
.unit-track-ring svg { display: block; }
.unit-track-ring circle { transition: stroke-dashoffset 0.6s ease; }
.unit-track-pct {
  position: absolute; inset: 0; display: grid; place-content: center;
  font-family: 'Outfit', sans-serif; font-weight: 900; font-size: 1.15em;
  color: var(--ink, #0f172a); font-variant-numeric: tabular-nums;
}
.unit-track-body { flex: 1 1 240px; min-width: 0; }
.unit-track-body h3 {
  font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 1.02em;
  margin: 0 0 9px; color: var(--ink, #0f172a);
}
.unit-track-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.unit-stat {
  font-size: 0.82em; color: var(--ink-mid, #475569);
  background: var(--ground, #f6f8fb); border-radius: 999px; padding: 5px 12px;
}
.unit-stat b {
  font-family: 'Outfit', sans-serif; font-weight: 800; color: var(--ink, #0f172a);
  font-variant-numeric: tabular-nums;
}
.unit-stat.done { background: #f0fdf4; color: #15803d; }
.unit-stat.done b { color: #15803d; }

/* a lesson row that is finished, or started */
.contents-list a.done .contents-num { background: #16a34a; color: #fff; }
.contents-list a.done::after { content: " ¹3"; color: #16a34a; font-weight: 800; }
.contents-list a.part .contents-num { background: #fde68a; color: #92400e; }

.unit-plan { margin: 16px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line-soft, #eef1f5); }

/* ---- the study plan as a full-width ribbon at the top of the index ---- */
/* The .ribbon variant and .l1-plan-inner were removed with the block that
   used them: the dashboard is the only page that ever carried them, and it
   now uses .trigger above. */

@media (max-width: 560px) {
  .unit-track-head { gap: 14px; }
}

/* ---- badges ----
   Filled when earned, grey when not. Unearned ones stay on show rather than
   being hidden: what is left to go for is the useful half. */
.l1-badges { margin: 16px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line-soft, #eef1f5); }
.l1-badges-head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px; }
.l1-badges-head h3 {
  font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 1.02em;
  margin: 0; color: var(--ink, #0f172a);
}
.l1-badges-count { font-size: 0.85em; font-weight: 700; color: var(--ink-soft, #64748b); }
.l1-badges-row { display: flex; flex-wrap: wrap; gap: 14px; }
.l1-badge {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  width: 92px; text-align: center;
}
.l1-badge-hex { position: relative; display: block; width: 46px; height: 46px; }
.l1-badge-hex svg { display: block; }
.l1-badge-ico {
  position: absolute; inset: 0; display: grid; place-content: center;
  font-size: 1.15em; color: #94a3b8; line-height: 1;
}
.l1-badge.on .l1-badge-ico { color: #fff; }
.l1-badge-label {
  font-size: 0.74em; font-weight: 700; line-height: 1.25;
  color: var(--ink-soft, #64748b);
}
.l1-badge.on .l1-badge-label { color: var(--ink, #0f172a); }
.l1-badge-sub {
  font-size: 0.68em; color: #94a3b8; font-variant-numeric: tabular-nums;
}

/* ---- the achievement room ---- */
.room-unit {
  background: #fff; border: 1.5px solid var(--line-soft, #eef1f5);
  border-radius: 16px; padding: 18px 20px; margin: 0 0 14px;
}
.room-unit.complete { border-color: #c9a845; background: #fffdf5; }
.room-unit-head { display: flex; align-items: center; gap: 14px; margin: 0 0 4px; }
.room-unit-ico {
  flex: none; display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 12px; font-size: 1.2em;
  background: var(--ground, #f6f8fb);
}
.room-unit-head > div { flex: 1 1 auto; min-width: 0; }
.room-unit-num {
  font-size: 0.72em; font-weight: 800; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-soft, #64748b);
}
.room-unit-head h3 {
  font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 1.05em;
  margin: 1px 0 0; line-height: 1.3;
}
.room-unit-head h3 a { color: var(--ink, #0f172a); text-decoration: none; }
.room-unit-head h3 a:hover { color: var(--accent, #4338ca); }
.room-unit-count {
  flex: none; font-family: 'Outfit', sans-serif; font-weight: 800;
  font-size: 0.95em; color: var(--ink-soft, #64748b);
  font-variant-numeric: tabular-nums;
}
.room-unit.complete .room-unit-count { color: #b45309; }
.room-unit .l1-badges { border-top: 0; margin-top: 6px; padding-top: 0; }

/* ---- how a badge is earned ----
   On a unit page it is a tooltip, shown on hover AND on focus so it can be
   reached from the keyboard, and present in the document either way so a
   screen reader gets it through aria-describedby. A title attribute would
   have done none of those things, and shows nothing at all on a touch screen.

   In the achievement room the same text is laid out as ordinary prose: "how
   do I get that one" is the question that page exists to answer, and hiding
   the answer behind a hover would be perverse. */
.l1-badge { position: relative; }
.l1-badge:focus-visible { outline: 3px solid #c7d2fe; outline-offset: 3px; border-radius: 10px; }
.l1-badge-how {
  position: absolute; z-index: 30; left: 50%; bottom: calc(100% + 8px);
  /* --nudge is set by l1-badges.js when a tooltip would hang off the edge. */
  transform: translateX(calc(-50% + var(--nudge, 0px)));
  width: 250px; padding: 11px 13px; border-radius: 11px;
  background: #0f172a; color: #e2e8f0;
  font-size: 0.78em; line-height: 1.5; text-align: left;
  box-shadow: 0 12px 30px rgba(15,23,42,0.28);
  opacity: 0; visibility: hidden; transition: opacity 0.15s;
  pointer-events: none;
}
.l1-badge-how b { display: block; color: #fff; margin-bottom: 4px; }
.l1-badge-how::after {
  content: ""; position: absolute; top: 100%; margin-left: -6px;
  left: calc(50% - var(--nudge, 0px));
  border: 6px solid transparent; border-top-color: #0f172a;
}
.l1-badge:hover .l1-badge-how,
.l1-badge:focus .l1-badge-how,
.l1-badge:focus-visible .l1-badge-how { opacity: 1; visibility: visible; }

/* the room: no tooltip, the explanation is the content */
.l1-badges-open .l1-badges-row {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.l1-badges-open .l1-badge {
  display: grid; grid-template-columns: 46px 1fr;
  column-gap: 13px; row-gap: 1px; align-items: start;
  width: auto; text-align: left;
  padding: 13px 15px; border-radius: 12px;
  background: var(--ground, #f6f8fb);
}
.l1-badges-open .l1-badge-hex { grid-row: 1 / span 3; }
.l1-badges-open .l1-badge.on { background: #fff; box-shadow: inset 0 0 0 1.5px var(--line, #e2e8f0); }
.l1-badges-open .l1-badge-hex { flex: none; }
.l1-badges-open .l1-badge-label {
  display: block; font-size: 0.92em; margin-bottom: 1px;
}
.l1-badges-open .l1-badge-sub { display: block; font-size: 0.78em; margin-bottom: 5px; }
.l1-badges-open .l1-badge-how {
  position: static; transform: none; width: auto; padding: 0;
  background: none; color: var(--ink-soft, #64748b);
  box-shadow: none; opacity: 1; visibility: visible;
  font-size: 0.8em; display: block;
}
.l1-badges-open .l1-badge-how b { color: var(--ink, #0f172a); display: none; }
.l1-badges-open .l1-badge-how::after { display: none; }

@media (max-width: 560px) {
  .l1-badge-how { width: 200px; }
}

/* ---- the per-lesson progress table ---------------------------------------
   A ring and five counters told a learner that fourteen of seventeen quizzes
   were passed and left them to find the other three. This says which. */

.unit-track-head {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  margin: 22px 0 8px;
}
.tk-big { font-family: 'Outfit', sans-serif; font-size: 26px; font-weight: 800; color: var(--ink); }
.tk-of  { font-size: 14px; font-weight: 600; color: var(--ink-mid); }
.tk-pct { margin-left: auto; font-weight: 800; color: var(--ink-mid); font-variant-numeric: tabular-nums; }
.tk-retry {
  background: #fef3c7; border: 1px solid #fcd34d; color: #92400e;
  border-radius: 20px; padding: 3px 11px; font-size: 12.5px; font-weight: 700;
}

.tk-bar { height: 8px; border-radius: 6px; background: #e2e8f0; overflow: hidden; margin: 0 0 18px; }
.tk-bar > i { display: block; height: 100%; width: 0; background: #16a34a; transition: width .35s; }

/* The table scrolls inside its own box on a narrow screen rather than
   pushing the page sideways. */
.unit-track-table-wrap { overflow-x: auto; margin: 0 0 22px; }

.unit-track-table {
  width: 100%; border-collapse: collapse;
  background: #fff; border: 1px solid var(--line-soft); border-radius: var(--radius);
  overflow: hidden; font-size: 13.5px;
}
.unit-track-table thead th {
  text-align: left; padding: 11px 14px; background: #f8fafc;
  font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-mid); border-bottom: 1px solid var(--line-soft); white-space: nowrap;
}
.unit-track-table tbody th {
  text-align: left; font-weight: 700; color: var(--ink);
  padding: 11px 14px; vertical-align: top; min-width: 190px;
}
.unit-track-table td { padding: 9px 14px; vertical-align: top; }
.unit-track-table tbody tr + tr th,
.unit-track-table tbody tr + tr td { border-top: 1px solid var(--line-soft); }
.unit-track-table tbody tr.done th { color: #15803d; }

/* the lesson number, so the row reads as 1, 2, 3 down the side */
.tk-num {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px;
  margin-right: 8px; border-radius: 6px; background: var(--accent-soft, #eef2ff);
  color: var(--accent); font-size: 11.5px; font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* Passed, tried, not started — three states, readable across a row. */
.tk-chip {
  display: inline-block; margin: 0 6px 6px 0; padding: 4px 10px;
  border-radius: 20px; font-size: 12px; font-weight: 700; white-space: nowrap;
}
/* Most chips are now links/buttons to the thing they track, not just
   labels — strip the browser's own link/button chrome so they keep
   reading as pills. */
a.tk-chip, button.tk-chip {
  text-decoration: none; cursor: pointer; font: inherit; border: 0; font-size: 12px;
}
a.tk-chip:hover, button.tk-chip:hover { filter: brightness(.95); text-decoration: underline; }
.tk-chip.pass { background: #dcfce7; color: #15803d; }
.tk-chip.fail { background: #fee2e2; color: #b91c1c; }
.tk-chip.todo { background: #f1f5f9; color: #64748b; }
/* A session started but not yet passed. Amber, not the red used for a quiz:
   a session is taken before the lesson is read, so a low score is the point
   of it rather than a failure to be corrected. */
.tk-chip.part { background: #ffedd5; color: #c2410c; }

/* A caption the table needs for a screen reader and nobody else. */
.sr-only {
  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: 560px) {
  .unit-track-table tbody th { min-width: 140px; }
  .tk-big { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) { .tk-bar > i { transition: none; } }

/* The lesson name jumps to the lesson. It replaced a separate row of links
   above the table, which listed the same lessons in the same order with less
   information attached. Underlined on hover and focus rather than always, so a
   column of ten does not read as a wall of links. */
.unit-track-table tbody th a {
  color: inherit; text-decoration: none; display: inline-flex;
  align-items: baseline; gap: 0;
}
.unit-track-table tbody th a:hover { color: var(--accent); text-decoration: underline; }
.unit-track-table tbody th a:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px;
}
.unit-track-table tbody tr.done th a:hover { color: #15803d; }

/* The study-plan chooser on the dashboard.
   7202 is assessed unit by unit, so "my study plan" is a question before it is
   an answer: which unit? The dashboard therefore asks, the way Level 2 does,
   rather than always writing about the whole course. It renders inline instead
   of in a modal because this panel already renders its plan inline, and a
   modal for the question with the answer behind it reads as two places. */
.l1-plan-pick { margin: 14px 0 0; display: grid; gap: 6px; }
.l1-plan-pick[hidden] { display: none; }
.l1-plan-pick-q { margin: 0 0 2px; font-size: 0.93em; color: var(--ink-soft, #64748b); }
.l1-plan-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 14px; border: 1px solid var(--line, #e2e8f0); border-radius: 10px;
  background: var(--card, #fff); cursor: pointer; text-align: left; font: inherit;
  color: var(--ink, #0f172a);
}
.l1-plan-row:hover { border-color: var(--accent, #4338ca); background: #f8fafc; }
.l1-plan-row:focus-visible { outline: 3px solid #c7d2fe; outline-offset: 2px; }
.l1-plan-row-num {
  flex: 0 0 auto; min-width: 34px; padding: 2px 7px; border-radius: 6px;
  background: #eef2ff; color: #4338ca; font-weight: 700; font-size: 0.82em;
  text-align: center;
}
.l1-plan-row-name { flex: 1 1 auto; min-width: 0; font-weight: 600; font-size: 0.95em; }
.l1-plan-row-hint { flex: 0 0 auto; font-size: 0.82em; color: var(--ink-soft, #64748b); }
.l1-plan-row-hint.due { color: #9a3412; font-weight: 600; }
.l1-plan-row.all { background: #eef2ff; border-color: #c7d2fe; }
.l1-plan-row.all:hover { background: #e0e7ff; }
.l1-plan-row.all .l1-plan-row-num { background: #4338ca; color: #fff; }
.l1-plan-back {
  margin: 12px 0 0; padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 0.88em; color: var(--accent, #4338ca); font-weight: 600;
}
.l1-plan-back:hover { text-decoration: underline; }
.l1-plan-scope { margin: 0 0 10px; font-size: 0.88em; color: var(--ink-soft, #64748b); }

.l1-plan-btn[hidden] { display: none; }

/* A unit plan that no longer matches the course plan it was written to sit
   inside. Not "old" — possibly wrong, which reads differently, so it is not
   the same grey as the plan's own timestamp. */
.l1-plan-stale {
  display: grid; gap: 6px; margin: 0 0 14px; padding: 12px 14px;
  border: 1px solid #fdba74; border-radius: 10px; background: #fff7ed;
}
.l1-plan-stale b { color: #9a3412; font-size: 0.95em; }
.l1-plan-stale span { color: #9a3412; font-size: 0.86em; line-height: 1.55; }
.l1-plan-stale-btn {
  justify-self: start; margin-top: 2px; padding: 6px 12px; font: inherit;
  font-size: 0.85em; font-weight: 700; color: #9a3412; cursor: pointer;
  background: #fff; border: 1px solid #ea580c; border-radius: 8px;
}
.l1-plan-stale-btn:hover { background: #ffedd5; }
@media print { .l1-plan-stale { display: none !important; } }
