/* ============================================================
   AI Learning Ground — design system
   Dark theme default, light via [data-theme="light"].
   ============================================================ */

:root {
  --bg: #0b0f1a;
  --bg-soft: #0e1322;
  --surface: #151a2b;
  --surface-2: #1c2338;
  --surface-3: #232c46;
  --border: #262f4a;
  --border-strong: #33406366;
  --text: #e7eaf4;
  --text-dim: #97a1bc;
  /* Was #6b7692: 3.4:1 on --surface-2, i.e. under AA for the 11–13px labels it
     is used on. Raised until every surface in this theme clears 4.5:1. */
  --text-faint: #8b95ad;

  --accent: #6366f1;
  --accent-2: #a855f7;
  --accent-soft: rgba(99, 102, 241, 0.16);
  --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #a855f7 100%);

  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.15);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.15);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.15);
  --blue: #38bdf8;
  --blue-soft: rgba(56, 189, 248, 0.15);

  /* ---- readable-on-background variants ----
     The hues above are chosen to look right as a fill, a border or a progress
     bar. As *text* several of them failed AA — --accent as a link on --bg was
     4.28:1, --red on --red-soft 3.97:1, and in the light theme --green on
     --green-soft was 2.1:1, which is a difficulty badge nobody can read. Fills
     keep the original hue; anything that is text uses one of these. */
  --accent-text: #9ca0f9;
  --green-text: #4ade80;
  --amber-text: #fbbf24;
  --red-text: #f87171;
  --blue-text: #7dd3fc;
  --accent-2-text: #c084fc;

  /* ---- type scale ----
     One ramp, 15px body, roughly a 1.15–1.25 step. Everything in the app picks
     a rung from this list; nothing invents a size. The two smallest rungs are
     for labels that sit beside a number, never for prose. */
  --fs-2xs: 11px;   /* counts inside chips, unit suffixes */
  --fs-xs: 12px;    /* eyebrows, badges, uppercase labels */
  --fs-sm: 13px;    /* meta lines, captions, chips */
  --fs-md: 14px;    /* secondary body, buttons, list rows */
  --fs-base: 15px;  /* body */
  --fs-lg: 17px;    /* card and section headings */
  --fs-xl: 20px;    /* screen titles */
  --fs-2xl: 25px;   /* screen hero heading */
  --fs-3xl: 30px;   /* stat figures */

  --lh-tight: 1.2;   /* display figures */
  --lh-snug: 1.3;    /* headings */
  --lh-base: 1.55;   /* prose */

  --fw-med: 500;
  --fw-semi: 600;
  --fw-bold: 700;
  --ls-caps: 0.08em;   /* uppercase eyebrows only */
  --ls-tight: -0.015em;

  /* Comfortable line length. Prose that runs the full width of a 1440px
     window is unreadable however pretty the type is. */
  --measure: 66ch;
  --measure-narrow: 52ch;

  /* ---- spacing rhythm ----
     A 4px base. Gaps, padding and margins come from here so vertical rhythm is
     a decision made once rather than re-guessed per component. */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 28px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 8px 24px rgba(0, 0, 0, 0.25);
  --shadow-lift: 0 4px 12px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.35);
  --sidebar-w: 232px;
  /* Height of the sticky topbar: 14px padding + a 34px control + 14px + the
     1px rule. Anything else that sticks (the Topics category headings) offsets
     by this so it lands under the bar rather than behind it. */
  --topbar-h: 63px;
  --speed: 150ms;

  --heat-0: #1b2236;
  --heat-1: #3b3a86;
  --heat-2: #5b52c9;
  --heat-3: #8168ee;
  --heat-4: #b18cff;

  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f3f5fb;
  --bg-soft: #eceff8;
  --surface: #ffffff;
  --surface-2: #f2f4fb;
  --surface-3: #e8ebf6;
  --border: #e2e6f2;
  --border-strong: #cdd4e6;
  --text: #1b2237;
  --text-dim: #5a6480;
  /* Was #8b94ad — 2.75:1 on --surface-2. */
  --text-faint: #5f677f;
  --accent-soft: rgba(99, 102, 241, 0.1);
  --accent-text: #4338ca;
  --green-text: #116632;
  --amber-text: #8a3d0b;
  --red-text: #b01717;
  --blue-text: #0b6f9c;
  --accent-2-text: #7e22ce;
  --shadow: 0 1px 2px rgba(23, 30, 60, 0.06), 0 8px 24px rgba(23, 30, 60, 0.07);
  --shadow-lift: 0 4px 12px rgba(23, 30, 60, 0.1), 0 14px 34px rgba(23, 30, 60, 0.12);
  --heat-0: #e5e9f4;
  --heat-1: #c7c5f4;
  --heat-2: #a29bee;
  --heat-3: #8172e6;
  --heat-4: #6350dd;
  color-scheme: light;
}

/* ---------------- base ---------------- */

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(139, 92, 246, 0.14), transparent 60%),
    radial-gradient(900px 420px at -10% 20%, rgba(56, 189, 248, 0.07), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  margin: 0 0 0.4em;
  line-height: var(--lh-snug);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
}
p { margin: 0 0 0.7em; }

/* ---- icons ----
   Every Icon() from public/js/views/icons.js carries `.ico`. An inline <svg>
   sits on the text baseline by default, which drops it below the x-height and
   is most of what made icon+label pairs look badly kerned. One rule fixes it
   everywhere; inside a flex row the vertical-align is ignored and `flex: none`
   stops the glyph being squashed by a long label. */
.ico {
  vertical-align: -0.16em;
  flex: none;
  color: inherit;
}

/* An icon immediately followed by its label. The gap belongs to the icon so
   callers can concatenate `Icon(...) + 'Label'` without a stray space. */
.btn > .ico:not(:only-child),
.badge > .ico:not(:only-child),
.chip > .ico:not(:only-child),
.status > .ico:not(:only-child),
.meta-ico > .ico:first-child { margin-right: 6px; }
.btn > .ico:last-child:not(:only-child) { margin-right: 0; margin-left: 6px; }

/* A number-plus-unit meta line: "35 min", "4 sections". */
.meta-ico { display: inline-flex; align-items: center; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: none;
  border: none;
}

::selection { background: var(--accent-soft); }

/* ---------------- layout ---------------- */

.app { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(14px);
  border-right: 1px solid var(--border);
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 18px;
  color: var(--text);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand-logo {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 45%, transparent);
}

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--text-dim);
  font-weight: 500;
  transition: background var(--speed) ease, color var(--speed) ease;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link.active {
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--accent);
}
.nav-link.active .nav-ico { color: var(--accent-text); }
.nav-ico { width: 19px; height: 19px; flex: none; }

.sidebar-foot { padding: 10px 12px 2px; }
.sidebar-foot-text { font-size: 12px; color: var(--text-faint); }

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 28px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.page-title { font-size: 20px; margin: 0; letter-spacing: -0.015em; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform var(--speed) ease;
}
.pill:hover { text-decoration: none; transform: translateY(-1px); }
.pill b { color: var(--text); }
.pill-accent { background: var(--accent-soft); border-color: transparent; color: var(--text); }
.pill-flame { filter: grayscale(1); opacity: 0.75; }
.pill-flame.lit { filter: none; opacity: 1; }

.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 3px 10px color-mix(in srgb, var(--accent) 40%, transparent);
}

.view {
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 26px 28px 90px;
  outline: none;
}
.view-intro { margin-bottom: 14px; }

/* ---------------- generic components ---------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform var(--speed) ease, box-shadow var(--speed) ease,
    border-color var(--speed) ease;
}

.panel { padding: 20px 22px; margin-bottom: 18px; }
.panel-plain { margin-bottom: 18px; }
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-head h2 { font-size: 17px; margin: 0; }
.link-dim { font-size: 13px; color: var(--text-dim); }
.link-dim:hover { color: var(--accent-text); }

.grid.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  transition: transform var(--speed) ease, box-shadow var(--speed) ease,
    background var(--speed) ease, opacity var(--speed) ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-primary {
  background: var(--btn-fill, var(--gradient));
  color: var(--on-btn, #fff);
  box-shadow: 0 4px 14px var(--btn-glow, rgba(14, 124, 134, 0.3));
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 6px 20px var(--btn-glow, rgba(14, 124, 134, 0.45)); }
.btn-ghost {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); }
/* Destructive action (Settings > Delete account). Outlined so it never
   competes with the primary button; red text passes 4.5:1 in both themes. */
.btn-danger {
  background: transparent;
  border-color: var(--red-text, var(--red));
  color: var(--red-text, var(--red));
}
.btn-danger:hover:not(:disabled) { background: var(--red-soft); }
.btn-danger:disabled { opacity: .55; cursor: not-allowed; }
.danger-zone { border-color: color-mix(in srgb, var(--red) 35%, var(--border)); }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  color: var(--text-dim);
  border: 1px solid transparent;
  transition: background var(--speed) ease, color var(--speed) ease,
    transform var(--speed) ease;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); transform: translateY(-1px); }

#theme-btn { border: 1px solid var(--border); background: var(--surface); }
[data-theme="light"] .ico-moon { display: block; }
[data-theme="light"] .ico-sun { display: none; }
.ico-moon { display: none; }
.ico-sun { display: block; }

.input {
  width: 100%;
  padding: 10px 14px;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color var(--speed) ease, box-shadow var(--speed) ease;
}
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input::placeholder { color: var(--text-faint); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.badge-green { background: var(--green-soft); color: var(--green-text); }
.badge-amber { background: var(--amber-soft); color: var(--amber-text); }
.badge-red { background: var(--red-soft); color: var(--red-text); }
.badge-blue { background: var(--blue-soft); color: var(--blue-text); }
.badge-muted { background: var(--surface-2); color: var(--text-dim); }

.status { font-size: 12px; font-weight: 600; }
.status-completed { color: var(--green-text); }
.status-progress { color: var(--amber-text); }
.status-none { color: var(--text-faint); }
.status.big { font-size: 14px; padding: 8px 4px; }

.meta-dim { color: var(--text-dim); font-size: 13px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: all var(--speed) ease;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); }
.chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text);
  font-weight: 600;
}
.chip-static { cursor: default; }
.chip-static:hover { transform: none; }
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; }

.chip-diff.diff-beginner.active { background: var(--green-soft); border-color: var(--green); }
.chip-diff.diff-intermediate.active { background: var(--amber-soft); border-color: var(--amber); }
.chip-diff.diff-advanced.active { background: var(--red-soft); border-color: var(--red); }

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--gradient);
  transition: width 400ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------------- toasts ---------------- */

.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 200;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 220px;
  max-width: 340px;
  padding: 12px 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  box-shadow: var(--shadow-lift);
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 250ms ease, transform 250ms cubic-bezier(0.22, 1, 0.36, 1);
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast-error { border-color: var(--red); }

.toast-xp {
  background: var(--gradient);
  border: none;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 8px 28px color-mix(in srgb, var(--accent) 55%, transparent);
}
.toast-xp .xp-label { font-weight: 400; opacity: 0.9; font-size: 13px; }
.xp-sparkle { animation: sparkle 1.2s ease infinite; display: inline-block; }
@keyframes sparkle {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.35) rotate(12deg); }
}

/* ---------------- skeletons / empty / boot ---------------- */

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton-card { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.sk-line { height: 13px; }
.w30 { width: 30%; } .w40 { width: 40%; } .w60 { width: 60%; } .w80 { width: 80%; }

.boot-loading { text-align: center; padding: 30px 0 20px; color: var(--text-dim); }
.boot-logo {
  font-size: 34px;
  animation: pulse 1.2s ease-in-out infinite;
  display: inline-block;
}
@keyframes pulse { 50% { transform: scale(1.2); opacity: 0.7; } }

.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-dim);
}
.empty-state h3 { color: var(--text); font-size: 18px; }
.empty-state .btn { margin-top: 12px; }
/* Holds an inline SVG now, not a 42px emoji: a tile with the glyph centred
   in it, so the empty state's vertical rhythm does not depend on a font. */
.empty-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto var(--sp-3);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-dim);
}
.retry-screen { max-width: 420px; margin: 40px auto; }

/* ---------------- modal ---------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 7, 16, 0.66);
  backdrop-filter: blur(4px);
  animation: fadeIn 180ms ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: var(--shadow-lift);
  animation: popIn 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
body.modal-open { overflow: hidden; }

/* ---------------- dashboard ---------------- */

.greeting { font-size: 21px; margin-bottom: 16px; letter-spacing: -0.01em; }
.greeting b { font-weight: 700; }

.due-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  margin-bottom: 18px;
  border-radius: var(--radius);
  background: linear-gradient(120deg, var(--accent-soft), rgba(168, 85, 247, 0.12));
  border: 1px solid var(--accent);
  color: var(--text);
  transition: transform var(--speed) ease, box-shadow var(--speed) ease;
}
.due-banner:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); }
.due-icon { display: inline-flex; flex: none; color: var(--accent-text); }
.due-cta { margin-left: auto; font-weight: 700; color: var(--accent-text); white-space: nowrap; }

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.kpi { display: flex; gap: 14px; align-items: center; padding: 18px; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.kpi-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: none;
  font-size: 22px;
  border-radius: 12px;
  background: var(--surface-2);
}
.kpi-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.kpi-value { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
.kpi-label { font-size: 12.5px; color: var(--text-dim); }
.kpi .progress-track { margin-top: 6px; }
.kpi-streak .flame { filter: grayscale(1); opacity: 0.6; }
.kpi-streak.lit .flame {
  filter: none;
  opacity: 1;
  background: var(--amber-soft);
  animation: flicker 1.6s ease-in-out infinite;
}
@keyframes flicker { 50% { transform: scale(1.08) rotate(-3deg); } }

.dash-grid {
  display: grid;
  grid-template-columns: minmax(300px, 5fr) minmax(300px, 7fr);
  gap: 18px;
  align-items: stretch;
}
.dash-grid .panel { margin-bottom: 18px; }

.rings-row {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 12px;
  padding: 6px 0;
}
.goal-ring { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ring-bg { fill: none; stroke: var(--surface-3); stroke-width: 10; }
.ring-fg {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dasharray 600ms cubic-bezier(0.22, 1, 0.36, 1);
}
.ring-value { fill: var(--text); font-size: 20px; font-weight: 800; }
.ring-sub { fill: var(--text-dim); font-size: 11px; }
.goal-ring-label {
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  flex-direction: column;
}
.goal-ring-label span { font-weight: 400; font-size: 12px; color: var(--text-dim); }

.heatmap {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 5px;
  margin-bottom: 10px;
}
.heat-cell {
  aspect-ratio: 1;
  border-radius: 5px;
  background: var(--heat-0);
  transition: transform var(--speed) ease;
  min-width: 14px;
}
.heat-cell:hover { transform: scale(1.15); }
.heat-cell.l1 { background: var(--heat-1); }
.heat-cell.l2 { background: var(--heat-2); }
.heat-cell.l3 { background: var(--heat-3); }
.heat-cell.l4 { background: var(--heat-4); }
.heat-legend {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
}
.heat-legend .heat-cell { width: 13px; min-width: 13px; height: 13px; flex: none; }
.heat-legend .heat-cell:hover { transform: none; }

.cat-bar-row {
  display: grid;
  grid-template-columns: minmax(140px, 210px) 1fr 52px;
  align-items: center;
  gap: 14px;
  padding: 7px 0;
}
.cat-bar-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-bar-count { font-size: 12.5px; color: var(--text-dim); text-align: right; }

.continue-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px;
  margin-bottom: 18px;
  background:
    radial-gradient(500px 200px at 100% 0%, rgba(168, 85, 247, 0.15), transparent 60%),
    var(--surface);
}
.continue-card:hover { box-shadow: var(--shadow-lift); }
.continue-kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-text);
  margin-bottom: 6px;
}
.continue-info h2 { font-size: 19px; }
.continue-info p { color: var(--text-dim); max-width: 52ch; }

/* ============================================================
   TOPICS
   158 items. The job of this screen is to get a learner to one of them, so
   everything above the results is a narrowing tool and everything below is
   scannable at a glance. Three chip rows is already a lot of furniture, so
   they are ordered widest-to-narrowest (track, then area) and carry no
   background of their own — the hairline under the bar is the only edge.
   ============================================================ */

.topics-view { display: flex; flex-direction: column; }

.filters-bar {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: 0 0 var(--sp-4);
  margin-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border);
}
/* Search and level sit on one line: they are the two filters a learner reaches
   for first and they are both small. */
.filters-primary {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
}
.filters-primary .search-wrap { flex: 1 1 320px; }
.chips-diff { flex: none; }

.results-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-bottom: var(--sp-5);
}
.results-count {
  font-size: var(--fs-md);
  font-weight: var(--fw-semi);
  font-variant-numeric: tabular-nums;
}

/* Category sections. The heading sticks under the topbar so scrolling 158
   cards always answers "which area am I in?" without a second navigation. */
.topic-section + .topic-section { margin-top: var(--sp-8); }
.topic-section-head {
  position: sticky;
  top: var(--topbar-h);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin: 0 0 var(--sp-4);
  padding: var(--sp-2) 0;
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  color: var(--text-dim);
  /* Matched to the topbar rather than a flat --bg fill: the page background is
     a gradient, so an opaque band would read as a seam. */
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topic-section-head .ico { color: var(--text-faint); }
.topic-section-meta {
  margin-left: auto;
  text-transform: none;
  letter-spacing: 0;
  font-weight: var(--fw-med);
  font-variant-numeric: tabular-nums;
}

.search-wrap { position: relative; max-width: 460px; }
.search-ico {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
}
.search-input { padding-left: 40px; }

.topic-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-4);
  cursor: pointer;
}
/* A 3px lift plus a heavy shadow on every one of 158 cards made the grid
   twitch under the cursor. One step, one border. */
.topic-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  border-color: var(--border-strong);
}
.topic-card-top { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-2); }
.topic-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-text);
}
.topic-icon svg { width: 20px; height: 20px; }
.topic-card-title { font-size: var(--fs-base); margin: 0; line-height: var(--lh-snug); }
.topic-card-title a { color: var(--text); }
.topic-card-title a:hover { color: var(--accent-text); text-decoration: none; }
.topic-card-summary {
  color: var(--text-dim);
  font-size: var(--fs-sm);
  line-height: 1.45;
  margin: 0;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.topic-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-3);
  margin-top: var(--sp-1);
}
.bookmark-btn.active { color: var(--amber-text); }
.bookmark-btn:hover { color: var(--amber-text); }

/* ---------------- topic detail ---------------- */

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.crumb-current { color: var(--text); font-weight: 600; }

.topic-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  padding: 22px 24px;
  margin-bottom: 18px;
}
.topic-header h2 { font-size: 22px; letter-spacing: -0.015em; }
.topic-summary { color: var(--text-dim); max-width: 62ch; }
.action-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }

.prose { max-width: 72ch; }
.prose h2 { font-size: 18px; margin-top: 1.2em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 15.5px; margin-top: 1em; }
.prose p { margin-bottom: 0.85em; }
.prose ul { margin: 0 0 0.9em; padding-left: 22px; }
.prose li { margin-bottom: 0.3em; }
.prose code {
  font-family: ui-monospace, SFMono-Regular, "Cascadia Code", Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
}

.key-concepts { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.kc-title { font-size: 13px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-dim); }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.tab-btn {
  padding: 9px 15px;
  border-radius: 9px 9px 0 0;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-dim);
  border-bottom: 2px solid transparent;
  transition: color var(--speed) ease, border-color var(--speed) ease;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent-text); border-bottom-color: var(--accent); }
.tab-count {
  background: var(--surface-2);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 11px;
  margin-left: 2px;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp 200ms ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } }

.link-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.link-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 36px 14px 16px;
  color: var(--text);
}
.link-card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  border-color: var(--accent);
}
.link-card-title { font-weight: 600; font-size: 14px; }
.link-card-sub { font-size: 12.5px; color: var(--text-dim); }
/* one-line "why read this" on papers / primary docs */
.link-card-why { font-size: 12.5px; line-height: 1.45; margin-top: 2px; }
.link-card-ext {
  position: absolute;
  top: 12px;
  right: 13px;
  color: var(--text-faint);
  font-size: 14px;
  transition: color var(--speed) ease, transform var(--speed) ease;
}
.link-card:hover .link-card-ext { color: var(--accent-text); transform: translate(2px, -2px); }

.notes-ta { resize: vertical; min-height: 110px; font-family: inherit; }
.notes-ind { font-size: 12.5px; }
.notes-ind.saving { color: var(--amber-text); }
.notes-ind.saved { color: var(--green-text); }
.notes-ind.error { color: var(--red-text); }

.comments-list { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.comment {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.comment p { margin: 0 0 3px; }
.comment-date { font-size: 12px; }
.comment-del { flex: none; width: 30px; height: 30px; font-size: 14px; }
.comment-del:hover { color: var(--red-text); background: var(--red-soft); }
.comment-form { display: flex; gap: 10px; }
.comments-empty { padding: 4px 0; }

/* ---------------- quiz ---------------- */

.quiz-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.quiz-progress { font-size: 13px; font-weight: 600; color: var(--text-dim); }
.quiz-track { margin-bottom: 18px; }
.quiz-q { font-size: 18px; margin-bottom: 16px; }
.quiz-options { display: flex; flex-direction: column; gap: 9px; margin-bottom: 14px; }
.quiz-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 14.5px;
  transition: all var(--speed) ease;
}
.quiz-opt:hover:not(:disabled) { border-color: var(--accent); transform: translateX(3px); }
.quiz-opt:disabled { cursor: default; opacity: 0.85; }
.opt-key {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 7px;
  background: var(--surface-3);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
}
.quiz-opt.correct { border-color: var(--green); background: var(--green-soft); opacity: 1; }
.quiz-opt.correct .opt-key { background: var(--green); color: #fff; }
.quiz-opt.wrong { border-color: var(--red); background: var(--red-soft); animation: shake 300ms ease; }
.quiz-opt.wrong .opt-key { background: var(--red); color: #fff; }
@keyframes shake {
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
.quiz-feedback {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 14px;
  animation: fadeUp 200ms ease;
}
.quiz-feedback.ok { background: var(--green-soft); border: 1px solid var(--green); }
.quiz-feedback.bad { background: var(--red-soft); border: 1px solid var(--red); }
.quiz-foot { display: flex; justify-content: flex-end; }

.quiz-results { text-align: center; padding: 10px 4px; }
.quiz-results-emoji { font-size: 46px; margin-bottom: 8px; animation: pop 400ms cubic-bezier(0.22, 1.4, 0.36, 1); }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } }
.quiz-results h3 { font-size: 22px; }
.quiz-results p { color: var(--text-dim); }
.quiz-results-btns { display: flex; justify-content: center; gap: 10px; margin-top: 18px; }

/* ============================================================
   ROADMAP
   The screen answers one question — "where am I on this, and what is next?"
   So it is built as a rail with one open station, not a stack of cards of
   equal weight. Weight comes from state: the phase you are on is the only
   one with a surface behind it; finished phases recede; future phases are
   outlines. No extra accent colours, no extra borders.
   ============================================================ */

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

.roadmap-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--sp-5) var(--sp-8);
  padding-bottom: var(--sp-6);
  margin-bottom: var(--sp-6);
  border-bottom: 1px solid var(--border);
}
.roadmap-header-copy { min-width: 0; }
.roadmap-header h2 {
  margin: var(--sp-1) 0 var(--sp-2);
  font-size: var(--fs-2xl);
}
.roadmap-header .lede { margin: 0; }

/* Shared with the workbook/project headers — one label style, not three. */
.eyebrow {
  display: block;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  color: var(--accent-text);
}
.lede {
  color: var(--text-dim);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  max-width: var(--measure);
}

/* Four figures, no boxes around them. Alignment and size do the separating. */
.roadmap-facts,
.asset-facts {
  display: flex;
  gap: var(--sp-7);
  margin: 0;
  align-self: start;
}
.roadmap-facts dt,
.asset-facts dt {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semi);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  color: var(--text-dim);
  margin-bottom: var(--sp-1);
  white-space: nowrap;
}
.roadmap-facts dd,
.asset-facts dd {
  margin: 0;
  font-size: var(--fs-3xl);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  font-variant-numeric: tabular-nums;
}
/* The denominator is context, not the number being read. */
.of {
  font-size: 0.55em;
  font-weight: var(--fw-semi);
  color: var(--text-dim);
}

.roadmap-progress {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.roadmap-progress .progress-track { height: 10px; }
.roadmap-here-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin: 0;
}

.track-switch-bar { margin-bottom: var(--sp-6); }

/* ---- the rail ---- */

.timeline {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0 0 0 44px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--border);
}
.timeline-item { position: relative; margin-bottom: var(--sp-2); }

.timeline-marker {
  position: absolute;
  left: -44px;
  top: 10px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border-strong);
  color: var(--text-faint);
  font-weight: var(--fw-bold);
  font-size: var(--fs-md);
  font-variant-numeric: tabular-nums;
  z-index: 1;
}
.timeline-item.is-started .timeline-marker { border-color: var(--accent); color: var(--accent-text); }
.timeline-item.is-complete .timeline-marker {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
/* "You are here." The only ring on the page. */
.timeline-item.is-next .timeline-marker {
  border-color: var(--accent);
  color: var(--accent-text);
  box-shadow: 0 0 0 5px var(--accent-soft);
}

/* ---- the phase ---- */

.phase-card {
  padding: var(--sp-3) 0 var(--sp-6);
  border-radius: var(--radius);
}
.timeline-item:last-child .phase-card { padding-bottom: 0; }
/* Only the current phase gets a surface. Everything else is type on the page —
   this is the difference between a path and a wall of cards. */
.timeline-item.is-next .phase-card {
  padding: var(--sp-5) var(--sp-6) var(--sp-6);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.timeline-item.is-complete .phase-card { opacity: 0.72; }
.timeline-item.is-complete:hover .phase-card { opacity: 1; }

.phase-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-4);
  flex-wrap: wrap;
}
.phase-head-copy { min-width: 0; flex: 1 1 340px; }
.phase-kicker {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin: 0 0 var(--sp-1);
}
.phase-weeks {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  color: var(--text-dim);
}
.timeline-item.is-next .phase-weeks { color: var(--accent-text); }
.phase-flag {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  color: var(--accent-text);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 2px var(--sp-2);
}
.phase-head h2 { font-size: var(--fs-lg); margin: 0 0 var(--sp-1); }
.phase-desc {
  color: var(--text-dim);
  font-size: var(--fs-md);
  max-width: var(--measure);
  margin: 0;
}

.phase-progress {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: var(--sp-3) 0 0;
}
.phase-progress .progress-track { flex: 1; height: 6px; }
.phase-progress-label { flex: none; font-variant-numeric: tabular-nums; }

/* ---- the collapsed topic list ---- */

.phase-body { margin-top: var(--sp-3); }
.phase-body-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) 0;
  cursor: pointer;
  list-style: none;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semi);
  color: var(--text-dim);
}
.phase-body-toggle::-webkit-details-marker { display: none; }
.phase-body-toggle:hover { color: var(--accent-text); }
.phase-body-caret { display: inline-flex; transition: transform var(--speed) ease; }
.phase-body[open] .phase-body-caret { transform: rotate(180deg); }
.phase-body > .phase-groups { margin-top: var(--sp-3); }
.phase-topics { list-style: none; margin: 0; padding: 0; }
/* No row separators. 40 dashed rules under 40 topics is 40 lines of noise;
   the marker column and the rhythm already group the rows. */
.phase-topic {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--radius-sm);
  font-size: var(--fs-md);
}
.phase-topic:hover { background: var(--surface-2); }
.phase-topic a { color: var(--text); flex: 1; min-width: 0; }
.phase-topic a:hover { color: var(--accent-text); text-decoration: none; }
.phase-topic.is-done a { color: var(--text-dim); }
.phase-topic.is-active a { font-weight: var(--fw-semi); }
.phase-topic.is-locked a { color: var(--text-faint); }
.phase-topic-min {
  flex: none;
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-xs);
  color: var(--text-faint);
}
/* The status marker is the icon itself. It used to be a bordered box with a
   circle drawn inside it — two shapes saying one thing. Colour carries the
   state, and every row also ships an .sr-only word so it is never colour-only. */
.check {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--text-faint);
}
.check.done { color: var(--green-text); }
.check.half { color: var(--amber-text); }
.check-locked { color: var(--text-faint); }
.milestones { margin-top: var(--sp-5); padding-top: var(--sp-4); border-top: 1px solid var(--border); }
.milestones h3 {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  color: var(--text-dim);
  margin-bottom: var(--sp-2);
}
.milestones-count {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semi);
  letter-spacing: 0;
  color: var(--text-dim);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 1px var(--sp-2);
}
.milestones ul { list-style: none; margin: 0; padding: 0; }
.milestones li {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  padding: var(--sp-1) 0;
  font-size: var(--fs-md);
  color: var(--text-dim);
}
.milestones li .ico { margin-top: 3px; color: var(--text-faint); }
.cert-btn { flex: none; }

@media (max-width: 900px) {
  .roadmap-header { grid-template-columns: 1fr; }
  .roadmap-facts,
  .asset-facts { flex-wrap: wrap; gap: var(--sp-5); }
  .roadmap-facts dd,
  .asset-facts dd { font-size: var(--fs-2xl); }
}
@media (max-width: 620px) {
  .timeline { padding-left: 34px; }
  .timeline::before { left: 13px; }
  .timeline-marker { left: -34px; width: 28px; height: 28px; font-size: var(--fs-sm); }
  .timeline-item.is-next .phase-card { padding: var(--sp-4); }
  .roadmap-here-line { align-items: flex-start; flex-direction: column; }
}

/* ---------------- certificate ---------------- */

.cert-page { max-width: 820px; margin: 0 auto; }
.cert-actions { display: flex; justify-content: space-between; margin-bottom: 20px; }
.certificate {
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: 6px;
  padding: 12px;
  box-shadow: var(--shadow-lift);
}
.cert-inner {
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  text-align: center;
  padding: 48px 40px 40px;
  background:
    radial-gradient(400px 160px at 50% 0%, var(--accent-soft), transparent 70%);
}
.cert-seal {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto var(--sp-3);
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.cert-brand {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-dim);
}
.cert-title {
  font-size: 30px;
  letter-spacing: -0.01em;
  margin: 6px 0 22px;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.cert-line { color: var(--text-dim); margin-bottom: 4px; }
.cert-name {
  font-size: 30px;
  font-weight: 800;
  margin: 6px 0 14px;
  border-bottom: 1px solid var(--border-strong);
  display: inline-block;
  padding: 0 30px 8px;
}
.cert-phase { font-size: 20px; font-weight: 700; margin-bottom: 2px; }
.cert-weeks { color: var(--text-dim); font-size: 13px; }
.cert-footer {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  margin-top: 46px;
  font-size: 13px;
  color: var(--text-dim);
}
.cert-sig, .cert-date { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; }
.cert-sig-line { display: block; width: 100%; max-width: 200px; border-top: 1px solid var(--border-strong); }

/* ---------------- glossary ---------------- */

.glossary-view .filters-bar { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.glossary-view .search-wrap { flex: 1; min-width: 220px; }
.term-group { margin-bottom: 22px; }
.term-letter {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent-text);
  text-transform: uppercase;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}
.term-card { margin-bottom: 8px; overflow: hidden; }
.term-card summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
}
.term-card summary::-webkit-details-marker { display: none; }
.term-card summary:hover { background: var(--surface-2); }
.term-name { flex: 1; }
.term-caret { color: var(--text-faint); transition: transform var(--speed) ease; }
.term-card[open] .term-caret { transform: rotate(180deg); }
.term-body { padding: 2px 16px 14px; color: var(--text-dim); animation: fadeUp 180ms ease; }
.term-body p { margin-bottom: 6px; }
.term-example { font-size: 13.5px; border-left: 3px solid var(--accent); padding-left: 12px; }

/* flashcards */

.review-session { max-width: 560px; margin: 0 auto; }
.review-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.review-track { margin-bottom: 26px; }
.review-loading { text-align: center; padding: 60px 0; }

.flip-scene { perspective: 1200px; margin-bottom: 22px; }
.flip-card {
  position: relative;
  width: 100%;
  min-height: 300px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  display: block;
}
.flip-inner {
  position: relative;
  width: 100%;
  min-height: 300px;
  transform-style: preserve-3d;
  transition: transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
}
.flip-card.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 28px;
  border-radius: 16px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lift);
  text-align: center;
}
.flip-front {
  background:
    radial-gradient(400px 200px at 50% 0%, var(--accent-soft), transparent 70%),
    var(--surface);
}
.flip-back { background: var(--surface); transform: rotateY(180deg); }
.flip-kicker {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-text);
}
.flip-term { font-size: 26px; font-weight: 800; letter-spacing: -0.01em; }
.flip-def { font-size: 15.5px; margin: 0; }
.flip-example { font-size: 13.5px; color: var(--text-dim); margin: 0; font-style: italic; }
.flip-hint { font-size: 12.5px; }

.rate-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; animation: fadeUp 200ms ease; }
.rate-btn { border: 1px solid var(--border); font-weight: 700; }
.rate-again { background: var(--red-soft); color: var(--red-text); border-color: var(--red); }
.rate-hard { background: var(--amber-soft); color: var(--amber-text); border-color: var(--amber); }
.rate-good { background: var(--blue-soft); color: var(--blue-text); border-color: var(--blue); }
.rate-easy { background: var(--green-soft); color: var(--green-text); border-color: var(--green); }

.review-summary { text-align: center; max-width: 480px; margin: 30px auto; padding: 40px 30px; }
.summary-stats { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* ============================================================
   WORKBOOKS & PROJECTS
   One layout, two screens — a learner moving between them should not have to
   relearn where anything is. What they are doing here is picking the next
   piece of hands-on work, so the collapsed row carries exactly the three
   things that decision turns on: how hard, how long, how much. Everything
   else lives inside the disclosure.
   (.wb-card / .wb-list / .wb-sum-* below were the previous markup's classes
   and had no elements left; the views render .asset-*.)
   ============================================================ */

.asset-view { display: flex; flex-direction: column; }

.asset-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--sp-5) var(--sp-8);
  padding-bottom: var(--sp-6);
  margin-bottom: var(--sp-5);
  border-bottom: 1px solid var(--border);
}
.asset-header-copy { min-width: 0; }
.asset-header h2 { margin: var(--sp-1) 0 var(--sp-2); font-size: var(--fs-2xl); }
.asset-header .lede { margin: 0; }

.asset-view > .chips-diff { margin-bottom: var(--sp-6); }

.asset-group + .asset-group { margin-top: var(--sp-8); }
.asset-group-head {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  margin: 0 0 var(--sp-3);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  color: var(--text-dim);
}
.asset-group-head .meta-dim { text-transform: none; letter-spacing: 0; font-weight: var(--fw-med); }

/* ---- the row ---- */

.asset-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}
.asset-card + .asset-card { margin-top: var(--sp-2); }
.asset-card > summary {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  cursor: pointer;
  list-style: none;
}
.asset-card > summary::-webkit-details-marker { display: none; }
.asset-card > summary:hover { background: var(--surface-2); }
.asset-card > summary:focus-visible { outline-offset: -3px; }

.asset-main { min-width: 0; }
.asset-main h2 { font-size: var(--fs-lg); margin: 0 0 var(--sp-1); }
.asset-desc {
  margin: 0 0 var(--sp-3);
  color: var(--text-dim);
  font-size: var(--fs-md);
  line-height: 1.45;
  max-width: var(--measure);
}
.asset-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
}
/* Cloud-cost warnings ship with the provider workbooks. Amber, not red:
   it is a "read this first", not a failure. */
.asset-warn { color: var(--amber-text); cursor: help; }

.asset-side { display: flex; align-items: center; gap: var(--sp-3); }
.asset-count {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  font-variant-numeric: tabular-nums;
  line-height: var(--lh-tight);
  color: var(--text-dim);
}
.asset-card.is-started .asset-count { color: var(--text); }
.asset-card.is-complete .asset-count { color: var(--green-text); }
.asset-caret { display: inline-flex; color: var(--text-faint); transition: transform var(--speed) ease; }
.asset-card[open] .asset-caret { transform: rotate(90deg); }

/* Progress sits on the card's bottom edge as a hairline, not as a bar
   competing with the text. Nothing to align, nothing to label. */
.asset-track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  border-radius: 0;
  background: transparent;
}
.asset-track .progress-fill { border-radius: 0; }
.asset-card.is-complete { border-color: color-mix(in srgb, var(--green) 40%, var(--border)); }

.asset-detail {
  padding: var(--sp-2) var(--sp-5) var(--sp-5);
  border-top: 1px solid var(--border);
}
.asset-deliverable { margin: 0; color: var(--text-dim); max-width: var(--measure); }
.asset-callout {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  margin: var(--sp-4) 0 0;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-sm);
  background: var(--amber-soft);
  color: var(--text);
  font-size: var(--fs-sm);
  line-height: var(--lh-base);
}
.asset-callout .ico { color: var(--amber-text); margin-top: 2px; }

.wb-section h3 {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  color: var(--text-dim);
  margin: var(--sp-5) 0 var(--sp-2);
}
.wb-section-n {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semi);
  letter-spacing: 0;
  color: var(--text-dim);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 1px var(--sp-2);
}

@media (max-width: 900px) {
  .asset-header { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .asset-card > summary { padding: var(--sp-4); }
  .asset-side { flex-direction: row-reverse; align-items: flex-start; }
}
.task-list { list-style: none; margin: 0; padding: 0; }
.task {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 7px 0;
}
.task input[type="checkbox"] {
  appearance: none;
  width: 20px;
  height: 20px;
  flex: none;
  margin: 2px 0 0;
  border-radius: 6px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface-2);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all var(--speed) ease;
}
.task input[type="checkbox"]:checked {
  background: var(--gradient);
  border-color: transparent;
}
/* Drawn, not typed: a "✓" character is a different face at a different
   baseline in every browser, and at 12px inside a 18px box that showed. */
.task input[type="checkbox"]:checked::after {
  content: "";
  width: 10px;
  height: 6px;
  border: 2px solid #fff;
  border-top: 0;
  border-right: 0;
  border-radius: 1px;
  transform: translateY(-1px) rotate(-45deg);
}
.task label { cursor: pointer; }
.task.is-done label { color: var(--text-dim); text-decoration: line-through; }
.step-num { color: var(--accent-text); margin-right: 2px; }
.pj-skills { margin-bottom: 4px; }

/* ---------------- settings ---------------- */

.settings-view { max-width: 640px; }
.settings-form .field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.field-row { display: flex; gap: 10px; margin-bottom: 8px; }
.goals-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 12px;
}
.theme-row { display: flex; gap: 12px; }
.theme-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--surface-2);
  font-weight: 600;
  transition: all var(--speed) ease;
}
.theme-opt:hover { transform: translateY(-1px); }
.theme-opt.active { border-color: var(--accent); background: var(--accent-soft); }
.theme-swatch {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
}
.swatch-dark { background: linear-gradient(135deg, #0b0f1a 50%, #6366f1 50%); }
.swatch-light { background: linear-gradient(135deg, #ffffff 50%, #6366f1 50%); }

/* ---------------- responsive ---------------- */

@media (max-width: 1000px) {
  .dash-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    inset: auto 0 0 0;
    width: 100%;
    height: 62px;
    flex-direction: row;
    align-items: center;
    padding: 0 6px;
    border-right: none;
    border-top: 1px solid var(--border);
  }
  .brand, .sidebar-foot { display: none; }
  .nav {
    flex-direction: row;
    width: 100%;
    overflow-x: auto;
    gap: 0;
    justify-content: space-around;
    -webkit-overflow-scrolling: touch;
  }
  .nav-link {
    flex-direction: column;
    gap: 3px;
    padding: 8px 10px;
    font-size: 10.5px;
    border-radius: 10px;
    flex: none;
  }
  .nav-link.active { box-shadow: none; }
  .main { margin-left: 0; }
  .view { padding: 18px 16px 110px; }
  .topbar { padding: 12px 16px; }
  /* Keeps the sticky category headings landing under the shorter bar. */
  :root { --topbar-h: 59px; }
  .filters-primary { gap: var(--sp-3); }
  .filters-primary .search-wrap { flex-basis: 100%; max-width: none; }
  .grid.cards-grid { grid-template-columns: 1fr; gap: var(--sp-3); }
  .page-title { font-size: 17px; }
  #streak-pill { display: none; }
  .continue-card { flex-direction: column; align-items: flex-start; }
  .cat-bar-row { grid-template-columns: 1fr; gap: 5px; }
  .cat-bar-count { text-align: left; }
  .heatmap { grid-template-columns: repeat(10, 1fr); }
  .comment-form { flex-direction: column; }
  .goals-grid { grid-template-columns: 1fr; }
  .rate-row { grid-template-columns: repeat(2, 1fr); }
  .cert-inner { padding: 30px 18px; }
  .cert-title { font-size: 23px; }
  .cert-name { font-size: 23px; }
  .cert-footer { flex-direction: column; gap: 22px; }
  /* The roadmap's own <=620px rule already narrows the rail and shrinks the
     markers; .phase-card no longer carries a left margin. */
  .wb-track { bottom: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------------- print (certificate) ---------------- */

@media print {
  body { background: #fff !important; }
  .sidebar, .topbar, .toasts, .cert-actions, .no-print,
  .preview-banner-slot { display: none !important; }
  .main { margin: 0 !important; }
  .view { padding: 0 !important; max-width: none !important; }
  .certificate {
    border-color: #6366f1;
    box-shadow: none;
    background: #fff;
    color: #1b2237;
  }
  .cert-inner { background: #fff; }
  .cert-title { -webkit-text-fill-color: #6366f1; color: #6366f1; }
  .cert-name, .cert-phase { color: #1b2237; }
  .cert-line, .cert-brand, .cert-weeks, .cert-footer { color: #5a6480; }
}

/* ============================================================
   VIDEO PLAYER — inline YouTube embeds with resume + watch history
   (player cards in topic resources, "Continue watching" on dashboard)
   ============================================================ */

/* ---- topic view: player cards ---- */

.video-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}
.video-extra-links { margin-top: 12px; }

/* Channels and playlists cannot be embedded, so they are deliberately NOT
   rendered as video tiles — they sit below the players as ordinary external
   links with an external-link icon, clearly separated and labelled. */
.video-offsite { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.video-offsite-head { font-size: 13px; font-weight: 600; margin: 0; }
.video-offsite-note { font-size: 12.5px; margin: 2px 0 12px; }

.video-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.video-card:hover { box-shadow: var(--shadow-lift); border-color: var(--border-strong); }

.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  padding: 0;
  overflow: hidden;
}
.video-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.92;
  transition: transform var(--speed) ease, opacity var(--speed) ease;
}
.video-thumb:hover .video-thumb-img { transform: scale(1.04); opacity: 1; }

.video-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
  transition: transform var(--speed) ease, box-shadow var(--speed) ease;
}
.video-play-btn svg { margin-left: 3px; }
.video-thumb:hover .video-play-btn {
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: 0 8px 26px rgba(99, 102, 241, 0.65);
}

/* resume / watched chips overlaid on the thumbnail */
.video-chips {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: flex;
  gap: 6px;
}
.video-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: rgba(11, 15, 26, 0.72);
  backdrop-filter: blur(4px);
}
.video-chip-done { color: var(--green-text); }

/* slim watched-timeline bar under the frame */
.video-timeline {
  height: 4px;
  background: var(--surface-3);
  overflow: hidden;
  flex: none;
}
.video-timeline-fill {
  height: 100%;
  border-radius: 0 999px 999px 0;
  background: var(--gradient);
  transition: width 400ms cubic-bezier(0.22, 1, 0.36, 1);
}

.video-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
}
.video-title { font-weight: 600; font-size: 14px; line-height: 1.35; }
.video-channel { font-size: 12.5px; }
.video-dur { font-size: 12px; }

/* ---- "How this is used in practice" (topic.businessExamples[]) ---- */

.biz-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.biz-item {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.biz-industry { align-self: flex-start; }
.biz-scenario { margin: 0; font-size: 14px; line-height: 1.55; }
.biz-services { gap: 6px; }
.biz-outcome {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-dim);
  border-left: 2px solid var(--accent);
  padding-left: 10px;
}

/* embedded IFrame player fills the frame */
.video-embed,
.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* loading spinner while the IFrame API boots */
.video-frame.video-loading .video-play-btn { visibility: hidden; }
.video-frame.video-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  animation: video-spin 0.8s linear infinite;
}
@keyframes video-spin { to { transform: rotate(360deg); } }

/* fallback when the IFrame API cannot load (offline / blocked) */
.video-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 34px 16px 16px;
  color: var(--text);
  font-size: 13.5px;
  background: var(--surface-2);
}
.video-fallback:hover { text-decoration: none; background: var(--surface-3); }
.video-fallback-icon { display: inline-flex; flex: none; color: var(--accent-text); }
.video-fallback-text { display: flex; flex-direction: column; gap: 1px; }
.video-fallback-text .meta-dim { font-size: 12px; }

/* ---- dashboard: "Continue watching" cards ---- */

.watch-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.watch-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--text);
}
.watch-card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  border-color: var(--accent);
}

.watch-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: #000;
}
.watch-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* progress bar overlaid on the bottom edge of the thumbnail */
.watch-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  display: block;
  background: rgba(255, 255, 255, 0.28);
}
.watch-bar-fill {
  display: block;
  height: 100%;
  background: var(--gradient);
}

.watch-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 13px;
}
.watch-title { font-weight: 600; font-size: 14px; line-height: 1.35; }
.watch-topic { font-size: 12.5px; }

/* ============================================================
   VIDEO THEATER — large overlay player (opens on tile click)
   ============================================================ */
.video-theater { position: fixed; inset: 0; z-index: 220; display: none; }
.video-theater.open { display: block; }
body.vt-open { overflow: hidden; }

.vt-backdrop {
  position: absolute; inset: 0;
  background: rgba(4, 6, 14, 0.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: vtFade var(--speed) ease;
}

.vt-panel {
  position: relative;
  margin: 4vh auto 0;
  width: min(1150px, 94vw);
  max-height: 92vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  padding: 14px 14px 16px;
  animation: vtUp 220ms ease;
}

.vt-close {
  position: absolute; top: 22px; right: 22px; z-index: 5;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(8, 11, 22, 0.6);
  color: #fff;
  border: 1px solid var(--border-strong);
  cursor: pointer;
  display: grid; place-items: center;
  transition: background var(--speed), transform var(--speed);
}
.vt-close:hover { background: rgba(8, 11, 22, 0.9); transform: scale(1.06); }

.vt-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.vt-stage .video-embed,
.vt-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vt-stage.video-loading::after {
  content: "";
  position: absolute; top: 50%; left: 50%;
  width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  animation: vtSpin 0.8s linear infinite;
}
.vt-stage .video-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }

.vt-meta {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 6px 12px;
  padding: 12px 4px 0;
}
.vt-titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.vt-titles .video-title { font-size: 15.5px; font-weight: 650; }
.vt-meta .video-timeline { flex-basis: 100%; margin-top: 4px; }

.vt-strip { padding: 12px 4px 0; }
.vt-strip-label {
  display: block;
  font-size: 12px; font-weight: 650;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}
.vt-strip-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.vt-tile {
  flex: 0 0 190px;
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  padding: 0 0 9px;
  color: var(--text);
  transition: border-color var(--speed), transform var(--speed);
}
.vt-tile:hover { transform: translateY(-2px); border-color: var(--accent); }
.vt-tile.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.vt-tile img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.vt-tile-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12.5px; line-height: 1.35;
  padding: 8px 10px 0;
}

@keyframes vtFade { from { opacity: 0; } }
@keyframes vtUp { from { opacity: 0; transform: translateY(16px); } }
@keyframes vtSpin { to { transform: rotate(360deg); } }

@media (max-width: 768px) {
  .vt-panel {
    margin: 0; width: 100%;
    max-height: 100vh; max-height: 100dvh;
    height: 100vh; height: 100dvh;
    border-radius: 0; border: 0;
  }
  .vt-close { top: 12px; right: 12px; }
}

/* ============================================================
   Learning hours (curriculum stats)
   ============================================================ */

.chip-hours {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-faint);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 1px 7px;
  margin-left: 2px;
}
.chip.active .chip-hours { color: var(--text-dim); background: var(--surface-3); }

/* .roadmap-header lives in the ROADMAP section above. The flex/padded version
   that used to sit here belonged to the older header markup (.roadmap-header-
   stats, since removed) and, being later in the file, silently won. */

.phase-hours { display: block; font-size: var(--fs-xs); margin-top: 2px; }

/* ============================================================
   Ask the Instructor
   ============================================================ */

.instructor-panel { position: relative; }
.instructor-panel .panel-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.instructor-head-ico {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--gradient);
  color: #fff;
  flex: none;
}

.chat-levels { margin-bottom: 6px; }
.chat-level-hint { font-size: 12.5px; margin: 0 0 12px; }

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 420px;
  overflow-y: auto;
  padding: 4px 2px 10px;
  scroll-behavior: smooth;
}

.chat-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 6px;
  font-size: 14px;
}
.chat-empty-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
  flex: none;
}

.chat-msg { display: flex; gap: 10px; max-width: 92%; }
.chat-msg-user { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg-assistant { align-self: flex-start; }

.chat-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  flex: none;
  margin-top: 2px;
  box-shadow: 0 3px 10px color-mix(in srgb, var(--accent) 35%, transparent);
}

.chat-bubble-wrap { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.chat-msg-user .chat-bubble-wrap { align-items: flex-end; }

.chat-bubble {
  padding: 9px 13px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.chat-bubble > :first-child { margin-top: 0; }
.chat-bubble > :last-child, .chat-bubble p:last-child { margin-bottom: 0; }
.chat-bubble h2, .chat-bubble h3 { font-size: 14.5px; margin: 0.6em 0 0.3em; }
.chat-bubble ul { margin: 0.3em 0; padding-left: 20px; }
.chat-bubble code {
  background: var(--surface-3);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 12.5px;
}

.chat-msg-user .chat-bubble {
  background: var(--gradient);
  border-color: transparent;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg-assistant .chat-bubble { border-bottom-left-radius: 4px; }

.chat-msg-meta {
  font-size: 11.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px;
}
.chat-offline-badge { font-size: 10.5px; padding: 1px 7px; text-transform: uppercase; letter-spacing: 0.04em; }

/* typing indicator */
.typing-dots { display: inline-flex; gap: 4px; padding: 3px 2px; }
.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-dim);
  animation: chat-bounce 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes chat-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* composer */
.chat-composer {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.chat-input {
  flex: 1;
  resize: none;
  min-height: 42px;
  max-height: 160px;
  line-height: 1.45;
}
.chat-send {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 12px;
  flex: none;
}

/* floating chat button (topic pages) */
.chat-fab {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 35;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--gradient);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 6px 24px color-mix(in srgb, var(--accent) 50%, transparent);
  transition: transform var(--speed) ease, box-shadow var(--speed) ease;
}
.chat-fab:hover { transform: translateY(-2px); box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 60%, transparent); }
.chat-fab svg { width: 18px; height: 18px; }

.chat-clear-confirm h3 { margin-bottom: 6px; }
.chat-clear-confirm .quiz-results-btns { margin-top: 16px; }

@media (max-width: 640px) {
  .chat-fab-label { display: none; }
  .chat-fab { padding: 14px; }
  .chat-msg { max-width: 100%; }
}

/* ============================================================
   Tracks (SPEC-V2 §2) — filter chips, badges, switchers
   ============================================================ */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.nav-tag {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: var(--gradient);
}

/* small track pill on a topic card */
.track-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  margin-right: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.track-badge-engineering { color: var(--blue-text); background: var(--blue-soft); border-color: transparent; }
.track-badge-business { color: var(--amber-text); background: var(--amber-soft); border-color: transparent; }
.track-badge-prompt { color: var(--accent-2-text); background: var(--accent-soft); border-color: transparent; }

.topic-card-top { align-items: center; }

/* Track row, then category row: widest filter first, narrowest last, so the
   bar reads top-to-bottom the way the narrowing actually happens.
   (.track-filter-row / .track-filter-note went with an older markup and had no
   element left to style.) */
.track-chips { margin: 0; }

/* The count is a subscript on the label, not a second badge. A pill inside a
   pill, in a row of eight pills, above a second row of pills, was most of why
   the filter bar looked busy. */
.chip-count {
  margin-left: var(--sp-1);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semi);
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.chip.active .chip-count { color: var(--accent-text); }

/* Selected is selected. Per-track chip colours meant the active state changed
   hue depending on which track you picked — three accents doing one job. The
   difficulty chips keep their green/amber/red because there the colour IS the
   meaning (and it matches the badge on every card below). */

/* compact switcher (roadmap header). No padding of its own — it is a row of
   pills on the page, not a panel; the pills already have edges. */
.track-switch-bar { margin-bottom: var(--sp-6); }
.track-switcher { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.track-switcher-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-right: 2px;
}
.track-pill-mine {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--green-text);
  background: var(--green-soft);
}

/* dashboard "your track" chip */
.dash-track-row { margin: -4px 0 16px; align-items: center; }
.track-chip-mine {
  gap: 8px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 7px 8px 7px 14px;
}
.track-chip-mine:hover { text-decoration: none; border-color: var(--accent); }
.track-chip-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.track-chip-edit {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-text);
  background: var(--accent-soft);
}
.track-chip-empty { border-style: dashed; }
.track-chip-lab { color: var(--text); font-weight: 600; }
.track-chip-lab:hover { text-decoration: none; border-color: var(--accent-2); }

/* roadmap phase groups */
.phase-groups { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
/* One rule colour, not four. A group used to carry a per-track accent stripe —
   indigo, sky, amber, violet — which put four competing hues on a screen whose
   only real signal is progress. The group's own icon already says which track
   it is; the stripe just has to say "these rows belong together". */
.phase-group { position: relative; padding-left: var(--sp-3); border-left: 2px solid var(--border); }
.phase-group.is-solo { padding-left: 0; border-left: none; }
.phase-group-head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin: 0 0 var(--sp-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--text-dim);
}
.phase-group-icon { display: inline-flex; color: var(--text-faint); }
.phase-group-hint {
  padding: 1px var(--sp-2);
  border-radius: 999px;
  font-size: var(--fs-2xs);
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--text-faint);
  background: var(--surface-2);
}
.phase-group-meta {
  margin-left: auto;
  text-transform: none;
  letter-spacing: 0;
  font-weight: var(--fw-med);
  font-variant-numeric: tabular-nums;
}
.phase-groups .phase-topics { margin: 0; }

/* category sub-headings inside a phase group (only the ones the track covers) */
.phase-cat + .phase-cat { margin-top: var(--sp-4); }
.phase-cat-head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin: 0 0 var(--sp-1);
  padding-left: var(--sp-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semi);
  color: var(--text-faint);
}
.phase-cat-name { color: var(--text-dim); }
.phase-cat-meta { margin-left: auto; font-weight: var(--fw-med); font-variant-numeric: tabular-nums; }

/* settings: opt-in switch */
.opt-in-row { display: flex; align-items: center; gap: 14px; padding: 6px 0 10px; }
.opt-in-icon { display: inline-flex; flex: none; color: var(--text-dim); }
.opt-in-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.opt-in-title { font-weight: 700; }
.opt-in-sub { font-size: 13px; }

.switch {
  flex: none;
  position: relative;
  width: 50px;
  height: 28px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  transition: background var(--speed) ease, border-color var(--speed) ease;
}
.switch.on { background: var(--gradient); border-color: transparent; }
.switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform var(--speed) cubic-bezier(0.22, 1, 0.36, 1);
}
.switch.on .switch-knob { transform: translateX(22px); }

/* ============================================================
   Prompt Lab (SPEC-V3 §7)
   ============================================================ */

.promptlab { max-width: 1080px; }

.pl-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  margin-bottom: 18px;
}
.pl-header-main h2 { margin: 2px 0 4px; font-size: 21px; letter-spacing: -0.01em; }
.pl-header-main p { margin: 0; max-width: 62ch; }
.pl-header-side { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.pl-spark { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.pl-spark-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pl-spark-dot { fill: var(--accent-2); stroke: var(--surface); stroke-width: 1.5; }
.pl-spark-label { font-size: 11px; }

/* --- exercise picker --- */
.pl-picker .panel-head { margin-bottom: 12px; }
.pl-ex-grid { grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); }

.pl-ex-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  text-align: left;
  border: 1px solid var(--border);
  transition: transform var(--speed) ease, border-color var(--speed) ease, box-shadow var(--speed) ease;
}
.pl-ex-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow-lift); }
.pl-ex-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pl-ex-top .track-badge { margin-left: 0; margin-right: 0; }
.pl-ex-title { margin: 0; font-size: 16px; letter-spacing: -0.01em; }
.pl-ex-scenario {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pl-ex-cta { margin-top: auto; font-size: 12.5px; font-weight: 600; color: var(--accent-text); }
.pl-ex-free { border-style: dashed; }

.pl-best-badge {
  margin-left: auto;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text);
  background: var(--surface-3);
}
.pl-best-badge.pl-band-expert { color: var(--green-text); background: var(--green-soft); }
.pl-best-badge.pl-band-strong { color: var(--blue-text); background: var(--blue-soft); }
.pl-best-badge.pl-band-developing { color: var(--amber-text); background: var(--amber-soft); }
.pl-best-badge.pl-band-basic { color: var(--red-text); background: var(--red-soft); }

.pl-warming .empty-state { padding: 34px 20px; }
.pl-warm-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* --- composer --- */
.pl-composer-head { margin-bottom: 12px; }

.pl-brief {
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
}
.pl-brief-free { border-left-color: var(--blue); }
.pl-brief-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; }
.pl-brief-top .track-badge { margin-left: 0; margin-right: 0; }
.pl-brief h3 { margin: 0 0 4px; font-size: 16px; }
.pl-brief-scenario { margin: 0; font-size: 14px; color: var(--text-dim); }

.pl-hints { margin-top: 10px; }
.pl-hints summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-text);
  list-style: none;
}
.pl-hints summary::-webkit-details-marker { display: none; }
.pl-hints summary:hover { text-decoration: underline; }
.pl-hints ul { margin: 8px 0 0; padding-left: 20px; font-size: 13px; color: var(--text-dim); }
.pl-hints li { margin-bottom: 4px; }

.pl-textarea {
  min-height: 190px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.6;
}
.pl-composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}
.pl-wordcount b { color: var(--text); font-size: 15px; }

.pl-inline-error {
  margin: 12px 0 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--amber-text);
  background: var(--amber-soft);
}

/* --- score dial --- */
.pl-score-row {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 24px;
  align-items: start;
}
.pl-dial-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pl-dial { overflow: visible; }
.pl-dial-bg { fill: none; stroke: var(--surface-3); stroke-width: 12; }
.pl-dial-fg {
  fill: none;
  stroke-width: 12;
  stroke-linecap: round;
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--accent) 45%, transparent));
}
.pl-dial-value {
  fill: var(--text);
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.pl-dial-unit { fill: var(--text-faint); font-size: 12px; font-weight: 600; }

.pl-band-label {
  padding: 4px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.pl-band-expert .pl-band-label { color: var(--green-text); background: var(--green-soft); }
.pl-band-strong .pl-band-label { color: var(--blue-text); background: var(--blue-soft); }
.pl-band-developing .pl-band-label { color: var(--amber-text); background: var(--amber-soft); }
.pl-band-basic .pl-band-label { color: var(--red-text); background: var(--red-soft); }

/* --- dimension bars --- */
.pl-dims { display: flex; flex-direction: column; gap: 8px; }

.pl-dim {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  overflow: hidden;
  transition: border-color var(--speed) ease;
}
.pl-dim[open] { border-color: var(--border-strong); }
.pl-dim-head {
  display: grid;
  grid-template-columns: minmax(120px, 1.1fr) minmax(80px, 2fr) 62px 16px;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
}
.pl-dim-head::-webkit-details-marker { display: none; }
.pl-dim-head:hover { background: var(--surface-3); }
.pl-dim-name { font-size: 13.5px; font-weight: 600; }
.pl-dim-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.pl-dim-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--gradient);
  transition: width 700ms cubic-bezier(0.22, 1, 0.36, 1);
}
.pl-dim-good .pl-dim-fill { background: linear-gradient(90deg, var(--accent), var(--green)); }
.pl-dim-mid .pl-dim-fill { background: linear-gradient(90deg, var(--accent), var(--amber)); }
.pl-dim-low .pl-dim-fill { background: linear-gradient(90deg, var(--accent), var(--red)); }
.pl-dim-score { font-size: 14px; font-weight: 800; text-align: right; }
.pl-dim-score .meta-dim { font-size: 12px; font-weight: 600; }
.pl-dim-caret { color: var(--text-faint); font-size: 12px; transition: transform var(--speed) ease; }
.pl-dim[open] .pl-dim-caret { transform: rotate(180deg); }

.pl-dim-body {
  padding: 4px 14px 14px;
  border-top: 1px solid var(--border);
  animation: fadeUp 180ms ease;
}
.pl-chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.pl-chip-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-right: 2px;
}
.pl-chip {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.pl-chip-found { color: var(--green-text); background: var(--green-soft); }
.pl-chip-missing { color: var(--red-text); background: var(--red-soft); }
.pl-tip {
  margin: 12px 0 0;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  background: var(--accent-soft);
}

.pl-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

/* --- improved prompt + diff --- */
.pl-improved { border-color: var(--accent); }
.pl-diff-legend { display: flex; gap: 10px; font-size: 12px; font-weight: 700; }
.pl-legend-ins { color: var(--green-text); }
.pl-legend-del { color: var(--red-text); }

.pl-diff {
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 460px;
  overflow: auto;
}
.pl-diff ins {
  text-decoration: none;
  color: var(--green-text);
  background: var(--green-soft);
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.25) inset;
  padding: 1px 0;
}
.pl-diff del {
  text-decoration: line-through;
  text-decoration-color: rgba(239, 68, 68, 0.7);
  color: var(--red-text);
  background: var(--red-soft);
  border-radius: 3px;
  opacity: 0.85;
  padding: 1px 0;
}

.pl-improved-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

.pl-improvements { margin-top: 20px; }
.pl-improvements h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.pl-improvements ol { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 14px; }
.pl-improvement-dim {
  display: inline-block;
  padding: 2px 10px;
  margin-bottom: 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-text);
  background: var(--accent-soft);
}
.pl-improvement-pair {
  display: grid;
  grid-template-columns: 1fr 20px 1fr;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.pl-before, .pl-after {
  display: block;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.pl-before { color: var(--text-dim); border-left: 3px solid var(--red); }
.pl-after { color: var(--text); border-left: 3px solid var(--green); }
.pl-ba-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 2px;
}
.pl-arrow { text-align: center; color: var(--accent-text); font-weight: 800; }
.pl-improvement-why { margin: 6px 0 0; font-size: 12.5px; }

/* --- side-by-side comparison --- */
.pl-delta-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent-soft), rgba(168, 85, 247, 0.08));
  border: 1px solid var(--accent);
  font-size: 14px;
}
.pl-delta-icon { font-size: 18px; }
.pl-delta-text { flex: 1; min-width: 220px; }
.pl-delta-text b { color: var(--accent-2-text); }
.pl-delta-score {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-dim);
  background: var(--surface-2);
}

.pl-compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.pl-answer {
  padding: 0;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
}
.pl-answer-basic { border-left: 4px solid var(--border-strong); opacity: 0.92; }
.pl-answer-improved {
  border-left: 4px solid var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft), var(--shadow);
}
.pl-answer-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.pl-answer-tag { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); }
.pl-answer-improved .pl-answer-tag { color: var(--accent-text); }
.pl-answer-body {
  padding: 14px 16px;
  font-size: 14px;
  max-height: 520px;
  overflow: auto;
}
.pl-answer-body h2, .pl-answer-body h3 { font-size: 15px; margin: 0.9em 0 0.35em; }
.pl-answer-body > :first-child { margin-top: 0; }
.pl-answer-body ul { padding-left: 20px; margin: 0.4em 0; }
.pl-answer-body code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-3);
  font-size: 12.5px;
}

/* --- live runner: usage meter, notices, the answer panel --- */

/* The daily allowance, read as a budget rather than a warning: it says how
   many runs are LEFT, and only turns amber/red as it empties. */
.pl-usage { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.pl-usage-bar {
  width: 108px;
  height: 5px;
  border-radius: 3px;
  background: var(--surface-3);
  overflow: hidden;
}
.pl-usage-fill {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--green);
  transition: width 0.35s ease;
}
.pl-usage-low .pl-usage-fill { background: var(--amber); }
.pl-usage-empty .pl-usage-fill { background: var(--red); }
.pl-usage-text { font-size: 11px; color: var(--text-faint); }
.pl-usage-text b { color: var(--text-dim); font-size: 12px; }
.pl-usage-low .pl-usage-text b { color: var(--amber-text); }
.pl-usage-empty .pl-usage-text b { color: var(--red-text); }

/* A cap or a degraded-mode message. Informational, NOT an error: nothing is
   broken, so it must not look like .pl-inline-error. */
.pl-notice {
  margin: 12px 0 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--blue);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-dim);
  background: var(--blue-soft);
}
.pl-notice-cap { border-left-color: var(--amber); background: var(--amber-soft); color: var(--amber-text); }

.pl-composer-btns { display: flex; align-items: center; gap: 8px; }

.pl-answer-run { border-left: 4px solid var(--accent); }
.pl-run-actions,
.pl-improved-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pl-tag-live { color: var(--accent-text); }
.pl-tag-sample { color: var(--text-faint); }

/* --- challenges --- */

.pl-ch-section { margin-top: 28px; }
.pl-ch-card { border-left: 3px solid var(--amber); }
.pl-brief-challenge { border-left-color: var(--amber); }

.pl-material { margin-top: 12px; }
.pl-material-label,
.pl-criteria-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 5px;
}
.pl-material-body {
  margin: 0;
  padding: 10px 12px;
  max-height: 220px;
  overflow: auto;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.pl-criteria-wrap { margin-top: 12px; }
.pl-criteria { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.pl-criterion {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
}
.pl-criterion-mark { flex: none; width: 16px; font-weight: 800; text-align: center; }
.pl-criterion-pending .pl-criterion-mark { color: var(--text-faint); }
.pl-criterion-pass { color: var(--text); }
.pl-criterion-pass .pl-criterion-mark { color: var(--green-text); }
.pl-criterion-fail .pl-criterion-mark { color: var(--red-text); }

.pl-ch-result .pl-criteria { margin-bottom: 14px; }
.pl-ch-rubric { margin: 12px 0 0; font-size: 13px; }

@media (max-width: 900px) {
  .pl-score-row { grid-template-columns: 1fr; justify-items: center; }
  .pl-dims { width: 100%; }
  .pl-compare-grid { grid-template-columns: 1fr; }
  .pl-improvement-pair { grid-template-columns: 1fr; }
  .pl-arrow { transform: rotate(90deg); }
  .pl-dim-head { grid-template-columns: 1fr 56px 16px; }
  .pl-dim-bar { grid-column: 1 / -1; order: 3; }
  .pl-composer-foot { flex-direction: column; align-items: stretch; }
  .pl-composer-btns { justify-content: stretch; }
  .pl-composer-btns .btn { flex: 1; }
}

/* ============================================================
   Access codes & preview mode (SPEC-V4)
   ============================================================ */

/* ---------------- preview banner ---------------- */

/* The slot is always in the DOM and collapses to nothing when empty, so
   showing/hiding the banner never reflows the topbar or the view. */
.preview-banner-slot { position: relative; z-index: 25; }
.preview-banner-slot[hidden] { display: none; }

.preview-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 28px;
  color: #fff;
  background: var(--gradient);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 22%, transparent);
  animation: previewSlide 260ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes previewSlide { from { opacity: 0; transform: translateY(-6px); } }

.preview-banner-badge {
  flex: none;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  white-space: nowrap;
}
.preview-banner-text {
  flex: 1;
  margin: 0;
  min-width: 0;
  font-size: 13.5px;
  line-height: 1.45;
}
.preview-banner .btn.preview-banner-cta {
  flex: none;
  background: #fff;
  color: #4c3ad6;
  box-shadow: 0 3px 10px rgba(8, 10, 30, 0.22);
}
.preview-banner .btn.preview-banner-cta:hover:not(:disabled) {
  box-shadow: 0 6px 16px rgba(8, 10, 30, 0.3);
}
.preview-banner-close {
  flex: none;
  width: 28px;
  height: 28px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
}
.preview-banner-close:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

/* ---------------- lock chip + muted cards ---------------- */

.lock-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  white-space: nowrap;
}

.topic-card-locked { border-style: dashed; }
.topic-card-locked .topic-card-title a,
.topic-card-locked .topic-card-summary { color: var(--text-dim); }
.topic-card-locked .topic-icon,
.topic-card-locked .badge,
.topic-card-locked .status { opacity: 0.6; }
.topic-card-locked:hover { border-color: var(--accent); border-style: solid; }

.phase-topic-locked a { color: var(--text-dim); }
.phase-topic-locked a:hover { color: var(--accent-text); }
.check-locked {
  display: inline-grid;
  place-items: center;
  font-size: 11px;
  opacity: 0.75;
}

.term-card-locked summary .term-name { color: var(--text-dim); }
.term-locked { margin: 0; font-size: 13.5px; }
.link-btn {
  padding: 0;
  color: var(--accent-text);
  font: inherit;
  text-decoration: underline;
}

/* ---------------- locked card (compact + full) ---------------- */

.locked-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  margin-bottom: 18px;
  border-style: dashed;
  background:
    linear-gradient(135deg, var(--accent-soft), transparent 62%),
    var(--surface);
}
.locked-card-icon { display: inline-flex; flex: none; color: var(--text-dim); }
.locked-card-body { flex: 1; min-width: 0; }
.locked-card-body h3 { font-size: 15.5px; margin: 0 0 3px; }
.locked-card-body p { margin: 0; font-size: 13.5px; color: var(--text-dim); }
.locked-card .btn { flex: none; }

/* Full-lesson stand-in on the topic detail view. */
.unlock-lesson {
  text-align: center;
  border-style: dashed;
  background:
    radial-gradient(600px 220px at 50% -30%, var(--accent-soft), transparent 70%),
    var(--surface);
  padding: 34px 24px;
}
.unlock-lesson-icon {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 12px;
  border-radius: 14px;
  color: #fff;
  background: var(--gradient);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 40%, transparent);
}
.unlock-lesson h2 { font-size: 19px; }
.unlock-lesson-pitch {
  max-width: 52ch;
  margin: 0 auto 16px;
  color: var(--text-dim);
}
.unlock-lesson-note { margin: 12px 0 0; font-size: 12.5px; }
.topic-locked-head { margin-bottom: 8px; }
.topic-detail-locked .topic-summary { color: var(--text-dim); }
.continue-card-locked { border-style: dashed; }

/* ---------------- redeem form (modal + full page) ---------------- */

.redeem-modal { position: relative; }
.redeem-close { position: absolute; top: -6px; right: -6px; }

.redeem-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}
.redeem-head h2 { font-size: 20px; margin: 0 0 4px; }
.redeem-org {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
.redeem-head h3 { font-size: 17px; margin: 0 0 3px; }
.redeem-head p { margin: 0; font-size: 13.5px; }
.redeem-lock {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #fff;
  background: var(--gradient);
  box-shadow: 0 5px 16px color-mix(in srgb, var(--accent) 40%, transparent);
}

.redeem-perks {
  list-style: none;
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: grid;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-dim);
}
.redeem-perks li { display: flex; align-items: flex-start; gap: 9px; }
.redeem-perks span { flex: none; }

.redeem-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.redeem-input {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-align: center;
  padding: 13px 14px;
}
.redeem-input::placeholder { letter-spacing: 0.14em; font-weight: 500; }
.input-error, .input-error:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}

.redeem-msg { margin: 8px 0 0; min-height: 20px; font-size: 13px; color: var(--text-dim); }
.redeem-msg-error { color: var(--red-text); font-weight: 600; }
.redeem-msg-hint { color: var(--amber-text); }
.redeem-msg-info { color: var(--text-dim); }

.redeem-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}
.redeem-submit.is-loading { opacity: 0.75; }
.redeem-help { margin: 14px 0 0; font-size: 12.5px; }
.redeem-help code {
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--surface-3);
  font-size: 12px;
}

.redeem-page { max-width: 560px; margin: 24px auto; }
.redeem-page .redeem-body { padding: 26px 26px 22px; }

.redeem-success { text-align: center; padding: 18px 6px 6px; }
.redeem-success-mark {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 12px;
  border-radius: 50%;
  color: #fff;
  background: var(--gradient);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 45%, transparent);
  animation: popIn 300ms cubic-bezier(0.22, 1, 0.36, 1);
}
.redeem-success h3 { font-size: 19px; }
.redeem-success-sub { font-size: 12.5px; margin-bottom: 0; }

@media (max-width: 720px) {
  .preview-banner { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .preview-banner-text { flex: 1 1 100%; order: 3; font-size: 12.5px; }
  .preview-banner-close { order: 2; margin-left: auto; }
  .locked-card { flex-direction: column; align-items: flex-start; }
  .redeem-actions { flex-direction: column-reverse; }
  .redeem-actions .btn { width: 100%; }
  .redeem-input { font-size: 17px; letter-spacing: 0.1em; }
}

/* ---------------- email updates (subscriptions) ----------------
   The first-sign-in ask reuses the track-chooser's full-view shape; the
   Settings section reuses the same .sub-choices list. */

.sub-ask {
  max-width: 620px;
  margin: 0 auto;
  padding: 20px 0 40px;
  text-align: center;
}
.sub-ask-head h2 {
  font-size: 26px;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.sub-ask-head p {
  max-width: 520px;
  margin: 0 auto 24px;
  color: var(--text-dim);
}

.sub-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.sub-choice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--speed) ease, background var(--speed) ease;
}
.sub-choice:hover { border-color: var(--accent); }
.sub-choice:has(input:checked) {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--accent-soft), transparent 70%), var(--surface);
}
.sub-choice input[type="checkbox"] {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
}
.sub-choice-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sub-choice-title { font-weight: 700; font-size: 14.5px; }
.sub-choice-sub { font-size: 13px; color: var(--text-dim); }

.sub-ask-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 22px;
}
.sub-later {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
  padding: 8px 14px;
  border-radius: 9px;
}
.sub-later:hover { color: var(--text); background: var(--surface-2); }
.sub-note {
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--text-faint);
}

@media (max-width: 720px) {
  .sub-ask-actions { flex-direction: column-reverse; gap: 8px; }
  .sub-ask-actions .btn { width: 100%; }
}

/* ============================================================
   Levels — Essentials / Foundation / Practitioner / Advanced,
   and the Go-deeper library.

   The visual job here is one thing: make "about ten hours" the
   figure a reader takes away, and make optional material look
   optional without looking like a downgrade. Go-deeper is dimmed
   and dashed, never locked-looking — it is a library, not a wall.
   ============================================================ */

.badge-accent {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}

.chip-optional {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
}

/* ---- the dashboard ladder ---- */

.level-panel { display: grid; gap: 14px; }

.level-ladder {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  counter-reset: level;
}

.level-row {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
}

.level-row.is-recommended {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 7%, var(--surface-2));
}

.level-row.is-done { opacity: 0.85; }

/* Deliberately NOT dimmed to the point of looking disabled: a later level is a
   recommendation about order, not a gate. */
.level-row.is-recommended-later { border-style: dashed; }

.level-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.level-row-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
}

.level-row-meta { font-size: 12px; white-space: nowrap; }
.level-row-blurb { margin: 0; font-size: 13px; line-height: 1.5; }

.level-row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.level-deeper {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 12px 14px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.55;
}
.level-deeper b { color: var(--text); }

/* ---- the roadmap level band ---- */

.level-band { list-style: none; margin: 18px 0 6px; }

.level-band-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.level-band.is-current .level-band-inner {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 7%, var(--surface-2));
}
.level-band.is-recommended-later .level-band-inner { border-style: dashed; }

.level-band-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
}

.level-band-blurb { margin: 0; font-size: 13px; max-width: 62ch; line-height: 1.5; }

.level-band-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
}

/* The number the restructure wants read first. */
.level-band-hours {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
}
.level-band-hours .of { font-size: 13px; font-weight: 600; color: var(--text-dim); margin-left: 2px; }

/* ---- topics list ---- */

.topic-section-blurb {
  margin: -2px 0 12px;
  font-size: 13px;
  line-height: 1.5;
  max-width: 74ch;
}

.topic-section.is-optional {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px dashed var(--border-strong);
}

.chips-levels .chip.active {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--text);
}

.topic-card.topic-level-deeper { border-style: dashed; }

.meta-video { white-space: nowrap; }

/* ---- videos are alternatives ---- */

.video-alt-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-dim);
}
.video-alt-note b { color: var(--text); }
.video-alt-note .ico { flex: none; margin-top: 2px; }

/* ---- deep dive as prose (the NVIDIA shape) ---- */

.deepdive-prose { margin: 0; font-size: 14px; line-height: 1.7; }

@media (max-width: 720px) {
  .level-band-inner { flex-direction: column; align-items: flex-start; }
  .level-row-head { align-items: flex-start; }
}

/* ------------------------------------------------------------------
   Buzz | Learn switch — the same control on Buzz (the apex) and in the
   learning app (play.*), so people can hop between the feed and their
   lessons. Plain links: the shared sign-in keeps them signed in.
   ------------------------------------------------------------------ */
.site-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.site-switch a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 16px;
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.site-switch a:hover { color: var(--text); }
.site-switch a[aria-current="page"] {
  background: var(--surface);
  color: var(--accent-text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 1px 6px rgba(0, 0, 0, .06);
}
.site-switch a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[data-theme="dark"] .site-switch a[aria-current="page"] {
  background: color-mix(in srgb, var(--accent) 26%, transparent);
  color: #fff;
  box-shadow: none;
}
@media (max-width: 720px) {
  .site-switch a { padding: 6px 12px; min-height: 32px; }
}
@media (max-width: 420px) {
  .site-switch svg { display: none; }
}
/* "Admin" — shown to admins next to the switch on Buzz and in the app. A
   bordered button, not part of the Buzz | Learn control: it leaves for the
   admin console instead of switching sites. */
.admin-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong, var(--border));
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.admin-jump[hidden] { display: none; }
.admin-jump svg { color: var(--accent-text, var(--accent)); }
.admin-jump:hover { text-decoration: none; border-color: var(--accent); }
.admin-jump:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 520px) {
  .admin-jump { padding: 5px 9px; }
  .admin-jump span { display: none; }
}

/* In the app: at the foot of the left sidebar on desktop (full width, two
   equal halves); in the top bar's right-hand group on phones, where the
   sidebar becomes the bottom tab bar and its foot is hidden. */
.site-switch-side { display: flex; box-sizing: border-box; width: 100%; margin: 0 0 12px; }
.site-switch-side a { flex: 1 1 0; min-width: 0; justify-content: center; padding: 6px 10px; }
.site-switch-top { display: none; }
@media (max-width: 768px) {
  .site-switch-top { display: inline-flex; }
}
@media (max-width: 640px) {
  .topbar .page-title { display: none; }
}
@media (max-width: 480px) {
  .topbar #xp-pill { display: none; }
}

/* Skip link: hidden until focused (the app had none, so it showed). */
.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.skip:focus { top: 12px; }
.greeting-ico { margin-left: 6px; vertical-align: -2px; }
