/* ── Variables ──────────────────────────────────────────────────────────────
   Dark theme + Blue accent (drop-in replacement for the old neon green).
   • Blue   #3B82F6 → primary actions, brand, focus, selected states
   • Green  #22C55E → kept ONLY for success states (correct answers, sub-active)
   • Purple #8B5CF6 → sparingly (icons)
   `--neon` is now an alias for the BLUE so every existing style that
   references --neon automatically uses the new primary color. */
:root {
  /* Accent palette */
  --accent-blue:    #3B82F6;             /* primary */
  --accent-blue-dim: #2563EB;            /* hover / pressed */
  --accent-blue-light: #60A5FA;          /* lighter highlights */
  --accent-blue-soft:  rgba(59,130,246,.14);
  --accent-blue-soft-lg: rgba(59,130,246,.22);
  --accent-green:   #22C55E;             /* success only */
  --accent-green-dim: #16A34A;
  --accent-green-soft: rgba(59,130,246,.12);
  --accent-green-soft-lg: rgba(59,130,246,.18);
  --accent-purple:  #8B5CF6;
  --accent-purple-soft: rgba(139,92,246,.12);

  /* Legacy names — now mapped to BLUE so existing CSS turns blue automatically */
  --neon:           var(--accent-blue);
  --neon-dim:       var(--accent-blue-dim);
  --neon-glow:      var(--accent-blue-soft);
  --neon-glow-lg:   var(--accent-blue-soft-lg);

  /* Surfaces — neutral, calm, not pure black */
  --bg:             #0B0B0C;
  --bg-2:           #131316;
  --surface:        #1C1C1E;            /* card surface */
  --surface-2:      #232326;
  --border:         rgba(255,255,255,0.06);
  --border-bright:  rgba(255,255,255,0.10);

  /* Text */
  --text:           #E5E5E7;            /* primary */
  --text-soft:      #A1A1A6;            /* secondary / paragraph */
  --text-muted:     #88888c;
  --text-dim:       #5a5a5e;
  --white:          #ffffff;
  --font-display:   'Inter', -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body:      'Inter', -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --radius-sm:      8px;
  --radius:         14px;
  --radius-lg:      20px;
  --transition:     .2s cubic-bezier(.4,0,.2,1);
}

/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable; /* reserve scrollbar space so layout never shifts */
}
body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  letter-spacing: -0.01em;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--neon); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
ul { list-style: none; }

/* ── Apple-style typographic baseline ─────────────────────────────────────
   H1 → 700/800 weight, line-height 1.1
   H2/H3 → 600 weight (less heavy, more refined)
   Body → 400 weight, soft gray
   Labels / UI → 500
   Inter is the family for everything; -apple-system is fallback. */

/* Section / card / form headings — 600 weight (H2/H3 tier) */
h2, h3, h4, h5, h6,
.section__title,
.card__title,
.detail__title,
.auth-card__title,
.empty-state h3,
.cta-strip__inner h2,
.how__step h4,
.plan-card__name,
.sub-card__heading {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
/* Top-level page H1 + hero — slightly heavier */
h1, .hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.hero__title { font-weight: 800; line-height: 1.05; }

/* Numbers / stats use the display face at 600–700 */
.stat__number,
.plan-card__amount,
.sub-card__amount,
.overview__stat-number {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Paragraph / body text — soft gray, never pure white */
p {
  color: var(--text-soft);
  line-height: 1.6;
  letter-spacing: -0.01em;
}
.form-hint, .hero__subtitle, .card__total, .stat__label,
.upload-choose__desc, .question-row__stem {
  color: var(--text-soft);
}

/* ── Scroll progress bar ──────────────────────────────────────────────────── */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--neon);
  box-shadow: 0 0 10px var(--neon), 0 0 20px var(--neon-glow);
  z-index: 9999;
  transition: width .05s linear;
}

/* ── Layout ───────────────────────────────────────────────────────────────── */
.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.section { padding: 7.5rem 0; }
.section--alt { background: var(--bg-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section__title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 600;
  text-align: center;
  margin-bottom: 3.5rem;
  color: var(--text);
  letter-spacing: -.02em;
  line-height: 1.15;
}
.section__title::after {
  content: '';
  display: block;
  width: 3rem;
  height: 3px;
  background: var(--neon);
  margin: .75rem auto 0;
  border-radius: 2px;
}

/* ── Nav ──────────────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(8,8,8,.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}
.nav .container { max-width: none; padding: 0 1rem 0 1rem; }
@media (max-width: 800px) {
  /* Tighter side padding on mobile so the logo sits flush to the left edge */
  .nav .container { padding: 0 1rem 0 .65rem; }
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; }
.nav__logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1;            /* unifies the line-box for both wordmark halves */
  color: var(--white);
  text-decoration: none;
  letter-spacing: -.02em;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}
/* Wordmark wrapper: keeps "Atomic" and "Learning" together as one flex item */
.nav__logo-text {
  display: inline;
  white-space: nowrap;
  vertical-align: baseline;
  line-height: 1;
}
/* "Learning" is just a color-only span inside the wordmark. Both words sit
   in one continuous inline text run as "AtomicLearning". A tiny vertical nudge
   compensates for the optical illusion where the colored half reads as higher. */
/* Both wordmark halves share the SAME element type (span) and the SAME class.
   Only the color differs. This guarantees their bounding boxes are identical. */
.nav__logo-half {
  display: inline;
  font: inherit;
  line-height: 1;
  color: var(--white);
  margin: 0; padding: 0;
  vertical-align: baseline;
}
.nav__logo-half--accent { color: var(--neon); }
.nav__logo-img {
  width: 28px; height: 28px;
  object-fit: contain;
  display: block;
}
@media (max-width: 480px) {
  .nav__logo-img { width: 24px; height: 24px; }
}
.nav__links { display: flex; align-items: center; gap: .15rem; }
/* Section markers — only render in the mobile dropdown, hidden on desktop */
.nav__section-label, .nav__divider { display: none; }
.nav__link {
  padding: .45rem .9rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: .9rem;
  letter-spacing: 0;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition), background var(--transition);
}
.nav__link:hover { color: var(--neon); background: rgba(59,130,246,.07); text-decoration: none; }
.nav__link--cta {
  background: var(--neon);
  color: #000 !important;
  font-weight: 700;
  margin-left: .5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.nav__link--cta:hover { background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.4); }
.nav__toggle {
  display: none;
  background: none; border: none;
  font-size: 1.4rem; cursor: pointer;
  color: var(--text);
  padding: .35rem .55rem;
  border-radius: 8px;
  transition: background .15s ease;
}
.nav__toggle:hover { background: rgba(255, 255, 255, .06); }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .65rem 1.5rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), transform .12s, box-shadow var(--transition);
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary {
  background: var(--neon); color: #000;
  box-shadow: none;
}
.btn--primary:hover {
  background: #60A5FA;
  box-shadow: 0 2px 10px rgba(59,130,246,.15);
}
.btn--primary:active {
  background: #1D4ED8;
  transform: translateY(0);
  transition: transform .08s, background .08s;
}
.btn--outline {
  background: transparent;
  border-color: var(--neon);
  color: var(--neon);
}
.btn--outline:hover { background: rgba(59,130,246,.07); box-shadow: 0 2px 10px rgba(0,0,0,.3); }
.btn--delete {
  background: transparent;
  color: #f87171;
  border: 1px solid #f87171;
  padding: .55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.btn--delete:hover { background: rgba(248,113,113,.12); }
.btn--sm  { padding: .4rem .9rem; font-size: .82rem; }
.btn--lg  { padding: .9rem 2.2rem; font-size: 1.05rem; }
.btn--full { width: 100%; justify-content: center; }

/* ── Alerts ───────────────────────────────────────────────────────────────── */
.alert {
  padding: .8rem 1.2rem;
  border-radius: var(--radius-sm);
  margin: 1rem 0;
  font-weight: 500;
  font-size: .9rem;
  border-left: 4px solid;
}
.alert--success { background: rgba(59,130,246,.08); color: var(--neon); border-color: var(--neon); }
.alert--error   { background: rgba(239,68,68,.08); color: #f87171; border-color: #ef4444; }
.alert--info    { background: rgba(59,130,246,.06); color: var(--text-muted); border-color: var(--border-bright); }

/* ── 3D Atom ──────────────────────────────────────────────────────────────── */
.atom3d {
  width: 200px;
  height: 200px;
  margin: 0 auto 2rem;
  cursor: grab;
}
.atom3d:active { cursor: grabbing; }

.atom3d__scene {
  width: 100%; height: 100%;
  perspective: 520px;
  perspective-origin: 50% 50%;
}

.atom3d__inner {
  width: 100%; height: 100%;
  position: relative;
  transform-style: preserve-3d;
  /* smooth return after mouse leave */
  transition: transform 0.6s cubic-bezier(.25,.46,.45,.94);
}
.atom3d__inner.is-dragging { transition: none; }

/* Nucleus */
.atom3d__nucleus-wrap {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}
.atom3d__nucleus {
  width: 22px; height: 22px;
  background: var(--neon);
  border-radius: 50%;
  box-shadow: 0 0 16px var(--neon), 0 0 40px rgba(59,130,246,.7);
  position: relative; z-index: 2;
}
.atom3d__glow-ring {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 56px; height: 56px;
  background: radial-gradient(circle, rgba(59,130,246,.35) 0%, transparent 70%);
  border-radius: 50%;
  animation: nucleusPulse 2.2s ease-in-out infinite alternate;
}
@keyframes nucleusPulse {
  from { transform: translate(-50%,-50%) scale(1);   opacity: .5; }
  to   { transform: translate(-50%,-50%) scale(1.6); opacity: 1; }
}

/* Orbital orientation shells */
.atom3d__orbit {
  position: absolute;
  top: 50%; left: 50%;
  width: 190px; height: 190px;
  transform-style: preserve-3d;
  transform: translate(-50%, -50%) rotateX(75deg);
}
.atom3d__orbit--2 { transform: translate(-50%, -50%) rotateX(75deg) rotateY(60deg); }
.atom3d__orbit--3 { transform: translate(-50%, -50%) rotateX(75deg) rotateY(120deg); }

/* Spinning ring */
.atom3d__ring {
  width: 100%; height: 100%;
  border: 1.5px solid rgba(59,130,246,.55);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(59,130,246,.15), inset 0 0 8px rgba(59,130,246,.05);
  animation: spinRing3d 3s linear infinite;
  position: relative;
  transform-style: preserve-3d;
}
@keyframes spinRing3d {
  to { transform: rotateZ(360deg); }
}

/* Electron */
.atom3d__electron {
  position: absolute;
  top: -7px; left: calc(50% - 7px);
  width: 14px; height: 14px;
  background: var(--neon);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--neon), 0 0 22px rgba(59,130,246,.6);
}

/* ── Floating symbols ─────────────────────────────────────────────────────── */
.float-symbols {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.float-sym {
  position: absolute;
  font-size: 2.6rem;
  opacity: 0.14;
  user-select: none;
  will-change: transform;
  /* No blur — keeps them looking like deliberate decorations rather than
     smudges on the screen. */
}

/* Section background symbols */
.section-sym {
  position: absolute;
  font-size: 14rem;
  opacity: 0.03;
  pointer-events: none;
  user-select: none;
  will-change: transform;
  z-index: 0;
  top: 50%;
  transform: translateY(-50%);
}
.section-sym--left  { left: -2rem; }
.section-sym--right { right: -2rem; }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 7rem 0 6rem;
  background: var(--bg);
  text-align: center;
  overflow: hidden;
}

/* Animated dot-grid background */
.hero__bg-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, #2a2a2a 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: .5;
  animation: gridPan 20s linear infinite;
}
@keyframes gridPan {
  0%   { background-position: 0 0; }
  100% { background-position: 32px 32px; }
}


.hero__inner { position: relative; z-index: 1; }

/* Level badges strip (inside hero) */
.levels-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .65rem .75rem;
  margin-top: 2.5rem;
  position: relative;
  z-index: 1;
}
.level-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1.4rem;
  min-height: 2.4rem;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .04em;
  /* Levels are "learning UI" → use the blue accent, not action-green */
  border: 1.5px solid rgba(59,130,246,.45);
  color: var(--accent-blue);
  background: var(--accent-blue-soft);
  cursor: pointer;
  text-decoration: none;
  position: relative;
  /* Subtle resting glow so they read as buttons, not flat tags */
  box-shadow: 0 1px 2px rgba(0,0,0,.2), 0 0 0 0 rgba(59,130,246,0);
  transition:
    background .25s ease,
    border-color .25s ease,
    color .25s ease,
    transform .2s cubic-bezier(.16, 1, .3, 1),
    box-shadow .25s ease;
}
a.level-chip:hover {
  background: rgba(59,130,246,.22);
  border-color: var(--accent-blue);
  color: #ffffff;
  transform: translateY(-3px) scale(1.04);
  box-shadow:
    0 0 0 4px rgba(59,130,246,.12),       /* outer halo ring */
    0 8px 22px rgba(59,130,246,.35),       /* glow drop */
    0 2px 6px rgba(0,0,0,.25);
  text-decoration: none;
}
a.level-chip:active {
  transform: translateY(-1px) scale(1.01);
  box-shadow:
    0 0 0 3px rgba(59,130,246,.10),
    0 4px 12px rgba(59,130,246,.28);
}
.level-chip--wip {
  border-color: var(--border-bright);
  color: var(--text-muted);
  background: transparent;
  box-shadow: none;
  cursor: not-allowed;
}
.level-chip__tag {
  display: inline-block;
  padding: .1rem .4rem;
  background: var(--surface-2);
  border: 1px solid var(--border-bright);
  border-radius: 999px;
  font-size: .65rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .06em;
  opacity: .45;
}

.hero__badge {
  display: inline-block;
  padding: .35rem 1rem;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6.5vw, 5rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--white);
  margin-bottom: 1.5rem;
  letter-spacing: -.04em;
}
.hero__title--accent {
  color: var(--neon);
}

.hero__subtitle {
  font-size: 1.05rem;
  color: rgba(255,255,255,.55);
  max-width: 520px;
  /* Generous breathing room above the CTA */
  margin: 0 auto 3.5rem;
  line-height: 1.85;
}
.hero__cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}
/* Premium hero CTA — Apple-style, intentional and balanced */
.hero__cta .btn {
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 600;
  min-width: 200px;
  border-radius: var(--radius-sm);
}
/* Hero CTA — default (Browse Resources for logged-in users): blue glow */
.hero__cta .btn--primary {
  box-shadow:
    0 0 0 1px rgba(59,130,246,.35),
    0 8px 22px rgba(59,130,246,.28),
    0 2px 8px rgba(59,130,246,.18);
  transition: transform .2s, box-shadow .2s, background .2s;
}
.hero__cta .btn--primary:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(59,130,246,.45),
    0 14px 30px rgba(59,130,246,.38),
    0 4px 12px rgba(59,130,246,.25);
}
.hero__cta .btn--primary:active {
  transform: translateY(0);
  box-shadow:
    0 0 0 1px rgba(59,130,246,.35),
    0 4px 14px rgba(59,130,246,.26);
}

/* "Start Learning Free" — electric orange to pop for unlogged-in visitors */
.hero__cta .btn--primary.btn--cta-orange {
  background: #FF6B00 !important;
  color: #ffffff !important;
  box-shadow:
    0 0 0 1px rgba(255,107,0,.45),
    0 8px 22px rgba(255,107,0,.32),
    0 2px 8px rgba(255,107,0,.20);
}
.hero__cta .btn--primary.btn--cta-orange:hover {
  background: #FF8124 !important;
  box-shadow:
    0 0 0 1px rgba(255,107,0,.55),
    0 14px 30px rgba(255,107,0,.42),
    0 4px 12px rgba(255,107,0,.28);
}
.hero__cta .btn--primary.btn--cta-orange:active {
  background: #E55A00 !important;
  box-shadow:
    0 0 0 1px rgba(255,107,0,.45),
    0 4px 14px rgba(255,107,0,.30);
}

/* Trust strip */
.trust-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0;
  margin: 2.75rem auto 0;
  width: fit-content;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,.08);
}
.trust-item {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .8rem;
  font-weight: 500;
  color: rgba(255,255,255,.8);
  letter-spacing: .01em;
  line-height: 1.5;
  padding: 0 1.1rem;
  white-space: nowrap;
}
.trust-item svg { flex-shrink: 0; opacity: .55; position: relative; top: 0; }
.trust-sep {
  flex-shrink: 0;
  width: 1px;
  height: .85rem;
  background: rgba(255,255,255,.18);
}
@media (max-width: 600px) {
  .trust-strip {
    flex-direction: column;
    align-items: flex-start;
    gap: .5rem;
    margin: 2.5rem auto 0;
    padding: 1.75rem 0 0;
    border-top: 1px solid rgba(255,255,255,.08);
    width: fit-content;
  }
  .trust-sep { display: none; }
  .trust-item { padding: 0; font-size: .82rem; }
  .levels-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .65rem;
    max-width: 320px;
    margin: 2.75rem auto 0;
  }
  .level-chip {
    justify-content: center;
  }
}

/* Scroll hint bouncing arrow */
.hero__scroll-hint {
  position: absolute;
  bottom: 2rem; left: 50%;
  transform: translateX(-50%);
  cursor: pointer;
}
.hero__scroll-hint span {
  display: block;
  width: 20px; height: 20px;
  border-right: 1.5px solid rgba(255,255,255,.25);
  border-bottom: 1.5px solid rgba(255,255,255,.25);
  transform: rotate(45deg);
  animation: scrollBounce 2.4s ease-in-out infinite;
}
@keyframes scrollBounce {
  0%, 100% { opacity: .15; transform: rotate(45deg) translateY(-5px); }
  50%       { opacity: .55; transform: rotate(45deg) translateY(3px); }
}

/* ── Stats ────────────────────────────────────────────────────────────────── */
.stats {
  padding: 3.5rem 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stats__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  text-align: center;
}
.stat {
  position: relative;
  padding: 1.25rem 1rem;
  border-radius: var(--radius);
  transition: transform var(--transition), background var(--transition);
}
.stat:hover { transform: translateY(-4px); background: rgba(255,255,255,.025); }
.stat + .stat::before {
  content: '';
  position: absolute;
  left: 0; top: 15%; bottom: 15%;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--border-bright), transparent);
}
.stat__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem; height: 2.75rem;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border-bright);
  margin: 0 auto .9rem;
  color: var(--text-muted);
  transition: border-color var(--transition), color var(--transition), box-shadow var(--transition);
}
.stat:hover .stat__icon {
  border-color: rgba(59,130,246,.5);
  color: var(--neon);
}
.stat__number {
  display: block;
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1;
  margin-bottom: .4rem;
}
.stat__label {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .09em;
}

/* ── Subject cards ────────────────────────────────────────────────────────── */
.subject-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius);
  padding: 2.5rem;
  transition: background var(--transition), border-color var(--transition);
}
.card:hover {
  background: var(--surface-2);
  border-color: rgba(255,255,255,0.08);
}
.card--subject { border-top: 3px solid var(--border-bright); }
.card--physics:hover   { border-top-color: var(--neon); }
.card--chemistry:hover { border-top-color: var(--neon); }
.card--biology:hover   { border-top-color: var(--neon); }
.card__icon { font-size: 2rem; margin-bottom: .75rem; perspective: 600px; }
.card--subject .card__icon { font-size: 0; }
.card--subject .subj-icon { width: 80px; height: 80px; }
.card--subject:hover .subj-icon {
  transform: perspective(500px) rotateX(-10deg) rotateY(12deg) translateZ(6px) scale(1.06);
  filter: drop-shadow(0 10px 22px rgba(59,130,246,.4));
}
.card--subject:active .subj-icon {
  transform: perspective(500px) rotateX(-10deg) rotateY(12deg) translateZ(6px) scale(1.06);
  filter: drop-shadow(0 10px 22px rgba(59,130,246,.4));
  animation-play-state: paused;
}
.card__title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--white);
}
.card__stats { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.card__stats li {
  display: flex; justify-content: space-between;
  font-size: .875rem;
  color: var(--text-muted);
  padding-bottom: .35rem;
  border-bottom: 1px solid var(--border);
}
.card__stats li:last-child { border-bottom: none; }
.card__stats strong { color: var(--white); font-weight: 700; }
.card__total { font-size: .8rem; color: var(--text-dim); margin-bottom: 1.25rem; }

/* ── How it works ─────────────────────────────────────────────────────────── */
.how__steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  text-align: center;
  position: relative;
}
/* Faint dashed arrow guiding the eye left → right through the three steps.
   Sits behind the cards (z-index 0) and is only drawn on wider viewports
   where the steps are arranged in a row. */
.how__steps::before {
  content: '';
  position: absolute;
  left: 12%; right: 12%;
  top: 3.4rem;             /* lines up with the centre of the icon circles */
  height: 0;
  border-top: 2px dashed rgba(59,130,246,.30);
  pointer-events: none;
  z-index: 0;
}
/* Tip-of-arrow at the right end */
.how__steps::after {
  content: '';
  position: absolute;
  right: calc(12% - 4px);
  top: calc(3.4rem - 5px);
  width: 0; height: 0;
  border-left: 8px solid rgba(59,130,246,.45);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  pointer-events: none;
  z-index: 0;
}
@media (max-width: 800px) {
  /* Hide the connector on narrow screens — steps stack vertically */
  .how__steps::before, .how__steps::after { display: none; }
}

.how__step {
  padding: 2rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition), box-shadow var(--transition), transform .25s;
  position: relative;
  z-index: 1;             /* sit above the dashed connector */
}
.how__step:hover {
  border-color: rgba(59,130,246,.4);
  box-shadow: 0 4px 20px rgba(0,0,0,.35), 0 0 0 1px rgba(59,130,246,.18);
  transform: translateY(-3px);
}
.how__step:hover .how__icon {
  background: rgba(59,130,246,.15);
  border-color: var(--accent-blue);
  color: var(--accent-blue-light, #60A5FA);
  transform: scale(1.05);
  box-shadow: 0 6px 18px rgba(59,130,246,.32);
}
.how__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 3.4rem; height: 3.4rem;
  background: rgba(59,130,246,.08);
  border: 1.5px solid rgba(59,130,246,.30);
  color: var(--accent-blue-light, #60A5FA);
  border-radius: 50%;
  margin-bottom: 1.1rem;
  /* Lift it slightly off the card so the connector visually threads through */
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  transition: background .25s, border-color .25s, color .25s, transform .25s, box-shadow .25s;
}
.how__icon svg { display: block; }
.how__step h4 { font-family: var(--font-display); font-size: 1.05rem; margin-bottom: .5rem; color: var(--white); }
.how__step p  { font-size: .9rem; color: var(--text-muted); }

/* ── CTA strip ────────────────────────────────────────────────────────────── */
.cta-strip { background: var(--bg); }
.cta-strip__inner {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
  padding: 3.5rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 4px 24px rgba(0,0,0,.4);
}
.cta-strip__inner h2 { font-family: var(--font-display); font-size: 2rem; color: var(--white); margin-bottom: .75rem; }
.cta-strip__inner p  { color: var(--text-muted); margin-bottom: 2rem; }

/* ── Auth pages ───────────────────────────────────────────────────────────── */
.auth-page {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - 65px);
  padding: 3rem 1.5rem;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
.auth-page::before {
  content: '';
  position: absolute;
  top: -20%; left: 50%;
  transform: translateX(-50%);
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(59,130,246,.06) 0%, transparent 65%);
  pointer-events: none;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 40px rgba(0,0,0,.5);
}
.auth-card__title { font-family: var(--font-display); font-size: 1.75rem; margin-bottom: .35rem; color: var(--white); }
.auth-card__sub   { color: var(--text-muted); margin-bottom: 2rem; font-size: .95rem; }
.auth-card__switch { text-align: center; margin-top: 1.5rem; font-size: .875rem; color: var(--text-muted); }

/* ── Forms ────────────────────────────────────────────────────────────────── */
.auth-form { display: flex; flex-direction: column; }
.form-group { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem; }
.form-row   { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; }
.form-label { font-size: .82rem; font-weight: 600; color: var(--text-muted); letter-spacing: .03em; text-transform: uppercase; }
.form-hint  { font-weight: 400; color: var(--text-dim); text-transform: none; }
.form-input, .form-select, .form-textarea {
  padding: .65rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .95rem;
  background: var(--bg-2);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.form-input::placeholder { color: var(--text-dim); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--neon);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.form-select option { background: var(--surface); color: var(--text); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-check { display: flex; align-items: center; gap: .5rem; font-size: .875rem; margin-bottom: 1rem; cursor: pointer; color: var(--text-muted); }

/* ── Password toggle ──────────────────────────────────────────────────────── */
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrap .form-input {
  padding-right: 2.75rem;
}
.pwd-toggle {
  position: absolute;
  right: .75rem;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  transition: color var(--transition);
}
.pwd-toggle:hover { color: var(--text-muted); }

/* ── File drop ────────────────────────────────────────────────────────────── */
.file-drop {
  border: 2px dashed var(--border-bright);
  border-radius: var(--radius-sm);
  padding: 2rem;
  text-align: center;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  cursor: pointer; position: relative;
  background: var(--bg-2);
}
.file-drop input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.file-drop--over { border-color: var(--neon); background: rgba(59,130,246,.04); box-shadow: 0 2px 12px rgba(0,0,0,.3); }
.file-drop__text  { font-size: .95rem; color: var(--text-muted); margin-bottom: .35rem; }
.file-drop__label { color: var(--neon); font-weight: 600; cursor: pointer; }
.file-drop__hint  { font-size: .8rem; color: var(--text-dim); }
.file-drop__chosen { font-size: .875rem; color: var(--neon); font-weight: 600; margin-top: .5rem; }

/* ── Resources page ───────────────────────────────────────────────────────── */
.filters {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}
.filters__row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; }
.filters__group { flex: 1 1 160px; margin-bottom: 0; }
.filters__group--grow { flex: 2 1 280px; }
.filters__btn { align-self: flex-end; height: 42px; }
.results-count { font-size: .875rem; color: var(--text-dim); margin-bottom: 1.25rem; }
.resource-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.resource-card { display: flex; flex-direction: column; position: relative; }
.resource-card__badges { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .85rem; padding-right: 4.5rem; }
.resource-card__title {
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 600;
  margin-bottom: .5rem; line-height: 1.4; color: var(--white);
}
.resource-card__desc  { font-size: .875rem; color: var(--text-muted); margin-bottom: 1rem; flex: 1; }
/* Extra breathing room above the Open button so the card doesn't feel cluttered */
.resource-card__footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,.05);
}
.resource-card__meta  { font-size: .78rem; color: var(--text-dim); }

/* Owner-only edit/delete icons in the top-right of each card */
.resource-card__admin {
  position: absolute;
  top: .65rem; right: .65rem;
  display: flex; gap: .3rem;
  z-index: 2;
}
.resource-card__admin-form { margin: 0; }
.resource-card__admin-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 7px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  color: var(--text-soft);
  cursor: pointer;
  padding: 0;
  transition: background .15s, border-color .15s, color .15s;
}
.resource-card__admin-btn:hover {
  background: rgba(59,130,246,.10);
  border-color: rgba(59,130,246,.35);
  color: var(--accent-blue-light, #60A5FA);
  text-decoration: none;
}
.resource-card__admin-btn--del:hover {
  background: rgba(239,68,68,.10);
  border-color: rgba(239,68,68,.35);
  color: #f87171;
}

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: .2rem .65rem;
  border-radius: 999px; font-size: .72rem; font-weight: 700;
  letter-spacing: .02em;
}
.badge--physics, .badge--chemistry, .badge--biology,
.badge--combined_physics, .badge--combined_chemistry, .badge--combined_biology,
.badge--science {
  background: rgba(255,255,255,.07); color: var(--text-muted);
  border: 1px solid rgba(255,255,255,.12);
}
/* Topic / type tags lean on the blue accent (learning UI) */
.badge--type  { background: var(--accent-blue-soft); color: var(--accent-blue); border: 1px solid rgba(59,130,246,.25); }
.badge--level { background: var(--surface-2); color: var(--text-soft); border: 1px solid var(--border-bright); }

/* ── Subscribe nav pill ───────────────────────────────────────────────────── */
.nav__link--subscribe {
  border: 1.5px solid var(--neon);
  color: var(--neon) !important;
  border-radius: var(--radius-sm);
  padding: .35rem .9rem;
  font-weight: 700;
  margin-left: .25rem;
}
.nav__link--subscribe:hover {
  background: rgba(59,130,246,.08);
  text-decoration: none;
}

/* ── Plan cards (subscribe page) ─────────────────────────────────────────── */
.plans-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.plan-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: .9rem;
  position: relative;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.plan-card--featured {
  border-color: var(--neon);
  box-shadow: 0 0 0 1px rgba(59,130,246,.15), 0 4px 24px rgba(59,130,246,.06);
}
.plan-card__badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--neon);
  color: #000;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  padding: .22rem .8rem;
  border-radius: 99px;
  white-space: nowrap;
}
.plan-card__name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .07em;
}
.plan-card__price {
  display: flex;
  align-items: baseline;
  gap: .3rem;
}
.plan-card__currency { font-size: .85rem; color: var(--text-muted); }
.plan-card__amount   { font-family: var(--font-display); font-size: 2.4rem; font-weight: 700; color: var(--white); line-height: 1; }
.plan-card__period   { font-size: .82rem; color: var(--text-dim); }
.plan-card__eq {
  font-size: .8rem;
  color: var(--text-dim);
  margin-top: -.25rem;
}
.plan-card__perks {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  padding: .75rem 0;
  border-top: 1px solid var(--border);
}
.plan-card__perks li {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .85rem;
  color: var(--text-muted);
}
.plan-card__perks li svg { flex-shrink: 0; color: var(--neon); opacity: .8; }
.plan-card--solo { max-width: 420px; margin: 0 auto; }
.plan-card__unavailable {
  font-size: .82rem;
  color: var(--text-dim);
  margin-top: auto;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
}
.plans-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-size: .8rem;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 2rem;
}
.plans-note svg { flex-shrink: 0; opacity: .5; }
.sub-perks-card {
  padding: 1.75rem 2rem;
}
@media (max-width: 560px) {
  .plans-grid { grid-template-columns: 1fr; }
}

/* ── Admin settings groups ────────────────────────────────────────────────── */
.settings-group {
  padding: 1.75rem 2rem;
  margin-bottom: 1.25rem;
}
.settings-group__title {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: .5rem;
}
.settings-group__title svg { opacity: .6; flex-shrink: 0; }
.settings-group__sub {
  font-size: .83rem;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

/* ── Success page ─────────────────────────────────────────────────────────── */
.success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: rgba(59,130,246,.08);
  border: 1px solid rgba(59,130,246,.25);
  color: var(--neon);
  margin: 0 auto;
}

/* ── Subscribe page ───────────────────────────────────────────────────────── */
.sub-card {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 2.25rem;
}
.sub-card__heading {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 1.25rem;
}
.sub-card__perks {
  display: flex;
  flex-direction: column;
  gap: .7rem;
  margin-bottom: 1.75rem;
}
.sub-card__perks li {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .9rem;
  color: var(--text-muted);
}
.sub-card__perks li svg { flex-shrink: 0; color: var(--neon); opacity: .8; }
.sub-card__price {
  display: flex;
  align-items: baseline;
  gap: .35rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.sub-card__currency { font-size: .9rem; color: var(--text-muted); }
.sub-card__amount   { font-family: var(--font-display); font-size: 2.5rem; font-weight: 700; color: var(--white); }
.sub-card__period   { font-size: .85rem; color: var(--text-dim); }

.sub-card__pay { border-top: 1px solid var(--border); padding-top: 2rem; }
.sub-card__pay-note { font-size: .875rem; color: var(--text-muted); margin-bottom: 1.25rem; line-height: 1.7; }

.pay-details { display: flex; flex-direction: column; gap: 0; }
.pay-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .7rem 0;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}
.pay-row:last-child { border-bottom: none; }
.pay-row__label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-dim); flex-shrink: 0; }
.pay-row__value { font-size: .9rem; color: var(--text); text-align: right; }
.pay-row__value--mono { font-family: monospace; font-size: .95rem; letter-spacing: .03em; color: var(--white); }

.sub-card__instructions {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .875rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ── Locked notice ────────────────────────────────────────────────────────── */
.locked-notice {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  background: var(--bg-2);
  color: var(--text-muted);
}
.locked-notice svg { flex-shrink: 0; margin-top: .15rem; opacity: .6; }
.locked-notice__title { font-weight: 700; color: var(--text); margin-bottom: .25rem; }
.locked-notice__sub   { font-size: .85rem; line-height: 1.6; }

.badge--locked { background: rgba(255,255,255,.05); color: var(--text-dim); border: 1px solid var(--border-bright); }
.badge--admin    { background: rgba(59,130,246,.08); color: var(--neon); border: 1px solid rgba(59,130,246,.2); }
.badge--operator { background: rgba(180,180,180,.08); color: var(--text); border: 1px solid rgba(255,255,255,.12); }

/* Role icons (crown / gear) shown next to usernames */
.role-icon { margin-right: .35rem; font-size: .95rem; }
.role-icon--owner    { filter: drop-shadow(0 0 4px rgba(255,200,80,.3)); }
/* Operators get a soft purple accent — sparingly, per the palette rules */
.role-icon--operator { opacity: .9; filter: drop-shadow(0 0 4px var(--accent-purple-soft)); }

/* Operator subject permissions panel */
/* Compact role dropdown inside the admin Users table */
.role-form { margin: 0; }
.role-select {
  font-size: .8rem;
  padding: .25rem .5rem;
  height: auto;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
}

.op-subjects { width: 100%; }
.op-subjects > summary {
  font-size: .78rem; font-weight: 600; color: var(--text-soft);
  cursor: pointer; padding: .15rem 0;
}
.op-subjects > summary:hover { color: var(--text); }
.op-subjects__form {
  display: flex; flex-direction: column; gap: .35rem;
  margin-top: .5rem; padding: .75rem;
  background: var(--surface-2);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 8px;
}
.op-subjects__row {
  display: flex; align-items: center; gap: .4rem;
  font-size: .82rem; color: var(--text);
  cursor: pointer;
}
.op-subjects__row input[type="checkbox"] {
  accent-color: var(--neon);
  width: 14px; height: 14px;
}
.badge--sub-active { background: rgba(59,130,246,.08); color: var(--neon); border: 1px solid rgba(59,130,246,.2); }
.badge--sub-none   { background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--border); }

/* ── Admin table ──────────────────────────────────────────────────────────── */
.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.admin-table th {
  text-align: left;
  padding: .85rem 1.25rem;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  white-space: nowrap;
}
.admin-table td {
  padding: .85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: middle;
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover td { background: rgba(255,255,255,.02); }
.admin-table__name  { color: var(--white); font-weight: 600; }
.admin-table__email { color: var(--text-dim); font-size: .85rem; }
.admin-table__na    { color: var(--text-dim); }

/* ── Empty state ──────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 5rem 2rem; color: var(--text-muted); }
.empty-state__icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3    { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: .5rem; color: var(--white); }
.empty-state p     { margin-bottom: 1.5rem; }

/* ── Resource detail ──────────────────────────────────────────────────────── */
.breadcrumb { font-size: .875rem; color: var(--text-dim); margin-bottom: 1.5rem; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--neon); }
.breadcrumb span { color: var(--text-muted); }
.detail__card  { max-width: 720px; margin: 0 auto; }
.detail__badges { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.detail__title {
  font-family: var(--font-display); font-size: 1.75rem; font-weight: 700;
  margin-bottom: 1rem; line-height: 1.3; color: var(--white);
}
.detail__desc { color: var(--text-muted); margin-bottom: 1.5rem; line-height: 1.7; }
.detail__meta {
  display: flex; flex-wrap: wrap; gap: 1.5rem;
  font-size: .875rem; color: var(--text-dim);
  margin-bottom: 2rem; padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.detail__meta strong { color: var(--text-muted); }

/* Download button — never overflow the card */
.detail__card .btn {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

/* PDF preview */
.pdf-preview { margin-top: 2rem; }
.pdf-preview__label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
  margin-bottom: .75rem;
}
.pdf-preview__wrap {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-2);
  min-height: 120px;
}
.pdf-preview__wrap canvas {
  display: block;
  width: 100%;
  height: auto;
}
.pdf-preview__loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  color: var(--text-dim);
  pointer-events: none;
}
@media (max-width: 768px) {
  /* nothing extra needed — canvas scales to 100% width automatically */
  /* Disable stuck touch-hover green border on cards */
  .card { border-color: var(--border) !important; }
  .card:hover { border-color: var(--border); box-shadow: none; }
}

/* ── Upload card ──────────────────────────────────────────────────────────── */
.upload-card { max-width: 660px; margin: 0 auto; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 4rem;
}
.footer__inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
}
.footer p { font-size: .875rem; color: var(--text-dim); }
.footer__support {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: .4rem .65rem;
  font-size: .85rem;
  color: var(--text-dim);
}
.footer__support-label {
  font-weight: 600;
  color: var(--text-soft);
  margin-right: .25rem;
}
.footer__support-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px dashed rgba(255,255,255,.18);
}
.footer__support-link:hover {
  color: var(--neon);
  border-bottom-color: var(--neon);
}
.footer__support-sep { color: var(--text-soft); opacity: .6; }

/* Mobile: condense the customer support row to a single line */
@media (max-width: 600px) {
  .footer__support {
    flex-wrap: nowrap;
    gap: .35rem;
    font-size: .72rem;
    overflow: hidden;
    white-space: nowrap;
  }
  .footer__support-label {
    margin-right: .15rem;
    font-size: .7rem;
  }
  .footer__support-link {
    font-size: .72rem;
    border-bottom: none;
    text-overflow: ellipsis;
    overflow: hidden;
  }
}

/* ── Practice dashboard ───────────────────────────────────────────────────── */
.practice-level { margin-bottom: 4rem; text-align: center; }

/* ── Practice page: desktop vs mobile visibility ──────────────────────── */
.practice-mobile-only { display: none; }
@media (max-width: 768px) {
  .practice-desktop-only { display: none; }
  .practice-mobile-only  { display: block; padding: 2.5rem 0 4rem; }
}

/* ── Mobile two-step picker ───────────────────────────────────────────── */
.mp-step {
  display: none;
  animation: mpFadeIn .35s cubic-bezier(.16, 1, .3, 1) both;
}
.mp-step[data-active="true"]  { display: block; }
.mp-step[data-leaving="true"] { display: block; animation: mpFadeOut .15s ease-in both; }
@keyframes mpFadeIn  {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes mpFadeOut {
  to { opacity: 0; transform: translateX(-16px); }
}

.mp-eyebrow {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-soft);
  margin: 0 0 .5rem;
}
.mp-title {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.1;
  margin: 0 0 .35rem;
  color: var(--text);
}
.mp-sub {
  font-size: .95rem;
  color: var(--text-soft);
  margin: 0 0 2rem;
  line-height: 1.5;
}

/* ── Step 1: Level picker ─────────────────────────────────────────────── */
.mp-level-grid {
  display: flex;
  flex-direction: column;
  gap: .85rem;
}
.mp-level {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.4rem 1.4rem;
  background: linear-gradient(135deg, rgba(28,28,30,.95), rgba(20,20,22,.95));
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 18px;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: transform .2s cubic-bezier(.16, 1, .3, 1), border-color .2s, box-shadow .2s;
  /* Staggered fade-in */
  opacity: 0;
  animation: mpLevelIn .5s cubic-bezier(.16, 1, .3, 1) forwards;
}
.mp-level:nth-child(1) { animation-delay: 60ms; }
.mp-level:nth-child(2) { animation-delay: 120ms; }
.mp-level:nth-child(3) { animation-delay: 180ms; }
.mp-level:nth-child(4) { animation-delay: 240ms; }
@keyframes mpLevelIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.mp-level:hover, .mp-level:focus-visible {
  border-color: rgba(59,130,246,.3);
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  transform: translateY(-2px);
}
.mp-level--pressed {
  transform: scale(.96) !important;
  border-color: var(--neon) !important;
  box-shadow:
    0 0 0 3px rgba(59,130,246,.15),
    0 12px 40px rgba(59,130,246,.25) !important;
}
.mp-level--pressed .mp-level__glow {
  opacity: 1;
  transform: scale(2.5);
}

/* The glow effect that pulses on press */
.mp-level__glow {
  position: absolute;
  top: 50%; left: 50%;
  width: 50%; height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,.4) 0%, transparent 70%);
  opacity: 0;
  transform: translate(-50%, -50%) scale(.5);
  transition: opacity .25s, transform .25s;
  pointer-events: none;
}

.mp-level__inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.mp-level__name {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -.02em;
  font-family: var(--font-display);
  color: var(--text);
  position: relative; z-index: 1;
}
.mp-level__count {
  font-size: .82rem;
  color: var(--text-soft);
  position: relative; z-index: 1;
}
.mp-level__chevron {
  font-size: 1.6rem;
  color: var(--text-soft);
  font-weight: 300;
  transition: transform .2s, color .2s;
  position: relative; z-index: 1;
}
.mp-level:hover .mp-level__chevron {
  color: var(--neon);
  transform: translateX(4px);
}

/* Per-level accent colors on the left edge */
.mp-level--G3      { border-left: 4px solid #22C55E; }
.mp-level--G2      { border-left: 4px solid #00bcd4; }
.mp-level--ALevel  { border-left: 4px solid #ff9100; }
.mp-level--PSLE    { border-left: 4px solid #c084fc; }

/* ── Step 2: Subject picker ───────────────────────────────────────────── */
.mp-back {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.06);
  color: var(--text-soft);
  font-size: .85rem;
  font-weight: 500;
  font-family: inherit;
  padding: .5rem .9rem;
  border-radius: 999px;
  cursor: pointer;
  margin-bottom: 1.5rem;
  transition: background .15s, color .15s;
}
.mp-back:hover {
  background: rgba(255,255,255,.08);
  color: var(--text);
}

.mp-subject-list {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.mp-subject {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.15rem;
  background: rgba(28,28,30,.85);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 14px;
  color: var(--text);
  text-decoration: none !important;
  opacity: 0;
  transform: translateX(20px);
  animation: mpSubjectIn .4s cubic-bezier(.16, 1, .3, 1) forwards;
  transition: transform .15s, border-color .15s, background .15s;
}
@keyframes mpSubjectIn {
  to { opacity: 1; transform: translateX(0); }
}
.mp-subject:hover, .mp-subject:focus-visible {
  background: rgba(36,36,40,.95);
  border-color: rgba(59,130,246,.3);
  transform: translateX(2px);
}
.mp-subject:active { transform: scale(.98); }

.mp-subject__icon-wrap {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.mp-subject__icon { font-size: 1.5rem; line-height: 1; }
.mp-subject__body { flex: 1; min-width: 0; }
.mp-subject__name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .15rem;
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
}
.mp-subject__tag {
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: rgba(255,255,255,.06);
  color: var(--text-soft);
  padding: .15rem .4rem;
  border-radius: 4px;
}
.mp-subject__count { font-size: .8rem; color: var(--text-soft); }
.mp-subject__count strong { color: var(--text); font-weight: 600; }
.mp-subject__chevron {
  font-size: 1.3rem;
  color: var(--text-dim);
  font-weight: 300;
  transition: color .15s, transform .15s;
}
.mp-subject:hover .mp-subject__chevron {
  color: var(--neon);
  transform: translateX(3px);
}
.practice-level__title {
  font-size: .82rem; font-weight: 600; color: var(--text-soft);
  text-transform: uppercase; letter-spacing: .07em;
  margin-bottom: 1.25rem; display: flex; align-items: center;
  justify-content: center; gap: .75rem;
}
.practice-level__subhead {
  font-size: 1rem; font-weight: 600; color: var(--text);
  margin: 1.75rem 0 1.25rem; text-align: center; letter-spacing: -0.01em;
}
.level-badge {
  display: inline-block; padding: .4rem 1.1rem; border-radius: 999px;
  font-size: .9rem; font-weight: 600; letter-spacing: .02em;
  background: rgba(59,130,246,.08);
  color: var(--neon); border: 1px solid rgba(59,130,246,.25);
  font-family: var(--font-display);
}
.practice-subject-grid {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem;
}
.practice-subject-grid .practice-subject-card {
  flex: 0 1 240px;
}
.practice-subject-card {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 2rem 1.75rem; text-decoration: none; color: var(--text);
  gap: .75rem;
  background:
    linear-gradient(180deg, rgba(255,255,255,.025) 0%, rgba(255,255,255,0) 50%),
    #1c1c1e;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  position: relative;
  /* Multi-layer resting shadow — already feels slightly raised */
  box-shadow:
    0 1px 0 rgba(255,255,255,.04) inset,                 /* top inner highlight */
    0 1px 2px rgba(0,0,0,.5),                            /* tight contact shadow */
    0 4px 14px rgba(0,0,0,.25);                          /* ambient lift */
  transition:
    transform .35s cubic-bezier(.16, 1, .3, 1),
    box-shadow .35s cubic-bezier(.16, 1, .3, 1),
    border-color .25s,
    background .25s;
  will-change: transform;
}
/* Subtle blue rim that fades in on hover, drawn with a pseudo-element so it
   doesn't repaint the whole card. Gives that "lit from above" 3D feel. */
.practice-subject-card::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, rgba(59,130,246,.45) 0%, rgba(59,130,246,0) 60%);
  -webkit-mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
}
.practice-subject-card:hover {
  transform: translateY(-6px) scale(1.015);
  text-decoration: none;
  border-color: rgba(255,255,255,0.10);
  box-shadow:
    0 1px 0 rgba(255,255,255,.06) inset,
    0 8px 16px rgba(0,0,0,.4),
    0 24px 48px rgba(0,0,0,.35),
    0 0 0 1px rgba(59,130,246,.18);                      /* faint blue rim */
}
.practice-subject-card:hover::before { opacity: 1; }
.practice-subject-card:active {
  transform: translateY(-2px) scale(1.005);
  box-shadow:
    0 1px 0 rgba(255,255,255,.05) inset,
    0 4px 10px rgba(0,0,0,.45),
    0 10px 20px rgba(0,0,0,.3);
  transition: transform .08s, box-shadow .08s;
}
.practice-subject-card:hover * { text-decoration: none; }

/* Touch feedback — :active mirrors the hover effect on phones (no :hover support).
   Also fires on PC click; hover handles the rest there. */
.practice-subject-card:active .subj-icon {
  transform: perspective(500px) rotateX(-12deg) rotateY(14deg) translateZ(8px) scale(1.08);
  filter: drop-shadow(0 12px 24px rgba(59,130,246,.45));
  animation-play-state: paused;
}

/* Combined-subjects badge — tiny pill in the top-right corner of the card */
.practice-subject-card--combined { position: relative; }
.combined-badge {
  position: absolute;
  top: .9rem; right: .9rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .25rem .55rem;
  border-radius: 999px;
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  border: 1px solid rgba(59,130,246,.25);
  pointer-events: none;
}

/* Mobile picker — give the SVG icon a proper container so it sits cleanly */
.mp-subject__icon { display: inline-flex; align-items: center; justify-content: center; }
.mp-subject__icon .subj-icon { width: 44px; height: 44px; }
.practice-subject-card__icon {
  font-size: 2rem; line-height: 1;
  margin-bottom: .25rem;
  perspective: 600px;
}

/* ── Subject SVG icons (3D-feeling, hover-tilt) ────────────────────────────
   Each card shows an animated SVG (atom / flask / DNA helix). On hover the
   icon tilts in 3D and gains a soft glow — gives a tactile, premium feel
   without a dependency. */
.subj-icon {
  display: inline-block;
  position: relative;
  transform-style: preserve-3d;
  transition:
    transform .35s cubic-bezier(.16, 1, .3, 1),
    filter .35s;
  will-change: transform;
  /* Subtle resting tilt so they don't look flat-on */
  transform: perspective(500px) rotateX(8deg) rotateY(-4deg);
  filter: drop-shadow(0 6px 14px rgba(59,130,246,.18));
}
.subj-icon svg { width: 100%; height: 100%; display: block; overflow: visible; }
.practice-subject-card:hover .subj-icon {
  transform: perspective(500px) rotateX(-12deg) rotateY(14deg) translateZ(8px) scale(1.08);
  filter: drop-shadow(0 12px 24px rgba(59,130,246,.35));
}

/* Subtle floating idle animation — adds life without being distracting */
@keyframes subjIconFloat {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -3px; }
}
.subj-icon { animation: subjIconFloat 4s ease-in-out infinite; }
.practice-subject-card:hover .subj-icon { animation-play-state: paused; }

/* Per-subject tints on hover */
.practice-subject-card--physics:hover .subj-icon,
.practice-subject-card--combined_physics:hover .subj-icon {
  filter: drop-shadow(0 12px 24px rgba(59,130,246,.45));
}
.practice-subject-card--chemistry:hover .subj-icon,
.practice-subject-card--combined_chemistry:hover .subj-icon {
  filter: drop-shadow(0 12px 24px rgba(34,211,238,.45));
}
.practice-subject-card--biology:hover .subj-icon,
.practice-subject-card--combined_biology:hover .subj-icon {
  filter: drop-shadow(0 12px 24px rgba(167,139,250,.45));
}

/* DNA helix gentle rotation around its vertical axis */
.subj-icon--biology .bio-helix {
  transform-origin: 40px 50px;
  animation: bioHelixSpin 8s linear infinite;
}
@keyframes bioHelixSpin {
  from { transform: rotateY(0deg); }
  to   { transform: rotateY(360deg); }
}
.practice-subject-card__name {
  font-size: 1.3rem;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: -.02em;
  margin: 0;
  color: var(--text);
}
.practice-subject-card__count { font-size: .9rem; color: var(--text-soft); margin: 0; }
.practice-subject-card__cta {
  margin-top: .5rem; font-size: .85rem; font-weight: 600;
  color: var(--neon); letter-spacing: 0;
}

/* ── Practice subject dashboard ───────────────────────────────────────────── */
.practice-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: calc(100vh - 64px);
  background:
    linear-gradient(to right,
      var(--surface) 0,
      var(--surface) 340px,
      var(--border) 340px,
      var(--border) 341px,
      transparent 341px);
}
/* Remove the 64px body-bg gap between practice page and footer */
main:has(.practice-layout) + .footer { margin-top: 0; }
.practice-sidebar {
  border-right: 1px solid var(--border);
  background: var(--surface);
  padding: 1.75rem 1.5rem;
  overflow-y: auto;
  max-height: calc(100vh - 64px);
  position: sticky; top: 64px;
}
.practice-sidebar__back {
  display: inline-block; font-size: .95rem; font-weight: 600;
  color: var(--text-muted); margin-bottom: 1.4rem;
  text-decoration: none;
}
.practice-sidebar__back:hover { color: var(--text); text-decoration: none; }
.practice-sidebar__heading-btn {
  background: none; border: none; padding: 0; margin: 0 0 1.75rem;
  text-align: left; width: 100%; display: block;
  border-radius: 6px; transition: opacity .15s;
}
.practice-sidebar__heading-btn:hover { opacity: .75; }
.practice-sidebar__subject {
  font-size: 1.85rem; font-weight: 700; margin: 0; color: var(--text);
  letter-spacing: -0.025em; line-height: 1.1;
  font-family: var(--font-display);
}
.practice-sidebar__level {
  font-size: 1rem; color: var(--neon); font-weight: 600;
  margin: .35rem 0 2rem; letter-spacing: -0.01em; text-transform: none;
  font-family: var(--font-display);
}
.practice-sidebar__heading {
  font-size: .72rem; font-weight: 600; color: var(--text-soft);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: .85rem;
}

.topic-list-v { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .15rem; }
.topic-item {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  background: transparent; border: 1px solid transparent; border-radius: 8px;
  padding: .75rem 1rem; color: var(--text); font-size: .95rem;
  text-align: left; transition: background .15s, border-color .15s;
}
.topic-item:not(:disabled):hover { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.06); }
.topic-item--empty { opacity: .35; }
.topic-item__name  {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 500;
  font-size: 1rem;
  flex: 1;
  line-height: 1.35;
  letter-spacing: -.01em;
}
.topic-item__meta  { display: flex; gap: .5rem; align-items: center; flex-shrink: 0; margin-left: .6rem; }
.topic-item__count { font-size: .75rem; color: var(--text-soft); font-weight: 500; padding: .15rem .5rem; background: rgba(255,255,255,0.04); border-radius: 4px; }
.topic-item__count--soon { background: transparent; color: var(--text-dim); font-weight: 500; }
.topic-item__score { font-size: .85rem; color: var(--text); font-weight: 600; }

.practice-main {
  width: 100%;
  max-width: none;
  padding: 3rem 2.5rem 3.5rem;
}
/* Anchor the inner content on wide screens — feels less drifty on ultrawide */
.practice-main > * { max-width: 1320px; margin-left: auto; margin-right: auto; }

.practice-head {
  margin-bottom: 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.practice-head__main { flex: 1; min-width: 0; }

/* Review-mode toggle (sits in the dashboard header) */
.review-toggle {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  cursor: pointer;
  user-select: none;
  padding: .55rem .85rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: background .15s, border-color .15s;
}
.review-toggle:hover { border-color: var(--neon); }
.review-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.review-toggle__track {
  position: relative;
  width: 38px; height: 22px;
  background: rgba(255,255,255,.1);
  border-radius: 999px;
  transition: background .15s;
  flex-shrink: 0;
}
.review-toggle__thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: left .18s cubic-bezier(.16, 1, .3, 1);
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.review-toggle__label {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.01em;
}
.review-toggle input:checked ~ .review-toggle__track {
  background: var(--neon);
}
.review-toggle input:checked ~ .review-toggle__track .review-toggle__thumb {
  left: 18px;
  background: #000;
}
/* Subtle visual indicator on the topic list when review mode is on */
body.review-mode-on .topic-item:not([disabled]) { border-color: rgba(59,130,246,.25); }
body.review-mode-on .topic-item:not([disabled]):hover { background: rgba(59,130,246,.08); }

/* Mobile-only sidebar toggle — sits next to the subject name. Hidden on
   desktop (where the dashboard-header toggle is used instead). */
.practice-sidebar__head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.review-toggle--sidebar { display: none; }
@media (max-width: 800px) {
  /* Show the sidebar toggle, hide the desktop dashboard toggle. */
  .review-toggle--sidebar {
    display: inline-flex;
    flex-shrink: 0;
    align-self: center;
  }
  .practice-head .review-toggle:not(.review-toggle--sidebar) { display: none; }
}

/* Review reset buttons (under the review viewer) */
.review-reset {
  display: flex;
  gap: .65rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px dashed rgba(255,255,255,.08);
  flex-wrap: wrap;
}
.review-reset .btn {
  flex: 1;
  min-width: 200px;
  font-size: .82rem;
  padding: .55rem .9rem;
}
/* Generic ghost button — quieter than outline, used for less-emphasized actions */
.btn--ghost {
  background: transparent;
  color: var(--text-soft);
  border: 1px solid rgba(255,255,255,.08);
  font-weight: 600;
}
.btn--ghost:hover {
  color: var(--neon);
  border-color: rgba(59,130,246,.3);
  background: rgba(59,130,246,.05);
}
.practice-head__title { font-size: 1.75rem; font-weight: 700; margin: 0; letter-spacing: -0.02em; line-height: 1.15; }
.practice-head__sub   { font-size: .9rem; color: var(--text-soft); margin: .35rem 0 0; }

.stat-rings {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem; margin-bottom: 2rem;
}
.stat-ring--streak {
  background: linear-gradient(135deg, rgba(255,140,0,.08), rgba(255,80,0,.04));
  border-color: rgba(255,140,0,.25);
  justify-content: center;
}
.stat-ring--streak .stat-ring__value {
  position: static; transform: none;
  font-size: 2rem; margin-top: .25rem;
}
.streak-flame {
  font-size: 3rem; line-height: 1; margin-bottom: .5rem;
  filter: drop-shadow(0 0 8px rgba(255,140,0,.4));
}

/* ── Dashboard widget grid (responsive — adapts to ultrawide) ────────────── */
.dash-row-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.75rem; margin-bottom: 2rem;
  align-items: stretch;
}
.dash-widget {
  background: #1c1c1e;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 0;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.dash-widget:hover {
  transform: translateY(-4px);
  border-color: rgba(255,255,255,0.1);
  box-shadow: 0 8px 28px rgba(0,0,0,0.35);
}
/* Empty / no-content variant — clearly muted, no hover lift */
.dash-widget--empty {
  background: rgba(28,28,30,0.55);
  opacity: .7;
}
.dash-widget--empty:hover {
  transform: none;
  border-color: rgba(255,255,255,0.05);
  box-shadow: none;
}
.dash-widget--empty .dash-widget__title { color: var(--text-soft); }
@media (max-width: 1100px) {
  .dash-row-top { grid-template-columns: 1fr; }
}
.dash-widget__title {
  font-size: 1.05rem; font-weight: 600; margin: 0 0 1.25rem;
  letter-spacing: -0.01em;
}
.dash-empty { font-size: .85rem; color: var(--text-soft); margin: 0; }

/* Heatmap (GitHub-style) */
.heatmap {
  display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px;
  margin-bottom: .75rem;
}
.heatmap__cell {
  aspect-ratio: 1 / 1; border-radius: 3px;
  background: rgba(255,255,255,.04);
}
.heatmap__cell--low  { background: rgba(59,130,246,.15); }
.heatmap__cell--med  { background: rgba(59,130,246,.4); }
.heatmap__cell--high { background: var(--neon); }
.heatmap__legend {
  display: flex; align-items: center; gap: .35rem;
  font-size: .7rem; color: var(--text-dim); justify-content: flex-end;
}
.heatmap__legend .heatmap__cell { width: 11px; height: 11px; aspect-ratio: auto; }

/* Recent activity feed */
.recent-feed { display: flex; flex-direction: column; gap: .65rem; }
.recent-feed__row {
  display: flex; align-items: center; gap: .75rem;
  padding: .55rem .75rem;
  background: var(--surface-2); border-radius: 8px;
}
.recent-feed__icon {
  width: 1.7rem; height: 1.7rem; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-weight: 900; font-size: .85rem;
}
.recent-feed__icon--ok { background: rgba(16,185,129,.15); color: #10B981; }
.recent-feed__icon--no { background: rgba(239,68,68,.12);  color: #ef4444; }
.recent-feed__body  { flex: 1; min-width: 0; }
.recent-feed__topic { font-size: .85rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-feed__when  { font-size: .72rem; color: var(--text-dim); }

/* Strengths / Weaknesses */
/* Sleek inline strengths / needs-work bar (top of dashboard) */
.insights-bar {
  display: flex; align-items: stretch; gap: 0;
  background: linear-gradient(135deg, rgba(16,185,129,.04), rgba(239,68,68,.04));
  border: 1px solid var(--border); border-radius: 14px;
  padding: 1rem 1.25rem; margin-bottom: 1.5rem;
  overflow: hidden;
}
.insights-bar__half {
  flex: 1; display: flex; align-items: center; gap: .9rem; min-width: 0;
  padding: .25rem .5rem;
}
.insights-bar__divider {
  width: 1px; background: var(--border); margin: 0 .5rem; flex-shrink: 0;
}
.insights-bar__label {
  font-size: .78rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-muted);
  white-space: nowrap; flex-shrink: 0;
}
.insights-bar__chips {
  display: flex; flex-wrap: wrap; gap: .4rem; flex: 1; min-width: 0;
}
.insights-bar__empty {
  font-size: .8rem; color: var(--text-dim); font-style: italic;
}
.insight-chip {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .35rem .7rem .35rem .8rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: .82rem; font-weight: 600; color: var(--text);
  white-space: nowrap;
}
.insight-chip__score {
  font-weight: 800; font-size: .78rem;
  padding: .1rem .45rem;
  border-radius: 999px;
}
.insight-chip--strength { border-color: rgba(16,185,129,.4); background: rgba(16,185,129,.08); }
.insight-chip--strength .insight-chip__score { color: #10B981; background: rgba(16,185,129,.15); }
.insight-chip--weakness { border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.08); }
.insight-chip--weakness .insight-chip__score { color: #ef4444; background: rgba(239,68,68,.15); }

@media (max-width: 900px) {
  .insights-bar { flex-direction: column; gap: 1rem; }
  .insights-bar__divider { width: auto; height: 1px; margin: 0; }
}

/* Ultrawide: spread widgets across more columns */
@media (min-width: 1800px) {
  .dash-widgets { grid-template-columns: 2fr 1fr 1fr; }
  .dash-widget--wide { grid-column: auto; }
  .stat-rings { grid-template-columns: repeat(4, 1fr); }
}
.stat-ring {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 1.5rem 1rem;
  display: flex; flex-direction: column; align-items: center; position: relative;
}
.stat-ring svg { display: block; }
.stat-ring__value {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, calc(-50% - 14px));
  font-size: 1.4rem; font-weight: 800; color: var(--text);
}
.stat-ring__label { margin-top: .65rem; font-size: .8rem; color: var(--text-muted); font-weight: 600; }

.practice-actions { margin: 1.5rem 0 3.5rem; }
.practice-section-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 3rem 0 1.5rem;
  letter-spacing: -0.01em;
  color: var(--text);
}
.practice-section-title:first-child { margin-top: 0; }

.topic-perf { display: flex; flex-direction: column; gap: .6rem; }
.topic-perf__row {
  display: grid; grid-template-columns: 1fr 2fr 60px auto;
  align-items: center; gap: 1rem;
  padding: .9rem 1.1rem;
  background: #1c1c1e; border: 1px solid rgba(255,255,255,0.05); border-radius: 10px;
  font-size: .9rem;
  transition: border-color .2s, background .2s, transform .2s, box-shadow .2s;
}
.topic-perf__row--empty {
  background: rgba(28,28,30,0.5);
  border-color: rgba(255,255,255,0.03);
  opacity: .55;
}
.topic-perf__row--clickable { cursor: pointer; }
.topic-perf__row--clickable:hover {
  border-color: rgba(255,255,255,0.1);
  background: var(--surface-2);
  transform: translateY(-2px);
  box-shadow: 0 4px 18px rgba(0,0,0,0.3);
}
.topic-perf__row--clickable:focus-visible {
  outline: 2px solid var(--neon); outline-offset: 2px;
}
.topic-perf__name  {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 600;
  font-size: .95rem;
  color: var(--text);
  letter-spacing: -.01em;
}
.topic-perf__bar   { height: 6px; background: rgba(255,255,255,0.05); border-radius: 999px; overflow: hidden; }
.topic-perf__fill  { height: 100%; background: var(--neon); border-radius: 999px; transition: width .4s; }
.topic-perf__score { font-size: .85rem; font-weight: 600; color: var(--text); text-align: right; }
.topic-perf__score em { color: var(--text-soft); font-style: normal; font-size: .75rem; }
.topic-perf__chevron {
  font-size: 1.3rem; color: var(--text-dim); font-weight: 400;
  width: 14px; text-align: center; transition: color .15s, transform .15s;
}
.topic-perf__row--clickable:hover .topic-perf__chevron { color: var(--text); transform: translateX(3px); }

/* Review view: marks "your answer" with a subtle ring (in addition to correct/wrong) */
.quiz-option--yours { box-shadow: inset 0 0 0 2px rgba(255,255,255,.15); }
.review-when {
  font-size: .8rem; color: var(--text-dim); margin: 0 0 .75rem;
  text-transform: uppercase; letter-spacing: .04em; font-weight: 600;
}
.review-nav {
  display: flex; gap: 1rem; justify-content: space-between; margin-top: 1.5rem;
}
.review-nav .btn[disabled] { opacity: .35; cursor: not-allowed; }

@media (max-width: 800px) {
  .practice-layout { grid-template-columns: 1fr; min-height: auto; background: none; }
  .practice-sidebar {
    position: static; max-height: none;
    border-right: none; border-bottom: none;
    padding: 1.75rem 1.25rem 1rem;
    background: var(--bg);
  }
  .practice-main { padding: 0; }
  /* Mobile: no dashboard cards, no analytics — sidebar's topic list is the page.
     Keep only the quiz/review/results views which appear when a topic is tapped. */
  #dashboard-view .practice-head,
  #dashboard-view .insights-bar,
  #dashboard-view .stat-rings,
  #dashboard-view .practice-actions,
  #dashboard-view .dash-row-top,
  #dashboard-view .dash-widget {
    display: none !important;
  }
  /* Make the sidebar topic items feel touch-friendly on mobile */
  .topic-item { padding: 1rem 1.1rem; font-size: 1rem; border-radius: 12px; }
  .topic-item__name { font-size: 1.05rem; font-weight: 600; }
  .topic-item:not(:disabled):active {
    background: rgba(59,130,246,.12);
    transform: scale(.98);
  }
  /* The topics heading on mobile */
  .practice-sidebar__heading { font-size: .78rem; margin-top: .5rem; }
  .practice-sidebar__subject { font-size: 2.1rem; }
  .practice-sidebar__level { font-size: 1.05rem; }

  /* While in quiz/review view: hide the sidebar so the user can't scroll
     back up to the topic list. They use the back-arrow button to return. */
  body.in-quiz .practice-sidebar { display: none; }

  /* ── Mobile question card (modern learning-app feel) ─────────────────── */
  .quiz-panel {
    padding: 1.25rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom));
    margin: .75rem .65rem 1.25rem;
    border-radius: 22px;
    background: linear-gradient(180deg, #1d1d20 0%, #161618 100%);
    border: 1px solid rgba(255,255,255,.07);
    box-shadow:
      0 24px 50px rgba(0,0,0,.5),
      0 6px 16px rgba(0,0,0,.3);
    max-width: none;
    overflow: hidden;
  }

  /* Slim, single-row header: icon back + topic·progress meta */
  .quiz-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
    gap: .75rem;
  }
  .quiz-back-btn {
    width: 38px; height: 38px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.06);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  .quiz-back-btn span { display: none; }      /* hide "Back to Dashboard" text on mobile */
  .quiz-back-btn svg {
    width: 18px !important;
    height: 18px !important;
    color: var(--text);
    display: block;
  }
  .quiz-meta {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: rgba(59,130,246,.1);
    color: var(--neon);
    border: 1px solid rgba(59,130,246,.2);
    padding: .35rem .8rem;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 600;
    flex-shrink: 0;
  }
  .quiz-mode-tag {
    color: var(--neon);
    font-size: .82rem;
    font-weight: 600;
  }
  .quiz-mode-tag::after {
    content: "·";
    margin: 0 .1rem 0 .35rem;
    opacity: .6;
  }
  .quiz-counter {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    color: var(--neon) !important;
    font-size: .82rem;
    font-weight: 600;
  }

  /* Each new question slides in with a smoother, slightly bouncier curve */
  #quiz-question-view {
    animation: quizCardIn .5s cubic-bezier(.34, 1.4, .55, 1) both;
  }
  @keyframes quizCardIn {
    0%   { opacity: 0; transform: translateX(36px) scale(.94); filter: blur(2px); }
    60%  { filter: blur(0); }
    100% { opacity: 1; transform: translateX(0) scale(1); filter: blur(0); }
  }
  .quiz-topic-label { display: none; }   /* topic now shown in the header pill */

  /* Question text: 18px / 1.55 line-height for premium reading */
  .quiz-stem {
    font-size: 1.125rem;
    line-height: 1.55;
    font-weight: 600;
    letter-spacing: -.01em;
    margin-bottom: 1.25rem;
    color: var(--text);
  }

  /* Question image — subtle inset card */
  .quiz-image {
    margin: 0 0 1.5rem;
    padding: .85rem;
    background: #fff;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 4px 14px rgba(0,0,0,.3);
    max-width: 100%;
    width: 100%;
  }

  /* Options — generous spacing, tappable, satisfying selected state */
  .quiz-options { gap: .9rem; margin-bottom: 0; }
  .quiz-option {
    min-height: 68px;
    padding: 1.1rem 1.2rem;
    font-size: 1rem;
    border-radius: 16px;
    background: rgba(255,255,255,.04);
    border: 1.5px solid rgba(255,255,255,.06);
    color: var(--text);
    transition:
      transform .15s cubic-bezier(.16, 1, .3, 1),
      background .15s,
      border-color .15s,
      box-shadow .15s;
  }
  .quiz-option:active:not([disabled]) {
    transform: scale(.97);
    background: rgba(59,130,246,.1);
    border-color: rgba(59,130,246,.4);
  }
  .quiz-option__letter {
    width: 32px; height: 32px;
    font-size: .9rem;
    flex-shrink: 0;
    transition: transform .2s, background .15s, color .15s;
  }
  .quiz-option__text { font-size: 1rem; line-height: 1.4; flex: 1; }

  /* Selected/locked states with bouncy scale */
  .quiz-option--correct {
    background: rgba(59,130,246,.14) !important;
    border-color: var(--neon) !important;
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
    animation: quizCorrectPulse .45s cubic-bezier(.34, 1.56, .64, 1) both;
  }
  .quiz-option--correct .quiz-option__letter {
    background: var(--neon);
    color: #000;
    transform: scale(1.05);
  }
  .quiz-option--wrong {
    background: rgba(239, 68, 68, .12) !important;
    border-color: rgba(239, 68, 68, .55) !important;
    animation: quizWrongShake .35s ease-in-out both;
  }
  .quiz-option--wrong .quiz-option__letter {
    background: rgba(239, 68, 68, .25);
    color: #f87171;
  }
  @keyframes quizCorrectPulse {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.025); }
    100% { transform: scale(1); }
  }
  @keyframes quizWrongShake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-5px); }
    40%      { transform: translateX(4px); }
    60%      { transform: translateX(-3px); }
    80%      { transform: translateX(2px); }
  }

  /* Keep the in-card Previous/Next buttons on mobile (no sticky bar). */
  .quiz-nav {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    margin-top: 1.5rem;
  }
  .quiz-nav__btn { flex: 1; min-width: 0; }

  /* ── Mobile: render multi-column tables as STACKED CARDS ────────────────
     No more horizontal scrolling. Each option (A/B/C/D) becomes a self-
     contained card; columns stack vertically inside it as label/value pairs. */
  .quiz-option-table-wrap {
    overflow: visible;
    mask-image: none;
    -webkit-mask-image: none;
    margin-top: 0;
  }
  .quiz-option-table {
    display: block;
    width: 100%;
    min-width: 0;
    font-size: .95rem;
    border-collapse: separate;
    border-spacing: 0;
  }
  .quiz-option-table thead { display: none; }   /* column names move into each cell */
  .quiz-option-table tbody { display: flex; flex-direction: column; gap: .65rem; }
  .quiz-option-row {
    display: flex;
    flex-direction: column;
    background: rgba(255,255,255,.04);
    border: 1.5px solid rgba(255,255,255,.06);
    border-radius: 14px;
    padding: .85rem 1rem;
    cursor: pointer;
    transition:
      transform .15s cubic-bezier(.16, 1, .3, 1),
      background .15s,
      border-color .15s;
  }
  .quiz-option-row:active:not(.quiz-option-row--disabled) {
    transform: scale(.97);
    background: rgba(59,130,246,.1);
    border-color: rgba(59,130,246,.4);
  }
  /* The A/B/C/D label sits at the top-left of the card as a circular badge */
  .quiz-option-row .quiz-option-row__label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px !important;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
    color: var(--text);
    font-weight: 700;
    font-size: .85rem;
    border: none;
    padding: 0;
    margin: 0 0 .65rem;
  }
  .quiz-option-row td {
    border: none;
    padding: 0;
    background: none;
  }
  /* Column data: each cell shows "P TO Q ··· constant" */
  .quiz-option-row td:not(.quiz-option-row__label) {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: .35rem 0;
    border-top: 1px solid rgba(255,255,255,.04);
    font-weight: 500;
  }
  .quiz-option-row td:not(.quiz-option-row__label):first-of-type {
    border-top: none;
    padding-top: 0;
  }
  /* The label (column name) auto-injected via data-label */
  .quiz-option-row td:not(.quiz-option-row__label)::before {
    content: attr(data-label);
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-soft);
    flex-shrink: 0;
  }
  /* Selected/correct/wrong styling adapts to the card layout */
  .quiz-option-row--correct {
    background: rgba(59,130,246,.12);
    border-color: var(--neon);
  }
  .quiz-option-row--correct .quiz-option-row__label {
    background: var(--neon);
    color: #000;
  }
  .quiz-option-row--wrong {
    background: rgba(239,68,68,.12);
    border-color: rgba(239,68,68,.55);
  }
  .quiz-option-row--wrong .quiz-option-row__label {
    background: rgba(239,68,68,.25);
    color: #f87171;
  }
  .quiz-option-row--yours { outline: none; }   /* outline doesn't make sense on cards */

  /* Sticky bottom action bar removed — using in-card Previous/Next instead. */
  .quiz-mobile-action { display: none !important; }

  /* Swipe animations */
  #quiz-question-view.quiz-swipe-out-left {
    animation: quizSwipeOutLeft .25s cubic-bezier(.4, 0, 1, 1) forwards;
  }
  #quiz-question-view.quiz-swipe-out-right {
    animation: quizSwipeOutRight .25s cubic-bezier(.4, 0, 1, 1) forwards;
  }
  @keyframes quizSwipeOutLeft {
    to { opacity: 0; transform: translateX(-100vw) rotate(-8deg); }
  }
  @keyframes quizSwipeOutRight {
    to { opacity: 0; transform: translateX(100vw) rotate(8deg); }
  }
}
/* Sticky bar hidden on desktop */
@media (min-width: 801px) {
  .quiz-mobile-action { display: none; }
}

/* ── Duolingo-style 3D buttons (used for quiz nav + sticky mobile next) ──
   The trick: a hard non-blurred shadow underneath gives the button a sense of
   depth, like it's resting on a colored block. On press, the button pushes
   down into the shadow (translateY + shadow shrinks) for a satisfying click. */
.quiz-duo-btn,
.quiz-nav__btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .7rem 1.5rem;
  min-width: 130px;
  border: none;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: .88rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform .12s cubic-bezier(.16, 1, .3, 1),
    box-shadow .12s cubic-bezier(.16, 1, .3, 1),
    filter .15s,
    background .15s;
}
/* Sticky mobile button is the primary CTA — keep it bigger and full-width */
.quiz-mobile-action .quiz-duo-btn {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  border-radius: 14px;
}

/* Primary (Next / sticky) — green with darker green shadow */
.quiz-duo-btn--primary,
.quiz-nav__btn--next {
  background: var(--neon);
  color: #000;
  box-shadow:
    0 4px 0 0 #1D4ED8,                  /* hard 3D bottom */
    0 6px 14px rgba(59,130,246,.18);     /* soft halo */
}
.quiz-duo-btn--primary:hover,
.quiz-nav__btn--next:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow:
    0 5px 0 0 #1D4ED8,
    0 8px 18px rgba(59,130,246,.28);
}
.quiz-duo-btn--primary:active,
.quiz-nav__btn--next:active {
  transform: translateY(3px);
  box-shadow:
    0 1px 0 0 #1D4ED8,
    0 2px 6px rgba(59,130,246,.15);
}

/* Secondary (Previous) — white-on-dark with neutral shadow */
.quiz-nav__btn--prev {
  background: rgba(255,255,255,.06);
  color: var(--text);
  border: 1.5px solid rgba(255,255,255,.1);
  box-shadow:
    0 4px 0 0 rgba(0,0,0,.5),
    0 6px 14px rgba(0,0,0,.25);
}
.quiz-nav__btn--prev:hover {
  background: rgba(255,255,255,.09);
  transform: translateY(-1px);
  box-shadow:
    0 5px 0 0 rgba(0,0,0,.5),
    0 8px 18px rgba(0,0,0,.32);
}
.quiz-nav__btn--prev:active {
  transform: translateY(3px);
  box-shadow:
    0 1px 0 0 rgba(0,0,0,.5),
    0 2px 6px rgba(0,0,0,.15);
}
.quiz-nav__btn:disabled {
  opacity: .35;
  cursor: not-allowed;
  transform: none !important;
}
.quiz-nav__btn:disabled:active {
  transform: none !important;
}

/* ── Topic grid (legacy practice dashboard) ──────────────────────────────── */
.topic-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.25rem;
}
.topic-card {
  background: #1c1c1e; border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
  cursor: pointer; transition: border-color .2s, background .2s, transform .2s, box-shadow .2s;
}
.topic-card:not(.topic-card--empty):hover {
  border-color: rgba(255,255,255,0.1);
  background: var(--surface-2);
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.topic-card--empty {
  background: rgba(28,28,30,0.5);
  border-color: rgba(255,255,255,0.03);
  opacity: .45;
  cursor: default;
}
.topic-card--empty .topic-card__name,
.topic-card--empty .topic-card__count { color: var(--text-soft); }
.topic-card__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.topic-card__name { font-size: .95rem; font-weight: 600; color: var(--text); }
.topic-card__count { font-size: .78rem; color: var(--text-soft); }
.topic-card__cta { font-size: .8rem; color: var(--neon); font-weight: 600; }
.topic-card__soon { font-size: .78rem; color: var(--text-dim); }

/* ── Quiz panel ───────────────────────────────────────────────────────────── */
.quiz-panel {
  background: #1c1c1e; border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius); padding: 2.5rem; max-width: 900px; margin: 0 auto;
}
.quiz-panel__header {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 2rem; padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.quiz-panel__back {
  background: none; border: none; color: var(--text-soft);
  font-size: .875rem; padding: 0; font-weight: 500;
}
.quiz-panel__back:hover { color: var(--text); }
.quiz-panel__mode { font-size: .85rem; font-weight: 600; color: var(--neon); margin-left: auto; letter-spacing: 0; }
.quiz-panel__progress { font-size: .8rem; color: var(--text-dim); white-space: nowrap; }

/* Prominent Back to Dashboard button + meta */
.quiz-back-btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .6rem 1.1rem;
  background: var(--surface-2);
  border: 1.5px solid var(--border-bright);
  border-radius: 8px;
  color: var(--text);
  font-size: .875rem; font-weight: 700;
  transition: background .15s, border-color .15s, color .15s, transform .15s, box-shadow .15s;
}
.quiz-back-btn:hover {
  background: rgba(59,130,246,.08);
  border-color: var(--neon);
  color: var(--neon);
  transform: translateX(-3px);
  box-shadow: 0 0 12px rgba(59,130,246,.18);
}
.quiz-meta {
  display: flex; align-items: center; gap: 1rem; margin-left: auto;
}
.quiz-mode-tag {
  display: inline-flex; align-items: center;
  padding: .35rem .8rem; border-radius: 999px;
  /* The topic name is a "learning UI" element → blue, not action-green */
  background: var(--accent-blue-soft); color: var(--accent-blue);
  font-size: .8rem; font-weight: 700;
  border: 1px solid rgba(59,130,246,.25);
}
.quiz-counter {
  font-size: .82rem; font-weight: 800; color: var(--text-dim);
  white-space: nowrap; letter-spacing: .03em;
}

.quiz-topic-label {
  font-size: .85rem; font-weight: 700; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: .75rem;
}
.quiz-stem {
  font-size: 1.15rem; line-height: 1.6; color: var(--text);
  margin-bottom: 1.75rem; white-space: pre-wrap; font-weight: 500;
}
.quiz-options { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1.25rem; }
.quiz-option {
  display: flex; align-items: center; gap: 1rem;
  background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: 10px; padding: .95rem 1.1rem;
  text-align: left; color: var(--text); font-size: 1rem;
  transition: border-color .12s, background .12s;
}
.quiz-option:not(:disabled):hover { border-color: var(--neon); background: rgba(59,130,246,.04); }
.quiz-option__letter {
  min-width: 1.7rem; height: 1.7rem; display: flex; align-items: center;
  justify-content: center; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border);
  font-size: .85rem; font-weight: 800; flex-shrink: 0;
}
.quiz-option__text { flex: 1; line-height: 1.5; }
.quiz-option--correct { border-color: #10B981 !important; background: rgba(16,185,129,.1) !important; }
.quiz-option--correct .quiz-option__letter { background: #10B981; color: #000; border-color: #10B981; }
.quiz-option--wrong { border-color: #ef4444 !important; background: rgba(239,68,68,.1) !important; }
.quiz-option--wrong .quiz-option__letter { background: #ef4444; color: #fff; border-color: #ef4444; }

.quiz-feedback { margin-top: 1rem; }
.quiz-feedback__banner {
  padding: .75rem 1rem; border-radius: 8px;
  font-weight: 700; font-size: .95rem; margin-bottom: .75rem;
}
.quiz-feedback__banner--correct { background: rgba(16,185,129,.15); color: #10B981; }
.quiz-feedback__banner--wrong   { background: rgba(239,68,68,.12);  color: #ef4444; }
.quiz-feedback__explanation { font-size: .875rem; color: var(--text-muted); line-height: 1.65; margin-bottom: 1rem; }

/* Practice quiz Previous/Next nav */
.quiz-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.quiz-nav .btn:disabled { opacity: .35; cursor: not-allowed; }

/* Self-check (image-only expected answer) */
.self-check { display: flex; flex-direction: column; gap: .5rem; }
.self-check__answer { display: flex; flex-direction: column; gap: .25rem; }
.self-check__image {
  max-width: 100%; max-height: 360px;
  border-radius: 8px; border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.03);
}
.self-check__ask  { font-weight: 600; margin: .85rem 0 .25rem; }
.self-check__buttons { display: flex; gap: .75rem; }
.self-check__buttons .btn { flex: 1 1 auto; }

/* Upload chooser landing page */
.upload-choose__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 2rem;
}
.upload-choose__card {
  display: flex;
  flex-direction: column;
  text-align: center;
  padding: 2rem 1.5rem;
  text-decoration: none !important;
  color: inherit;
  transition: transform .15s, border-color .15s;
}
.upload-choose__card:hover {
  border-color: var(--neon);
  transform: translateY(-2px);
}
.upload-choose__icon {
  font-size: 2.5rem;
  margin-bottom: .75rem;
}
.upload-choose__desc {
  color: var(--text-muted);
  font-size: .9rem;
  flex: 1;
  margin: .5rem 0 0;
}
@media (max-width: 640px) {
  .upload-choose__grid { grid-template-columns: 1fr; }
}

/* ── AI Study Chat ──────────────────────────────────────────────────────── */
.chat-container { max-width: 820px; }
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.chat-thread {
  display: flex; flex-direction: column; gap: .8rem;
  min-height: 320px; max-height: 60vh;
  overflow-y: auto;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  margin-bottom: 1rem;
}
.chat-msg {
  max-width: 85%;
  padding: .75rem 1rem;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: .95rem;
  line-height: 1.55;
  border: 1px solid var(--border);
}
.chat-msg--user {
  background: rgba(59,130,246,.08);
  border-color: rgba(59,130,246,.2);
  align-self: flex-end;
}
.chat-msg--assistant { align-self: flex-start; }
.chat-msg__images {
  display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .6rem;
}
.chat-msg__images img {
  max-width: 180px; max-height: 140px;
  border-radius: 6px; border: 1px solid rgba(255,255,255,.1);
}
.chat-msg__recs {
  margin-top: .8rem; padding-top: .6rem;
  border-top: 1px dashed var(--border);
}
.chat-msg__recs-label {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-muted); margin-bottom: .4rem;
}
.chat-rec {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .75rem; border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  margin-top: .35rem;
  text-decoration: none !important;
  color: var(--text);
  font-size: .85rem;
  transition: border-color .15s, background .15s;
}
.chat-rec:hover { border-color: var(--neon); background: rgba(59,130,246,.05); }

/* Retry button on a failed AI reply */
.chat-msg__retry {
  margin-top: .6rem;
  padding: .35rem .75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  font-size: .82rem;
  transition: border-color .15s, background .15s;
}
.chat-msg__retry:hover:not(:disabled) {
  border-color: var(--neon);
  background: rgba(59,130,246,.05);
}
.chat-msg__retry:disabled { opacity: .5; cursor: default; }

.chat-input { padding: 1rem; }
.chat-image-strip { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .5rem; }
.chat-image-strip:empty { display: none; }
.chat-image-thumb { position: relative; }
.chat-image-thumb img {
  max-width: 100px; max-height: 80px;
  border-radius: 6px; border: 1px solid rgba(255,255,255,.15);
}
.chat-image-thumb button {
  position: absolute; top: -6px; right: -6px;
  width: 22px; height: 22px; border-radius: 50%;
  border: none; background: #ff5050; color: #fff;
  font-size: .7rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.chat-actions {
  display: flex; align-items: center; gap: .5rem;
  margin-top: .6rem;
}
.chat-attach {
  cursor: pointer; display: inline-flex; align-items: center;
  margin: 0;
}

/* ── Floating chat widget ────────────────────────────────────────────────── */
.chat-widget {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 1000;
}
.chat-widget__bubble {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--neon);
  color: #000;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,.4), 0 0 0 4px rgba(59,130,246,.15);
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s, box-shadow .15s;
}
.chat-widget__bubble:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(0,0,0,.5), 0 0 0 6px rgba(59,130,246,.2);
}
.chat-widget__panel[hidden] { display: none !important; }
.chat-widget__panel {
  width: min(380px, calc(100vw - 2rem));
  height: min(560px, calc(100vh - 2rem));
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  overflow: hidden;
  animation: chatWidgetIn .18s ease-out;
}
@keyframes chatWidgetIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.chat-widget__head {
  display: flex; justify-content: space-between; align-items: center;
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.chat-widget__head strong { font-size: .95rem; }
.chat-widget__plan {
  font-size: .68rem;
  font-weight: 600;
  padding: .15rem .45rem;
  border-radius: 999px;
  letter-spacing: .02em;
  white-space: nowrap;
}
.chat-widget__plan--pro  { background: rgba(59,130,246,.12); color: var(--neon); border: 1px solid rgba(59,130,246,.25); }
.chat-widget__plan--free { background: rgba(255,255,255,.05); color: var(--text-soft); border: 1px solid rgba(255,255,255,.08); }
.chat-widget__plan--free a { color: var(--neon); text-decoration: none; margin-left: .25rem; }
.chat-widget__plan--free a:hover { text-decoration: underline; }

/* ── Subscribe page — outcome-focused redesign ───────────────────────── */
.subscribe-page__inner { max-width: 880px; }

.subscribe-hero { text-align: center; margin-bottom: 3rem; }
.subscribe-hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0 0 1.25rem;
  color: var(--text);
}
.subscribe-hero__title--accent { color: var(--neon); }
.subscribe-hero__sub {
  font-size: 1.05rem;
  color: var(--text-soft);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.6;
}

.subscribe-plan {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
}
/* Center the SGD/amount/month row inside the subscribe pricing card */
.subscribe-plan .plan-card__price {
  justify-content: center;
  margin: .25rem auto .35rem;
}
.subscribe-price-line {
  font-size: .92rem;
  color: var(--text-soft);
  margin: 0 0 2rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.subscribe-price-line strong { color: var(--text); }

.subscribe-perks {
  text-align: left;
  padding: 0 .25rem;
  margin: 0 0 2rem;
}
.subscribe-perks li {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .55rem 0;
  font-size: .95rem;
  color: var(--text);
  line-height: 1.55;
}
.subscribe-perks li svg {
  color: var(--neon); flex-shrink: 0; margin-top: .2rem;
}
.subscribe-perks li strong { color: var(--text); font-weight: 600; }
.subscribe-perks li span { color: var(--text-soft); }
.subscribe-perks li span strong { color: var(--text); }

.subscribe-cta {
  font-size: 1rem !important;
  font-weight: 600 !important;
  padding: .95rem !important;
  letter-spacing: .01em !important;
}
.subscribe-cta--lg {
  padding: 1.1rem 2.5rem !important;
  font-size: 1.05rem !important;
  min-width: 240px;
}
.subscribe-cta-sub {
  text-align: center;
  margin-top: .9rem !important;
  font-size: .82rem;
  color: var(--text-soft);
}
.subscribe-status {
  text-align: center; color: var(--neon); font-weight: 600;
  margin-bottom: 1rem;
}

/* ── Why students upgrade ──────────────────────────────────────────── */
.subscribe-why { margin: 5rem 0 4rem; }
.subscribe-why__title {
  font-family: var(--font-display);
  font-size: 1.6rem; font-weight: 600;
  letter-spacing: -.02em; text-align: center;
  margin: 0 0 2.5rem;
  color: var(--text);
}
.subscribe-why__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
@media (max-width: 640px) {
  .subscribe-why__grid { grid-template-columns: 1fr; }
}
.subscribe-why__card {
  background: #1c1c1e;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 14px;
  padding: 1.75rem;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.subscribe-why__card:hover {
  transform: translateY(-3px);
  border-color: rgba(255,255,255,.1);
  box-shadow: 0 6px 22px rgba(0,0,0,.35);
}
.subscribe-why__icon { font-size: 1.7rem; margin-bottom: .85rem; line-height: 1; }
.subscribe-why__card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem; font-weight: 600;
  margin: 0 0 .55rem;
  letter-spacing: -.01em; color: var(--text);
  line-height: 1.3;
}
.subscribe-why__card p {
  font-size: .92rem; color: var(--text-soft);
  line-height: 1.55; margin: 0;
}

/* ── Compare table ─────────────────────────────────────────────────── */
.compare-section { margin: 4rem 0; }
.compare-section__title {
  font-family: var(--font-display);
  font-size: 1.6rem; font-weight: 600;
  letter-spacing: -.02em; text-align: center;
  margin: 0 0 2rem; color: var(--text);
}
.compare-table {
  background: #1c1c1e;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 14px;
  overflow: hidden;
}
.compare-row {
  display: grid;
  grid-template-columns: 1.7fr .9fr 1.2fr;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.compare-row:last-child { border-bottom: none; }
.compare-row--head {
  background: rgba(255,255,255,.03);
  padding: .85rem 1.5rem;
}
.compare-row--head .compare-cell { font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-soft); }
.compare-cell--free   { text-align: center; }
.compare-cell--pro    { text-align: center; color: var(--neon); font-weight: 600; }
.compare-row--head .compare-cell--pro { color: var(--neon); }
.compare-recommended {
  display: inline-block; margin-left: .35rem;
  font-size: .58rem;
  background: rgba(59,130,246,.15);
  color: var(--neon);
  padding: .15rem .4rem;
  border-radius: 999px;
  letter-spacing: .03em;
  text-transform: uppercase;
  vertical-align: middle;
  border: 1px solid rgba(59,130,246,.25);
}

.compare-cell--label { font-size: .92rem; color: var(--text); }
.compare-cell--label strong { display: block; font-weight: 600; }
.compare-cell--label span {
  display: block;
  font-size: .8rem;
  color: var(--text-soft);
  margin-top: .15rem;
  line-height: 1.4;
}

.compare-row .compare-cell--free {
  color: var(--text-dim);
  font-size: .92rem;
}
.compare-row .compare-cell--pro {
  background: rgba(59,130,246,.04);
  border-radius: 8px;
  padding: .55rem .35rem;
  margin: -.55rem -.35rem;
  font-size: .92rem;
}
.compare-check {
  display: inline-block;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(59,130,246,.15);
  color: var(--neon);
  font-weight: 700;
  text-align: center;
  line-height: 20px;
  font-size: .75rem;
  margin-right: .25rem;
  vertical-align: -2px;
}

.compare-group-head {
  grid-column: 1 / -1;
  padding: 1.25rem 1.5rem .5rem;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-soft);
  background: rgba(255,255,255,.02);
  border-bottom: 1px solid rgba(255,255,255,.04);
}

@media (max-width: 640px) {
  .compare-row { grid-template-columns: 1.4fr .7fr 1fr; padding: .9rem 1rem; }
  .compare-cell--label { font-size: .88rem; }
  .compare-cell--label span { font-size: .74rem; }
  .compare-row .compare-cell--free,
  .compare-row .compare-cell--pro { font-size: .88rem; }
  .compare-recommended { display: none; }
}

/* ── Final CTA ─────────────────────────────────────────────────────── */
.subscribe-final {
  text-align: center;
  margin: 4rem 0 1rem;
  padding: 3rem 2rem;
  background: linear-gradient(135deg, rgba(59,130,246,.06), rgba(59,130,246,.02));
  border: 1px solid rgba(59,130,246,.15);
  border-radius: 16px;
}
.subscribe-final__title {
  font-family: var(--font-display);
  font-size: 1.75rem; font-weight: 700;
  letter-spacing: -.02em;
  margin: 0 0 .5rem;
  color: var(--text);
}
.subscribe-final__sub {
  font-size: .98rem; color: var(--text-soft);
  margin: 0 0 1.75rem;
}
.subscribe-final__small {
  font-size: .8rem;
  color: var(--text-soft);
  margin: 1rem 0 0;
}
.chat-widget__head-actions { display: flex; gap: .35rem; }
.chat-widget__icon-btn {
  background: none; border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: .25rem .5rem;
  border-radius: 6px;
  font-size: .9rem;
}
.chat-widget__icon-btn:hover { background: rgba(255,255,255,.06); color: var(--text); }
.chat-widget__thread {
  flex: 1;
  display: flex; flex-direction: column; gap: .6rem;
  padding: .9rem;
  overflow-y: auto;
  background: var(--bg);
}
.chat-widget__thread .chat-msg {
  max-width: 92%;
  font-size: .88rem;
  padding: .55rem .75rem;
}
.chat-widget__thread .chat-msg__images img { max-width: 140px; max-height: 110px; }
.chat-widget__compose {
  border-top: 1px solid var(--border);
  padding: .65rem .75rem;
  background: var(--surface-2);
}
.chat-widget__compose textarea {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .5rem .65rem;
  font-family: inherit;
  font-size: .9rem;
  resize: none;
  outline: none;
}
.chat-widget__compose textarea:focus { border-color: var(--neon); }
.chat-widget__actions {
  display: flex; align-items: center; gap: .5rem;
  margin-top: .5rem;
}
.chat-widget__attach {
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  width: 30px; height: 30px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: .9rem;
}
.chat-widget__attach:hover { border-color: var(--neon); }

.chat-widget__step {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .72rem;
  color: var(--text-soft);
  cursor: pointer;
  user-select: none;
}
.chat-widget__step input[type="checkbox"] {
  accent-color: var(--neon);
  width: 13px; height: 13px;
}
.chat-widget__step:hover { color: var(--text); }

/* AI is thinking — three bouncing dots inside an assistant bubble */
.chat-msg--thinking { padding: .5rem .9rem; }
.chat-thinking {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .15rem .25rem;
  min-height: 18px;
}
.chat-thinking__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-soft);
  animation: chatBounce 1.1s infinite ease-in-out;
}
.chat-thinking__dot:nth-child(2) { animation-delay: .15s; }
.chat-thinking__dot:nth-child(3) { animation-delay: .3s; }
@keyframes chatBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .35; }
  40%           { transform: translateY(-5px); opacity: 1; }
}
.chat-widget__status { font-size: .72rem; color: var(--text-muted); }
.chat-widget__actions .btn { margin-left: auto; }

@media (max-width: 480px) {
  .chat-widget { bottom: .75rem; right: .75rem; }
  /* 100dvh = dynamic viewport height — excludes the mobile browser address
     bar so the panel header (and the close X) stay on-screen. */
  .chat-widget__panel {
    width: calc(100vw - 1.5rem);
    height: calc(100dvh - 5rem);
    max-height: calc(100dvh - 5rem);
  }
  /* Belt-and-braces: keep the header pinned to the top of the panel even if
     the panel ever scrolls, so the close button is always reachable. */
  .chat-widget__head {
    position: sticky;
    top: 0;
    z-index: 2;
  }
}

/* Diagnostic results */
.quiz-results__title { font-size: 1.4rem; font-weight: 800; margin-bottom: .5rem; }
.quiz-results__score { font-size: 1.1rem; color: var(--neon); font-weight: 700; margin-bottom: 1.5rem; }
.quiz-results__grid { display: flex; flex-direction: column; gap: .5rem; }
.quiz-result-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: .65rem 1rem; border-radius: 8px; font-size: .875rem; font-weight: 600;
}
.quiz-result-row--pass { background: rgba(16,185,129,.1); color: #10B981; }
.quiz-result-row--fail { background: rgba(239,68,68,.08); color: #ef4444; }

/* ── Admin question list ──────────────────────────────────────────────────── */
.question-list { display: flex; flex-direction: column; gap: 1rem; }
.question-row { padding: 1.25rem 1.5rem; }
.question-row__meta { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .6rem; }
.question-row__stem { font-size: .9rem; color: var(--text); margin-bottom: .6rem; line-height: 1.5; }
.question-row__options {
  display: grid; grid-template-columns: 1fr 1fr; gap: .25rem .75rem;
  font-size: .8rem; color: var(--text-dim); margin-bottom: .75rem;
}
.question-row__footer { display: flex; align-items: center; justify-content: space-between; }
.question-row__answer { font-size: .85rem; color: #10B981; }

/* ── Custom cursor ──────────────────────────────────────────────────────────
   Three cursor states, all matching the same neon-green art style:
     • Arrow         — default
     • I-beam        — text content (paragraphs, headings) + text inputs
     • Pointer hand  — clickable elements (a, button, .btn, cards, links, etc.)
   Pointer rule is declared LAST so it wins over text rule for buttons/links
   that contain text (same specificity → later declaration prevails). */
@media (hover: hover) {
  /* Default arrow */
  *, *::before, *::after {
    cursor: url('/static/cursor.svg') 2 1, auto !important;
  }
  /* I-beam for any text-bearing content + text inputs */
  p, h1, h2, h3, h4, h5, h6,
  span, label, li, td, th, dt, dd, blockquote, em, strong, code, pre,
  .quiz-stem, .part-card__prompt, .recent-feed__topic,
  .question-row__stem, .review-open-text, .chat-msg__body,
  input[type="text"], input[type="email"], input[type="password"],
  input[type="number"], input[type="search"], input[type="url"],
  input[type="tel"], input:not([type]),
  textarea, [contenteditable="true"],
  .form-textarea {
    cursor: url('/static/cursor-text.svg') 12 12, text !important;
  }
  /* Pointer hand for clickable elements + everything they contain
     (so spans / labels inside a button still get the hand) */
  a, a *, button, button *, [role="button"], [role="button"] *,
  summary, summary *, label[for], label[for] *, select, .form-select,
  input[type="submit"], input[type="button"], input[type="reset"],
  input[type="checkbox"], input[type="radio"], input[type="file"],
  .btn, .btn *,
  .topic-item, .topic-item *,
  .topic-card:not(.topic-card--empty), .topic-card:not(.topic-card--empty) *,
  .topic-perf__row--clickable, .topic-perf__row--clickable *,
  .practice-subject-card, .practice-subject-card *,
  .upload-choose__card, .upload-choose__card *,
  .quiz-option, .quiz-option *, .quiz-option-row, .quiz-option-row *,
  .chat-rec, .chat-rec *, .chat-widget__bubble, .chat-msg__retry,
  .nav__link, .nav__link *, .nav__toggle, .nav__logo, .nav__logo *,
  .filters__btn, .form-check, .form-check *, .file-drop__label,
  .practice-sidebar__heading-btn, .practice-sidebar__heading-btn *,
  .quiz-back-btn, .quiz-back-btn *, .practice-sidebar__back {
    cursor: url('/static/cursor-pointer.svg') 6 1, pointer !important;
  }
  /* Disabled controls keep the default arrow with not-allowed semantic */
  [disabled], [disabled] *,
  .btn:disabled, button:disabled,
  input:disabled, textarea:disabled, select:disabled {
    cursor: url('/static/cursor.svg') 2 1, not-allowed !important;
  }
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Mobile slide-in panel — anchored top-right */
  .nav__links {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 1rem;
    left: auto;
    width: min(300px, calc(100vw - 2rem));
    background: rgba(22, 22, 24, .94);
    backdrop-filter: blur(28px) saturate(160%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    flex-direction: column;
    align-items: stretch;
    padding: .75rem;
    gap: 0;
    box-shadow:
      0 24px 60px rgba(0, 0, 0, .6),
      0 6px 16px rgba(0, 0, 0, .4);
    transform-origin: top right;
    animation: navSlideIn .22s cubic-bezier(.16, 1, .3, 1);
  }
  @keyframes navSlideIn {
    from { opacity: 0; transform: translateY(-6px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
  }
  .nav__links--open { display: flex; }
  .nav__toggle { display: block; }
  .nav { position: relative; }

  /* Section labels — small caps headings */
  .nav__section-label {
    display: block;
    list-style: none;
    padding: .5rem .75rem .35rem;
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-soft);
  }
  /* Section divider — thin line between groups */
  .nav__divider {
    display: block;
    list-style: none;
    height: 1px;
    background: rgba(255, 255, 255, .05);
    margin: .65rem .15rem;
  }

  /* Standard navigation rows */
  .nav__links .nav__link {
    display: block;
    width: 100%;
    padding: .85rem 1rem;
    border-radius: 10px;
    font-size: .95rem;
    font-weight: 500;
    color: var(--text);
    transition: background .15s ease, color .15s ease, transform .1s ease;
  }
  .nav__links .nav__link:hover,
  .nav__links .nav__link:focus-visible {
    background: rgba(255, 255, 255, .05);
    color: var(--text);
  }
  .nav__links .nav__link:active {
    background: rgba(255, 255, 255, .08);
    transform: scale(.98);
  }

  /* Action buttons — Subscribe (primary) and Logout (secondary) */
  .nav__action {
    list-style: none;
    margin: .25rem 0 0;
  }
  .nav__action:first-of-type { margin-top: 0; }

  /* Subscribe — primary green CTA */
  .nav__links .nav__link--subscribe {
    display: block;
    width: 100%;
    background: var(--neon);
    color: #000 !important;
    padding: .85rem 1rem;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    font-size: .95rem;
    box-shadow: 0 2px 8px rgba(59,130,246, .15);
    transition: background .15s ease, transform .1s ease, box-shadow .15s ease;
  }
  .nav__links .nav__link--subscribe:hover {
    background: #60A5FA;
    color: #000;
    box-shadow: 0 4px 12px rgba(59,130,246, .25);
  }
  .nav__links .nav__link--subscribe:active { transform: scale(.98); }

  /* Logout — secondary gray translucent button */
  .nav__links .nav__link--cta {
    display: block;
    width: 100%;
    background: rgba(255, 255, 255, .06) !important;
    color: var(--text) !important;
    padding: .85rem 1rem;
    border-radius: 10px;
    text-align: center;
    font-weight: 500;
    font-size: .95rem;
    border: 1px solid rgba(255, 255, 255, .06);
    transition: background .15s ease, transform .1s ease, border-color .15s ease;
  }
  .nav__links .nav__link--cta:hover {
    background: rgba(255, 255, 255, .1) !important;
    color: var(--text) !important;
    border-color: rgba(255, 255, 255, .1);
  }
  .nav__links .nav__link--cta:active { transform: scale(.98); }
  .stats__grid { grid-template-columns: repeat(3,1fr); gap: 1rem; }
  .stat__number { font-size: 2rem; }
  .filters__row { flex-direction: column; align-items: stretch; gap: .75rem; }
  .filters__group { flex: unset; width: 100%; }
  .filters__btn { width: 100%; height: 46px; }
  .hero { padding: 8rem 0 5rem; }
  .section { padding: 4.5rem 0; }
  .auth-card { padding: 1.75rem; }
  .footer__inner { justify-content: center; text-align: center; }
  .btn--primary { padding: .85rem 1.75rem; }
  .btn--lg { padding: 1rem 2rem; }
}
@media (max-width: 480px) {
  .stats__grid { grid-template-columns: 1fr; }
  .stat + .stat::before { display: none; }
  /* Tighten the gap above the CTA on mobile so the buttons sit higher */
  .hero__title { margin-bottom: 1rem; }
  .hero__subtitle { margin-bottom: 1.75rem; line-height: 1.55; }
  /* Keep the two hero CTAs side-by-side on mobile (Start Learning + Log In). */
  .hero__cta {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: .65rem;
    margin-bottom: 2rem;
  }
  .hero__cta .btn {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    font-size: 14px;
    white-space: nowrap;
  }
}

/* Open-ended question UI */
.quiz-open { width: 100%; }
.quiz-open .form-textarea { width: 100%; box-sizing: border-box; }
.review-open-block { width: 100%; }
.review-open-text {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  white-space: pre-wrap;
}
.review-open-text--expected {
  border-color: var(--neon, #6cff6c);
  background: rgba(108,255,108,0.05);
}

/* Question image (above all parts) */
.quiz-image {
  max-width: 100%;
  max-height: 360px;
  display: block;
  margin: 0 0 1.25rem 0;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  cursor: zoom-in;
  transition: transform .15s ease;
}
.quiz-image:hover { transform: scale(1.01); }

/* Lightbox overlay for clicked images (mobile + desktop) */
.img-lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.92);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  padding: 2rem;
  cursor: zoom-out;
  animation: imgLightboxIn .18s ease-out;
}
.img-lightbox img {
  max-width: 100%; max-height: 100%;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  cursor: crosshair;
}
.img-lightbox__lens {
  position: absolute;
  width: 220px; height: 220px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.85);
  box-shadow: 0 0 0 9999px rgba(0,0,0,0), 0 8px 24px rgba(0,0,0,.5);
  background-repeat: no-repeat;
  background-color: #fff;
  pointer-events: none;
  transform: translate(-50%, -50%);
  display: none;
  z-index: 1;
}
.img-lightbox__lens--visible { display: block; }
@media (hover: none) {
  /* On touch devices, rely on native pinch-zoom rather than the lens */
  .img-lightbox__lens { display: none !important; }
  .img-lightbox img { cursor: zoom-out; }
}
.img-lightbox__close {
  position: absolute; top: 1rem; right: 1rem;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(0,0,0,.5);
  color: #fff; font-size: 1.4rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
@keyframes imgLightboxIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Multi-part question cards (student view) */
.part-card {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  background: rgba(255,255,255,0.02);
}
.part-card__head { margin-bottom: 0.5rem; }
.part-card__prompt { margin: 0 0 0.75rem 0; font-size: 1rem; }
.part-card__body { display: flex; flex-direction: column; gap: 0.5rem; }
.part-card__feedback { margin-top: 0.75rem; padding: 0.5rem 0.75rem; border-radius: 6px; }
.part-card__feedback--correct { background: rgba(108,255,108,0.07); border-left: 3px solid var(--neon, #6cff6c); }
.part-card__feedback--wrong   { background: rgba(255,80,80,0.06);  border-left: 3px solid #ff5050; }
.part-card__banner { font-weight: 600; }
.part-card__expl   { margin: 0.4rem 0 0 0; font-size: 0.9rem; opacity: 0.85; }

/* Admin parts builder */
.aq-part-card {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  background: rgba(255,255,255,0.02);
}
.aq-part-card__head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.75rem;
}
.aq-part-card__head .btn { padding: 0.25rem 0.75rem; font-size: 0.85rem; }

/* Admin: table-mode option builder */
.aq-tbl-cols { display: flex; flex-direction: column; gap: .4rem; }
.aq-tbl-col-input { display: flex; gap: .4rem; align-items: center; }
.aq-tbl-col-input input { flex: 1; }
.aq-tbl-col-input .btn { padding: .25rem .55rem; line-height: 1; }
.aq-tbl-grid { display: flex; flex-direction: column; gap: .35rem; margin-top: .75rem; }
.aq-tbl-row { display: grid; gap: .4rem; align-items: center; }
.aq-tbl-row,
.aq-tbl-row--head { grid-template-columns: 2.5rem repeat(auto-fit, minmax(80px, 1fr)); }
.aq-tbl-cell { display: flex; align-items: center; }
.aq-tbl-cell--label {
  font-weight: 700;
  color: var(--text-muted);
  justify-content: center;
}
.aq-tbl-cell--head {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  padding: 0 .3rem;
}
.aq-tbl-cell-input { width: 100%; }

/* Student / review: clickable option table */
/* Wrapper allows horizontal swipe-scroll without touching the rest of the layout.
   Critical: max-width: 100% + min-width: 0 stops the inner table forcing the
   parent card wider than the viewport. */
.quiz-option-table-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;     /* momentum scroll on iOS */
  scrollbar-width: thin;
  position: relative;
  margin-top: .25rem;
  /* A faint right-edge fade tells the user there's more to swipe to,
     and the gradient is hidden when the user has scrolled to the end. */
  mask-image: linear-gradient(to right, black calc(100% - 28px), transparent);
  -webkit-mask-image: linear-gradient(to right, black calc(100% - 28px), transparent);
}
/* Stop ancestors from being widened by the table — fixes the clipped Previous/Next buttons.
   NOTE: don't include .quiz-panel here — it has its own max-width that we want to keep. */
.quiz-options,
.part-card,
.part-card__body,
#quiz-options,
#quiz-question-view {
  min-width: 0;
  max-width: 100%;
}
.quiz-panel { min-width: 0; }
/* When the table fits without scroll, drop the fade so it doesn't waste space */
.quiz-option-table-wrap:not([data-scrollable]) {
  mask-image: none;
  -webkit-mask-image: none;
}
/* Slim webkit scrollbar so it doesn't intrude */
.quiz-option-table-wrap::-webkit-scrollbar { height: 4px; }
.quiz-option-table-wrap::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.15); border-radius: 999px;
}

.quiz-option-table {
  /* Let the table grow as wide as it needs, then the wrapper handles overflow */
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .95rem;
}
.quiz-option-table th,
.quiz-option-table td {
  border: 1px solid rgba(255,255,255,0.12);
  padding: .55rem .9rem;
  text-align: left;
  white-space: nowrap;       /* don't compress cell content */
}
.quiz-option-table thead th {
  background: rgba(255,255,255,0.04);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
}
.quiz-option-row { cursor: pointer; transition: background .15s; }
.quiz-option-row:hover:not(.quiz-option-row--disabled) {
  background: rgba(59,130,246,.06);
}
.quiz-option-row__label {
  font-weight: 700;
  color: var(--text-muted);
  width: 2.5rem;
  text-align: center !important;
}
.quiz-option-row--disabled { cursor: default; }
.quiz-option-row--correct {
  background: rgba(59,130,246,.12);
}
.quiz-option-row--correct .quiz-option-row__label { color: var(--neon); }
.quiz-option-row--wrong {
  background: rgba(255,80,80,.12);
}
.quiz-option-row--wrong .quiz-option-row__label { color: #ff7070; }
.quiz-option-row--yours {
  outline: 1px dashed rgba(255,255,255,0.25);
  outline-offset: -1px;
}

/* ── Homepage personalised overview ──────────────────────────────────────── */
.overview__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.overview__stat-card {
  text-align: center;
  padding: 1.25rem 1rem;
}
.overview__stat-number {
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--neon);
  line-height: 1.1;
}
.overview__stat-label {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: .35rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.overview__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.overview__progress-item { margin-bottom: .85rem; }
.overview__progress-item:last-child { margin-bottom: 0; }
.overview__progress-label {
  display: flex;
  justify-content: space-between;
  font-size: .88rem;
  margin-bottom: .35rem;
  color: var(--text);
}
.overview__progress-bar {
  height: 7px;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
}
.overview__progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .6s ease;
  background: var(--neon-dim);
}
.overview__progress-fill--good { background: var(--neon); }
.overview__progress-fill--ok   { background: #f0c040; }
.overview__progress-fill--low  { background: #ff5050; }

.overview__goals-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.overview__goals-level { display: flex; flex-direction: column; gap: .35rem; }
.overview__goals-level-head {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: .1rem;
}
.overview__goal-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .9rem;
  cursor: pointer;
  color: var(--text);
}
.overview__goal-item input[type="checkbox"] {
  accent-color: var(--neon);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.overview__recs { margin-top: 0; }
.overview__rec-list { display: flex; flex-direction: column; gap: .6rem; }
.overview__rec-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .6rem .9rem;
  background: var(--surface-2);
  border-radius: 8px;
  gap: 1rem;
}
.overview__rec-info { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.overview__rec-topic { font-size: .9rem; color: var(--text); }
.overview__rec-acc {
  font-size: .82rem;
  font-weight: 600;
  padding: .2rem .55rem;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
}
.overview__rec-acc--ok  { background: rgba(59,130,246,.12); color: var(--neon); }
.overview__rec-acc--low { background: rgba(255,80,80,.12); color: #ff7070; }
.overview__rec-acc--new { background: rgba(255,255,255,.08); color: var(--text-muted); }
.overview__empty { color: var(--text-muted); font-size: .9rem; }

@media (max-width: 640px) {
  .overview__stats { grid-template-columns: repeat(3, 1fr); gap: .5rem; }
  .overview__stat-number { font-size: 1.4rem; }
  .overview__grid { grid-template-columns: 1fr; }
}

/* ── Quiz "selected but not yet submitted" state + Submit button ────────────
   Two-step pattern: first tap selects, second tap (or the Submit button) commits. */
.quiz-option--selected {
  border-color: var(--neon) !important;
  background: rgba(59,130,246,.08) !important;
}
.quiz-option--selected .quiz-option__letter {
  background: var(--neon);
  color: #000;
  border-color: var(--neon);
}
.quiz-option-row--selected {
  background: rgba(59,130,246,.1) !important;
  outline: 1.5px solid var(--neon);
  outline-offset: -1px;
}
.quiz-option-row--selected .quiz-option-row__label {
  color: var(--neon);
}
.quiz-submit-btn {
  display: block;
  width: 100%;
  margin-top: 1rem;
  padding: .8rem 1rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.quiz-submit-btn[disabled] {
  opacity: .4;
  cursor: not-allowed;
}

/* ── Practice page: Anthropic-style sans (Onest, free Söhne-alike) ──────────
   Scoped to the practice layout so the rest of the site keeps Inter.
   The subject name + level on the sidebar keep their original display font. */
.practice-layout,
.practice-layout * {
  font-family: 'Onest', 'Inter', -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.practice-sidebar__subject,
.practice-sidebar__level {
  font-family: var(--font-display) !important;
}

/* Fix: on mobile the back-arrow SVG was flex-shrinking down to ~1px, looking
   like a fullstop. Lock its size and prevent it from being shrunk by the flex
   parent (the round 38px button). */
.quiz-back-btn svg {
  flex-shrink: 0;
  flex-grow: 0;
  flex-basis: auto;
}
@media (max-width: 800px) {
  .quiz-back-btn svg {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px;
  }
}

/* ──────────────────────────────────────────────────────────────────────────
   HOMEPAGE: Trust Bar / Atomic Edge / Sample Preview / Grade Jump cards
   ────────────────────────────────────────────────────────────────────────── */

/* Common eyebrow + lead text used by the new sections */
.section__eyebrow {
  display: block;
  text-align: center;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent-blue-light, #60A5FA);
  margin-bottom: .75rem;
}
.section__lead {
  text-align: center;
  font-size: 1rem;
  color: var(--text-soft);
  max-width: 600px;
  margin: 1rem auto 3rem;
  line-height: 1.6;
}

/* ── Trust Bar ──────────────────────────────────────────────────────────── */
.trust-bar {
  background: rgba(255,255,255,.025);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: .75rem 0;
  overflow: hidden;
  position: relative;
}
.trust-bar__track {
  display: flex;
  width: max-content;
  animation: trustScroll 32s linear infinite;
}
.trust-bar__group {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding-right: 2rem;
  white-space: nowrap;
}
.trust-bar__item {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--text-muted);
  filter: grayscale(1);
}
.trust-bar__sep {
  color: var(--text-dim);
  font-size: .5rem;
}
@keyframes trustScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .trust-bar__track { animation: none; }
}

/* ── The Atomic Edge ────────────────────────────────────────────────────── */
.edge__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}
.edge__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  transition: transform .25s, border-color .25s, box-shadow .25s;
  display: flex;
  flex-direction: column;
}
.edge__card:hover {
  transform: translateY(-4px);
  border-color: rgba(59,130,246,.3);
  box-shadow: 0 12px 32px rgba(0,0,0,.35), 0 0 0 1px rgba(59,130,246,.12);
}
.edge__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 3rem; height: 3rem;
  background: rgba(59,130,246,.1);
  border: 1.5px solid rgba(59,130,246,.3);
  color: var(--accent-blue-light, #60A5FA);
  border-radius: 12px;
  margin-bottom: 1.1rem;
}
.edge__title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: .55rem;
  color: var(--text);
  letter-spacing: -.01em;
}
.edge__desc {
  font-size: .92rem;
  color: var(--text-soft);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  flex: 1;
}
/* Each card has a small visual that previews what the feature looks like */
.edge__viz {
  margin-top: auto;
  padding: 1rem;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 96px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}

/* Viz — Fleming three-finger hint */
.edge__viz--fleming {
  flex-direction: column;
  gap: .5rem;
}
.edge-fleming__finger {
  position: absolute;
  width: 5px; border-radius: 3px;
  background: linear-gradient(180deg, var(--accent-blue-light, #60A5FA), var(--accent-blue));
}
.edge-fleming__finger--thumb  { height: 28px; bottom: 28px; left: 38%; transform: rotate(-30deg); }
.edge-fleming__finger--index  { height: 38px; bottom: 28px; left: 50%; }
.edge-fleming__finger--middle { height: 32px; bottom: 28px; left: 62%; transform: rotate(40deg); }
.edge-fleming__label {
  position: absolute;
  bottom: 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: .82rem;
  letter-spacing: .25em;
  color: var(--accent-blue-light, #60A5FA);
}

/* Viz — MCQ row */
.edge__viz--mcq {
  flex-direction: column;
  align-items: stretch;
  gap: .35rem;
  padding: .85rem;
}
.edge-mcq__row {
  font-family: var(--font-body);
  font-size: .82rem;
  color: var(--text-muted);
  padding: .35rem .65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255,255,255,.02);
}
.edge-mcq__row--correct {
  color: #10B981;
  border-color: rgba(16,185,129,.4);
  background: rgba(16,185,129,.08);
  font-weight: 700;
}

/* Viz — Phone mock */
.edge__viz--phone { padding: .75rem; }
.edge-phone {
  width: 60px; height: 92px;
  border-radius: 12px;
  border: 2px solid var(--accent-blue-light, #60A5FA);
  padding: 6px 4px;
  position: relative;
}
.edge-phone::before {
  content: ''; position: absolute; top: 4px; left: 50%;
  transform: translateX(-50%);
  width: 14px; height: 3px; background: var(--text-dim); border-radius: 2px;
}
.edge-phone__screen {
  margin-top: 8px;
  display: flex; flex-direction: column; gap: 4px;
}
.edge-phone__bar {
  height: 5px; background: rgba(59,130,246,.4); border-radius: 2px;
}
.edge-phone__bar--short { width: 60%; }

/* ── Sample Preview / Peek Inside (drag-slider) ─────────────────────────── */
.peek__compare {
  position: relative;
  max-width: 920px;
  margin: 0 auto;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
  user-select: none;
  cursor: ew-resize;
  aspect-ratio: 16 / 10;
  background: var(--surface);
}
.peek__img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.peek__after-wrap {
  position: absolute;
  inset: 0;
  width: 50%;
  overflow: hidden;
  border-right: 2px solid var(--accent-blue);
}
.peek__after-wrap .peek__img {
  width: 200%;
}
.peek__handle {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 40px;
  transform: translateX(-50%);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  z-index: 2;
}
.peek__handle-line {
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 2px; background: var(--accent-blue);
  transform: translateX(-50%);
}
.peek__handle-knob {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent-blue);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(59,130,246,.45);
}
.peek__tag {
  position: absolute;
  top: .85rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .3rem .65rem;
  border-radius: 999px;
  z-index: 3;
}
.peek__tag--before {
  left: .85rem;
  background: rgba(0,0,0,.55);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,.15);
}
.peek__tag--after {
  right: .85rem;
  background: var(--accent-blue);
  color: #ffffff;
}

/* ── Grade Jump cards ───────────────────────────────────────────────────── */
.grade-jump__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.grade-jump__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem 1.4rem;
  display: flex; flex-direction: column;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.grade-jump__card:hover {
  transform: translateY(-3px);
  border-color: rgba(59,130,246,.25);
  box-shadow: 0 12px 28px rgba(0,0,0,.35);
}
.grade-jump__header {
  display: flex; align-items: center; gap: .55rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.grade-jump__badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.2rem; padding: .25rem .55rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  border-radius: 8px;
  letter-spacing: -.02em;
}
.grade-jump__badge--from {
  background: rgba(239,68,68,.12);
  color: #f87171;
  border: 1px solid rgba(239,68,68,.3);
}
.grade-jump__badge--to {
  background: rgba(16,185,129,.12);
  color: #10B981;
  border: 1px solid rgba(16,185,129,.35);
}
.grade-jump__badge--neutral {
  background: rgba(59,130,246,.12);
  color: var(--accent-blue-light, #60A5FA);
  border: 1px solid rgba(59,130,246,.3);
  font-size: .78rem;
  letter-spacing: 0;
}
.grade-jump__arrow {
  font-size: 1.1rem;
  color: var(--text-muted);
  font-weight: 700;
}
.grade-jump__period {
  margin-left: auto;
  font-size: .78rem;
  color: var(--text-muted);
  font-weight: 600;
}
.grade-jump__quote {
  font-size: .95rem;
  color: var(--text);
  line-height: 1.6;
  margin: 0 0 1.25rem;
  flex: 1;
}
.grade-jump__quote em {
  font-style: italic;
  font-weight: 400;
  color: var(--text-soft);
}
.grade-jump__footer {
  display: flex; align-items: center; gap: .65rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.grade-jump__avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 800; font-size: 1rem;
  color: #fff;
  flex-shrink: 0;
}
.grade-jump__avatar--blue   { background: linear-gradient(135deg, #3B82F6, #2563EB); }
.grade-jump__avatar--purple { background: linear-gradient(135deg, #8B5CF6, #7C3AED); }
.grade-jump__avatar--green  { background: linear-gradient(135deg, #34d399, #16A34A); }
.grade-jump__author { display: flex; flex-direction: column; line-height: 1.25; flex: 1; min-width: 0; }
.grade-jump__author strong { font-size: .92rem; color: var(--text); font-weight: 700; }
.grade-jump__author-meta { font-size: .78rem; color: var(--text-muted); }
.grade-jump__verified {
  display: inline-flex; align-items: center; gap: .25rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent-blue-light, #60A5FA);
  flex-shrink: 0;
}

/* ── CTA strip exam calendar link ───────────────────────────────────────── */
.cta-strip__exam-link {
  margin-top: 1rem;
  font-size: .85rem;
  color: var(--text-muted);
}
.cta-strip__exam-link a {
  color: var(--accent-blue-light, #60A5FA);
  text-decoration: none;
  border-bottom: 1px dashed rgba(59,130,246,.4);
  transition: color .2s, border-color .2s;
}
.cta-strip__exam-link a:hover {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
  text-decoration: none;
}

/* ── Pre-quiz setup popup ────────────────────────────────────────────────── */
.ps-modal { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 1.25rem; }
.ps-modal[hidden] { display: none !important; }
.ps-modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.ps-modal__panel {
  position: relative;
  width: 100%; max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.75rem 1.6rem 1.5rem;
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
  animation: psPanelIn .2s cubic-bezier(.16,1,.3,1);
}
@keyframes psPanelIn {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.ps-modal__close {
  position: absolute; top: .85rem; right: .85rem;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-soft); font-size: 1.3rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.ps-modal__close:hover { color: var(--text); border-color: var(--border-bright); }
.ps-modal__title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; margin: 0 0 .35rem; letter-spacing: -.02em; }
.ps-modal__sub { color: var(--text-soft); font-size: .92rem; margin: 0 0 1.25rem; line-height: 1.5; }
.ps-modal__sub strong { color: var(--accent-blue-light, #60A5FA); }
.ps-modal__grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: .75rem;
  margin-bottom: 1.5rem;
}
.ps-field {
  display: flex; flex-direction: column; gap: .35rem;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .65rem .75rem;
}
.ps-field__label { font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }
.ps-field input {
  width: 100%; box-sizing: border-box;
  background: transparent; border: none; outline: none;
  color: var(--text); font-size: 1.15rem; font-weight: 700;
  font-family: var(--font-body);
  padding: 0;
}
.ps-field__hint { font-size: .7rem; color: var(--text-dim); }
.ps-modal__actions {
  display: flex; gap: .65rem;
  flex-direction: row; flex-wrap: wrap;
}
.ps-modal__actions .btn { flex: 1; min-width: 130px; }
@media (max-width: 480px) {
  .ps-modal__grid { grid-template-columns: 1fr 1fr; }
  .ps-field:nth-child(3) { grid-column: 1 / -1; }
  .ps-modal__actions { flex-direction: column-reverse; }
  .ps-modal__actions .btn { width: 100%; }
}
body.ps-modal-open { overflow: hidden; }

/* ── Per-part countdown timer ────────────────────────────────────────────── */
.quiz-timer {
  position: fixed;
  top: 80px; right: 1.25rem;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .65rem .85rem;
  box-shadow: 0 8px 22px rgba(0,0,0,.3);
  display: flex; align-items: center; gap: .65rem;
  min-width: 160px;
}
.quiz-timer[hidden] { display: none; }
.quiz-timer__label { font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.quiz-timer__value { font-family: var(--font-display); font-size: 1.05rem; font-weight: 800; color: var(--accent-blue-light, #60A5FA); font-variant-numeric: tabular-nums; }
.quiz-timer__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.06); border-radius: 0 0 12px 12px; overflow: hidden; }
.quiz-timer__bar-fill { height: 100%; background: var(--accent-blue); transition: width .25s linear; }
.quiz-timer--low .quiz-timer__value { color: #fbbf24; }
.quiz-timer--low .quiz-timer__bar-fill { background: #fbbf24; }
.quiz-timer--out .quiz-timer__value { color: #f87171; animation: timerPulse 1s ease-in-out infinite; }
.quiz-timer--out .quiz-timer__bar-fill { background: #f87171; }
@keyframes timerPulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@media (max-width: 800px) {
  .quiz-timer { top: auto; bottom: 1rem; left: 1rem; right: 1rem; min-width: 0; justify-content: center; }
}

/* ── Homepage demo-note popup ────────────────────────────────────────────── */
.demo-popup { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 1.25rem; }
.demo-popup[hidden] { display: none !important; }
.demo-popup__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: demoFade .25s ease-out; }
.demo-popup__panel {
  position: relative;
  width: 100%; max-width: 460px;
  background: linear-gradient(180deg, var(--surface), rgba(20,20,22,1));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 22px;
  padding: 2.4rem 2rem 1.75rem;
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
  text-align: center;
  animation: demoIn .28s cubic-bezier(.16,1,.3,1);
}
@keyframes demoFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes demoIn   { from { opacity: 0; transform: translateY(20px) scale(.94); } to { opacity: 1; transform: none; } }
.demo-popup__close {
  position: absolute; top: .85rem; right: .85rem;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: var(--text-soft);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.demo-popup__close:hover { background: rgba(239,68,68,.10); color: #f87171; border-color: rgba(239,68,68,.35); }
.demo-popup__icon {
  font-size: 2.2rem;
  width: 64px; height: 64px;
  margin: 0 auto 1rem;
  display: flex; align-items: center; justify-content: center;
  background: rgba(59,130,246,.12);
  border: 1px solid rgba(59,130,246,.3);
  border-radius: 18px;
}
.demo-popup__eyebrow {
  font-size: .7rem; font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent-blue-light, #60A5FA);
  margin: 0 0 .65rem;
}
.demo-popup__title {
  font-family: var(--font-display);
  font-size: 1.4rem; font-weight: 700;
  letter-spacing: -.02em; line-height: 1.2;
  margin: 0 0 .65rem;
  color: var(--text);
}
.demo-popup__sub { color: var(--text-soft); font-size: .92rem; line-height: 1.55; margin: 0 0 1.5rem; }
.demo-popup__actions { display: flex; flex-direction: column; gap: .55rem; align-items: stretch; }
.demo-popup__actions .btn { width: 100%; padding: .85rem 1rem; }
.demo-popup__skip {
  background: transparent; border: none;
  color: var(--text-muted); font-size: .85rem; font-weight: 500;
  cursor: pointer; padding: .35rem;
  font-family: inherit;
}
.demo-popup__skip:hover { color: var(--text); }
body.demo-popup-open { overflow: hidden; }

/* ── AI Tutor: rich Markdown / inline interactive snippets ───────────────── */
.chat-msg__body p { margin: .35rem 0; }
.chat-msg__body p:first-child { margin-top: 0; }
.chat-msg__body p:last-child  { margin-bottom: 0; }
.chat-msg__body ul, .chat-msg__body ol { margin: .5rem 0 .5rem 1.4rem; padding: 0; }
.chat-msg__body li { margin: .15rem 0; }
.chat-msg__body strong { color: var(--text); font-weight: 700; }
.chat-msg__body code {
  background: rgba(255,255,255,.06);
  padding: .12rem .35rem;
  border-radius: 4px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .85em;
}
.chat-msg__body pre {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .75rem .9rem;
  overflow-x: auto;
  margin: .65rem 0;
}
.chat-msg__body pre code { background: transparent; padding: 0; font-size: .82rem; }
.chat-msg__body table {
  border-collapse: collapse;
  margin: .5rem 0;
  font-size: .9rem;
  width: 100%;
}
.chat-msg__body th, .chat-msg__body td {
  border: 1px solid var(--border);
  padding: .35rem .55rem;
  text-align: left;
}
.chat-msg__body th { background: rgba(255,255,255,.04); font-weight: 700; }

/* Inline interactive HTML snippets — sandboxed iframe rendered in-thread */
.chat-snippet__frame {
  display: block;
  width: 100%;
  min-height: 220px;
  max-height: 480px;
  border: 1px solid rgba(59,130,246,.25);
  border-radius: 10px;
  background: rgba(59,130,246,.04);
  margin: .65rem 0;
}

/* "Open the interactive note" link inside the recommendations block */
.chat-rec--note {
  background: rgba(59,130,246,.10) !important;
  border: 1px solid rgba(59,130,246,.32) !important;
  color: var(--accent-blue-light, #60A5FA) !important;
}
.chat-rec--note:hover {
  background: rgba(59,130,246,.18) !important;
  border-color: var(--accent-blue) !important;
}
.chat-rec__note-icon { font-size: 1.05rem; }
