/* Français — self-contained styles. System fonts only, no external requests.
   Palette: warm paper, French blue (primary), French red (sparingly), plus one tint per section type. */

:root {
  --bg: #f6f2ea;
  --bg-2: #efe9dd;
  --surface: #fffdf9;
  --fg: #1f2430;
  --muted: #5b6270;
  --line: #e3dccd;
  --line-2: #d3cab6;
  --shadow: 0 1px 2px rgba(60, 45, 20, 0.06), 0 6px 18px rgba(60, 45, 20, 0.06);
  --shadow-lg: 0 2px 4px rgba(60, 45, 20, 0.07), 0 14px 34px rgba(60, 45, 20, 0.1);

  --blue: #1f4fa3;
  --blue-ink: #173d82;
  --blue-soft: #e6edf9;
  --red: #c7303a;
  --red-soft: #fbe9ea;
  --on-accent: #ffffff;
  --focus: #1f4fa3;

  /* section kinds: --k (accent / dot / border), --k-ink (text on tint), --k-soft (tint) */
  --video: #1f4fa3;
  --video-ink: #173d82;
  --video-soft: #e7eefa;
  --handout: #5148b5;
  --handout-ink: #3f3794;
  --handout-soft: #ecebfa;
  --cards: #d49a0a;
  --cards-ink: #7c5600;
  --cards-soft: #fcf1d3;
  --exercises: #2a7d4f;
  --exercises-ink: #1d6039;
  --exercises-soft: #e3f3e9;
  --reading: #0f7a74;
  --reading-ink: #0a5d58;
  --reading-soft: #def3f1;
  --speaking: #c42f55;
  --speaking-ink: #9d2243;
  --speaking-soft: #fbe6ec;
  --other: #6b7280;
  --other-ink: #4b5563;
  --other-soft: #eceae4;

  --good: #247a48;
  --good-soft: #e1f3e8;
  --warn: #8a5300;
  --warn-soft: #fdf0d5;
  --bad: #b32a33;
  --bad-soft: #fbe7e8;

  --radius: 0.9rem;
  --radius-sm: 0.55rem;
  --header-h: 3.6rem;
  --stick: var(--header-h);

  --serif: Charter, "Iowan Old Style", "Palatino Linotype", Georgia, "Noto Serif CJK SC", "Songti SC", serif;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "DejaVu Sans Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161b;
    --bg-2: #1a1d23;
    --surface: #1d2027;
    --fg: #e8e6e0;
    --muted: #a0a5b0;
    --line: #2d313a;
    --line-2: #3b404c;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 18px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.45), 0 14px 34px rgba(0, 0, 0, 0.35);

    --blue: #8db0f2;
    --blue-ink: #b3cbf7;
    --blue-soft: #1d2842;
    --red: #f0777e;
    --red-soft: #3a2024;
    --on-accent: #0f1522;
    --focus: #9dbcf5;

    --video: #7fa6ee;
    --video-ink: #a9c4f5;
    --video-soft: #1c2740;
    --handout: #a39bf0;
    --handout-ink: #c2bcf7;
    --handout-soft: #25234a;
    --cards: #e8b73d;
    --cards-ink: #f0c866;
    --cards-soft: #3a2f12;
    --exercises: #62c28a;
    --exercises-ink: #8bd8aa;
    --exercises-soft: #173324;
    --reading: #4fc2ba;
    --reading-ink: #7fd8d1;
    --reading-soft: #123532;
    --speaking: #f0789a;
    --speaking-ink: #f7a1b9;
    --speaking-soft: #3b1b27;
    --other: #98a0ad;
    --other-ink: #b8bec9;
    --other-soft: #272a31;

    --good: #6cc48b;
    --good-soft: #17301f;
    --warn: #eab552;
    --warn-soft: #38290e;
    --bad: #f08a90;
    --bad-soft: #3a2024;
  }
}

.k-video { --k: var(--video); --k-ink: var(--video-ink); --k-soft: var(--video-soft); }
.k-handout { --k: var(--handout); --k-ink: var(--handout-ink); --k-soft: var(--handout-soft); }
.k-cards { --k: var(--cards); --k-ink: var(--cards-ink); --k-soft: var(--cards-soft); }
.k-exercises { --k: var(--exercises); --k-ink: var(--exercises-ink); --k-soft: var(--exercises-soft); }
.k-reading { --k: var(--reading); --k-ink: var(--reading-ink); --k-soft: var(--reading-soft); }
.k-speaking { --k: var(--speaking); --k-ink: var(--speaking-ink); --k-soft: var(--speaking-soft); }
.k-other { --k: var(--other); --k-ink: var(--other-ink); --k-soft: var(--other-soft); }

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--stick) + 3.4rem); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.65;
}
main { max-width: 52rem; margin: 0 auto; padding: 1.5rem 1.25rem 5rem; }
main.wide { max-width: 66rem; }

h1, h2, h3, h4 { font-family: var(--ui); line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.65rem, 1.2rem + 2vw, 2.25rem); margin: 0.3rem 0 0.35rem; font-family: var(--serif); letter-spacing: -0.02em; }
h2 { font-size: 1.3rem; margin: 0; }
h3 { font-size: 1.05rem; margin: 0; }
p, ul, ol { margin: 0.7rem 0; }
a { color: var(--blue); text-underline-offset: 0.18em; }
a:hover { color: var(--blue-ink); }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
strong { font-weight: 650; }
code { font-family: var(--mono); font-size: 0.86em; background: var(--bg-2); border: 1px solid var(--line); border-radius: 0.3rem; padding: 0.05em 0.35em; }
[hidden] { display: none !important; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.center { text-align: center; }
.sr-only, .visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 0.3rem; }
summary:focus-visible { outline-offset: -2px; }

/* all UI chrome in the system sans stack */
.eyebrow, .chip, .chips-row, .nav, .btn, .tag, .badge, .status, .stats, .pill, .kchip, summary, .icon-btn, .notice, .agenda, .jump,
.hero-badge, .hero-date, .hero-stats, .strip, .review-cta, .pager, .section-kind, .section-note, .mini-h, .complete-card, .stage, .tile,
.next-card, .plan-row, .legend, .countdown, .preview-card .section-kind, .fcard-hint, .answer-label, .rcard-label, .review-count, .mini,
.video-meta, .step, .logout, .brand, .page-head .muted {
  font-family: var(--ui);
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset;
}
.hbar {
  max-width: 66rem;
  margin: 0 auto;
  min-height: var(--header-h);
  padding: 0.35rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.brand { text-decoration: none; color: var(--fg); display: inline-flex; align-items: center; border-radius: 0.5rem; }
.brand-mark { display: inline-flex; align-items: center; gap: 0.5rem; }
.wordmark { font-family: var(--serif); font-weight: 700; font-size: 1.28rem; letter-spacing: -0.02em; color: var(--fg); }
.tricolore { display: inline-flex; width: 1.5rem; height: 1rem; border-radius: 0.22rem; overflow: hidden; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12); flex: none; }
.tricolore i { flex: 1; display: block; }
.tricolore i:nth-child(1) { background: #1f4fa3; }
.tricolore i:nth-child(2) { background: #ffffff; }
.tricolore i:nth-child(3) { background: #d1343a; }
.brand-mark.large { flex-direction: column; gap: 0.7rem; }
.brand-mark.large .tricolore { width: 3.4rem; height: 2.2rem; border-radius: 0.45rem; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1), var(--shadow); }
.brand-mark.large .wordmark { font-size: 2.4rem; }

.nav { display: flex; align-items: center; gap: 0.3rem; margin-left: 0.5rem; }
.nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  padding: 0 0.95rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 560;
  border: 1px solid transparent;
}
.nav a:hover { background: var(--bg-2); color: var(--fg); }
.nav a.active { background: var(--blue); color: var(--on-accent); border-color: var(--blue); box-shadow: 0 1px 3px rgba(31, 79, 163, 0.35); }
.nav a.active:hover { color: var(--on-accent); }
.badge {
  display: inline-block;
  min-width: 1.35rem;
  padding: 0.18rem 0.42rem;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
form.inline.logout-form { margin-left: auto; }
form.inline { display: inline; margin: 0; }
.logout {
  min-height: 2.25rem;
  padding: 0 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
}
.logout:hover { color: var(--fg); border-color: var(--muted); background: var(--bg-2); }

/* ---------- buttons, chips, notices ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.9rem;
  padding: 0 1.2rem;
  border-radius: 0.65rem;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--fg);
  font-size: 0.96rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(60, 45, 20, 0.06);
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s, border-color 0.12s;
}
.btn:hover { border-color: var(--blue); color: var(--blue-ink); box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: var(--on-accent); }
.btn.primary:hover { background: var(--blue-ink); border-color: var(--blue-ink); color: var(--on-accent); }
@media (prefers-color-scheme: dark) { .btn.primary:hover { background: #a7c3f6; border-color: #a7c3f6; } }
.btn.big { min-height: 3.4rem; padding: 0 2rem; font-size: 1.08rem; border-radius: 0.8rem; }
.btn.subtle { color: var(--muted); box-shadow: none; }
.btn.github { background: #1b1f24; border-color: #1b1f24; color: #fff; min-height: 3.2rem; padding: 0 1.6rem; font-size: 1.02rem; }
.btn.github:hover { background: #000; color: #fff; border-color: #000; }
@media (prefers-color-scheme: dark) { .btn.github { background: #f0f2f5; border-color: #f0f2f5; color: #14161b; } .btn.github:hover { background: #fff; color: #000; } }

.chips-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.5rem; font-size: 0.78rem; }
.chip, .tag, .pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.12rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--muted);
  white-space: nowrap;
}
.chip.phase { background: var(--blue-soft); border-color: transparent; color: var(--blue-ink); }
.chip.weekend { background: var(--speaking-soft); border-color: transparent; color: var(--speaking-ink); }
.chip.status.today { background: var(--blue); border-color: var(--blue); color: var(--on-accent); }
.chip.status.done { background: var(--good-soft); border-color: transparent; color: var(--good); }
.chip.status.upcoming { background: var(--other-soft); border-color: transparent; color: var(--other-ink); }
.chip.status.missed { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.pill { background: var(--k-soft, var(--bg-2)); border-color: transparent; color: var(--k-ink, var(--muted)); }
.pill.dur { background: var(--video-soft); color: var(--video-ink); font-variant-numeric: tabular-nums; }
.tag { margin-left: 0.35rem; padding: 0.02rem 0.5rem; font-weight: 550; text-transform: none; }
.tag.weekend, .tag.speaking { background: var(--speaking-soft); border-color: transparent; color: var(--speaking-ink); }
.tag.ready { background: var(--good-soft); border-color: transparent; color: var(--good); }
.tag.outline { background: var(--other-soft); border-color: transparent; color: var(--other-ink); }
.kchip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.12rem 0.65rem;
  border-radius: 999px;
  background: var(--k-soft);
  color: var(--k-ink);
  font-size: 0.8rem;
  font-weight: 650;
  white-space: nowrap;
}

.notice {
  font-size: 0.93rem;
  background: var(--blue-soft);
  color: var(--fg);
  border: 1px solid transparent;
  border-left: 4px solid var(--blue);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  margin: 1rem 0;
}
.notice.warn { background: var(--warn-soft); border-left-color: #d49a0a; }
.notice a { font-weight: 600; }

/* ---------- day hero ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.2rem;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.4rem 1.3rem;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: linear-gradient(90deg, #1f4fa3 0 33.3%, #ffffff 33.3% 66.6%, #d1343a 66.6% 100%);
  box-shadow: 0 1px 0 var(--line);
}
.hero-badge {
  width: 4.6rem;
  height: 4.6rem;
  border-radius: 1.1rem;
  background: var(--blue);
  color: var(--on-accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  margin-top: 0.4rem;
  box-shadow: 0 6px 14px rgba(31, 79, 163, 0.3);
}
.hero-badge span { font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.85; margin-bottom: 0.2rem; }
.hero-badge strong { font-size: 2rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.hero-main { min-width: 0; }
.hero-main .chips-row { margin-top: 0.5rem; }
.hero-date { margin: 0; font-size: 0.85rem; color: var(--muted); font-weight: 560; letter-spacing: 0.01em; }
.subtitle { font-size: 1.15rem; color: var(--muted); margin: 0 0 0.6rem; font-family: var(--ui); }
.lede { font-size: 1.08rem; margin: 0.6rem 0; color: var(--fg); }
.hero-stats { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; margin: 0.8rem 0 0; font-size: 0.9rem; color: var(--muted); }
.hero-stats strong { color: var(--fg); font-size: 1.05rem; }

/* review CTA + today strip */
.strip { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 1rem 0; align-items: stretch; }
.today-strip .strip-progress {
  flex: 2 1 16rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.8rem 1.1rem;
  font-family: var(--ui);
}
.strip-progress p { margin: 0.2rem 0; }
.strip-progress .strip-title { font-size: 0.92rem; }
.review-cta {
  flex: 1 1 14rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.4rem;
  padding: 0.7rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--cards);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--fg);
  text-decoration: none;
  font-weight: 650;
  font-size: 0.96rem;
}
.review-cta:hover { border-color: var(--cards); border-left-color: var(--cards); color: var(--fg); box-shadow: var(--shadow-lg); }
.review-cta.has-due { background: var(--cards-soft); border-color: var(--cards); }
.cta-icon { font-size: 1.4rem; }
main > .review-cta { margin: 1.2rem 0; max-width: 28rem; }

/* progress */
progress.bar {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 0.625rem;
  min-height: 0;
  max-width: none;
  padding: 0;
  box-shadow: none;
  border: 0;
  border-radius: 999px;
  background: var(--bg-2);
  overflow: hidden;
  color: var(--blue);
  margin: 0.4rem 0;
}
progress.bar::-webkit-progress-bar { background: var(--bg-2); border-radius: 999px; }
progress.bar::-webkit-progress-value { background: var(--blue); border-radius: 999px; transition: width 0.3s; }
progress.bar::-moz-progress-bar { background: var(--blue); border-radius: 999px; }
progress.bar.good { color: var(--good); }
progress.bar.good::-webkit-progress-value { background: linear-gradient(90deg, var(--blue), var(--good)); }
progress.bar.good::-moz-progress-bar { background: linear-gradient(90deg, var(--blue), var(--good)); }

/* ---------- jump nav ---------- */
.jump {
  position: sticky;
  top: var(--stick);
  z-index: 10;
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  margin: 1rem -1.25rem 0.4rem;
  padding: 0.6rem 1.25rem;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  scrollbar-width: none;
}
.jump::-webkit-scrollbar { display: none; }
.jump-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.2rem;
  padding: 0 0.9rem;
  border-radius: 999px;
  background: var(--k-soft);
  color: var(--k-ink);
  border: 1px solid transparent;
  font-size: 0.86rem;
  font-weight: 650;
  text-decoration: none;
}
.jump-chip:hover { border-color: var(--k); color: var(--k-ink); }
.jump-chip.current { background: var(--k); color: var(--on-accent); }
.jump-chip.k-cards.current, .jump-chip.k-other.current { color: #1a1300; }

/* ---------- agenda ---------- */
.agenda {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.3rem 1rem;
  margin: 1rem 0;
}
.agenda-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.agenda-total { margin: 0; font-weight: 700; color: var(--blue-ink); }
.stackbar { display: block; width: 100%; height: 0.7rem; margin: 0.7rem 0 0.4rem; border-radius: 999px; overflow: hidden; background: var(--bg-2); }
.seg { fill: var(--k); }
.steps { list-style: none; margin: 0.4rem 0 0; padding: 0; position: relative; }
.step { display: grid; grid-template-columns: auto auto 1fr; gap: 0 0.7rem; align-items: start; padding: 0.7rem 0; border-top: 1px solid var(--line); }
.step:first-child { border-top: 0; }
.step-check { width: 1.25rem; height: 1.25rem; margin: 0.15rem 0 0; accent-color: var(--good); cursor: pointer; }
.step-dot { width: 0.8rem; height: 0.8rem; border-radius: 50%; background: var(--k); margin-top: 0.4rem; box-shadow: 0 0 0 3px var(--k-soft); }
.step-main { min-width: 0; }
.step-line { display: flex; align-items: baseline; justify-content: space-between; gap: 0.8rem; }
.step-title { display: flex; flex-direction: column; gap: 0.05rem; color: var(--fg); text-decoration: none; font-weight: 600; font-size: 0.97rem; min-width: 0; }
a.step-title:hover .step-label { text-decoration: underline; text-decoration-color: var(--k); text-underline-offset: 0.2em; }
.step-kind { font-size: 0.74rem; font-weight: 700; color: var(--k-ink); text-transform: uppercase; letter-spacing: 0.06em; }
.step-min { flex: none; font-weight: 700; color: var(--k-ink); background: var(--k-soft); padding: 0.1rem 0.6rem; border-radius: 999px; font-size: 0.82rem; }
.step-instr { margin: 0.3rem 0 0; font-size: 0.86rem; color: var(--muted); line-height: 1.5; }
.step-check:checked ~ .step-main .step-label { text-decoration: line-through; text-decoration-color: var(--muted); color: var(--muted); }
.agenda-foot { display: flex; align-items: center; gap: 1rem; border-top: 1px solid var(--line); padding-top: 0.7rem; }
.agenda-foot progress { flex: 1; }
.agenda-count { margin: 0; color: var(--muted); white-space: nowrap; }

/* ---------- section cards ---------- */
.section {
  margin: 1.6rem 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--k);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: clip;
}
.section-head { display: flex; align-items: center; gap: 0.85rem; padding: 0.9rem 1.2rem; background: var(--k-soft); border-bottom: 1px solid var(--line); }
.kicon { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; flex: none; border-radius: 0.7rem; background: var(--surface); font-size: 1.25rem; box-shadow: 0 0 0 2px var(--k); }
.section-title { flex: 1; min-width: 0; }
.section-kind { margin: 0; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 750; color: var(--k-ink); }
.section-head h2 { color: var(--fg); font-size: 1.28rem; }
.section-aside { flex: none; }
.section-body { padding: 1rem 1.3rem 1.3rem; }
.section-note { color: var(--muted); margin-top: 0; }
.folder { font-family: var(--ui); font-weight: 600; color: var(--video-ink); background: var(--video-soft); padding: 0.05rem 0.45rem; border-radius: 0.35rem; word-break: break-all; }

/* videos */
.videos { list-style: none; padding: 0; margin: 0.8rem 0 0; display: grid; gap: 0.9rem; }
.video { display: grid; grid-template-columns: auto 1fr; gap: 1rem; padding: 1rem; background: var(--bg); border: 1px solid var(--line); border-radius: 0.8rem; }
.video-num {
  display: grid;
  place-items: center;
  min-width: 3.4rem;
  height: 3.4rem;
  padding: 0 0.5rem;
  border-radius: 0.9rem;
  background: var(--video);
  color: var(--on-accent);
  font-family: var(--ui);
  font-size: 1.5rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.video-num.blank { display: none; }
.video-num.blank + .video-body { grid-column: 1 / -1; }
.video-body { min-width: 0; }
.video-title { font-family: var(--serif); font-size: 1.1rem; font-weight: 650; line-height: 1.35; word-break: break-word; }
.video-title a { color: var(--fg); }
.video-sub { margin: 0.15rem 0 0; font-size: 0.9rem; color: var(--muted); font-family: var(--ui); }
.video-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.8rem; margin: 0.6rem 0; font-size: 0.86rem; }
.netdisk { color: var(--muted); font-weight: 560; }
.mini-h { margin: 0.7rem 0 0.2rem; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 750; color: var(--muted); }
.focus { list-style: none; padding: 0; margin: 0.2rem 0; font-size: 0.96rem; }
.focus li { position: relative; padding-left: 1.5rem; margin: 0.3rem 0; line-height: 1.5; }
.focus li::before { content: "✓"; position: absolute; left: 0.1rem; top: 0; color: var(--k, var(--video)); font-family: var(--ui); font-weight: 800; }
.section.k-handout .focus li::before { content: "•"; font-size: 1.3em; line-height: 1.2; }
.chips { list-style: none; padding: 0; margin: 0.2rem 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chips .skip { font-family: var(--ui); font-size: 0.84rem; background: var(--warn-soft); color: var(--warn); border-radius: 0.45rem; padding: 0.15rem 0.6rem; }

/* coming soon */
.soon { margin: 1.6rem 0; padding: 1.6rem 1.4rem; text-align: center; border: 2px dashed var(--line-2); border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.soon h2 { font-size: 1.2rem; }
.soon-list { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; padding: 0; margin: 1rem 0; }
.soon-list li { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; padding: 0.6rem 0.9rem; border: 1px dashed var(--k); border-radius: 0.7rem; font-family: var(--ui); }

/* ---------- prose (rendered markdown: handout, reading, model answer) ---------- */
.prose { font-size: 1.04rem; line-height: 1.68; max-width: 44rem; }
.prose > :first-child { margin-top: 0; }
.prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { border: 0; padding: 0; scroll-margin-top: 5rem; }
.prose h2 { font-size: 1.4rem; margin: 0.4rem 0 1rem; font-family: var(--serif); color: var(--k-ink); }
.prose h3 { font-size: 1.2rem; margin: 2.2rem 0 0.6rem; padding-bottom: 0.35rem; border-bottom: 2px solid var(--k-soft); color: var(--fg); }
.prose h4 { font-size: 1rem; margin: 1.7rem 0 0.4rem; color: var(--k-ink); text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.86rem; }
.prose h5, .prose h6 { font-size: 0.95rem; margin: 1.3rem 0 0.3rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin: 0.3rem 0; }
.prose li::marker { color: var(--k); font-weight: 700; }
.prose em { font-style: italic; color: var(--blue-ink); }
.prose strong { color: var(--fg); }
.prose strong em, .prose em strong { color: var(--blue-ink); }
.prose hr { border: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--line-2), transparent); margin: 1.8rem 0; }
.prose img { max-width: 100%; height: auto; border-radius: 0.5rem; }
.prose blockquote {
  margin: 1.1rem 0;
  padding: 0.5rem 1.1rem;
  background: var(--k-soft);
  border-left: 4px solid var(--k);
  border-radius: 0 0.6rem 0.6rem 0;
  color: var(--fg);
}
.prose blockquote > :first-child { margin-top: 0.2rem; }
.prose blockquote > :last-child { margin-bottom: 0.2rem; }
.prose pre { overflow-x: auto; background: var(--bg-2); border: 1px solid var(--line); border-radius: 0.6rem; padding: 0.8rem 1rem; font-size: 0.9rem; line-height: 1.5; }
.prose pre code { background: none; border: 0; padding: 0; }
.prose code { color: var(--cards-ink); word-break: normal; }
.ipa {
  font-family: var(--mono);
  font-size: 0.86em;
  font-style: normal;
  color: var(--handout-ink);
  background: var(--handout-soft);
  border-radius: 0.35rem;
  padding: 0.02em 0.38em;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.k-reading .ipa { color: var(--reading-ink); background: var(--reading-soft); }
.k-speaking .ipa { color: var(--speaking-ink); background: var(--speaking-soft); }

.table-wrap { overflow-x: auto; margin: 1.1rem 0; border: 1px solid var(--line); border-radius: 0.7rem; background: var(--surface); -webkit-overflow-scrolling: touch; }
.table-wrap:focus-visible { outline-offset: 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.93rem; line-height: 1.5; font-family: var(--ui); }
.prose th, .prose td { padding: 0.55rem 0.85rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose td { min-width: 5rem; font-family: var(--serif); font-size: 0.98rem; }
.prose th { background: var(--k-soft); color: var(--k-ink); font-weight: 700; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.prose tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--bg-2) 70%, transparent); }
.prose tbody tr:last-child td { border-bottom: 0; }

/* listen buttons (round icon buttons) */
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  flex: none;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--blue);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
  box-shadow: 0 1px 2px rgba(60, 45, 20, 0.08);
  transition: transform 0.12s, background 0.12s, border-color 0.12s;
}
.icon-btn:hover { background: var(--blue-soft); border-color: var(--blue); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn.playing { background: var(--blue); border-color: var(--blue); }

/* ---------- flashcards (day page) ---------- */
.fcards { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); gap: 0.9rem; }
.fcard { background: var(--surface); border: 1px solid var(--line-2); border-top: 4px solid var(--cards); border-radius: 0.8rem; box-shadow: var(--shadow); transition: box-shadow 0.15s, transform 0.15s; }
.fcard:hover { box-shadow: var(--shadow-lg); }
.fcard summary { display: flex; flex-direction: column; justify-content: space-between; gap: 0.8rem; min-height: 7.2rem; padding: 1rem 1.05rem 0.8rem; cursor: pointer; list-style: none; border-radius: 0.8rem; }
.fcard summary::-webkit-details-marker { display: none; }
.fcard-front { font-family: var(--serif); font-size: 1.12rem; line-height: 1.4; font-weight: 600; color: var(--fg); }
.fcard-hint { font-size: 0.76rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--cards-ink); }
.fcard-hint::before { content: "↻ "; }
.fcard details[open] .fcard-hint { display: none; }
.fcard details[open] { background: var(--cards-soft); border-radius: 0.8rem; }
.fcard-back { padding: 0.8rem 1.05rem 1rem; border-top: 1px dashed var(--cards); animation: reveal 0.28s ease-out; }
.fcard-answer { margin: 0 0 0.4rem; font-size: 1rem; }
.ipa-line { margin: 0.4rem 0; }
.example { margin: 0.5rem 0; font-style: italic; color: var(--fg); }

/* ---------- exercises ---------- */
.exercise { margin: 0 0 1.8rem; }
.exercise:last-child { margin-bottom: 0; }
.ex-head { display: flex; align-items: center; flex-wrap: wrap; gap: 0.3rem 0.6rem; padding-bottom: 0.4rem; border-bottom: 2px solid var(--exercises-soft); }
.ex-head .tag { margin-left: 0; text-transform: capitalize; background: var(--exercises-soft); color: var(--exercises-ink); border-color: transparent; }
.ex-instr { color: var(--muted); font-size: 0.95rem; margin: 0.6rem 0; }
.items { list-style: none; counter-reset: ex; padding: 0; margin: 0.8rem 0 0; display: grid; gap: 0.7rem; }
.ex-item { counter-increment: ex; position: relative; background: var(--bg); border: 1px solid var(--line); border-radius: 0.75rem; padding: 0.85rem 1rem 0.5rem 3.3rem; }
.ex-item::before {
  content: counter(ex);
  position: absolute;
  left: 0.85rem;
  top: 0.85rem;
  width: 1.75rem;
  height: 1.75rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--exercises);
  color: var(--on-accent);
  font-family: var(--ui);
  font-size: 0.85rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.ex-q { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.7rem; }
.prompt { white-space: pre-line; font-size: 1.05rem; padding-top: 0.05rem; }
.options { list-style: none; padding: 0; margin: 0.5rem 0; display: flex; flex-wrap: wrap; gap: 0.4rem; font-family: var(--ui); font-size: 0.93rem; }
.options li { border: 1px solid var(--line-2); border-radius: 0.5rem; padding: 0.15rem 0.75rem; background: var(--surface); font-variant-numeric: tabular-nums; }
details > summary { cursor: pointer; }
.answer-box > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.3rem;
  padding: 0 0.85rem;
  margin: 0.2rem 0 0.4rem;
  border-radius: 999px;
  background: var(--exercises-soft);
  color: var(--exercises-ink);
  font-size: 0.86rem;
  font-weight: 650;
  list-style: none;
}
.answer-box > summary::-webkit-details-marker { display: none; }
.answer-box > summary::before { content: "▸"; transition: transform 0.15s; }
.answer-box[open] > summary::before { transform: rotate(90deg); }
.answer-box > summary:hover { filter: brightness(0.97); }
.answer { background: var(--good-soft); border-left: 4px solid var(--good); border-radius: 0 0.6rem 0.6rem 0; padding: 0.3rem 1rem 0.4rem; margin: 0.2rem 0 0.6rem; animation: reveal 0.25s ease-out; }
.answer p { margin: 0.4rem 0; }
.answer-label { display: inline-block; margin-right: 0.4rem; padding: 0.05rem 0.5rem; border-radius: 0.3rem; background: var(--good); color: var(--on-accent); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; vertical-align: 0.1em; }
.answer-main strong { font-size: 1.08rem; font-family: var(--serif); }
.model > .answer { border-left-color: var(--speaking); background: var(--speaking-soft); }
.model > summary { background: var(--speaking-soft); color: var(--speaking-ink); }

/* speaking */
.prompts { list-style: none; counter-reset: pr; padding: 0; display: grid; gap: 0.6rem; margin: 0.8rem 0; }
.prompts li { counter-increment: pr; position: relative; background: var(--bg); border: 1px solid var(--line); border-radius: 0.75rem; padding: 0.75rem 1rem 0.75rem 3.2rem; }
.prompts li::before { content: counter(pr); position: absolute; left: 0.85rem; top: 0.75rem; width: 1.75rem; height: 1.75rem; display: grid; place-items: center; border-radius: 50%; background: var(--speaking); color: var(--on-accent); font-family: var(--ui); font-size: 0.85rem; font-weight: 750; }

/* ---------- complete / pager ---------- */
.complete-card { margin: 2rem 0 1rem; padding: 1.6rem 1.4rem; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); position: relative; scroll-margin-top: 5rem; }
.complete-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; border-radius: var(--radius) var(--radius) 0 0; background: var(--blue); }
.complete-card.is-done::before { background: var(--good); }
.complete-card.is-done { background: var(--good-soft); border-color: var(--good); }
.complete-card h2 { font-size: 1.25rem; }
.complete-card .done-note { color: var(--good); }
.complete-card p { margin: 0.4rem auto 1rem; max-width: 34rem; }
.pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; }
.pager-link { display: flex; flex-direction: column; padding: 0.7rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 0.8rem; text-decoration: none; color: var(--fg); min-width: 7.5rem; box-shadow: var(--shadow); }
.pager-link:hover { border-color: var(--blue); }
.pager-link.next { text-align: right; margin-left: auto; }

/* ---------- review ---------- */
.review { max-width: 38rem; margin: 0 auto; }
.review-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.review-head h1 { margin: 0; }
.review-count { margin: 0; font-size: 0.95rem; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.rcard { margin: 1.2rem 0 0.8rem; background: var(--surface); border: 1px solid var(--line-2); border-top: 6px solid var(--cards); border-radius: 1.1rem; box-shadow: var(--shadow-lg); padding: 1.6rem 1.5rem 1.2rem; }
.rcard-label { margin: 0 0 0.5rem; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cards-ink); }
.rcard-front { font-family: var(--serif); font-size: clamp(1.4rem, 1.1rem + 1.6vw, 1.9rem); line-height: 1.4; font-weight: 600; text-align: center; min-height: 6rem; display: flex; align-items: center; justify-content: center; white-space: pre-line; padding: 0.5rem 0 1rem; }
.reveal > summary { list-style: none; display: flex; justify-content: center; margin-top: 0.3rem; }
.reveal > summary::-webkit-details-marker { display: none; }
.reveal-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; padding: 0 2rem; border-radius: 0.7rem; background: var(--cards-soft); color: var(--cards-ink); border: 1px solid var(--cards); font-family: var(--ui); font-weight: 700; font-size: 0.98rem; }
.reveal > summary:hover .reveal-btn { filter: brightness(0.97); }
.reveal[open] > summary { display: none; }
.rcard-back { border-top: 1px dashed var(--cards); margin-top: 0.3rem; padding-top: 1rem; text-align: center; animation: reveal 0.3s ease-out; }
.rcard-answer { font-family: var(--serif); font-size: 1.25rem; line-height: 1.5; white-space: pre-line; }
.rcard-back .example { font-size: 1.05rem; }
.grade { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin-top: 1.4rem; }
.grade .btn { min-height: 3.6rem; font-size: 1.05rem; border-width: 2px; }
.btn.forgot { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.btn.forgot:hover { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.remembered { background: var(--good-soft); border-color: var(--good); color: var(--good); }
.btn.remembered:hover { background: var(--good); color: #fff; border-color: var(--good); }
@media (prefers-color-scheme: dark) { .btn.forgot:hover, .btn.remembered:hover { color: #101319; } }
.empty { text-align: center; padding: 3rem 1rem 2rem; background: var(--surface); border: 1px solid var(--line); border-radius: 1.1rem; box-shadow: var(--shadow); margin-top: 0.5rem; }
.empty-art { font-size: 3.6rem; line-height: 1; margin-bottom: 0.5rem; }
.empty h1 { margin-top: 0.2rem; }

/* ---------- plan ---------- */
.page-head { margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.page-head .muted { margin: 0.2rem 0 0; }
.card, .stage { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.3rem; }
.stage-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.stage-pct { margin: 0; font-weight: 700; color: var(--good); }
.stage progress.bar { height: 0.9rem; margin: 0.7rem 0 0.2rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 0.8rem; margin: 1rem 0; }
.tile { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--blue); border-radius: var(--radius); box-shadow: var(--shadow); padding: 0.85rem 1.05rem; }
.tile.streak { border-top-color: var(--red); }
.tile.good { border-top-color: var(--good); }
.tile.cards { border-top-color: var(--cards); }
.tile.due { border-top-color: var(--red); background: var(--red-soft); }
.tile.calm { border-top-color: var(--line-2); }
.tile dt { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--muted); }
.tile dd { margin: 0.1rem 0; font-size: 2rem; font-weight: 750; line-height: 1.15; font-family: var(--ui); }
.tile dd.hint { margin: 0; font-size: 0.88rem; font-weight: 400; line-height: 1.4; color: var(--muted); }
.block-h { margin: 2.2rem 0 0.8rem; font-size: 1.2rem; }
.next { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 0.9rem; }
.next-card { display: flex; flex-direction: column; gap: 0.35rem; height: 100%; padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; color: var(--fg); transition: box-shadow 0.15s, transform 0.15s; }
.next-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); color: var(--fg); }
.status-today .next-card { border-top-color: var(--blue); }
.next-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.next-day { font-weight: 750; font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.next-title { display: flex; flex-direction: column; font-size: 1.02rem; line-height: 1.35; }
.plan-title { font-family: var(--serif); font-weight: 650; }
.plan-zh { font-size: 0.88rem; font-family: var(--ui); }
.plan-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.1rem; }
.plan-meta .tag { margin-left: 0.4rem; }
.mix { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.25rem; }
.mini { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.05rem 0.5rem; border-radius: 999px; background: var(--k-soft); color: var(--k-ink); font-size: 0.78rem; font-weight: 650; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0; margin: 0 0 1rem; }

.status { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.15rem 0.7rem; border-radius: 999px; font-size: 0.76rem; font-weight: 700; white-space: nowrap; background: var(--other-soft); color: var(--other-ink); border: 1px solid transparent; }
.status.done { background: var(--good-soft); color: var(--good); }
.status.today { background: var(--blue); color: var(--on-accent); }
.status.missed { background: var(--warn-soft); color: var(--warn); border-color: #d49a0a66; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 1.6rem; position: relative; }
.timeline::before { content: ""; position: absolute; left: 0.45rem; top: 0.6rem; bottom: 0.6rem; width: 2px; background: var(--line-2); }
.timeline > li { position: relative; margin: 0 0 0.7rem; }
.node { position: absolute; left: -1.55rem; top: 1.15rem; width: 0.85rem; height: 0.85rem; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-2); }
.status-done .node { background: var(--good); border-color: var(--good); }
.status-today .node { background: var(--blue); border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.status-missed .node { background: var(--warn-soft); border-color: #d49a0a; }
.plan-row { display: grid; grid-template-columns: 3rem 1fr auto; gap: 0.9rem; align-items: start; padding: 0.85rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; color: inherit; transition: box-shadow 0.15s, border-color 0.15s; }
.plan-row:hover { box-shadow: var(--shadow-lg); border-color: var(--line-2); color: inherit; }
.status-today .plan-row { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue), var(--shadow); }
.status-done .plan-row { background: color-mix(in srgb, var(--good-soft) 40%, var(--surface)); }
.status-missed .plan-row { border-left: 4px solid #d49a0a; }
.plan-day { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 3rem; height: 3rem; border-radius: 0.8rem; background: var(--bg-2); font-family: var(--ui); font-weight: 750; font-size: 1.15rem; line-height: 1; font-variant-numeric: tabular-nums; }
.plan-day .small { font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); font-weight: 700; margin-bottom: 0.15rem; }
.status-today .plan-day { background: var(--blue); color: var(--on-accent); }
.status-today .plan-day .small { color: inherit; opacity: 0.85; }
.status-done .plan-day { background: var(--good-soft); color: var(--good); }
.plan-main { display: flex; flex-direction: column; min-width: 0; gap: 0.1rem; }

/* ---------- login / centered / messages / countdown ---------- */
.center-card { max-width: 25rem; margin: 9vh auto 0; text-align: center; padding: 2.4rem 1.8rem 2rem; background: var(--surface); border: 1px solid var(--line); border-radius: 1.2rem; box-shadow: var(--shadow-lg); position: relative; overflow: hidden; }
.center-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: linear-gradient(90deg, #1f4fa3 0 33.3%, #ffffff 33.3% 66.6%, #d1343a 66.6% 100%); box-shadow: 0 1px 0 var(--line); }
.auth-brand { display: flex; justify-content: center; margin-bottom: 0.4rem; }
.auth-tag { color: var(--muted); font-family: var(--ui); margin: 0.2rem 0 1.4rem; }
.center-card h1 { font-size: 1.7rem; }
.center-card .notice { text-align: left; }
.message-card { max-width: 30rem; margin: 6vh auto 0; padding: 2rem 1.6rem; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 1.1rem; box-shadow: var(--shadow); }

.countdown { display: grid; grid-template-columns: auto 1fr; gap: 1.4rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem 1.5rem; position: relative; overflow: hidden; }
.countdown::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: linear-gradient(90deg, #1f4fa3 0 33.3%, #ffffff 33.3% 66.6%, #d1343a 66.6% 100%); box-shadow: 0 1px 0 var(--line); }
.count-badge { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 6.2rem; height: 6.2rem; border-radius: 50%; background: var(--blue); color: var(--on-accent); font-family: var(--ui); line-height: 1; box-shadow: 0 8px 18px rgba(31, 79, 163, 0.3); }
.count-badge strong { font-size: 2.7rem; font-weight: 750; }
.count-badge span { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; margin-top: 0.2rem; opacity: 0.9; }
.countdown h1 { margin: 0.1rem 0; }
.countdown .eyebrow { margin: 0; font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.countdown .lede { margin-bottom: 0; }
.preview-card { margin: 1.4rem 0; padding: 1.4rem 1.5rem; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--k); border-radius: var(--radius); box-shadow: var(--shadow); }
.preview-card h2 { font-family: var(--serif); font-size: 1.45rem; margin-top: 0.1rem; }
.preview-card .section-kind { color: var(--k-ink); }
.preview-card .subtitle { margin: 0.2rem 0 0.5rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 1.1rem 0 0.8rem; }

/* ---------- motion ---------- */
@keyframes reveal { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- small screens ---------- */
@media (max-width: 40rem) {
  /* two-row header: brand + logout, then full-width tabs. Only the tab row stays stuck. */
  :root { --stick: 3.2rem; }
  .site-header { top: -3rem; }
  .hbar { flex-wrap: wrap; padding: 0 0.8rem; gap: 0; }
  .brand { order: 1; height: 3rem; }
  form.inline.logout-form { order: 2; margin-left: auto; height: 3rem; display: flex; align-items: center; }
  .nav { order: 3; width: 100%; margin: 0; padding: 0 0 0.35rem; gap: 0.3rem; height: 3.2rem; align-items: center; }
  .nav a { flex: 1; justify-content: center; padding: 0 0.4rem; }
  main { padding: 1.1rem 1rem 4rem; }
  .jump { margin: 0.8rem -1rem 0.3rem; padding: 0.5rem 1rem; }
  .hero { grid-template-columns: 1fr; padding: 1.3rem 1.1rem 1.1rem; gap: 0.5rem; }
  .hero-badge { width: 3.6rem; height: 3.6rem; border-radius: 0.9rem; flex-direction: row; gap: 0.35rem; width: auto; padding: 0 0.9rem; height: 2.6rem; justify-self: start; margin-top: 0.3rem; }
  .hero-badge span { margin: 0; font-size: 0.7rem; }
  .hero-badge strong { font-size: 1.4rem; }
  .agenda { padding: 1rem 1rem 0.9rem; }
  .step { grid-template-columns: auto auto 1fr; gap: 0 0.55rem; }
  .section-head { padding: 0.8rem 0.95rem; gap: 0.65rem; flex-wrap: wrap; }
  .section-body { padding: 0.9rem 0.95rem 1.1rem; }
  .section-aside { flex-basis: 100%; order: 3; }
  .video { grid-template-columns: 1fr; gap: 0.6rem; padding: 0.9rem; }
  .video-num { min-width: 2.9rem; height: 2.9rem; font-size: 1.3rem; justify-self: start; }
  .fcards { grid-template-columns: 1fr; }
  .ex-item { padding-left: 2.9rem; }
  .ex-item::before { left: 0.65rem; }
  .prompts li { padding-left: 2.9rem; }
  .prompts li::before { left: 0.65rem; }
  .grade { grid-template-columns: 1fr; }
  .grade .btn.remembered { order: -1; }
  .rcard { padding: 1.3rem 1.1rem 1rem; }
  .countdown { grid-template-columns: 1fr; text-align: center; justify-items: center; padding: 1.4rem 1.1rem; }
  .count-badge { width: 5.4rem; height: 5.4rem; }
  .plan-row { grid-template-columns: 2.6rem 1fr; gap: 0.6rem 0.7rem; padding: 0.75rem 0.8rem; }
  .plan-row .status { grid-column: 2; justify-self: start; }
  .plan-day { width: 2.6rem; height: 2.6rem; font-size: 1rem; }
  .timeline { padding-left: 1.3rem; }
  .node { left: -1.3rem; }
  .timeline::before { left: 0.2rem; }
  .pager-link { min-width: 0; flex: 1; }
  .tile dd { font-size: 1.6rem; }
}
