/* ── Custom Training — design system ─────────────────────────────
   Look: "electric campus" — cool paper ground, deep indigo ink,
   violet→magenta gradient signature, amber used for figure marks.
   Display: Bricolage Grotesque · Body: Inter · Mono: IBM Plex Mono
*/

:root {
  --paper: #F4F5FB;
  --card: #FFFFFF;
  --ink: #181B34;
  --ink-soft: #5C6180;
  --line: #E4E5F2;
  --brand: #5B4CF1;
  --accent: #F14C8B;
  --grad: linear-gradient(115deg, #5B4CF1 0%, #9C4DF4 55%, #F14C8B 100%);
  --grad-soft: linear-gradient(115deg, rgba(91,76,241,.10), rgba(241,76,139,.10));
  --sweep: rgba(122, 92, 245, 0.16);
  --highlight: #FFC94D;
  --highlight-soft: #FFF3D6;
  --good: #0F9D58;
  --good-soft: #E2F6EB;
  --bad: #E5484D;
  --bad-soft: #FDE9EA;
  --algebra: #E0761B;
  --geometry: #0BA5C7;
  --calculus: #4C6FF1;
  --finance: #0EA47E;
  --statistics: #C13CE8;
  --trigonometry: #6741D9;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(24, 27, 52, 0.08);
  --shadow-brand: 0 10px 30px rgba(91, 76, 241, 0.18);
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "Consolas", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Course color darkened for TEXT on light ground. Raw course colors
   sit as low as 2.1:1 on white; a 58/42 mix with ink keeps every one
   of the 30 at or above 4.87:1. Resolved per element, so it tracks
   whatever --course-color is in scope. */
* { --course-ink: color-mix(in srgb, var(--course-color, var(--brand)) 58%, var(--ink)); }

/* Touch targets: pointer-based, not width-based, so a tablet in
   landscape still gets comfortable answer buttons. */
@media (pointer: coarse) {
  .sq-opt { min-height: 44px; padding: 10px 14px; }
  .sp-chip { min-height: 40px; padding: 8px 15px; }
  .main-nav a { padding: 10px 6px; display: inline-block; }
}

/* Keyboard users' first tab stop; visually hidden until focused. */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px 16px;
  border-radius: 0 0 10px 10px;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus-visible { top: 0; }
main:focus { outline: none; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  font-family: var(--font-body);
  /* "Aurora" ground: indigo → violet → cyan wash with colored light pools */
  background: #EDEFFD;
  background-image:
    radial-gradient(62rem 42rem at 114% -10%, rgba(124, 77, 255, 0.22), transparent 60%),
    radial-gradient(52rem 38rem at -14% 16%, rgba(12, 166, 200, 0.18), transparent 60%),
    radial-gradient(58rem 42rem at 52% 124%, rgba(241, 76, 139, 0.15), transparent 62%),
    linear-gradient(160deg, #EEF1FF 0%, #F2EDFD 42%, #EAF5FA 100%);
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
  /* Keeps the footer at the bottom even when a page is short */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body > main { flex: 1 0 auto; }
body > .site-footer { flex-shrink: 0; }

/* ── Header / nav ── */
.site-header {
  background: #14163A;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 14px rgba(20, 22, 58, 0.35);
}
.site-header::after {
  content: "";
  display: block;
  height: 3px;
  background: var(--grad);
}
.site-header .bar {
  max-width: 1480px;
  margin: 0 auto;
  padding: 15px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  text-decoration: none;
  color: #FFFFFF;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
}
.wordmark .brand-mark { width: 38px; height: 25px; flex: none; margin-right: 8px; }
}
.wordmark .mark {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
/* min-width:0 lets the nav shrink below its content width so the links wrap
   among themselves instead of pushing the header wider than the phone. */
.main-nav { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.main-nav a {
  text-decoration: none;
  color: #B9BCE0;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
}
.main-nav a:hover { color: #FFFFFF; background: rgba(255, 255, 255, 0.08); }
.main-nav a.active {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.10);
  box-shadow: inset 0 -3px 0 var(--accent);
  border-radius: 8px 8px 0 0;
}
.main-nav a.soon { opacity: 0.4; cursor: default; }
.main-nav a:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* The hidden attribute must beat our explicit display rules — a
   .topic-row is display:flex, which would otherwise override it. */
[hidden] { display: none !important; }

/* ── Search ── */
.search-wrap {
  position: relative;
  margin-left: auto;      /* pins the box to the right corner */
  flex: 0 1 320px;
  min-width: 200px;
}
/* In the header the box shares one row with the wordmark, the nav, and the
   auth button. A fixed 320px basis pushed the button onto a second row, so
   the box flexes instead and only reaches full width when there's space. */
.search-wrap.header-search {
  align-self: center;
  flex: 1 1 230px;
  max-width: 320px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: 999px;
  padding: 8px 14px;
}
.search-field:focus-within {
  background: rgba(255, 255, 255, 0.16);
  border-color: var(--accent);
}
.search-field .icon { color: #B9BCE0; flex-shrink: 0; font-size: 0.95rem; }
.search-field input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  outline: none;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.92rem;
}
.search-field input::placeholder { color: #9296C4; }

.search-results {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(460px, 92vw);
  max-height: 68vh;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 44px rgba(24, 27, 52, 0.22);
  padding: 8px;
  z-index: 120;
}
.search-results.show { display: block; }
.search-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  padding: 6px 10px 8px;
}
.search-empty { font-size: 0.9rem; color: var(--ink-soft); padding: 14px 12px; }
.search-result {
  display: block;
  text-decoration: none;
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 8px;
  border-left: 3px solid var(--course-color, var(--brand));
  margin-bottom: 4px;
}
.search-result:hover, .search-result.active { background: var(--grad-soft); }
.search-result .sr-course {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--course-ink);
  font-weight: 700;
}
.search-result .sr-title { display: block; font-weight: 700; font-size: 1rem; margin: 2px 0 3px; }
.search-result .sr-snip { display: block; font-size: 0.85rem; color: var(--ink-soft); line-height: 1.45; }
.search-results mark {
  background: var(--highlight-soft);
  color: var(--ink);
  border-radius: 3px;
  padding: 0 2px;
}

@media (max-width: 720px) {
  .search-wrap { flex-basis: 100%; margin-left: 0; }
  .search-results { right: auto; left: 0; width: min(460px, 94vw); }
}

.page {
  max-width: 1480px;
  margin: 0 auto;
  padding: 44px 24px 90px;
  width: 100%;
}

/* ── Headings ── */
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; letter-spacing: -0.02em; }
.hl {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede { color: var(--ink-soft); font-size: 1.08rem; max-width: 64ch; margin-top: 14px; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--brand);
  font-weight: 700;
}

/* ── Home ── */
.hero { padding: 44px 0 40px; border-bottom: 1px solid var(--line); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 40px;
  align-items: center;
}
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }

/* The signature: a live problem as the opening move. The product is
   practice, so the hero IS practice. */
.problem-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-brand);
  padding: 20px 20px 16px;
  position: relative;
}
.problem-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--grad);
}
.pc-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  display: block;
  margin-bottom: 10px;
}
.pc-more {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--brand);
  text-decoration: none;
}
.pc-more:hover { text-decoration: underline; }
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 36px;
}
.menu-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  text-decoration: none;
  color: var(--ink);
  display: block;
  position: relative;
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.menu-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--grad);
  opacity: 0.9;
}
.menu-card.disabled::before { background: var(--line); }
.menu-card h2 { font-size: 1.4rem; margin: 8px 0 8px; }
.menu-card p { color: var(--ink-soft); font-size: 0.94rem; }
.menu-card.enabled:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-brand);
}
.menu-card.disabled { opacity: 0.55; cursor: default; }
.menu-card .go {
  font-weight: 700;
  font-size: 0.9rem;
  margin-top: 14px;
  display: inline-block;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.how { margin-top: 56px; }
.how ol {
  margin: 18px 0 0 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.how li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  font-size: 0.94rem;
  color: var(--ink-soft);
}
.how li strong { color: var(--ink); display: block; margin-bottom: 4px; font-size: 1rem; }
.how li .stepnum {
  font-family: var(--font-mono);
  color: #fff;
  background: var(--grad);
  border-radius: 6px;
  padding: 1px 8px;
  font-size: 0.8rem;
  margin-right: 8px;
  font-weight: 700;
}

/* ── Catalog (courses / workbooks) layout ── */
.courses-layout {
  display: grid;
  grid-template-columns: 1fr 370px;
  gap: 36px;
  align-items: start;
  margin-top: 36px;
}
@media (max-width: 900px) {
  .courses-layout { grid-template-columns: 1fr; }
  .tray { position: static !important; }
}

.course-block {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.course-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: none;
  border: none;
  border-left: 6px solid var(--course-color, var(--ink));
  cursor: pointer;
  text-align: left;
  font-family: var(--font-display);
  color: var(--ink);
}
.course-head:hover { background: var(--grad-soft); }
.course-head h2 { font-size: 1.45rem; font-weight: 700; }
.course-head .tagline { font-family: var(--font-body); color: var(--ink-soft); font-size: 0.88rem; margin-top: 2px; }
.course-head .count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
  white-space: nowrap;
}
.course-head .chev { font-size: 0.9rem; color: var(--ink-soft); transition: transform 0.2s; }
.course-block.open .chev { transform: rotate(90deg); }
.topic-list { display: none; border-top: 1px solid var(--line); }
.course-block.open .topic-list { display: block; }

.topic-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 20px 14px 26px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.topic-row:last-child { border-bottom: none; }
.topic-row:hover { background: var(--grad-soft); }
.topic-row input[type="checkbox"] {
  width: 19px;
  height: 19px;
  margin-top: 3px;
  accent-color: var(--brand);
  cursor: pointer;
  flex-shrink: 0;
}
.topic-row .topic-name { font-weight: 700; font-size: 1.02rem; }
.video-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--course-ink);
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 1px 8px;
  margin-left: 6px;
  vertical-align: 2px;
  opacity: 0.9;
  white-space: nowrap;
}
.topic-row .topic-desc { color: var(--ink-soft); font-size: 0.88rem; margin-top: 2px; }
.topic-row .mins {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-soft);
  white-space: nowrap;
  padding-top: 4px;
}

/* ── Selection tray (signature element) ── */
.tray {
  position: sticky;
  top: 92px;
  background: linear-gradient(var(--card), var(--card)) padding-box, var(--grad) border-box;
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-brand);
}
.tray h2 { font-size: 1.25rem; margin-bottom: 4px; }
.tray .tray-sub { color: var(--ink-soft); font-size: 0.85rem; margin-bottom: 14px; }
.tray ol { list-style: none; counter-reset: mod; margin-bottom: 16px; }
.tray ol li {
  counter-increment: mod;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.93rem;
}
.tray ol li::before {
  content: counter(mod, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--course-ink);
  font-weight: 700;
}
.tray .tray-course { color: var(--ink-soft); font-size: 0.78rem; margin-left: auto; white-space: nowrap; }
.tray .empty { color: var(--ink-soft); font-size: 0.9rem; font-style: italic; padding: 10px 0 16px; }
.tray .totals {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-bottom: 16px;
}

/* ── Buttons ── */
.btn {
  display: inline-block;
  width: 100%;
  padding: 13px 18px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  background: var(--grad);
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}
.btn:hover:not(:disabled) { filter: brightness(1.07); transform: translateY(-1px); box-shadow: var(--shadow-brand); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-secondary {
  background: var(--card);
  color: var(--brand);
  border: 2px solid var(--brand);
}
.btn-secondary:hover:not(:disabled) { background: var(--grad-soft); filter: none; }

.linkbox { margin-top: 16px; display: none; }
.linkbox.show { display: block; }
.linkbox label { font-size: 0.8rem; font-weight: 700; display: block; margin-bottom: 6px; }
.linkbox .linkrow { display: flex; gap: 8px; }
.linkbox input {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
}
.linkbox .copy-btn {
  padding: 8px 14px;
  font-weight: 700;
  font-size: 0.85rem;
  border: none;
  background: var(--grad);
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
.linkbox .copy-btn:hover { filter: brightness(1.08); }
.linkbox .open-link { display: block; margin-top: 10px; font-weight: 700; font-size: 0.9rem; color: var(--brand); }

/* ── Training / workbook page ── */
.training-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  align-items: start;
  margin-top: 30px;
}
@media (max-width: 900px) {
  .training-layout { grid-template-columns: 1fr; }
  .toc { position: static !important; }
}
.toc {
  position: sticky;
  top: 92px;
  font-size: 0.9rem;
}
.toc .eyebrow { display: block; margin-bottom: 10px; }
.toc a {
  display: flex;
  align-items: baseline;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 6px 10px;
  border-left: 3px solid var(--line);
}
.toc a:hover { color: var(--ink); border-left-color: var(--course-color, var(--brand)); background: var(--grad-soft); }
.toc .toc-num { font-family: var(--font-mono); font-size: 0.72rem; margin-right: 6px; }
.toc .toc-pass { margin-left: auto; font-weight: 800; font-size: 0.8rem; }
.toc .toc-pass.pass { color: var(--good); }
.toc .toc-pass.fail { color: var(--bad); }

.module {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px 36px;
  margin-bottom: 34px;
  box-shadow: var(--shadow);
}
.module-head { border-bottom: 2px solid var(--ink); padding-bottom: 16px; margin-bottom: 22px; }
.module-head .eyebrow { color: var(--course-color, var(--brand)); }
.module-head h2 { font-size: 2rem; margin-top: 4px; font-weight: 800; }
.module-head .meta { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-soft); margin-top: 6px; }

.section { margin-bottom: 26px; }
.section > h3 {
  font-size: 1.18rem;
  margin-bottom: 10px;
  display: inline-block;
  background: linear-gradient(transparent 62%, var(--sweep) 62%, var(--sweep) 96%, transparent 96%);
  padding: 0 4px;
  font-weight: 700;
}
.section p { margin-bottom: 10px; max-width: 72ch; }
.section p:last-child { margin-bottom: 0; }

dl.defs { display: grid; gap: 10px; }
dl.defs .def-pair {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 16px;
}
dl.defs dt { font-weight: 700; }
dl.defs dd { color: var(--ink-soft); font-size: 0.95rem; }

.formula-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.formula-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--course-color, var(--brand));
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
}
.formula-card .fname { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
.formula-card .fbody { font-family: var(--font-mono); font-size: 0.98rem; margin: 8px 0 4px; }
.formula-card .fnote { font-size: 0.82rem; color: var(--ink-soft); }

.example {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
}
.example .ex-problem { padding: 14px 16px; background: var(--paper); }
.example .ex-problem .ex-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--course-ink);
  display: block;
  margin-bottom: 4px;
  font-weight: 700;
}
.example .ex-solution { padding: 14px 16px; border-top: 1px dashed var(--line); font-size: 0.95rem; }
.example .ex-solution::before {
  content: "Solution";
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  display: block;
  margin-bottom: 4px;
}

/* ── Figures (concept graphs) ── */
.figure-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 18px 8px;
  margin-bottom: 14px;
  background: var(--card);
}
.fig-svg { width: 100%; height: auto; display: block; }
.fig-svg .axis { stroke: var(--line); stroke-width: 1.5; }
.fig-svg .tick { stroke: var(--ink-soft); stroke-width: 1.5; }
.fig-svg .curve { stroke: var(--course-color, var(--calculus)); stroke-width: 2.5; fill: none; }
.fig-svg .secant { stroke: #9AA0B8; stroke-width: 1.75; stroke-dasharray: 6 5; fill: none; }
.fig-svg .tangent { stroke: var(--ink); stroke-width: 2; fill: none; }
.fig-svg .dot { fill: var(--highlight); stroke: var(--ink); stroke-width: 1.5; }
.fig-svg .dot-minor { fill: #9AA0B8; }
.fig-svg .slice { fill: var(--highlight); fill-opacity: 0.45; stroke: var(--card); stroke-width: 2; }
.fig-svg .area { fill: var(--highlight); fill-opacity: 0.55; }
.fig-svg .flabel { font-family: var(--font-body); font-size: 13px; fill: var(--ink-soft); }
.fig-svg .flabel.strong { fill: var(--ink); font-weight: 700; }
.fig-svg .flabel.curve-l { fill: var(--course-color, var(--calculus)); font-weight: 700; }
.fig-svg .flabel.alt { fill: var(--accent); font-weight: 700; }
.fig-svg .alt-curve { stroke: var(--accent); stroke-width: 2.5; fill: none; stroke-dasharray: 7 5; }
.fig-svg .zoombox { stroke: var(--ink); stroke-width: 1.5; fill: none; stroke-dasharray: 4 3; }
.fig-svg .flux { stroke: var(--course-color, var(--calculus)); stroke-width: 2; }
.fig-svg .fluxhead { fill: var(--course-color, var(--calculus)); }
.fig-svg .sphere { fill: var(--highlight); fill-opacity: 0.3; stroke: var(--course-color, var(--calculus)); stroke-width: 2.5; }
.fig-svg .band { fill: var(--highlight); }
.fig-svg .span-line { stroke: var(--ink-soft); stroke-width: 1.5; }
.fig-svg .cash-in { stroke: var(--good); stroke-width: 3; }
.fig-svg .cash-in-head { fill: var(--good); }
.fig-svg .cash-out { stroke: var(--bad); stroke-width: 3; }
.fig-svg .cash-out-head { fill: var(--bad); }
.figure-card figcaption {
  font-size: 0.88rem;
  color: var(--ink-soft);
  padding: 10px 4px 8px;
  border-top: 1px dashed var(--line);
  margin-top: 10px;
}

/* ── Quiz ── */
.quiz-note {
  font-size: 0.9rem;
  color: var(--ink-soft);
  background: var(--grad-soft);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  max-width: none !important;
}
.quiz-note a { color: var(--brand); font-weight: 600; }
.quiz .question {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 14px;
  background: var(--paper);
}
.quiz .qtext { font-weight: 700; margin-bottom: 10px; }
.quiz .qtext .qnum { font-family: var(--font-mono); font-size: 0.8rem; color: var(--brand); margin-right: 8px; }
.quiz label.opt {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
}
.quiz label.opt:hover { background: var(--grad-soft); }
.quiz input[type="radio"] { accent-color: var(--brand); margin-top: 4px; }
.quiz .question.correct { border-color: var(--good); box-shadow: inset 4px 0 0 var(--good); }
.quiz .question.incorrect { border-color: var(--bad); box-shadow: inset 4px 0 0 var(--bad); }
.quiz .explain {
  display: none;
  margin-top: 10px;
  font-size: 0.88rem;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--card);
  border: 1px dashed var(--line);
}
.quiz .question.graded .explain { display: block; }

/* ── Solutions sheet: the missed questions, consolidated ── */
.sol-sheet {
  margin-top: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.sol-sheet h3 { font-size: 1.15rem; margin-bottom: 14px; }
.sol-item { padding: 14px 0; border-top: 1px dashed var(--line); }
.sol-item:first-of-type { border-top: none; }
.sol-q { font-weight: 700; margin-bottom: 8px; }
.sol-q .qnum { margin-right: 8px; }
.sol-answers { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 0.9rem; margin-bottom: 8px; }
.sol-yours { color: var(--bad); }
.sol-right { color: var(--good); font-weight: 700; }
.sol-explain { font-size: 0.93rem; color: var(--ink-soft); line-height: 1.55; }
.sol-more {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand);
  background: transparent;
  border: 1px solid var(--brand);
  border-radius: 999px;
  padding: 4px 13px;
  margin-top: 8px;
  cursor: pointer;
}
.sol-more:hover:not(:disabled) { background: var(--grad-soft); }
.sol-more:disabled { opacity: 0.6; cursor: progress; }
.sol-detail {
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: 10px;
  font-size: 0.93rem;
  line-height: 1.6;
  white-space: pre-line;
}
.quiz .explain .verdict { font-weight: 700; display: block; margin-bottom: 2px; }
.quiz .question.correct .verdict { color: var(--good); }
.quiz .question.incorrect .verdict { color: var(--bad); }

/* review-missed mode: hide the ones already right */
.quiz-body.review-mode .question.correct { display: none; }

.quiz-actions { display: flex; align-items: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.quiz-actions .btn { width: auto; padding: 11px 20px; }
.quiz-score { font-family: var(--font-mono); font-size: 0.95rem; font-weight: 700; }
.quiz-score.passed { color: var(--good); }
.quiz-score.failed { color: var(--bad); }

.pass-badge {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  vertical-align: 1px;
}
.pass-badge.pass { background: var(--good-soft); color: var(--good); }
.pass-badge.fail { background: var(--bad-soft); color: var(--bad); }

.training-summary {
  background: linear-gradient(var(--card), var(--card)) padding-box, var(--grad) border-box;
  border: 2px solid transparent;
  border-radius: var(--radius);
  box-shadow: var(--shadow-brand);
  padding: 26px 30px;
  margin: 30px 0 40px;
}
.training-summary h2 { font-size: 1.3rem; margin-bottom: 8px; }
.training-summary .totals-line { font-family: var(--font-mono); font-size: 0.83rem; color: var(--ink-soft); }
.overall-score { margin-top: 10px; font-weight: 700; display: none; }

.error-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  margin-top: 40px;
  box-shadow: var(--shadow);
}
.error-card a { color: var(--brand); font-weight: 700; }

/* ── Timed tests ── */
/* The clock sticks below the header so it's never scrolled away. */
.tt-bar {
  position: sticky;
  top: 74px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  background: #14163A;
  color: #E4E6FA;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 14px 22px;
  margin-top: 22px;
  box-shadow: 0 6px 22px rgba(20, 22, 58, 0.28);
}
.tt-clock {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  min-width: 108px;
}
.tt-bar-meta {
  font-size: 0.86rem;
  color: #A8ACD4;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}
.tt-bar .tt-sep { opacity: 0.5; }
.tt-bar .btn { width: auto; padding: 10px 20px; }

/* Under 25% of the allowance left, then under 10%. */
.tt-bar.warn { background: #6B4A05; }
.tt-bar.warn .tt-clock { color: var(--highlight); }
.tt-bar.danger { background: #6E1518; }
.tt-bar.danger .tt-clock { color: #FFB3B5; animation: ttPulse 1s ease-in-out infinite; }
.tt-bar.done { background: var(--ink); }
.tt-bar.done .tt-clock { font-size: 1.5rem; }
@keyframes ttPulse { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) {
  .tt-bar.danger .tt-clock { animation: none; }
}

.tt-progress-track {
  height: 5px;
  background: var(--line);
  border-radius: 0 0 4px 4px;
  overflow: hidden;
  margin-bottom: 26px;
}
.tt-progress-track span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--grad);
  transition: width 0.2s ease;
}

.tt-plan { list-style: none; margin: 14px 0 4px; display: grid; gap: 7px; }
.tt-plan li {
  border-left: 3px solid var(--course-color, var(--brand));
  padding-left: 11px;
  font-size: 0.9rem;
}
.tt-plan .tt-topic { font-weight: 700; }
.tt-plan .tt-detail { color: var(--ink-soft); font-size: 0.83rem; margin-left: 8px; }

.tt-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  color: var(--course-ink);
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 1px 8px;
  margin-left: 8px;
  vertical-align: 2px;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .tt-bar { top: 66px; gap: 12px; padding: 12px 16px; }
  .tt-clock { font-size: 1.6rem; min-width: 84px; }
}

/* ── Auth: header control ── */
.auth-control { position: relative; flex-shrink: 0; }
.btn-auth {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 9px 18px;
  border: none;
  border-radius: 999px;
  background: var(--grad);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}
.btn-auth:hover { filter: brightness(1.08); }

.account-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 5px 12px 5px 5px;
  cursor: pointer;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
}
.account-btn:hover { background: rgba(255, 255, 255, 0.16); }
.account-btn .avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--grad);
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.account-btn .chev { font-size: 0.7rem; color: #B9BCE0; }
.account-name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.account-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 210px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(24, 27, 52, 0.24);
  padding: 8px;
  z-index: 130;
}
.account-menu.show { display: block; }
.account-menu .am-email {
  font-size: 0.78rem;
  color: var(--ink-soft);
  padding: 6px 10px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}
.account-menu a, .account-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  border: none;
  background: none;
  border-radius: 7px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}
.account-menu a:hover, .account-menu button:hover { background: var(--grad-soft); }

/* ── Auth: modal ── */
.auth-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 22, 58, 0.62);
  z-index: 200;
  padding: 24px;
  overflow-y: auto;
}
.auth-modal.show { display: grid; place-items: start center; }
.auth-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 26px 70px rgba(20, 22, 58, 0.38);
  width: min(460px, 100%);
  margin-top: 6vh;
  padding: 26px 28px 28px;
  position: relative;
}
.auth-close {
  position: absolute;
  top: 12px; right: 14px;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
}
.auth-close:hover { color: var(--ink); }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.auth-tabs button {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink-soft);
  cursor: pointer;
}
.auth-tabs button.active { background: var(--grad); color: #fff; border-color: transparent; }
.auth-heading { font-size: 1.35rem; margin-bottom: 14px; }
.auth-scope {
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--ink-soft);
  background: var(--grad-soft);
  border-radius: 8px;
  padding: 11px 13px;
  margin-bottom: 16px;
}
.auth-field { display: block; margin-bottom: 13px; }
.auth-field > span {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-bottom: 5px;
}
.auth-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--paper);
  color: var(--ink);
}
.auth-field input:focus { outline: none; border-color: var(--brand); background: var(--card); }

.strength-bar {
  height: 6px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}
.strength-bar span { display: block; height: 100%; width: 0; transition: width 0.18s ease; }
.strength-bar .s0, .strength-bar .s1 { background: var(--bad); }
.strength-bar .s2 { background: var(--highlight); }
.strength-bar .s3 { background: #4C9BF1; }
.strength-bar .s4 { background: var(--good); }
.strength-label { font-size: 0.78rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.policy-list { list-style: none; margin-bottom: 13px; }
.policy-list li { font-size: 0.79rem; line-height: 1.5; padding-left: 18px; position: relative; }
.policy-list li.bad { color: var(--bad); }
.policy-list li.good { color: var(--good); }
.policy-list li.bad::before { content: "•"; position: absolute; left: 4px; }
.policy-list li.good::before { content: "✓"; position: absolute; left: 2px; }

.auth-error {
  background: var(--bad-soft);
  color: var(--bad);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}
.auth-switch { font-size: 0.85rem; color: var(--ink-soft); margin-top: 12px; text-align: center; }
.auth-switch button {
  background: none; border: none; padding: 0;
  color: var(--brand); font-family: var(--font-body);
  font-size: 0.85rem; font-weight: 700; cursor: pointer; text-decoration: underline;
}
/* "Check your inbox" panel + verification page */
.auth-sent { text-align: center; padding: 8px 4px 4px; }
.auth-sent .sent-icon {
  font-size: 2.4rem;
  line-height: 1;
  margin-bottom: 10px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-sent h2 { font-size: 1.3rem; margin-bottom: 10px; }
.auth-sent p { font-size: 0.9rem; color: var(--ink-soft); line-height: 1.6; margin-bottom: 14px; }
.auth-sent .btn { width: auto; }
.sent-dev {
  background: var(--highlight-soft);
  border-radius: 8px;
  padding: 11px 13px;
  font-size: 0.84rem !important;
  color: var(--ink) !important;
  text-align: left;
}
.sent-dev a { color: var(--brand); font-weight: 700; overflow-wrap: anywhere; }
.auth-notice {
  background: var(--grad-soft);
  color: var(--ink);
  font-size: 0.85rem;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}
.verify-note { font-size: 0.85rem; font-weight: 600; margin-top: 10px; }
.verify-note.ok { color: var(--good); }
.verify-note.bad { color: var(--bad); }
.verify-note a { color: var(--brand); font-weight: 700; overflow-wrap: anywhere; }
.verify-card { max-width: 620px; margin-left: auto; margin-right: auto; }
.verify-resend { max-width: 340px; margin: 0 auto; text-align: left; }

.save-note { font-size: 0.85rem; font-weight: 700; }
.save-note.ok { color: var(--good); }
.save-note.bad { color: var(--bad); }

/* ── My Trainings ── */
.mt-count {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  margin: 26px 0 14px;
}
.mt-list { display: grid; gap: 14px; }
.mt-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 5px solid var(--course-color, var(--brand));
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: var(--shadow);
}
.mt-main { flex: 1 1 320px; min-width: 0; }
.mt-meta {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--course-ink);
  font-weight: 700;
}
.mt-name { font-size: 1.2rem; margin: 3px 0 4px; }
.mt-topics { font-size: 0.86rem; color: var(--ink-soft); }
.mt-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mt-actions .btn { width: auto; padding: 9px 16px; font-size: 0.86rem; text-decoration: none; }
.mt-danger { color: var(--bad) !important; border-color: var(--bad) !important; }
.mt-danger:hover { background: var(--bad-soft) !important; }

@media (max-width: 720px) {
  .account-name { display: none; }
  .auth-control { margin-left: auto; }
}

/* ── Site footer ── */
.site-footer {
  background: #14163A;
  color: #C3C6E8;
  border-top: 3px solid transparent;
  background-image: linear-gradient(#14163A, #14163A), var(--grad);
  background-origin: border-box;
  background-clip: padding-box, border-box;
}
.footer-inner {
  max-width: 1480px;
  margin: 0 auto;
  padding: 52px 24px 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 40px;
}
.footer-col-wide { grid-column: span 1; }
@media (min-width: 900px) {
  .footer-inner { grid-template-columns: 1fr 1fr 1.4fr; }
}
.footer-col h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.12);
}
.footer-col p { font-size: 0.88rem; line-height: 1.65; }
.footer-col a { color: #C9A6FF; text-decoration: none; }
.footer-col a:hover { color: #FFFFFF; text-decoration: underline; }

.contact-list { list-style: none; margin-bottom: 14px; }
.contact-list li { margin-bottom: 10px; font-size: 0.88rem; }
.contact-list .c-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #8E92C4;
}
.contact-list .c-value { display: block; color: #E4E6FA; }
.contact-note { font-size: 0.82rem !important; color: #9296C4; font-style: italic; }

#disclaimer p { color: #A8ACD4; font-size: 0.85rem; }

.footer-bar {
  border-top: 1px solid rgba(255, 255, 255, 0.10);
}
.footer-bar > * { max-width: 1480px; }
.footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 1480px;
  margin: 0 auto;
  padding: 20px 24px 30px;
  font-size: 0.83rem;
  color: #8E92C4;
}
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: #8E92C4; text-decoration: none; }
.footer-links a:hover { color: #FFFFFF; }

/* Anchor targets shouldn't hide under the sticky header */
#about-us, #contact-us, #disclaimer { scroll-margin-top: 90px; }

/* ── Print (export as PDF via browser print) ── */
@media print {
  .site-header, .toc, .quiz-actions, .no-print, .site-footer { display: none !important; }
  body { background: #fff; }
  .module { border: none; padding: 0 0 30px; page-break-inside: avoid; box-shadow: none; }
  .training-layout { display: block; }
  .training-summary { box-shadow: none; }
  .hl { color: var(--ink); background: none; }
}

/* ══ 2026 refresh: course tile mosaic ═════════════════════════════
   The catalog is a grid of colored square tiles — one per course —
   with the topic checklist opening in a panel beneath the grid.
   Every tile derives its gradient from the course color.          */

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 16px;
}
.course-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  border: none;
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  text-align: left;
  cursor: pointer;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
  font-family: var(--font-display);
  /* Fallback first, then the layered gradient for browsers with color-mix */
  background: var(--course-color, var(--brand));
  background-image:
    /* Text scrim: the name and tagline sit at the bottom, and the seven
       lightest course colors leave white text under 3:1 without it. */
    linear-gradient(to top, rgba(13, 16, 42, 0.50) 0%, rgba(13, 16, 42, 0.30) 26%, transparent 52%),
    radial-gradient(130% 95% at 88% -12%, rgba(255, 255, 255, 0.30), transparent 55%),
    linear-gradient(152deg,
      color-mix(in srgb, var(--course-color) 86%, #ffffff) 0%,
      var(--course-color) 46%,
      color-mix(in srgb, var(--course-color) 70%, #10133A) 100%);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--course-color) 32%, transparent);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.course-tile:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 16px 36px color-mix(in srgb, var(--course-color) 52%, transparent);
}
.course-tile.active {
  transform: translateY(-2px);
  box-shadow: 0 0 0 3px var(--card), 0 0 0 6px var(--course-color),
              0 14px 32px color-mix(in srgb, var(--course-color) 45%, transparent);
}
.course-tile .tile-glyph {
  position: absolute;
  top: -0.28em;
  right: -0.05em;
  font-size: 5.4rem;
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1;
  color: rgba(255, 255, 255, 0.16);
  pointer-events: none;
  z-index: -1;
}
.course-tile .tile-count {
  position: absolute;
  top: 12px;
  left: 12px;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #fff;
  background: rgba(16, 19, 58, 0.28);
  border-radius: 999px;
  padding: 3px 9px;
}
.course-tile .tile-sel {
  position: absolute;
  top: 12px;
  right: 12px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--course-ink);
  background: #fff;
  border-radius: 999px;
  padding: 3px 9px;
  box-shadow: 0 2px 8px rgba(16, 19, 58, 0.25);
}
.course-tile .tile-name {
  display: block;
  font-size: 1.16rem;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 6px rgba(16, 19, 58, 0.30);
}
.course-tile .tile-tagline {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 5px;
  font-family: var(--font-body);
  font-size: 0.73rem;
  font-weight: 400;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.88);
}

/* ── Topic panel opened by a tile ── */
.course-panels { margin-top: 20px; }
.course-panel {
  display: none;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 14px 38px color-mix(in srgb, var(--course-color) 22%, rgba(24, 27, 52, 0.10));
  border: 1px solid color-mix(in srgb, var(--course-color) 28%, var(--line));
}
.course-panel.open { display: block; animation: panelIn 0.22s ease; }
@keyframes panelIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  color: #fff;
  background: var(--course-color, var(--brand));
  background-image: linear-gradient(120deg,
    color-mix(in srgb, var(--course-color) 88%, #ffffff) 0%,
    var(--course-color) 55%,
    color-mix(in srgb, var(--course-color) 72%, #10133A) 100%);
}
.panel-head .panel-title h2 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.panel-head .tagline { font-size: 0.86rem; color: rgba(255, 255, 255, 0.88); margin-top: 1px; }
.panel-head .count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
  background: rgba(16, 19, 58, 0.26);
  border-radius: 999px;
  padding: 4px 11px;
}
.panel-close {
  border: none;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 0.95rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, transform 0.15s ease;
}
.panel-close:hover { background: rgba(255, 255, 255, 0.32); transform: rotate(90deg); }
.course-panel .topic-list { display: block; border-top: none; }
.course-panel .topic-row:hover {
  background: color-mix(in srgb, var(--course-color) 7%, var(--card));
}
.course-panel .topic-row input[type="checkbox"] { accent-color: var(--course-color); }

/* Tiles pack tighter when the tray shares the row */
@media (max-width: 1100px) {
  .course-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .course-tile .tile-name { font-size: 1.04rem; }
}
@media (max-width: 480px) {
  .course-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .course-tile { border-radius: 16px; padding: 12px; }
  .course-tile .tile-tagline { display: none; }
}

/* ── Home: vivid menu tiles ── */
.menu-card.vivid {
  color: #fff;
  border: none;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--mc, var(--brand)) 35%, transparent);
  background: var(--mc, var(--brand));
  background-image:
    radial-gradient(120% 90% at 85% -10%, rgba(255, 255, 255, 0.26), transparent 55%),
    linear-gradient(150deg,
      color-mix(in srgb, var(--mc, var(--brand)) 86%, #ffffff) 0%,
      var(--mc, var(--brand)) 48%,
      color-mix(in srgb, var(--mc, var(--brand)) 70%, #10133A) 100%);
}
.menu-card.vivid::before { display: none; }
.menu-card.vivid .eyebrow { color: rgba(255, 255, 255, 0.85); }
.menu-card.vivid h2 { color: #fff; }
.menu-card.vivid p { color: rgba(255, 255, 255, 0.90); }
.menu-card.vivid .go {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  color: #fff;
  border-bottom: 2px solid rgba(255, 255, 255, 0.55);
  padding-bottom: 1px;
}
.menu-card.vivid.enabled:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 40px color-mix(in srgb, var(--mc, var(--brand)) 55%, transparent);
}
.menu-card.m1 { --mc: #5B4CF1; }
.menu-card.m2 { --mc: #0CA678; }
.menu-card.m3 { --mc: #F14C8B; }
.menu-card.m4 { --mc: #15AABF; }
.menu-card.m5 { --mc: #F59F00; }

/* ── Home: stats strip ── */
.stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 22px;
  min-width: 150px;
  box-shadow: var(--shadow);
}
.stat .stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.15;
}
.stat .stat-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  font-weight: 700;
}

/* ══ Slim footer + info pages + feedback form ═════════════════════ */

.footer-slim {
  max-width: 1480px;
  margin: 0 auto;
  padding: 26px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  color: #FFFFFF;
}
.footer-brand > span:first-child { color: #C9A6FF; }
.footer-brand .footer-tag {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.84rem;
  color: #8E92C4;
}
.footer-slim .footer-links { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.footer-slim .footer-links a {
  color: #C3C6E8;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
}
.footer-slim .footer-links a:hover { color: #fff; background: rgba(255, 255, 255, 0.10); }
.footer-slim .footer-links a.active { color: #fff; background: rgba(255, 255, 255, 0.14); }
.footer-slim .footer-links a.footer-feedback {
  color: #fff;
  background: var(--grad);
  box-shadow: 0 4px 14px rgba(156, 77, 244, 0.35);
}
.footer-slim .footer-links a.footer-feedback:hover { filter: brightness(1.1); }
.footer-copy { flex-basis: 100%; font-size: 0.8rem; color: #8E92C4; }
@media (min-width: 900px) {
  .footer-copy { flex-basis: auto; margin-left: 24px; }
}

/* ── Info pages (About / Contact / Disclaimer / Feedback) ── */
.info-page { max-width: 880px; }
.info-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 34px;
  margin-top: 26px;
}
.info-card p { margin-bottom: 14px; max-width: 68ch; }
.info-card p:last-child { margin-bottom: 0; }
.info-card a { color: var(--brand); font-weight: 600; }

.contact-cards { list-style: none; display: grid; gap: 14px; margin-bottom: 18px; }
.contact-cards li {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 16px;
}
.contact-cards .c-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-soft);
}
.contact-cards .c-value { font-weight: 700; color: var(--ink); text-decoration: none; }
.contact-cards a.c-value { color: var(--brand); }
.info-card .contact-note { color: var(--ink-soft); font-size: 0.92rem; }

/* ── Feedback form ── */
.fb-row { margin-bottom: 20px; }
.fb-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.fb-label em { font-style: normal; text-transform: none; letter-spacing: 0; font-weight: 400; }

.stars {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 2px;
}
.stars input { position: absolute; opacity: 0; pointer-events: none; }
.stars label {
  font-size: 2.1rem;
  line-height: 1;
  color: #D9DCF2;
  cursor: pointer;
  padding: 2px 4px;
  transition: color 0.12s ease, transform 0.12s ease;
}
.stars label:hover { transform: scale(1.18); }
.stars label:hover, .stars label:hover ~ label,
.stars input:checked ~ label { color: var(--highlight); }
.stars input:focus-visible + label { outline: 3px solid var(--accent); border-radius: 6px; }

.fb-cats { display: flex; gap: 8px; flex-wrap: wrap; }
.fb-cats input { position: absolute; opacity: 0; pointer-events: none; }
.fb-cats label {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.12s ease;
}
.fb-cats label:hover { border-color: var(--brand); color: var(--brand); }
.fb-cats input:checked + label {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(156, 77, 244, 0.30);
}
.fb-cats input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 2px; }

.fb-field { display: block; margin-bottom: 18px; position: relative; }
.fb-field textarea, .fb-field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.95rem;
  resize: vertical;
}
.fb-field textarea:focus, .fb-field input:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--card);
  box-shadow: 0 0 0 3px rgba(91, 76, 241, 0.12);
}
.fb-counter {
  position: absolute;
  right: 4px;
  bottom: -18px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-soft);
}
.fb-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 26px;
}
@media (max-width: 640px) { .fb-grid2 { grid-template-columns: 1fr; } }

.fb-error {
  background: var(--bad-soft);
  color: var(--bad);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
}
.fb-submit { width: auto; padding: 13px 32px; }

.fb-thanks { text-align: center; padding: 20px 0 10px; }
.fb-thanks-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #0CA678, #37B24D);
  box-shadow: 0 10px 26px rgba(12, 166, 120, 0.35);
}
.fb-thanks h2 { font-size: 1.5rem; margin-bottom: 8px; }
.fb-thanks p { color: var(--ink-soft); max-width: 46ch; margin: 0 auto 10px; }
.fb-thanks .fb-back { width: auto; padding: 11px 24px; margin-top: 6px; }

/* ══ Samples page ═════════════════════════════════════════════════ */

.sample-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.sp-chip {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 13px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.sp-chip:hover { color: var(--ink); border-color: var(--course-color); }
.sp-chip.active {
  color: var(--course-ink);
  border-color: var(--course-ink);
  background: color-mix(in srgb, var(--course-color) 12%, transparent);
  cursor: default;
}
.sp-chip:disabled { opacity: 0.55; cursor: progress; }

.spotlight {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  margin-top: 30px;
  padding: 26px 30px;
  border-radius: var(--radius);
  color: #fff;
  background: var(--course-color, var(--brand));
  background-image:
    radial-gradient(120% 120% at 90% -20%, rgba(255, 255, 255, 0.25), transparent 55%),
    linear-gradient(140deg,
      color-mix(in srgb, var(--course-color) 86%, #ffffff) 0%,
      var(--course-color) 48%,
      color-mix(in srgb, var(--course-color) 70%, #10133A) 100%);
  box-shadow: 0 14px 36px color-mix(in srgb, var(--course-color) 38%, transparent);
}
.spot-main { flex: 1 1 420px; min-width: 0; }
.spot-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.85);
}
.spotlight h2 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 6px 0 8px;
}
.spot-intro { font-size: 0.96rem; color: rgba(255, 255, 255, 0.92); max-width: 72ch; }
.spot-meta {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.80);
  margin-top: 10px;
}
.shuffle-btn {
  flex-shrink: 0;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 13px 22px;
  border: 2px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.shuffle-btn:hover { background: rgba(255, 255, 255, 0.28); transform: rotate(-2deg) scale(1.04); }

/* ── The three sample cards ── */
.sample-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 22px;
  align-items: start;
}
@media (max-width: 1080px) { .sample-grid { grid-template-columns: 1fr; } }

.sample-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 5px solid var(--sc, var(--brand));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sc-lesson   { --sc: #5B4CF1; }
.sc-workbook { --sc: #0CA678; }
.sc-timed    { --sc: #F14C8B; }

.sample-tag {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--sc);
  background: color-mix(in srgb, var(--sc) 10%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--sc) 30%, transparent);
  border-radius: 999px;
  padding: 3px 11px;
}
.sample-card h3 { font-size: 1.35rem; font-weight: 800; }
.sample-sub { font-size: 0.88rem; color: var(--ink-soft); }

.mini-defs { display: grid; gap: 8px; }
.mini-def {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.87rem;
}
.mini-def strong { display: block; }
.mini-def span { color: var(--ink-soft); }
.mini-formula {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--sc);
  border-radius: 10px;
  padding: 10px 14px;
  overflow-x: auto;
}
.mini-formula .mf-name {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}
.mini-formula .mf-body { font-family: var(--font-mono); font-size: 0.92rem; }
.mini-example {
  border: 1px dashed color-mix(in srgb, var(--sc) 45%, var(--line));
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.88rem;
}
.mini-example .me-tag {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sc);
  margin-bottom: 6px;
}
.reveal-btn {
  margin-top: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--sc);
  background: none;
  border: 1.5px solid var(--sc);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
}
.reveal-btn:hover { background: color-mix(in srgb, var(--sc) 10%, #ffffff); }
.me-solution { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); color: var(--ink-soft); }

/* ── Live sample questions ── */
.sq {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 15px;
}
.sq-tag {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--sc, var(--brand));
  margin-bottom: 5px;
}
.sq-q { font-weight: 700; font-size: 0.92rem; margin-bottom: 10px; }
.sq-opts { display: grid; gap: 6px; }
.sq-opt {
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.87rem;
  padding: 8px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
  color: var(--ink);
}
.sq-opt:hover:not(:disabled) { border-color: var(--sc, var(--brand)); background: color-mix(in srgb, var(--sc, var(--brand)) 6%, #ffffff); }
.sq-opt:disabled { cursor: default; opacity: 0.75; }
.sq-opt.right { border-color: var(--good); background: var(--good-soft); opacity: 1; font-weight: 700; }
.sq-opt.wrong { border-color: var(--bad); background: var(--bad-soft); opacity: 1; }
.sq-explain {
  margin-top: 10px;
  font-size: 0.83rem;
  color: var(--ink-soft);
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 9px 12px;
}
.sq-verdict { font-weight: 800; }
.sq-verdict.ok { color: var(--good); }
.sq-verdict.no { color: var(--bad); }

/* ── Demo clock ── */
.mock-clock {
  display: flex;
  align-items: baseline;
  gap: 12px;
  background: #14163A;
  border-radius: 10px;
  padding: 12px 18px;
}
.mock-clock-time {
  font-family: var(--font-mono);
  font-size: 1.9rem;
  font-weight: 700;
  color: #FFC94D;
  font-variant-numeric: tabular-nums;
}
.mock-clock-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #8E92C4;
}

.sample-cta { margin-top: auto; width: 100%; font-size: 0.92rem; padding: 12px 16px; }

/* ══ Cart ═════════════════════════════════════════════════════════ */

/* Header cart button */
.cart-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 7px 14px;
  color: #fff;
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 700;
  flex-shrink: 0;
  position: relative;
}
.cart-btn:hover { background: rgba(255, 255, 255, 0.18); }
.cart-btn.active { background: rgba(255, 255, 255, 0.20); }
.cart-btn .cart-ico { font-size: 1rem; line-height: 1; }
.cart-btn .cart-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
}
@media (max-width: 720px) { .cart-btn .cart-label { display: none; } }

/* Tray "Add to cart" button */
.tray .btn-cart { margin-top: 10px; }
.tray .btn-cart.added {
  background: var(--good);
  color: #fff;
  border-color: var(--good);
}

/* Cart page layout */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 28px;
  align-items: start;
  margin-top: 30px;
}
@media (max-width: 940px) { .cart-layout { grid-template-columns: 1fr; } }

.cart-list { display: grid; gap: 12px; }
.cart-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 5px solid var(--ci, var(--brand));
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.ci-training { --ci: #5B4CF1; }
.ci-workbook { --ci: #0CA678; }
.ci-timed    { --ci: #F14C8B; }

.ci-mode {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ci);
  border: 1px solid color-mix(in srgb, var(--ci) 45%, transparent);
  background: color-mix(in srgb, var(--ci) 8%, #ffffff);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
  flex-shrink: 0;
}
.ci-main { flex: 1; min-width: 0; }
.ci-name { display: block; font-weight: 700; font-size: 1.02rem; }
.ci-topics {
  display: block;
  font-size: 0.82rem;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ci-preview { font-size: 0.8rem; font-weight: 700; color: var(--brand); text-decoration: none; }
.ci-preview:hover { text-decoration: underline; }
.ci-unit {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-soft);
  white-space: nowrap;
}
.ci-price {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  white-space: nowrap;
}
.ci-remove {
  border: none;
  background: var(--paper);
  color: var(--ink-soft);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: all 0.13s ease;
}
.ci-remove:hover { background: var(--bad-soft); color: var(--bad); }

@media (max-width: 640px) {
  .cart-item { flex-wrap: wrap; }
  .ci-unit { order: 5; }
}

/* Summary card */
.cart-summary {
  position: sticky;
  top: 92px;
  background: linear-gradient(var(--card), var(--card)) padding-box, var(--grad) border-box;
  border: 2px solid transparent;
  border-radius: var(--radius);
  box-shadow: var(--shadow-brand);
  padding: 22px 24px;
}
.cart-summary h2 { font-size: 1.25rem; margin-bottom: 14px; }
.cs-lines { margin-bottom: 16px; }
.cs-lines div {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.93rem;
  color: var(--ink-soft);
}
.cs-lines .cs-total {
  border-bottom: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--ink);
}
.cs-checkout { margin-bottom: 10px; }
.cs-clear { font-size: 0.88rem; padding: 10px 16px; }
.cs-note {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
  line-height: 1.55;
}

/* Empty state */
.cart-empty {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  padding: 60px 30px;
  margin-top: 30px;
}
.cart-empty-icon { font-size: 3rem; margin-bottom: 12px; }
.cart-empty h2 { font-size: 1.5rem; margin-bottom: 8px; }
.cart-empty p { color: var(--ink-soft); margin-bottom: 22px; }
.cart-empty-links { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.cart-empty-links .btn { width: auto; padding: 11px 22px; }

/* "Coming soon" checkout modal */
.soon-modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 22, 58, 0.62);
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
}
.soon-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 26px 70px rgba(20, 22, 58, 0.38);
  width: min(440px, 100%);
  padding: 34px 32px;
  text-align: center;
}
.soon-icon { font-size: 2.6rem; margin-bottom: 10px; }
.soon-card h2 { font-size: 1.45rem; margin-bottom: 10px; }
.soon-card p { color: var(--ink-soft); font-size: 0.94rem; margin-bottom: 20px; }
.soon-ok { width: auto; padding: 11px 30px; }

/* ══ Paywall lock screen ══════════════════════════════════════════ */
.lock-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  padding: 60px 34px;
  margin: 60px auto 0;
  max-width: 640px;
}
.lock-icon { font-size: 3rem; margin-bottom: 12px; }
.lock-card h2 { font-size: 1.6rem; margin-bottom: 12px; }
.lock-card p { color: var(--ink-soft); margin-bottom: 12px; }
.lock-card p strong { color: var(--ink); }
.lock-card a { color: var(--brand); font-weight: 600; }
.lock-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.lock-actions .btn { width: auto; padding: 12px 24px; color: #fff; }
.lock-actions .btn-secondary { color: var(--brand); }


/* Clear-all control in the selection tray */
.tray-clear {
  display: block;
  margin: -6px 0 10px;
  padding: 0;
  border: none;
  background: none;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.tray-clear:hover { color: var(--bad); }


/* Labeled Delete button on cart items (was a bare circle) */
.ci-remove {
  width: auto;
  height: auto;
  border-radius: 999px;
  padding: 6px 14px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

/* Per-topic remove in the selection tray */
.tray ol li { position: relative; }
.tray-remove {
  border: none;
  background: none;
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1;
  padding: 3px 5px;
  margin-left: 4px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
}
.tray-remove:hover { background: var(--bad-soft); color: var(--bad); }


/* ── My Trainings: tabs + order history ── */
.mt-tabs { display: flex; gap: 8px; margin-top: 26px; border-bottom: 2px solid var(--line); }
.mt-tab {
  border: none;
  background: none;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--ink-soft);
  padding: 10px 18px 12px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}
.mt-tab:hover { color: var(--ink); }
.mt-tab.active { color: var(--ink); border-bottom-color: var(--brand); }

.order-card { border-left-color: var(--brand); }
.oc-status {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 11px;
  border-radius: 999px;
  vertical-align: 3px;
  margin-left: 8px;
}
.oc-status.paid { background: var(--good-soft); color: var(--good); }
.oc-status.pending { background: var(--highlight-soft); color: #8a6100; }
.oc-status.cancelled { background: var(--bad-soft); color: var(--bad); }
.oc-items { list-style: none; margin: 8px 0 4px; display: grid; gap: 5px; }
.oc-items li { font-size: 0.9rem; color: var(--ink); display: flex; align-items: baseline; gap: 8px; }
.oc-mode {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--brand);
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 1px 8px;
  white-space: nowrap;
}
.oc-price { margin-left: auto; font-weight: 700; }
.oc-note { font-size: 0.82rem; color: var(--ink-soft); margin-top: 8px; font-style: italic; }
.oc-note.ok { color: var(--good); font-style: normal; }


/* Open link on paid order items */
.oc-open { font-size: 0.82rem; font-weight: 700; color: var(--brand); text-decoration: none; white-space: nowrap; }
.oc-open:hover { text-decoration: underline; }


/* ══ Pricing page ═════════════════════════════════════════════════ */
.price-section {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 40px 0 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.pc-flag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--good);
  background: var(--good-soft);
  border-radius: 999px;
  padding: 4px 12px;
}
.price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.price-grid-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.price-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 5px solid var(--pc, var(--brand));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pc-training { --pc: #5B4CF1; }
.pc-workbook { --pc: #0CA678; }
.pc-timed    { --pc: #F14C8B; }
.pc-bundle   { --pc: #F59F00; background: linear-gradient(var(--card), var(--card)) padding-box, var(--grad) border-box; border: 2px solid transparent; border-top-width: 2px; }
.pc-icon { font-size: 2rem; line-height: 1; }
.price-card h3 { font-size: 1.3rem; font-weight: 800; }
.pc-price {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.1;
}
.pc-per { font-size: 1rem; color: var(--ink-soft); -webkit-text-fill-color: var(--ink-soft); margin-left: 6px; font-weight: 600; }
.price-card p { font-size: 0.92rem; color: var(--ink-soft); }
.pc-hint { font-size: 0.82rem !important; font-style: italic; }
.pc-badge {
  position: absolute;
  top: -12px;
  right: 16px;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
  background: var(--grad);
  border-radius: 999px;
  padding: 4px 12px;
  box-shadow: 0 4px 12px rgba(156, 77, 244, 0.35);
}
.pc-cta { margin-top: auto; width: 100%; font-size: 0.92rem; padding: 12px 16px; }
.price-foot { margin-top: 34px; color: var(--ink-soft); }
.price-foot a { color: var(--brand); font-weight: 700; }

/* Bundle flag on cart items + discount line in summary */
.ci-bundle { display: block; font-size: 0.8rem; font-weight: 700; color: var(--good); }
.cs-lines .cs-discount dd { color: var(--good); font-weight: 700; }


/* Question issue-report flag (appears with the explanation) */
.q-report {
  display: block;
  margin-top: 8px;
  border: none;
  background: none;
  padding: 0;
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.q-report:hover:not(:disabled) { color: var(--bad); }
.q-report:disabled { color: var(--good); text-decoration: none; cursor: default; }


/* ══ Checkout receipt — deliberately monochrome ═══════════════════ */
.receipt-page main.page { max-width: 720px; }
.receipt-wrap { padding-top: 10px; }
.receipt {
  position: relative;
  background: #ffffff;
  color: #111111;
  padding: 46px 44px 40px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.10);
  border-radius: 2px;
}
/* Scalloped receipt edge */
.receipt::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: -9px;
  height: 18px;
  background: radial-gradient(circle at 9px 0px, transparent 8px, #ffffff 9px);
  background-size: 18px 18px;
  background-position: 0 9px;
}
.r-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  color: #111;
  margin-bottom: 30px;
}
.r-table { width: 100%; border-collapse: collapse; }
.r-table th {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  color: #111;
  padding: 0 0 12px;
  border-bottom: 2px solid #111;
}
.r-table th.r-num, .r-table td.r-num { text-align: right; white-space: nowrap; }
.r-table td { padding: 16px 0; border-bottom: 1px solid #e5e5e5; vertical-align: top; }
.r-item-name { display: block; font-weight: 700; color: #111; }
.r-item-meta { display: block; font-size: 0.82rem; color: #666; margin-top: 2px; }
.r-totals { margin-top: 6px; }
.r-totals div {
  display: flex;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid #e5e5e5;
  font-size: 0.95rem;
  color: #111;
}
.r-totals dt { font-weight: 700; }
.r-totals .r-grand { border-bottom: 3px double #111; font-size: 1.15rem; }
.r-totals .r-grand dd { font-weight: 800; }
.r-note {
  margin-top: 18px;
  font-size: 0.88rem;
  color: #111;
  background: #f4f4f4;
  border-left: 3px solid #111;
  padding: 10px 14px;
}
.r-note.ok { border-left-color: #444; }
.r-empty { text-align: center; color: #666; padding: 20px 0 8px; }
.r-actions { display: flex; align-items: center; gap: 20px; margin-top: 26px; flex-wrap: wrap; }
.r-btn {
  display: inline-block;
  background: #111111;
  color: #ffffff;
  border: none;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  padding: 14px 30px;
  cursor: pointer;
  text-decoration: none;
  border-radius: 2px;
}
.r-btn:hover:not(:disabled) { background: #333; }
.r-btn:disabled { background: #999; cursor: default; }
.r-back { color: #666; font-size: 0.9rem; text-decoration: underline; text-underline-offset: 3px; }
.r-back:hover { color: #111; }
.r-confirm { margin-top: 26px; border-top: 2px solid #111; padding-top: 22px; text-align: center; }
.r-stamp {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.2em;
  font-size: 0.9rem;
  color: #111;
  border: 3px double #111;
  padding: 8px 22px;
  transform: rotate(-2deg);
  margin-bottom: 14px;
}
.r-confirm-line { font-size: 1rem; color: #111; }
.r-confirm-sub { font-size: 0.86rem; color: #666; max-width: 46ch; margin: 8px auto 0; }
.r-confirm .r-actions { justify-content: center; }
@media (max-width: 560px) { .receipt { padding: 36px 22px 30px; } }

/* ── Unlimited subscription (pricing card, cart chip, orders banner) ── */
.price-grid-1 { grid-template-columns: minmax(280px, 760px); justify-content: center; }
.pc-unlimited {
  --pc: #181B34;
  background: #181B34;
  border-top: 5px solid #181B34;
}
.pc-unlimited h3 { color: #fff; }
.pc-unlimited p { color: rgba(255, 255, 255, 0.75); }
.pc-unlimited .pc-price {
  background: linear-gradient(90deg, #9BE8FF, #C3B5FF, #FFD3E8);
  -webkit-background-clip: text;
  background-clip: text;
}
.pc-unlimited .pc-per { color: rgba(255, 255, 255, 0.6); -webkit-text-fill-color: rgba(255, 255, 255, 0.6); }

.ci-sub { --ci: #181B34; }

.mt-subbanner {
  margin: 0 0 18px;
  padding: 14px 20px;
  border-radius: var(--radius);
  background: #181B34;
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.5;
}
.mt-subbanner strong { color: #fff; }

/* Button-styled links inside cards must keep the button's white text —
   the card-scoped link colors above are for inline text links only. */
.error-card a.btn, .info-card a.btn, .lock-card a.btn { color: #fff; }
.error-card a.btn-secondary, .info-card a.btn-secondary, .lock-card a.btn-secondary { color: var(--brand); }

/* Legal/info pages: section headings inside the card */
.info-card h2 { font-size: 1.12rem; font-weight: 800; margin: 26px 0 8px; }
.info-card h2:first-child { margin-top: 0; }
.info-card code { font-family: var(--font-mono); font-size: 0.85em; background: var(--grad-soft); padding: 1px 6px; border-radius: 6px; }

/* Search deep-link: the row the visitor searched for, briefly lit */
.topic-row.row-flash { animation: rowFlash 2.4s ease-out; }
@keyframes rowFlash {
  0%, 40% { background: var(--grad-soft); box-shadow: inset 3px 0 0 var(--brand); }
  100% { background: transparent; box-shadow: none; }
}

/* ── Full search-results page (search.html) ── */
.sp-group {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 5px solid var(--course-color, var(--brand));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 0 0 18px;
  padding: 6px 22px 10px;
}
.sp-course {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 800;
  margin: 14px 0 6px;
}
.sp-dot {
  width: 12px; height: 12px; border-radius: 4px;
  background: var(--course-color, var(--brand));
  flex: none;
}
.sp-course-n {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--ink-soft);
  margin-left: auto;
}
.sp-row { cursor: pointer; }

/* Sticky action bar: selection count, add-to-cart, close */
.sp-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px clamp(16px, 4vw, 48px);
  background: var(--card);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(24, 27, 52, 0.08);
}
.sp-bar-info { font-weight: 700; margin-right: auto; }
.sp-bar .btn { width: auto; }
body:has(.sp-bar:not([hidden])) main.page { padding-bottom: 90px; }

/* "See all results" row at the bottom of the header search dropdown */
.search-all {
  display: block;
  padding: 11px 16px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--brand);
  text-decoration: none;
  border-top: 1px solid var(--line);
  background: var(--grad-soft);
}
.search-all:hover { filter: brightness(0.97); }
.search-all kbd {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
  margin-left: 6px;
  background: var(--card);
}

/* Subject advisory on runner pages (law/tax/medical caveats) */
.subject-notice {
  margin: 12px 0 0;
  padding: 11px 14px;
  border-left: 4px solid var(--warn, #F59F00);
  border-radius: 8px;
  background: rgba(245, 159, 0, 0.09);
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--ink-soft);
}
.subject-notice strong { color: var(--ink); }
.subject-notice a { color: var(--brand); font-weight: 700; white-space: nowrap; }

/* ── Figure vocabulary (shared by all course diagrams) ──
   Diagrams are inline SVG using these classes so they inherit the
   palette and the per-course accent (--course-color) automatically.
   Arrowheads are drawn as <polygon class="head">, never as markers —
   marker ids would collide between figures on the same page. */
.fig-svg .grid        { stroke: var(--line); stroke-width: 1; }
.fig-svg .bar         { fill: var(--course-color, var(--brand)); fill-opacity: 0.75; }
.fig-svg .bar-alt     { fill: var(--accent); fill-opacity: 0.55; }
.fig-svg .bar-mute    { fill: var(--ink-soft); fill-opacity: 0.28; }
.fig-svg .box         { fill: var(--card); stroke: var(--ink-soft); stroke-width: 1.5; }
.fig-svg .box-fill    { fill: var(--highlight-soft); stroke: var(--course-color, var(--brand)); stroke-width: 2; }
.fig-svg .box-good    { fill: var(--good-soft); stroke: var(--good); stroke-width: 1.75; }
.fig-svg .box-bad     { fill: var(--bad-soft); stroke: var(--bad); stroke-width: 1.75; }
.fig-svg .arrow       { stroke: var(--ink-soft); stroke-width: 2; fill: none; }
.fig-svg .arrow-strong{ stroke: var(--ink); stroke-width: 2.5; fill: none; }
.fig-svg .head        { fill: var(--ink-soft); }
.fig-svg .head-strong { fill: var(--ink); }
.fig-svg .dashed      { stroke: var(--ink-soft); stroke-width: 1.5; stroke-dasharray: 5 4; fill: none; }
.fig-svg .node        { fill: var(--card); stroke: var(--course-color, var(--brand)); stroke-width: 2; }
.fig-svg .node-fill   { fill: var(--course-color, var(--brand)); }
.fig-svg .edge        { stroke: var(--ink-soft); stroke-width: 1.75; fill: none; }
.fig-svg .region-a    { fill: var(--course-color, var(--brand)); fill-opacity: 0.22; stroke: var(--course-color, var(--brand)); stroke-width: 2; }
.fig-svg .region-b    { fill: var(--accent); fill-opacity: 0.20; stroke: var(--accent); stroke-width: 2; }
.fig-svg .good        { stroke: var(--good); stroke-width: 2.5; fill: none; }
.fig-svg .bad         { stroke: var(--bad); stroke-width: 2.5; fill: none; }
.fig-svg .flabel.mono { font-family: var(--font-mono); font-size: 12px; }
.fig-svg .flabel.tiny { font-size: 11px; }
.fig-svg .flabel.good { fill: var(--good); font-weight: 700; }
.fig-svg .flabel.bad  { fill: var(--bad); font-weight: 700; }
