/* ============================================================
   MOBILE BREAKPOINT CONTRACT — established 2026-04-27

   This codebase uses ONLY three breakpoints. Any new media query
   must use one of these. Do NOT introduce 600/640/720/760/900/etc.

   @media (max-width: 1024px)  — tablet (e.g. iPad portrait, narrow laptop)
   @media (max-width: 768px)   — large phone / small tablet
   @media (max-width: 480px)   — phone (target: iPhone 13 mini @ 375pt)

   DESKTOP-FIRST RULE:
   Base/unscoped rules describe the desktop intent. Mobile is
   ALWAYS expressed as an override inside one of the three
   media queries above. Never edit a base rule "to also work
   on mobile" — that breaks desktop within 3 commits.

   Legacy stragglers (720, 760, 900, 640, 600, 520) are being
   retired as we touch each page. Don't add new ones.
   ============================================================ */

/* STAAR Math Prep — base styles */
:root {
  --navy: #0b2545;
  --blue: #1d4ed8;
  --blue-light: #dbeafe;
  --accent: #f59e0b;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --success: #16a34a;
  --error: #dc2626;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --max: 1100px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { height: 100%; background: #0a1628; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #0a1628;
  color: var(--text);
  line-height: 1.55;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body > .site-footer { margin-top: auto; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* Header — glass nav */
.site-header {
  background: rgba(10, 22, 40, 0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.015em;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  transition: opacity 0.15s ease;
}
.brand:hover { text-decoration: none; opacity: 0.92; }
.brand-logo {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 8px rgba(251, 191, 36, 0.35)) drop-shadow(0 0 1px rgba(251, 191, 36, 0.4));
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.brand:hover .brand-logo { transform: rotate(72deg) scale(1.06); }
/* §64 — Wordmark unified to all-white text + gold star icon.
   Was 'Grade' white + 'Earn' gold-gradient (read coupon-tier
   split). Now 'GradeEarn' is a single confident white wordmark;
   the gold accent lives only in the star icon to its left. */
.brand-text { font-weight: 700; color: #ffffff; }
.brand-text-accent {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: currentColor;
  color: inherit;
}
/* Pill-group nav */
.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 4px;
}
.nav a {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.005em;
  color: rgba(255, 255, 255, 0.6);
  padding: 8px 16px;
  border-radius: 999px;
  transition: all 0.2s ease;
}
.nav a:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
}
.nav a.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) inset;
  font-weight: 500;
}

/* §64 — Sign-in button: ghost style on navy+gold palette.
   Was a pure white pill that read foreign to the brand. Now a
   gold-bordered ghost button (transparent fill, gold text, gold
   border) that visually belongs alongside the grade buttons.
   Matches the family: 12px radius, gold border, scale on tap.
   Applies on every page where the top-right Sign in renders. */
.user-slot .user-signin,
.user-slot .user-signin.btn {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  color: #fbbf24;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 14px;
  padding: 8px 18px;
  border-radius: 12px;
  border: 1px solid rgba(251, 191, 36, 0.55);
  box-shadow: none;
  transition: background 180ms ease, border-color 180ms ease, transform 120ms ease;
}
.user-slot .user-signin:hover,
.user-slot .user-signin.btn:hover {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.75);
  transform: none;
  color: #fcd34d;
}
.user-slot .user-signin:active,
.user-slot .user-signin.btn:active {
  background: rgba(251, 191, 36, 0.18);
  transform: scale(0.98);
}

/* Hero — atmospheric layered background */
.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background-color: #060d1f;
  color: #fff;
  padding: 48px 0 100px;
  min-height: 720px;
}
/* Layer 0a: amber drift glow (top-right) */
.hero::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.18) 0%, rgba(251, 191, 36, 0.06) 30%, transparent 60%);
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
  animation: drift-amber 20s ease-in-out infinite;
}
/* Layer 0b: blue drift glow (bottom-left) */
.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -15%;
  width: 900px;
  height: 900px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(99, 102, 241, 0.08) 30%, transparent 60%);
  filter: blur(50px);
  pointer-events: none;
  z-index: 0;
  animation: drift-blue 25s ease-in-out infinite;
}
@keyframes drift-amber {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(-40px, 30px) scale(1.05); }
  66%      { transform: translate(30px, -20px) scale(0.95); }
}
@keyframes drift-blue {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(60px, -40px) scale(1.08); }
}

/* Layer 1: subtle grid (Linear/Vercel) — masked separate layer */
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, #000 30%, transparent 80%);
          mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, #000 30%, transparent 80%);
  pointer-events: none;
  z-index: 1;
}

/* Layer 1: starfield — twinkling stars (brand fit) */
.starfield {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}
.star {
  position: absolute;
  width: var(--size, 1.5px);
  height: var(--size, 1.5px);
  background: #ffffff;
  border-radius: 50%;
  box-shadow:
    0 0 4px rgba(255, 255, 255, 0.8),
    0 0 8px rgba(251, 191, 36, 0.4);
  opacity: 0;
  animation: twinkle 4s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(0.5); }
  50%      { opacity: 0.9; transform: scale(1); }
}

/* Layer 1: cursor spotlight */
.hero-spotlight {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(
    600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(251, 191, 36, 0.06),
    transparent 40%
  );
  transition: background 0.3s ease;
}

/* Layer 3: bottom fade-out into next section */
.hero-bottom-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(180deg, transparent 0%, #060d1f 100%);
  pointer-events: none;
  z-index: 3;
}

/* Layer 2: hero content sits above all atmosphere */
.hero > .container,
.hero-content { position: relative; z-index: 2; }

@media (prefers-reduced-motion: reduce) {
  .star, .hero::before, .hero::after,
  .mockup-card--main, .mockup-card--accent-top, .mockup-card--accent-bottom,
  .headline-accent {
    animation: none !important;
  }
}

.hero h1,
.hero-headline {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-style: normal;
  font-size: clamp(48px, 5.5vw, 80px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #ffffff;
  max-width: 640px;
  margin: 32px 0 24px;
}
.hero h1 .hero-accent,
.hero-headline .headline-accent {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #fbbf24 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: shimmer 4s ease-in-out infinite;
}
@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
.hero p {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 1.6;
  letter-spacing: -0.005em;
  color: rgba(255, 255, 255, 0.72);
  max-width: 560px;
  margin: 0 0 40px;
}
@media (max-width: 640px) {
  .hero { padding: 80px 0 96px; }
  .hero p { font-size: 16px; }
}

.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* Hero 2-column layout */
.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.hero-left { max-width: 600px; }
.hero-right { position: relative; }

@media (max-width: 1024px) {
  .hero-content { grid-template-columns: 1fr; gap: 48px; }
  .hero-left { max-width: none; }
}

/* Hero visual / floating mockup */
.hero-visual {
  position: relative;
  width: 100%;
  height: 520px;
  perspective: 1200px;
  pointer-events: none;
}
.mockup-card { will-change: transform; }

.mockup-card--main {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 380px;
  max-width: calc(100% - 24px);
  background: linear-gradient(180deg, #1a2540 0%, #141d33 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 24px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 0 0 1px rgba(255, 255, 255, 0.02),
    0 24px 48px -12px rgba(0, 0, 0, 0.5),
    0 8px 16px -4px rgba(0, 0, 0, 0.3),
    0 0 80px -20px rgba(251, 191, 36, 0.15);
  transform: translate(-50%, -50%) rotate(-2deg);
  animation: float-main 6s ease-in-out infinite;
  pointer-events: auto;
}
@keyframes float-main {
  0%, 100% { transform: translate(-50%, -50%) rotate(-2deg) translateY(0); }
  50%      { transform: translate(-50%, -50%) rotate(-2deg) translateY(-12px); }
}
.mockup-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.mockup-tag {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.2);
  padding: 4px 10px;
  border-radius: 999px;
}
.mockup-progress {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
}
.mockup-question {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 28px;
  font-weight: 400;
  color: #ffffff;
  line-height: 1.3;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}
.math-highlight {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 500;
}
.mockup-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}
.mockup-option {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  cursor: default;
  transition: all 0.2s ease;
}
.mockup-option--correct {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  box-shadow:
    0 0 0 1px rgba(16, 185, 129, 0.2),
    0 0 20px -4px rgba(16, 185, 129, 0.4);
}
.mockup-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.mockup-streak, .mockup-points {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
}
.mockup-points { color: #fbbf24; }

.mockup-card--accent-top,
.mockup-card--accent-bottom {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(180deg, rgba(26, 37, 64, 0.92) 0%, rgba(20, 29, 51, 0.92) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 14px 18px;
  box-shadow: 0 16px 32px -8px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
}
.mockup-card--accent-top {
  top: 8%;
  right: 4%;
  transform: rotate(4deg);
  animation: float-accent-1 7s ease-in-out infinite;
}
.mockup-card--accent-bottom {
  bottom: 10%;
  left: 2%;
  transform: rotate(-3deg);
  animation: float-accent-2 8s ease-in-out infinite;
}
@keyframes float-accent-1 {
  0%, 100% { transform: rotate(4deg) translateY(0); }
  50%      { transform: rotate(4deg) translateY(-16px); }
}
@keyframes float-accent-2 {
  0%, 100% { transform: rotate(-3deg) translateY(0); }
  50%      { transform: rotate(-3deg) translateY(-10px); }
}
.accent-icon { font-size: 24px; line-height: 1; }
.accent-label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 2px;
}
.accent-value {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.01em;
}

@media (max-width: 1024px) {
  .hero-visual { height: 420px; transform: scale(0.9); transform-origin: top center; }
  .mockup-card--main { width: 340px; }
}
@media (max-width: 640px) {
  .hero-visual { height: 360px; }
  .mockup-card--main { width: 300px; padding: 20px; }
  .mockup-question { font-size: 24px; }
  .mockup-card--accent-top,
  .mockup-card--accent-bottom { display: none; }
  @keyframes float-main {
    0%, 100% { transform: translate(-50%, -50%) rotate(-2deg) translateY(0); }
    50%      { transform: translate(-50%, -50%) rotate(-2deg) translateY(-8px); }
  }
}
@media (prefers-reduced-motion: reduce) {
  .mockup-card--main,
  .mockup-card--accent-top,
  .mockup-card--accent-bottom { animation: none; }
}

/* Live student count pill — premium glass */
.hero-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.hero-live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow:
    0 0 0 3px rgba(16, 185, 129, 0.2),
    0 0 12px rgba(16, 185, 129, 0.5);
  animation: hero-live-pulse 2s ease-in-out infinite;
}
@keyframes hero-live-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

/* Buttons */
.btn {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.05s ease, background 0.15s ease;
}

/* Hero buttons — premium */
.hero .btn-primary,
.hero .btn-secondary,
.btn-primary,
.btn-secondary {
  height: 48px;
  padding: 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hero .btn-primary,
.btn-primary {
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  color: #0a1628;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.005em;
  border-radius: 12px;
  border: 1px solid rgba(251, 191, 36, 0.5);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4) inset,
    0 0 0 1px rgba(251, 191, 36, 0.3),
    0 4px 12px -2px rgba(251, 191, 36, 0.35),
    0 2px 4px rgba(0, 0, 0, 0.15);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.hero .btn-primary:hover,
.btn-primary:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.5) inset,
    0 0 0 1px rgba(251, 191, 36, 0.4),
    0 6px 16px -2px rgba(251, 191, 36, 0.45),
    0 3px 6px rgba(0, 0, 0, 0.18);
}
.hero .btn-primary:active,
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.005em;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }

/* Sections */
section { padding: 56px 0; }
section h2 { font-size: 1.6rem; margin: 0 0 24px; color: var(--navy); }

/* Rewards / earn banner — premium dark glass callout */
.rewards-section {
  background: #060d1f;
  position: relative;
  padding: 0 32px;
}
.earn-banner,
.rewards-callout {
  position: relative;
  max-width: 1200px;
  margin: -60px auto 80px;
  padding: 28px 40px;
  background: linear-gradient(135deg, rgba(26, 37, 64, 0.6) 0%, rgba(20, 29, 51, 0.6) 100%);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 24px 48px -12px rgba(0, 0, 0, 0.4),
    0 8px 16px -4px rgba(0, 0, 0, 0.2);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  z-index: 5;
  overflow: hidden;
}
.earn-banner::before,
.rewards-callout::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -100px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.2) 0%, transparent 70%);
  filter: blur(40px);
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 0;
  inset: auto auto auto -100px;
}
.earn-banner > *,
.rewards-callout > * {
  position: relative;
  z-index: 1;
}

.earn-banner-icon,
.rewards-icon {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.15) 0%, rgba(245, 158, 11, 0.05) 100%);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 16px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 0 24px -4px rgba(251, 191, 36, 0.3);
  position: relative;
  font-size: 0;
}
.earn-banner-icon::after,
.rewards-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.1), transparent 60%);
  pointer-events: none;
}

.earn-banner-body,
.rewards-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.earn-banner-title,
.rewards-title {
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #ffffff;
  margin: 0;
}
.earn-banner-sub,
.rewards-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.65);
  margin: 0;
  max-width: 720px;
}

.earn-banner-cta,
.rewards-cta {
  flex-shrink: 0;
  white-space: nowrap;
  height: 44px;
  padding: 0 22px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.005em;
  color: #0a1628;
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  border: 1px solid rgba(251, 191, 36, 0.5);
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4) inset,
    0 0 0 1px rgba(251, 191, 36, 0.3),
    0 4px 12px -2px rgba(251, 191, 36, 0.35),
    0 2px 4px rgba(0, 0, 0, 0.15);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}
.earn-banner-cta:hover,
.rewards-cta:hover {
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.5) inset,
    0 0 0 1px rgba(251, 191, 36, 0.4),
    0 8px 20px -4px rgba(251, 191, 36, 0.45),
    0 4px 8px rgba(0, 0, 0, 0.2);
  text-decoration: none;
}
.rewards-cta-arrow { transition: transform 0.2s ease; }
.rewards-cta:hover .rewards-cta-arrow,
.earn-banner-cta:hover .rewards-cta-arrow { transform: translateX(2px); }

@media (max-width: 768px) {
  .earn-banner,
  .rewards-callout {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 24px;
    gap: 16px;
    margin: -40px 16px 60px;
  }
  .earn-banner-icon,
  .rewards-icon { margin: 0 auto; }
  .earn-banner-cta,
  .rewards-cta { width: 100%; justify-content: center; }
}

/* Grade grid */
.grade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
/* Premium dark grade card — applies anywhere the shared GradeCard component is used.
   See also: .grades-section .grade-card overrides below for landing-page hover glow. */
.grade-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: linear-gradient(180deg, rgba(26, 37, 64, 0.5) 0%, rgba(20, 29, 51, 0.5) 100%);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 22px;
  color: #ffffff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.03) inset,
    0 4px 12px -2px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.3s ease,
              background 0.3s ease,
              box-shadow 0.3s ease;
  overflow: visible;
  text-decoration: none;
}
.grade-card:hover {
  transform: translateY(-3px);
  border-color: rgba(251, 191, 36, 0.3);
  background: linear-gradient(180deg, rgba(30, 42, 72, 0.6) 0%, rgba(24, 33, 58, 0.6) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 0 0 1px rgba(251, 191, 36, 0.15),
    0 16px 32px -8px rgba(0, 0, 0, 0.4);
  text-decoration: none;
}
/* Locked card — kid is below the user's grade level */
.grade-card--locked {
  cursor: not-allowed;
  opacity: 0.55;
  filter: grayscale(0.4);
}
.grade-card--locked:hover {
  transform: none;
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.03) inset,
    0 4px 12px -2px rgba(0, 0, 0, 0.2);
}
/* Current-grade badge variant (gold + check vibe via copy) */
.grade-card-badge--current {
  background: linear-gradient(180deg, #c7d2fe 0%, #818cf8 100%);
  color: #0a1628;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}
.grade-card-badge--locked {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  box-shadow: none;
}

/* ---------- Premium grades section (landing) ---------- */
.grades-section {
  background: #060d1f;
  padding: 80px 32px 120px;
  position: relative;
}
.grades-section-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0;
}
.grades-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 48px;
}
.grades-header-text { max-width: 560px; }
.grades-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(36px, 4.2vw, 52px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: 0 0 14px 0;
}
.grades-subtitle {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}
.grades-pill {
  display: inline-flex;
  align-items: center;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  white-space: nowrap;
}
@media (max-width: 720px) {
  .grades-section { padding: 56px 20px 80px; }
  .grades-header { flex-direction: column; align-items: flex-start; gap: 18px; margin-bottom: 32px; }
}

.grades-section .grade-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.grades-section .grade-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: linear-gradient(180deg, rgba(26, 37, 64, 0.5) 0%, rgba(20, 29, 51, 0.5) 100%);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 22px;
  color: #ffffff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.03) inset,
    0 4px 12px -2px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.3s ease,
              background 0.3s ease,
              box-shadow 0.3s ease;
  overflow: visible;
}
.grades-section .grade-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(420px circle at 100% 0%, rgba(251, 191, 36, 0.06), transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.grades-section .grade-card:hover {
  transform: translateY(-4px);
  border-color: rgba(251, 191, 36, 0.3);
  background: linear-gradient(180deg, rgba(30, 42, 72, 0.6) 0%, rgba(24, 33, 58, 0.6) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 0 0 1px rgba(251, 191, 36, 0.15),
    0 16px 32px -8px rgba(0, 0, 0, 0.4),
    0 0 24px -8px rgba(251, 191, 36, 0.3);
  text-decoration: none;
}
.grades-section .grade-card:hover::before { opacity: 1; }

.grade-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.grade-card-eyebrow {
  display: inline-block;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(251, 191, 36, 0.9);
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.18);
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
}
.grade-card-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.75);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.grade-card-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: #ffffff;
  margin: 0;
}
.grade-card-meta {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
}
.grade-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.grade-card-age {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.45);
}
.grade-card-arrow {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.55);
  transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.grades-section .grade-card:hover .grade-card-arrow {
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  border-color: rgba(251, 191, 36, 0.5);
  color: #0a1628;
  transform: translateX(2px);
}

/* Most popular ribbon (Grade 3) — sits half-outside the top edge */
.grade-card-badge {
  position: absolute;
  top: -10px;
  right: 16px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #0a1628;
  background: linear-gradient(180deg, #fde68a 0%, #fbbf24 60%, #f59e0b 100%);
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
  z-index: 3;
}
.grades-section .grade-card--popular {
  border-color: rgba(251, 191, 36, 0.22);
}

/* Kindergarten variant — gentle indigo */
.grades-section .grade-card--kinder {
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.12) 0%, rgba(20, 29, 51, 0.55) 100%);
  border-color: rgba(129, 140, 248, 0.22);
}
.grades-section .grade-card--kinder:hover {
  border-color: rgba(129, 140, 248, 0.45);
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.18) 0%, rgba(24, 33, 58, 0.6) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 0 0 1px rgba(129, 140, 248, 0.2),
    0 16px 32px -8px rgba(0, 0, 0, 0.4),
    0 0 24px -8px rgba(99, 102, 241, 0.35);
}
.grades-section .grade-card--kinder .grade-card-icon {
  background: rgba(129, 140, 248, 0.12);
  border-color: rgba(129, 140, 248, 0.3);
  color: #c7d2fe;
}

@media (prefers-reduced-motion: reduce) {
  .grades-section .grade-card,
  .grades-section .grade-card:hover,
  .grades-section .grade-card .grade-card-arrow,
  .grades-section .grade-card:hover .grade-card-arrow { transition: none; transform: none; }
}

/* Footer */
.site-footer {
  background: var(--navy);
  color: #cbd5e1;
  padding: 32px 0;
  margin-top: 64px;
  font-size: 0.9rem;
}
.site-footer a { color: #cbd5e1; }

/* Practice / generic content */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

/* Grade detail */
.grade-header { margin-bottom: 32px; }
.unit-list { display: grid; gap: 18px; }
.unit-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.unit-card h3 { margin: 4px 0 6px; color: var(--navy); }
.unit-order {
  display: inline-block;
  background: var(--blue-light);
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
}
.unit-cat { color: var(--muted); font-size: 0.85rem; margin-bottom: 8px; }
.unit-summary { margin: 8px 0 14px; color: var(--text); }
.lesson-list { list-style: none; padding: 0; margin: 0 0 14px; border-top: 1px solid var(--border); }
.lesson-list li { border-bottom: 1px solid var(--border); }
.lesson-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  color: var(--text);
}
.lesson-list a:hover { color: var(--blue); text-decoration: none; }
.lesson-teks { font-size: 0.8rem; color: var(--muted); }

/* Practice */
.practice-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 28px;
  align-items: start;
}
.practice-main { min-width: 0; }
.practice-header { margin-bottom: 24px; }
.practice-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 12px;
}
.practice-title-row h2 { margin: 0; }
.btn-restart {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--navy);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}
.btn-restart:hover {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--navy);
}
.btn-restart:hover svg { transform: rotate(-45deg); }
.btn-restart svg { transition: transform 0.25s ease; }
.back-link { font-size: 0.9rem; color: var(--muted); }
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin: 16px 0 6px;
}
.progress-fill {
  height: 100%;
  background: var(--blue);
  width: 0;
  transition: width 0.3s ease;
}
.progress-text { color: var(--muted); font-size: 0.85rem; }

.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.q-meta { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.q-prompt { font-size: 1.2rem; color: var(--navy); margin-bottom: 18px; line-height: 1.5; }
.q-body { display: grid; gap: 10px; margin-bottom: 18px; }

.choice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.1s ease, border-color 0.1s ease;
}
.choice:hover { background: var(--blue-light); border-color: var(--blue); }
.choice:has(input:checked) {
  background: var(--blue-light);
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.choice input { margin: 0; transform: scale(1.15); accent-color: var(--blue); }
.choice .choice-symbol {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  min-width: 1.4em;
  display: inline-block;
  text-align: center;
}
.choice .choice-hint { color: var(--text-muted, #6b7280); font-size: 0.95rem; }

.num-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.num-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-light); }

/* Feedback */
.feedback {
  margin-top: 16px;
  border-radius: var(--radius);
  padding: 18px;
  border: 1px solid var(--border);
}
.feedback.correct { background: #f0fdf4; border-color: #bbf7d0; }
.feedback.incorrect { background: #fef2f2; border-color: #fecaca; }
.feedback-head { font-weight: 700; font-size: 1.05rem; margin-bottom: 8px; }
.feedback.correct .feedback-head { color: var(--success); }
.feedback.incorrect .feedback-head { color: var(--error); }
.feedback-body p { margin: 6px 0; }
.feedback-actions { margin-top: 14px; }

/* AI tutor */
.tutor-box { margin-top: 12px; padding-top: 12px; border-top: 1px dashed #fecaca; }
.tutor-output {
  margin-top: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  line-height: 1.55;
}
.tutor-output p { margin: 8px 0; }
.tutor-output p:first-child { margin-top: 0; }
.tutor-output p:last-child { margin-bottom: 0; }
.tutor-output ol,
.tutor-output ul {
  margin: 8px 0;
  padding-left: 22px;
}
.tutor-output ol { list-style: decimal; }
.tutor-output ul { list-style: disc; }
.tutor-output li { margin: 4px 0; }
.tutor-output li::marker { color: var(--amber); font-weight: 700; }
.tutor-output strong { color: var(--navy); font-weight: 700; }
.tutor-output em { font-style: italic; }
.tutor-output code {
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
}
.tutor-msg { padding: 8px 0; border-top: 1px solid var(--border); }
.tutor-msg:first-child { border-top: 0; }
.tutor-msg.user { color: var(--text); }
.tutor-msg.assistant { color: var(--text); }
.tutor-msg.loading {
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Rainbow thinking spinner */
.rainbow-spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: conic-gradient(
    #ef4444, #f59e0b, #eab308, #22c55e, #06b6d4, #3b82f6, #8b5cf6, #ec4899, #ef4444
  );
  -webkit-mask: radial-gradient(circle, transparent 56%, #000 58%);
          mask: radial-gradient(circle, transparent 56%, #000 58%);
  animation: rainbow-spin 1.1s linear infinite;
  vertical-align: middle;
  flex-shrink: 0;
}
.tutor-btn .rainbow-spinner { width: 16px; height: 16px; }
@keyframes rainbow-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .rainbow-spinner { animation-duration: 3s; }
}
.tutor-followup {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  align-items: stretch;
}
.tutor-followup input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
}
.tutor-followup input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-light); }
.tutor-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--navy);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}
.tutor-send:hover:not(:disabled) { background: #fbbf24; }
.tutor-send:active { transform: translateY(1px); }
.tutor-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* Performance panel */
.performance-panel {
  position: sticky;
  top: 80px;
  display: grid;
  gap: 14px;
}
.perf-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.perf-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 8px;
}
.perf-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 10px;
}
.perf-ring-wrap {
  display: flex;
  justify-content: center;
  margin: 6px 0 12px;
}
.perf-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  text-align: center;
}
.perf-stats .stat {
  padding: 6px 4px;
  border-radius: 8px;
  background: var(--bg);
}
.stat-num {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
}
.stat-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.recent-dots {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 5px;
}
.recent-dots .dot {
  display: block;
  height: 14px;
  border-radius: 4px;
  background: #e2e8f0;
}
.recent-dots .dot.correct { background: var(--success); }
.recent-dots .dot.incorrect { background: var(--error); }

.unit-rows { display: grid; gap: 9px; }
.unit-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 8px;
  font-size: 0.8rem;
}
.unit-row-title {
  grid-column: 1;
  grid-row: 1;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.unit-row-pct {
  grid-column: 2;
  grid-row: 1;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.unit-row-bar {
  grid-column: 1 / span 2;
  grid-row: 2;
  height: 5px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 3px;
}
.unit-row-fill {
  height: 100%;
  background: var(--blue);
  transition: width 0.4s ease, background 0.3s ease;
}
.unit-row.dim .unit-row-title { color: var(--muted); }

@media (max-width: 900px) {
  .practice-layout { grid-template-columns: 1fr; }
  .performance-panel { position: static; }
}

/* Branded modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.18s ease;
  padding: 20px;
}
.modal-overlay.open { opacity: 1; }
.modal-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 26px 26px 20px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
  transform: translateY(8px) scale(0.98);
  transition: transform 0.2s ease;
  border-top: 4px solid var(--amber);
}
.modal-overlay.open .modal-card { transform: translateY(0) scale(1); }
.modal-title {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: 1.15rem;
  font-weight: 700;
}
.modal-message {
  margin: 0 0 20px;
  color: var(--text);
  line-height: 1.5;
  font-size: 0.95rem;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg);
  color: var(--navy);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy);
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.35);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  z-index: 1100;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Restart flash */
@keyframes restart-flash {
  0%   { background: rgba(245, 158, 11, 0); }
  30%  { background: rgba(245, 158, 11, 0.18); }
  100% { background: rgba(245, 158, 11, 0); }
}
.practice-main.flash {
  animation: restart-flash 0.7s ease;
  border-radius: var(--radius);
}

/* Pre-quiz preparing-your-set loader */
.prep-loader {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 520px;
  margin: 60px auto;
}
.prep-loader .rainbow-spinner { width: 36px; height: 36px; }
.prep-title {
  font-weight: 700;
  color: var(--navy);
  font-size: 1rem;
}
.prep-sub {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 2px;
}

@media (max-width: 600px) {
  .hero { padding: 48px 0; }
  .hero h1 { font-size: 1.75rem; }
  .nav { gap: 12px; }
  .q-prompt { font-size: 1.05rem; }
}

/* ========== Auth (local profiles) ========== */
.user-slot { display: flex; align-items: center; gap: 8px; position: relative; }

/* User pill (header) — premium dark glass, applies on every page */
.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  cursor: pointer;
  color: rgba(255, 255, 255, 0.92);
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: -0.005em;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.user-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}
.user-pill svg { color: rgba(255, 255, 255, 0.5); }
.user-pill-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 500;
}

/* User dropdown menu — dark glass card */
.user-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: rgba(15, 23, 42, 0.92);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 16px 40px rgba(0, 0, 0, 0.5);
  padding: 6px;
  min-width: 180px;
  z-index: 1200;
}
.user-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  font-family: 'Inter', system-ui, sans-serif;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.user-menu button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.user-signin { padding: 8px 16px; font-size: 0.85rem; }

/* Profile avatar */
.profile-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.profile-avatar.small { width: 26px; height: 26px; font-size: 0.8rem; }

/* Auth modal extras */
.auth-modal .modal-card {
  max-width: 420px;
  padding: 28px 28px 22px;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}
.auth-modal .modal-title {
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.auth-modal .modal-message {
  margin-bottom: 22px;
  font-size: 0.9rem;
  color: var(--muted);
}
.auth-modal .modal-actions {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.auth-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 16px 0 8px;
}
.auth-label:first-of-type { margin-top: 4px; }
.auth-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 0.98rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--navy);
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.auth-input::placeholder { color: var(--muted); opacity: 0.65; }
.auth-input:hover { border-color: var(--navy); }
.auth-input:focus {
  outline: none;
  border-color: var(--amber);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}
.pin-input {
  letter-spacing: 0.6em;
  text-align: center;
  font-size: 1.4rem;
  padding: 14px;
}
.auth-help { color: var(--muted); font-size: 0.78rem; margin: 4px 0 0; }
.auth-error { color: var(--error); font-size: 0.85rem; margin: 8px 0 0; }

.modal-full { width: 100%; }
.modal-tight { margin-top: 8px; }
.modal-divider {
  display: flex;
  align-items: center;
  margin: 18px 0 12px;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.modal-divider::before,
.modal-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.modal-divider span { padding: 0 12px; }

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 6px;
}
.profile-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 10px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
  position: relative;
}
.profile-tile:hover {
  border-color: var(--amber);
  transform: translateY(-2px);
}
.profile-tile .profile-avatar { width: 42px; height: 42px; font-size: 1.1rem; }
.profile-tile .profile-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-tile .profile-lock {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 0.75rem;
  opacity: 0.7;
}

.manage-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  max-height: 280px;
  overflow: auto;
}
.manage-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: 10px;
}
.manage-row .profile-name { flex: 1; color: var(--navy); font-weight: 600; font-size: 0.9rem; }
.btn-link {
  background: none;
  border: 0;
  padding: 4px 8px;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: underline;
}
.btn-link.danger { color: var(--error); }

@media (max-width: 600px) {
  .user-pill-name { max-width: 70px; }
  .nav { gap: 14px; }
}

.rainbow-spinner.small { width: 14px; height: 14px; vertical-align: -2px; }
.user-menu-meta {
  padding: 8px 12px 6px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
  font-family: 'Inter', system-ui, sans-serif;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 4px;
}

/* Wallet / points pill in header — gold-tint glass, applies on every page */
.user-slot { display: inline-flex; align-items: center; gap: 10px; }
.wallet-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.005em;
  border: 1px solid rgba(251, 191, 36, 0.25);
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.12s ease;
}
.wallet-pill:hover {
  text-decoration: none;
  background: rgba(251, 191, 36, 0.16);
  border-color: rgba(251, 191, 36, 0.4);
  transform: translateY(-1px);
}
.wallet-pill svg { color: #fbbf24; }

/* Question reward badge */
.q-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.q-reward {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-weight: 700;
  font-size: 0.78rem;
  border: 1px solid #fde68a;
}

/* +cents toast */
.cents-toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translate(-50%, -10px);
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.25s ease;
  z-index: 9999;
  pointer-events: none;
}
.cents-toast.show { opacity: 1; transform: translate(-50%, 0); }
.cents-toast-coin {
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  color: #78350f;
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.95rem;
}
.cents-toast-loss { border-color: #fecaca; background: #fff5f5; color: #7f1d1d; }
.cents-toast-loss .cents-toast-coin {
  background: linear-gradient(135deg, #fecaca, #ef4444);
  color: #7f1d1d;
}

.user-menu-link {
  display: block;
  padding: 9px 12px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 13px;
  font-family: 'Inter', system-ui, sans-serif;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}
.user-menu-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  text-decoration: none;
}

/* Marketplace */
.market-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; margin-top: 18px; }
.toy-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.toy-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(15, 23, 42, 0.10); }
.toy-card.affordable { border-color: #fcd34d; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.10); }
.toy-img-wrap {
  position: relative;
  background: linear-gradient(135deg, #f9fafb, #f3f4f6);
}
.toy-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: block;
  padding: 8px;
}
.toy-img-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #92400e;
  font-size: 2.6rem;
}
.toy-price-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  color: #78350f;
  padding: 5px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}
.toy-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.toy-name { font-weight: 700; color: var(--navy); margin: 0; font-size: 0.98rem; line-height: 1.3; }
.toy-desc {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
  white-space: pre-line;
}
.toy-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 4px; min-height: 18px; }
.toy-stock { color: var(--muted); font-size: 0.75rem; }
.toy-stock.low { color: #b45309; font-weight: 600; }
.toy-stock.can { color: #15803d; font-weight: 700; }
.toy-buy { padding: 9px 14px; font-size: 0.9rem; margin-top: 4px; }
.toy-buy:disabled { opacity: 0.6; cursor: not-allowed; }

.wallet-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 22px;
  align-items: center;
}
.wallet-summary-stat .label { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }
.wallet-summary-stat .value { color: var(--navy); font-size: 1.6rem; font-weight: 800; }
.wallet-progress {
  flex: 1;
  min-width: 200px;
  height: 10px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.wallet-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #fde68a, #f59e0b, #ec4899);
  transition: width 0.4s ease;
}

/* Admin */
.admin-tabs { display: flex; gap: 8px; margin: 18px 0; border-bottom: 1px solid var(--border); }
.admin-tab {
  padding: 10px 16px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
}
.admin-tab.active { color: var(--navy); border-bottom-color: var(--amber); }
.admin-form { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin-bottom: 18px; }
.admin-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.admin-form .row.col1 { grid-template-columns: 1fr; }
.admin-img-preview { max-width: 160px; max-height: 160px; border-radius: 10px; margin-top: 8px; border: 1px solid var(--border); }
.admin-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.admin-table th, .admin-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.admin-table th { background: var(--bg); font-weight: 700; color: var(--navy); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
.status-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-shipped { background: #dbeafe; color: #1e40af; }
.status-delivered { background: #d1fae5; color: #065f46; }
.status-cancelled { background: #fee2e2; color: #991b1b; }

/* Checkout / parent consent */
.consent-card { background: #fffbeb; border: 1.5px solid #fcd34d; border-radius: 12px; padding: 14px 16px; margin: 14px 0; font-size: 0.88rem; color: #78350f; }
.consent-card label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.consent-card input[type=checkbox] { margin-top: 3px; transform: scale(1.2); }

.admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  border: 0;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}
.admin-badge:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
  color: #fff;
}

.earn-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--amber), #f97316);
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}
.earn-cta:hover { transform: translateY(-1px); text-decoration: none; color: #fff; box-shadow: 0 6px 18px rgba(245, 158, 11, 0.4); }

/* Section mastery */
.mastered-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #fcd34d;
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 16px;
  color: #78350f;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}
.mastered-banner.mastered-celebrate {
  background: linear-gradient(135deg, #fef9c3, #fde047);
  border-color: #facc15;
}
.mastered-star { font-size: 2rem; line-height: 1; }
.mastered-title { font-weight: 800; font-size: 1.05rem; }
.mastered-sub { font-size: 0.88rem; opacity: 0.85; margin-top: 2px; }

.q-reward-locked {
  background: linear-gradient(135deg, #fde68a, #facc15) !important;
  color: #78350f !important;
  font-weight: 800;
}

.mastered-badge {
  display: inline-block;
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  color: #78350f;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  vertical-align: middle;
  margin-left: 6px;
}
.unit-card.unit-mastered { border-color: #fcd34d; box-shadow: 0 0 0 2px rgba(252, 211, 77, 0.25); }
.lesson-mastered > a { background: rgba(254, 243, 199, 0.5); }

.modal-card { position: relative; }
.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, color 0.12s ease;
}
.modal-close:hover { background: #f3f4f6; color: var(--navy); }

/* Dashboard */
.dash-welcome { padding: 32px 0 16px; }
.dash-welcome h1 { margin: 0 0 6px; font-size: 2rem; color: var(--navy); }
.dash-sub { color: var(--muted); margin: 0; font-size: 1rem; }
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 18px 0 24px;
}
.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}
.dash-card-stat { text-align: left; }
.dash-stat-label { font-size: 0.82rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.dash-stat-value { font-size: 2.4rem; font-weight: 800; color: var(--navy); margin: 6px 0 4px; line-height: 1; }
.dash-stat-foot { font-size: 0.85rem; color: var(--muted); }
.dash-card-board { padding: 22px 24px; }
.dash-board-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.dash-board-head h3 { margin: 0; color: var(--navy); }
.dash-board-sub { color: var(--muted); font-size: 0.85rem; }

/* "Your journey" — kid-friendly replacement for the leaderboard. */
.journey-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin: 6px 0 18px;
}
.journey-tile {
  border-radius: 14px;
  padding: 16px;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
  border: 1px solid rgba(99, 102, 241, 0.12);
}
.journey-tile-label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.journey-tile-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--navy);
  margin: 6px 0 4px;
  line-height: 1.05;
}
.journey-tile-unit {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
}
.journey-tile-foot { font-size: 0.82rem; color: var(--muted); }
.journey-streak { background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%); border-color: rgba(234, 88, 12, 0.18); }
.journey-streak .journey-tile-value { color: #c2410c; }
.journey-today { background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%); border-color: rgba(16, 185, 129, 0.2); }
.journey-today .journey-tile-value { color: #047857; }
.journey-best { background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); border-color: rgba(59, 130, 246, 0.2); }
.journey-best .journey-tile-value { color: #1d4ed8; }
.journey-cta { text-align: center; margin-top: 4px; }
.leaderboard {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 520px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}
.leaderboard::-webkit-scrollbar { width: 8px; }
.leaderboard::-webkit-scrollbar-track { background: transparent; }
.leaderboard::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.18);
  border-radius: 8px;
}
.leaderboard::-webkit-scrollbar-thumb:hover { background: rgba(15, 23, 42, 0.32); }
.leaderboard li {
  display: grid;
  grid-template-columns: 72px 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.95rem;
}
.leaderboard li:last-child { border-bottom: none; }
.leaderboard .lb-rank {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 1.8rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: #475569;
  background: #f1f5f9;
  box-shadow: inset 0 0 0 2px rgba(15, 23, 42, 0.05);
}
.leaderboard .lb-name { color: var(--navy); font-weight: 600; }
.leaderboard .lb-you { color: var(--blue); font-weight: 700; font-size: 0.8rem; }
.leaderboard .lb-correct { color: var(--muted); font-size: 0.88rem; }
.leaderboard .lb-acc {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1e3a8a;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.8rem;
}
.leaderboard .lb-me {
  border-bottom-color: transparent;
}

/* Gold #1 */
.leaderboard .lb-rank-1 .lb-rank {
  width: 64px; height: 64px;
  font-size: 2.2rem;
  color: #78350f;
  background: radial-gradient(circle at 30% 28%, #fff7c2 0%, #fcd34d 55%, #b45309 115%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.7),
    inset 0 0 0 2px rgba(255,255,255,0.45),
    0 6px 14px -4px rgba(180, 83, 9, 0.55);
  text-shadow: 0 1px 0 rgba(255,255,255,0.55);
}
/* Silver #2 */
.leaderboard .lb-rank-2 .lb-rank {
  width: 60px; height: 60px;
  font-size: 2rem;
  color: #1e293b;
  background: radial-gradient(circle at 30% 28%, #ffffff 0%, #e2e8f0 55%, #94a3b8 115%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.85),
    inset 0 0 0 2px rgba(255,255,255,0.5),
    0 5px 12px -4px rgba(100, 116, 139, 0.5);
  text-shadow: 0 1px 0 rgba(255,255,255,0.6);
}
/* Bronze #3 */
.leaderboard .lb-rank-3 .lb-rank {
  width: 60px; height: 60px;
  font-size: 2rem;
  color: #7c2d12;
  background: radial-gradient(circle at 30% 28%, #fff0e0 0%, #fdba74 55%, #c2410c 115%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.7),
    inset 0 0 0 2px rgba(255,255,255,0.4),
    0 5px 12px -4px rgba(194, 95, 22, 0.55);
  text-shadow: 0 1px 0 rgba(255,255,255,0.55);
}
/* Ranks 4+ — clean dark numeral */
.leaderboard .lb-rank-n .lb-rank {
  font-size: 1.5rem;
  color: var(--navy);
}

/* ===== Full-row tinting for top 3 (overrides .lb-me) ===== */
/* Gold row — #1 */
.leaderboard .lb-rank-1 {
  background: linear-gradient(90deg, #fff7c2 0%, #fde68a 55%, #fbbf24 110%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 4px 14px -8px rgba(217, 119, 6, 0.55);
}
.leaderboard .lb-rank-1 .lb-name { color: #78350f; }
.leaderboard .lb-rank-1 .lb-correct { color: #92400e; font-weight: 600; }
.leaderboard .lb-rank-1 .lb-acc {
  background: rgba(255, 255, 255, 0.55);
  color: #78350f;
}

/* Platinum row — #2 (cool icy gradient with a faint blue sheen) */
.leaderboard .lb-rank-2 {
  background: linear-gradient(90deg, #f8fafc 0%, #e2e8f0 55%, #cbd5e1 110%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 4px 14px -8px rgba(100, 116, 139, 0.45);
}
.leaderboard .lb-rank-2 .lb-name { color: #1e293b; }
.leaderboard .lb-rank-2 .lb-correct { color: #475569; font-weight: 600; }
.leaderboard .lb-rank-2 .lb-acc {
  background: rgba(255, 255, 255, 0.7);
  color: #1e293b;
}

/* Bronze row — #3 (warm peach copper) */
.leaderboard .lb-rank-3 {
  background: linear-gradient(90deg, #fff1e6 0%, #fed7aa 55%, #fb923c 110%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 4px 14px -8px rgba(194, 95, 22, 0.5);
}
.leaderboard .lb-rank-3 .lb-name { color: #7c2d12; }
.leaderboard .lb-rank-3 .lb-correct { color: #9a3412; font-weight: 600; }
.leaderboard .lb-rank-3 .lb-acc {
  background: rgba(255, 255, 255, 0.55);
  color: #7c2d12;
}

/* "you" row keeps a subtle blue ring; tint stays per-rank */
.leaderboard .lb-me {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: -2px;
}
/* Plain rows (#4+) — keep white */
.leaderboard .lb-rank-n { background: #fff; }
.leaderboard .lb-rank-n.lb-me {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
}

/* Dancing emoji for the leader — travels across the row, swaps frames */
.leaderboard .lb-row { position: relative; overflow: hidden; }
.leaderboard .lb-rank-1 { position: relative; overflow: hidden; }
.lb-dancer {
  position: absolute;
  top: 50%;
  left: 0;
  width: 1.6em;
  height: 1.6em;
  font-size: 1.6rem;
  pointer-events: none;
  z-index: 3;
  transform-origin: 50% 90%;
  animation: lb-dance-across 6s ease-in-out infinite alternate;
  filter: drop-shadow(0 2px 3px rgba(120, 53, 15, 0.35));
}
.lb-dancer .lb-d1,
.lb-dancer .lb-d2 {
  position: absolute;
  inset: 0;
  display: block;
  line-height: 1;
}
/* Frame swap (250ms each) — looks like the dancer is actually stepping */
.lb-dancer .lb-d1 { animation: lb-frame-a 0.5s steps(1, end) infinite; }
.lb-dancer .lb-d2 { animation: lb-frame-b 0.5s steps(1, end) infinite; }
@keyframes lb-frame-a {
  0%, 49%   { opacity: 1; transform: scale(1)    rotate(-6deg); }
  50%, 100% { opacity: 0; transform: scale(0.92) rotate(6deg); }
}
@keyframes lb-frame-b {
  0%, 49%   { opacity: 0; transform: scale(0.92) rotate(-6deg); }
  50%, 100% { opacity: 1; transform: scale(1)    rotate(6deg); }
}
@keyframes lb-dance-across {
  0%   { left: 2%;  transform: translateY(-50%) rotate(-10deg); }
  20%  { left: 22%; transform: translateY(-62%) rotate(8deg); }
  40%  { left: 44%; transform: translateY(-50%) rotate(-8deg); }
  60%  { left: 64%; transform: translateY(-62%) rotate(10deg); }
  80%  { left: 80%; transform: translateY(-50%) rotate(-10deg); }
  100% { left: 92%; transform: translateY(-62%) rotate(12deg); }
}
@media (prefers-reduced-motion: reduce) {
  .lb-dancer,
  .lb-dancer .lb-d1,
  .lb-dancer .lb-d2 { animation: none; }
  .lb-dancer { left: 8px; }
  .lb-dancer .lb-d2 { opacity: 0; }
}

/* Movers for ranks 2 / 3 / 4 */
.lb-mover {
  position: absolute;
  top: 50%;
  left: 0;
  font-size: 1.4rem;
  pointer-events: none;
  z-index: 3;
  transform-origin: 50% 90%;
  filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.25));
}
/* #2 — runner: zips across quickly */
.lb-runner {
  animation: lb-run-across 4s linear infinite, lb-run-bob 0.28s ease-in-out infinite;
}
@keyframes lb-run-across {
  0%   { left: -2%; }
  100% { left: 100%; }
}
@keyframes lb-run-bob {
  0%, 100% { transform: translateY(-50%); }
  50%      { transform: translateY(-58%); }
}
/* #3 — sweater: jogs slowly with a tired wobble */
.lb-sweater {
  animation: lb-sweat-across 9s ease-in-out infinite alternate, lb-sweat-wobble 0.6s ease-in-out infinite;
}
@keyframes lb-sweat-across {
  0%   { left: 2%; }
  100% { left: 88%; }
}
@keyframes lb-sweat-wobble {
  0%, 100% { transform: translateY(-50%) rotate(-6deg); }
  50%      { transform: translateY(-46%) rotate(6deg); }
}
/* #4 — walker: strolls along, occasional sway */
.lb-walker {
  animation: lb-walk-across 14s linear infinite, lb-walk-sway 1s ease-in-out infinite;
}
@keyframes lb-walk-across {
  0%   { left: -2%; }
  100% { left: 100%; }
}
@keyframes lb-walk-sway {
  0%, 100% { transform: translateY(-50%) rotate(-3deg); }
  50%      { transform: translateY(-54%) rotate(3deg); }
}
@media (prefers-reduced-motion: reduce) {
  .lb-mover { animation: none; left: 8px; transform: translateY(-50%); }
}

.leaderboard .lb-empty {
  display: block;
  text-align: center;
  color: var(--muted);
  padding: 18px;
  border-bottom: none;
}
.lb-meta { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); color: var(--muted); font-size: 0.9rem; }
.dash-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }

/* Two-column dashboard main: side panel (CTA + grade picker) | leaderboard */
.dash-main {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 18px;
  margin-bottom: 28px;
}
.dash-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dash-practice-cta {
  width: 100%;
  text-align: center;
  font-size: 1.05rem;
  padding: 14px 22px;
  box-shadow: 0 8px 22px -8px rgba(245, 158, 11, 0.6);
}
.dash-side-card { padding: 18px 20px; }
.dash-side-title {
  margin: 0 0 4px;
  font-size: 1rem;
  color: var(--navy);
}
.dash-side-sub {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.85rem;
}
/* Global ranking card */
.dash-rank-card {
  padding: 18px 20px 16px;
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 60%, #60a5fa 100%);
  color: #fff;
  border: none;
  text-align: center;
  box-shadow: 0 10px 24px -12px rgba(30, 58, 138, 0.55);
}
.dash-rank-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.85);
}
.dash-rank-num {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
  margin: 8px 0 4px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.dash-rank-hash {
  font-size: 1.6rem;
  font-weight: 700;
  vertical-align: 18px;
  margin-right: 2px;
  opacity: 0.85;
}
.dash-rank-of {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
}
.dash-rank-pct {
  margin-top: 10px;
  display: inline-block;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}
.dash-rank-pct:empty { display: none; }
.grade-grid-compact {
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.grade-grid-compact .grade-card {
  padding: 12px 14px;
  border-radius: 12px;
}
.grade-grid-compact .grade-card .label { font-size: 0.7rem; }
.grade-grid-compact .grade-card .title { font-size: 0.95rem; margin: 2px 0 0; }
.grade-grid-compact .grade-card .desc { display: none; }
@media (max-width: 880px) {
  .dash-main { grid-template-columns: 1fr; }
  .grade-grid-compact { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 520px) {
  .grade-grid-compact { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .leaderboard li { grid-template-columns: 60px 1fr auto; }
  .leaderboard .lb-rank { width: 48px; height: 48px; font-size: 1.5rem; }
  .leaderboard .lb-rank-1 .lb-rank,
  .leaderboard .lb-rank-2 .lb-rank,
  .leaderboard .lb-rank-3 .lb-rank { width: 52px; height: 52px; font-size: 1.7rem; }
  .leaderboard .lb-correct { display: none; }
}

/* Dashboard polish */
.dash-welcome { padding: 36px 0 18px; position: relative; }
.dash-welcome-emoji {
  font-size: 2.4rem;
  display: inline-block;
  margin-bottom: 4px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}
.dash-welcome h1 {
  background: linear-gradient(135deg, var(--navy) 0%, #2563eb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 2.2rem;
}
.dash-card { transition: transform 0.15s ease, box-shadow 0.15s ease; }
.dash-card-stat:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15,23,42,0.08); }
.dash-card-board { background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%); }
.dash-board-head h3 { font-size: 1.15rem; }

/* Admin-only edit pill on marketplace cards */
.toy-img-wrap { position: relative; }
.toy-edit {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.02em;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: background 0.15s ease, transform 0.15s ease;
}
.toy-edit:hover { background: var(--blue); transform: translateY(-1px); }

/* "How it works" grid */
.howit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.howit-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 22px 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}
.howit-card:hover {
  box-shadow: 0 6px 22px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}
.howit-icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  font-size: 1.4rem;
  border-radius: 10px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  margin-bottom: 12px;
}
.howit-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.howit-card p {
  font-size: 0.95rem;
  color: var(--navy);
  margin: 0 0 10px;
  line-height: 1.5;
}
.howit-card ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}
.howit-card ul li { margin-bottom: 4px; }
.howit-card ul li strong, .howit-card ul li em { color: var(--navy); }

/* ===== Header chat bell ===== */
/* Chat / friends bell in header — dark glass icon button, applies on every page */
.chat-bell {
  position: relative;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.7);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.chat-bell:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}
.chat-bell-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #ef4444;
  color: #fff;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  border: 2px solid #0a1628;
}

/* ===== Friends panel ===== */
.sf-panel {
  position: fixed;
  inset: 0;
  z-index: 9999;
}
.sf-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.sf-card {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100vw);
  background: #fff;
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 30px -10px rgba(0, 0, 0, 0.2);
  animation: sf-slide 0.22s ease-out;
}
@keyframes sf-slide {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
.sf-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.sf-title {
  margin: 0;
  flex: 1;
  font-size: 1.05rem;
  color: var(--navy);
}
.sf-back, .sf-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--navy);
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sf-back:hover, .sf-close:hover { background: #f1f5f9; }
.sf-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px 18px;
}
.sf-section-title {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 14px 4px 6px;
}
.sf-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sf-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid transparent;
}
.sf-row-friend {
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.sf-row-friend:hover { background: #f8fafc; border-color: var(--border); }
.sf-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  color: #fff;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sf-avatar-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}
.sf-presence {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid #fff;
  box-sizing: border-box;
}
.sf-presence-online {
  background: #16a34a;
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5);
  animation: sf-presence-pulse 2s ease-out infinite;
}
.sf-presence-offline { background: #cbd5e1; }
@keyframes sf-presence-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}
.sf-name-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.sf-name-col .sf-name { flex: none; }
.sf-presence-text {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 1px;
}
.sf-presence-text-online { color: #16a34a; font-weight: 600; }
.sf-name {
  flex: 1;
  color: var(--navy);
  font-weight: 600;
  font-size: 0.95rem;
}
.sf-chev { color: var(--muted); }
.sf-pending {
  font-size: 0.78rem;
  color: var(--muted);
  font-style: italic;
}
.sf-actions { display: flex; gap: 6px; }
.sf-btn {
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}
.sf-btn-accept { background: #16a34a; color: #fff; }
.sf-btn-accept:hover { background: #15803d; }
.sf-btn-decline { background: #f1f5f9; color: var(--navy); }
.sf-btn-decline:hover { background: #e2e8f0; }
.sf-empty {
  padding: 20px 10px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Conversation view */
.sf-conv {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.sf-conv-msgs {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 4px 12px;
  min-height: 200px;
}
.sf-msg {
  display: flex;
  flex-direction: column;
  max-width: 80%;
}
.sf-msg-me { align-self: flex-end; align-items: flex-end; }
.sf-msg-them { align-self: flex-start; align-items: flex-start; }
.sf-msg-bubble {
  padding: 8px 14px;
  border-radius: 18px;
  font-size: 1rem;
  line-height: 1.35;
  word-break: break-word;
}
.sf-msg-me .sf-msg-bubble {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border-bottom-right-radius: 6px;
}
.sf-msg-them .sf-msg-bubble {
  background: #f1f5f9;
  color: var(--navy);
  border-bottom-left-radius: 6px;
}
.sf-msg-react .sf-msg-bubble {
  background: transparent !important;
  color: inherit;
  font-size: 1.8rem;
  padding: 0;
  line-height: 1;
}
.sf-msg-time {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 2px;
}
.sf-conv-pad {
  border-top: 1px solid var(--border);
  padding: 12px 4px 4px;
  margin-top: 8px;
}
.sf-pad-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 4px 4px 8px;
}
.sf-phrase-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
}
.sf-phrase {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.88rem;
  color: var(--navy);
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, transform 0.06s;
}
.sf-phrase:hover { background: #eff6ff; }
.sf-phrase:active { transform: scale(0.97); }
.sf-react-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.sf-react {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  width: 38px;
  height: 38px;
  font-size: 1.3rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, transform 0.06s;
}
.sf-react:hover { background: #fef3c7; }
.sf-react:active { transform: scale(0.92); }

@media (max-width: 480px) {
  .sf-card { width: 100vw; }
}

/* Make leaderboard rows tappable for friend requests */
.leaderboard .lb-row { cursor: pointer; }
.leaderboard .lb-row:hover { filter: brightness(0.98); }

/* ============== Premium kid-friendly polish ============== */

/* Dyslexia-friendly font preference. Falls back gracefully if no font installed. */
body.pref-dyslexia,
body.pref-dyslexia .question-card,
body.pref-dyslexia .q-prompt,
body.pref-dyslexia .choice,
body.pref-dyslexia .feedback {
  font-family: "OpenDyslexic", "Comic Sans MS", "Lexend", "Atkinson Hyperlegible", system-ui, sans-serif !important;
  letter-spacing: 0.01em;
}
body.pref-large-text { font-size: 18px; }
body.pref-large-text .q-prompt { font-size: 1.25rem; line-height: 1.55; }
body.pref-large-text .choice { font-size: 1.1rem; }

/* Read-aloud button on question prompt */
.q-prompt { display: flex; align-items: flex-start; gap: 10px; }
.q-prompt-text { flex: 1; }
.q-read-btn {
  flex: 0 0 auto;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(99, 102, 241, 0.25);
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  cursor: pointer;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.q-read-btn:hover { transform: scale(1.06); box-shadow: 0 4px 10px rgba(99, 102, 241, 0.18); }
.q-read-btn:active { transform: scale(0.96); }

/* FX toast (milestones) */
.fx-toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 20px);
  background: #0f172a;
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
  opacity: 0;
  transition: opacity 280ms ease, transform 280ms ease;
  z-index: 9999;
  pointer-events: none;
}
.fx-toast-in { opacity: 1; transform: translate(-50%, 0); }
.fx-toast-win {
  background: linear-gradient(135deg, #f59e0b 0%, #ec4899 100%);
}

/* Settings page */
.settings-container { max-width: 880px; }
.settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
.settings-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  padding: 22px 24px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}
.settings-card h3 { margin: 0 0 14px; color: var(--navy); }
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  cursor: pointer;
}
.settings-row:last-of-type { border-bottom: none; }
.settings-row-label { display: flex; flex-direction: column; gap: 2px; }
.settings-row-title { font-weight: 600; color: var(--navy); }
.settings-row-sub { font-size: 0.85rem; color: var(--muted); }
.settings-toggle {
  appearance: none;
  width: 46px; height: 26px;
  background: #cbd5e1;
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background 180ms ease;
  flex: 0 0 auto;
}
.settings-toggle::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 180ms ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.settings-toggle:checked { background: #10b981; }
.settings-toggle:checked::after { transform: translateX(20px); }
.settings-select {
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.95rem;
  background: #fff;
  cursor: pointer;
}
.settings-test {
  display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px;
}

/* ============== Admin: ship-these-now panel ============== */
.ship-panel {
  background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%);
  border: 1px solid rgba(234, 88, 12, 0.25);
  border-radius: 16px;
  padding: 22px 24px;
  margin: 18px 0 24px;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.10);
}
.ship-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.ship-panel-head h2 { margin: 0; color: #9a3412; display: inline-flex; align-items: center; gap: 10px; }
.ship-count {
  background: #ea580c;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  padding: 2px 12px;
  border-radius: 999px;
  min-width: 28px;
  text-align: center;
}
.ship-panel-sub { color: #9a3412; font-weight: 600; }
.ship-list { display: grid; gap: 14px; }
.ship-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(234, 88, 12, 0.18);
  padding: 16px 18px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}
.ship-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  border-bottom: 1px dashed rgba(15, 23, 42, 0.08);
  padding-bottom: 10px;
}
.ship-toy { font-weight: 700; font-size: 1.1rem; color: var(--navy); }
.ship-when { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }
.ship-price { font-weight: 800; color: #ea580c; white-space: nowrap; }
.ship-card-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 14px;
}
.ship-block { font-size: 0.9rem; }
.ship-block-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 4px;
}
.ship-block-value { color: var(--navy); line-height: 1.45; }
.ship-block-value a { color: var(--navy); text-decoration: underline; }
.ship-muted { color: var(--muted); font-size: 0.78rem; }
.ship-block-addr .ship-copy {
  margin-top: 8px;
  padding: 4px 10px;
  font-size: 0.78rem;
}
.ship-card-foot {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  border-top: 1px dashed rgba(15, 23, 42, 0.08);
  padding-top: 12px;
}
.ship-track { flex: 1 1 200px; padding: 8px 12px; font-size: 0.9rem; }

/* Tab badge for pending count on Orders tab. */
.tab-badge {
  display: inline-block;
  background: #ea580c;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 1px 8px;
  border-radius: 999px;
  margin-left: 6px;
  min-width: 20px;
  text-align: center;
  vertical-align: middle;
}

/* ---------- Premium footer (landing) ---------- */
.footer {
  position: relative;
  background: #060d1f;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 80px 32px 32px;
  overflow: hidden;
  color: #ffffff;
  margin-top: 0;
}
.footer::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 400px;
  background: radial-gradient(ellipse at center, rgba(251, 191, 36, 0.08) 0%, transparent 60%);
  filter: blur(40px);
  pointer-events: none;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
}
.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 56px;
}
.footer-brand-col { max-width: 320px; }
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  text-decoration: none;
  margin-bottom: 16px;
}
.footer-logo .logo-accent {
  background: linear-gradient(180deg, #fde68a 0%, #fbbf24 60%, #f59e0b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.footer-tagline {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.55);
  margin: 0 0 20px 0;
}
.footer-trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.footer-trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 12px;
  border-radius: 999px;
}
.trust-dot {
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
  flex-shrink: 0;
}
.footer-nav-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer-col-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin: 0 0 4px 0;
}
.footer .footer-link {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  transition: color 0.2s ease;
}
.footer .footer-link:hover { color: #ffffff; }
.footer-divider {
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 20%,
    rgba(255, 255, 255, 0.08) 80%,
    transparent 100%);
  margin-bottom: 24px;
}
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-copy {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}
.footer-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}
.footer-meta-divider { color: rgba(255, 255, 255, 0.25); }
.footer-social { display: flex; gap: 8px; }
.footer-social-link {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.6);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.footer-social-link:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  transform: translateY(-1px);
}
@media (max-width: 1024px) {
  .footer-top { grid-template-columns: 1fr 1fr; gap: 40px; }
  .footer-brand-col { grid-column: 1 / -1; max-width: 480px; }
}
@media (max-width: 640px) {
  .footer { padding: 56px 20px 28px; }
  .footer-top { grid-template-columns: 1fr; gap: 32px; margin-bottom: 40px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 14px; }
}

/* =================================================================
   Premium Marketplace page (body.marketplace-page)
   ================================================================= */
body.marketplace-page { background: #060d1f; color: #ffffff; }

/* Hero */
.marketplace-hero {
  position: relative;
  background: #060d1f;
  padding: 100px 32px 60px;
  overflow: hidden;
}
.marketplace-hero::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -10%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.15) 0%, transparent 60%);
  filter: blur(50px);
  pointer-events: none;
}
.marketplace-hero::after {
  content: '';
  position: absolute;
  bottom: -200px;
  left: -10%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 60%);
  filter: blur(50px);
  pointer-events: none;
}
.marketplace-hero-inner {
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}
.marketplace-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(251, 191, 36, 0.9);
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.2);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 24px;
}
.eyebrow-dot {
  width: 6px;
  height: 6px;
  background: #fbbf24;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.2), 0 0 8px rgba(251, 191, 36, 0.6);
  animation: market-pulse 2s ease-in-out infinite;
}
@keyframes market-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.marketplace-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: 0 0 20px 0;
  max-width: 820px;
}
.marketplace-title .title-accent {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.marketplace-subtitle {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
  max-width: 720px;
  margin: 0 0 40px 0;
}
.marketplace-stats {
  display: inline-flex;
  align-items: center;
  gap: 32px;
  padding: 20px 32px;
  background: linear-gradient(180deg, rgba(26, 37, 64, 0.5) 0%, rgba(20, 29, 51, 0.5) 100%);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
}
.marketplace-stats .stat-item { display: flex; flex-direction: column; gap: 4px; }
.marketplace-stats .stat-value {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 28px;
  font-weight: 400;
  color: #ffffff;
  letter-spacing: -0.02em;
  line-height: 1;
}
.marketplace-stats .stat-label {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}
.marketplace-stats .stat-divider { width: 1px; height: 32px; background: rgba(255, 255, 255, 0.08); }
@media (max-width: 640px) {
  .marketplace-hero { padding: 64px 20px 32px; }
  .marketplace-stats { flex-direction: column; gap: 16px; align-items: flex-start; padding: 18px 20px; }
  .marketplace-stats .stat-divider { width: 100%; height: 1px; }
}

/* Section wrapper below hero */
body.marketplace-page .marketplace-section {
  background: #060d1f;
  padding: 0 0 40px;
}

/* Sign-in callout (guest) */
.signin-callout {
  position: relative;
  max-width: 1216px;
  margin: 0 auto 40px;
  padding: 24px 32px;
  background: linear-gradient(135deg, rgba(26, 37, 64, 0.6) 0%, rgba(20, 29, 51, 0.6) 100%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 16px 32px -12px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}
.signin-callout::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -100px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.18) 0%, transparent 70%);
  filter: blur(40px);
  transform: translateY(-50%);
  pointer-events: none;
}
.signin-callout > * { position: relative; z-index: 1; }
.signin-callout-icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.15) 0%, rgba(245, 158, 11, 0.05) 100%);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 14px;
}
.signin-callout-content { display: flex; flex-direction: column; gap: 4px; }
.signin-callout-eyebrow {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(251, 191, 36, 0.9);
}
.signin-callout-text {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: #ffffff;
  margin: 0;
}
.signin-callout-cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: #0a1628;
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  border: 1px solid rgba(251, 191, 36, 0.5);
  border-radius: 12px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset, 0 4px 12px -2px rgba(251, 191, 36, 0.35);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
}
.signin-callout-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 8px 20px -4px rgba(251, 191, 36, 0.45);
}
@media (max-width: 768px) {
  .signin-callout { grid-template-columns: 1fr; text-align: center; gap: 16px; padding: 20px; margin: 0 16px 32px; }
  .signin-callout-icon { margin: 0 auto; }
}

/* Logged-in wallet summary on dark */
body.marketplace-page #wallet-summary.wallet-summary {
  max-width: 1216px;
  margin: 0 auto 32px;
  padding: 22px 28px;
  background: linear-gradient(180deg, rgba(26, 37, 64, 0.5) 0%, rgba(20, 29, 51, 0.5) 100%);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: center;
  color: #ffffff;
}
body.marketplace-page .wallet-summary-stat .label {
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
body.marketplace-page .wallet-summary-stat .value {
  color: #ffffff;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 26px;
  font-weight: 400;
}
body.marketplace-page .wallet-progress {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}
body.marketplace-page .wallet-progress-fill {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  height: 100%;
}

/* Filter / sort controls */
.marketplace-controls {
  max-width: 1280px;
  margin: 0 auto 28px;
  padding: 0 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.marketplace-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-pill {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.filter-pill:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}
.filter-pill--active {
  color: #0a1628;
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  border-color: rgba(251, 191, 36, 0.5);
  box-shadow: 0 2px 8px -2px rgba(251, 191, 36, 0.4);
}
.marketplace-sort { display: flex; align-items: center; gap: 12px; }
.sort-label {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}
.sort-select {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 32px 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%23ffffff' stroke-opacity='0.5' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.sort-select option { background: #0a1628; color: #ffffff; }

/* Toys grid */
body.marketplace-page .toys-grid {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px 80px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  align-items: stretch;
}
@media (max-width: 1024px) { body.marketplace-page .toys-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  { body.marketplace-page .toys-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { body.marketplace-page .toys-grid { grid-template-columns: 1fr; padding: 0 20px 60px; } }
.market-loading, .market-empty, .market-error, .orders-empty {
  grid-column: 1 / -1;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
  padding: 24px 0;
}
.market-error { color: #fca5a5; }

/* Toy card (scoped — overrides legacy white .toy-card on this page) */
body.marketplace-page .toy-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: linear-gradient(180deg, rgba(26, 37, 64, 0.5) 0%, rgba(20, 29, 51, 0.5) 100%);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.3s ease,
              box-shadow 0.3s ease;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 4px 12px -2px rgba(0, 0, 0, 0.2);
}
body.marketplace-page .toy-card:hover {
  transform: translateY(-6px);
  border-color: rgba(251, 191, 36, 0.25);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 0 0 1px rgba(251, 191, 36, 0.15),
    0 24px 48px -12px rgba(0, 0, 0, 0.5),
    0 0 32px -8px rgba(251, 191, 36, 0.25);
}
body.marketplace-page .toy-card:hover .toy-image-glow { opacity: 1; }
body.marketplace-page .toy-card:hover .toy-image { transform: scale(1.05); }

/* Stock badge */
body.marketplace-page .toy-stock-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.toy-stock-badge--limited {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.toy-stock-badge--scarce {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  box-shadow: 0 0 12px -2px rgba(239, 68, 68, 0.3);
  animation: scarce-pulse 2s ease-in-out infinite;
}
.toy-stock-badge--out {
  color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
@keyframes scarce-pulse {
  0%, 100% { box-shadow: 0 0 12px -2px rgba(239, 68, 68, 0.3); }
  50%      { box-shadow: 0 0 20px -2px rgba(239, 68, 68, 0.55); }
}

/* Image area */
body.marketplace-page .toy-image-wrapper {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.04) 0%, transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, transparent 100%);
  overflow: hidden;
  padding: 32px;
}
.toy-image-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(251, 191, 36, 0.12) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
body.marketplace-page .toy-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.35));
}
body.marketplace-page .toy-image-placeholder {
  width: 60%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.1) 0%, rgba(245, 158, 11, 0.04) 100%);
  border: 1px solid rgba(251, 191, 36, 0.18);
  border-radius: 16px;
  color: #fbbf24;
  font-size: 2.4rem;
  position: relative;
  z-index: 1;
}

/* Points badge — gold pill bottom-right of image */
.toy-points-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #0a1628;
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.5);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4) inset,
    0 4px 12px -2px rgba(251, 191, 36, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Card content */
body.marketplace-page .toy-content {
  padding: 18px 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
body.marketplace-page .toy-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #ffffff;
  margin: 0;
  line-height: 1.3;
}
body.marketplace-page .toy-description {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card footer + CTA */
body.marketplace-page .toy-footer {
  padding: 12px 20px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 12px;
}
body.marketplace-page .toy-cta {
  width: 100%;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.005em;
  color: #0a1628;
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  border: 1px solid rgba(251, 191, 36, 0.5);
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4) inset,
    0 0 0 1px rgba(251, 191, 36, 0.2),
    0 4px 12px -2px rgba(251, 191, 36, 0.3);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
}
body.marketplace-page .toy-cta:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.5) inset,
    0 0 0 1px rgba(251, 191, 36, 0.3),
    0 8px 20px -4px rgba(251, 191, 36, 0.45);
}
body.marketplace-page .toy-cta:hover:not(:disabled) svg { transform: translateX(2px); }
body.marketplace-page .toy-cta svg { transition: transform 0.2s ease; }
body.marketplace-page .toy-cta--disabled,
body.marketplace-page .toy-cta:disabled {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.45);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  cursor: not-allowed;
}

/* Affordable card subtle ring */
body.marketplace-page .toy-card--affordable {
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.03) inset,
    0 0 0 1px rgba(16, 185, 129, 0.12),
    0 4px 12px -2px rgba(0, 0, 0, 0.2);
}

/* Admin edit pill (for admins) */
body.marketplace-page .toy-edit {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 4px 10px;
  border-radius: 999px;
  text-decoration: none;
}

/* My orders block */
.orders-block {
  max-width: 1280px;
  margin: 24px auto 80px;
  padding: 0 32px;
}
.orders-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: 0 0 18px 0;
}
body.marketplace-page #orders-root {
  background: linear-gradient(180deg, rgba(26, 37, 64, 0.4) 0%, rgba(20, 29, 51, 0.4) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 8px;
  overflow-x: auto;
}
body.marketplace-page #orders-root .orders-empty {
  padding: 28px;
  margin: 0;
}
body.marketplace-page #orders-root .admin-table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
}
body.marketplace-page #orders-root .admin-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
}
body.marketplace-page #orders-root .admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.85);
}
body.marketplace-page #orders-root .admin-table tr:last-child td { border-bottom: 0; }
body.marketplace-page #orders-root .admin-table img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .eyebrow-dot, .toy-stock-badge--scarce { animation: none; }
  body.marketplace-page .toy-card,
  body.marketplace-page .toy-card:hover,
  body.marketplace-page .toy-image,
  body.marketplace-page .toy-cta { transition: none; transform: none; }
}

/* Defensive overrides — any legacy navy/dark text on the marketplace page
   reads white on the new dark background. */
body.marketplace-page,
body.marketplace-page p,
body.marketplace-page h1,
body.marketplace-page h2,
body.marketplace-page h3,
body.marketplace-page h4,
body.marketplace-page span,
body.marketplace-page strong,
body.marketplace-page label { color: #ffffff; }
body.marketplace-page section h2 { color: #ffffff; }
body.marketplace-page .wallet-summary-stat .label { color: rgba(255, 255, 255, 0.55); }
body.marketplace-page .wallet-summary-stat .value { color: #ffffff; }
body.marketplace-page .toy-stock,
body.marketplace-page .toy-stock.low,
body.marketplace-page .toy-stock.can { color: rgba(255, 255, 255, 0.7); }
body.marketplace-page .earn-cta {
  color: #0a1628;
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  border: 1px solid rgba(251, 191, 36, 0.5);
}
/* Header brand + nav stay legible */
body.marketplace-page .site-header .brand,
body.marketplace-page .site-header .brand-text { color: #ffffff; }
body.marketplace-page .site-header .nav a { color: rgba(255, 255, 255, 0.75); }
body.marketplace-page .site-header .nav a.active,
body.marketplace-page .site-header .nav a:hover { color: #ffffff; }

/* ============================================================
   ABOUT / HOW IT WORKS — premium dark overhaul (Prompt 10)
   Scoped under body.about-page
   ============================================================ */
body.about-page { background: #060d1f; color: #ffffff; }
body.about-page .site-header { background: rgba(6, 13, 31, 0.85); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(255,255,255,0.06); }
body.about-page .site-header .brand,
body.about-page .site-header .brand-text { color: #ffffff; }
body.about-page .site-header .nav a { color: rgba(255,255,255,0.75); }
body.about-page .site-header .nav a.active,
body.about-page .site-header .nav a:hover { color: #ffffff; }

.about-section {
  position: relative;
  background: #060d1f;
  padding: 100px 32px 120px;
  overflow: hidden;
}
.about-section::before {
  content: '';
  position: absolute;
  top: 0;
  right: -10%;
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(251, 191, 36, 0.08) 0%, transparent 60%);
  filter: blur(60px);
  pointer-events: none;
}
.about-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: -10%;
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(99, 102, 241, 0.08) 0%, transparent 60%);
  filter: blur(60px);
  pointer-events: none;
}
.about-inner {
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.about-header {
  max-width: 720px;
  margin: 0 auto 80px;
  text-align: center;
}
.about-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(251, 191, 36, 0.9);
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.2);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 24px;
}
.about-eyebrow .eyebrow-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #fbbf24;
  box-shadow: 0 0 8px rgba(251,191,36,0.7);
  animation: eyebrow-pulse 2s ease-in-out infinite;
}
@keyframes eyebrow-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.about-title {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(48px, 6vw, 72px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: 0 0 20px 0;
}
.about-title .title-accent {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.about-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.65);
  margin: 0 auto;
  max-width: 600px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 80px;
}
@media (max-width: 1024px) { .features-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .features-grid { grid-template-columns: 1fr; } }

.feature-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 32px;
  background: linear-gradient(180deg, rgba(26, 37, 64, 0.5) 0%, rgba(20, 29, 51, 0.5) 100%);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.03) inset,
    0 4px 12px -2px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 120px;
  background: radial-gradient(ellipse at top, rgba(251, 191, 36, 0.06), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(251, 191, 36, 0.2);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 0 0 1px rgba(251, 191, 36, 0.1),
    0 24px 48px -12px rgba(0, 0, 0, 0.4),
    0 0 32px -8px rgba(251, 191, 36, 0.2);
}
.feature-card:hover::before { opacity: 1; }

.feature-card-step {
  position: absolute;
  top: 24px;
  right: 24px;
  font-family: 'Instrument Serif', serif;
  font-size: 32px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.06);
  letter-spacing: -0.02em;
  pointer-events: none;
  z-index: 0;
}

.feature-card-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.15) 0%, rgba(245, 158, 11, 0.05) 100%);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 14px;
  color: #fbbf24;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.feature-card-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.12), transparent 60%);
  pointer-events: none;
}

.feature-card-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 1;
}
.feature-card-title {
  font-family: 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: #ffffff;
  margin: 0;
}
.feature-card-description {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.65);
  margin: 0;
}
.feature-card-description strong {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
}
.feature-card-description em { color: rgba(255,255,255,0.85); font-style: italic; }
.feature-card-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.feature-card-list li {
  position: relative;
  padding-left: 24px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.6);
}
.feature-card-list li em { color: rgba(255,255,255,0.78); font-style: italic; }
.feature-card-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none'%3E%3Cpath d='M3 7L6 10L11 4' stroke='%23fbbf24' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.7;
}

/* Saad's note — featured testimonial */
.saad-note {
  position: relative;
  margin: 80px 0 0;
  padding: 48px;
  background: linear-gradient(135deg, rgba(26, 37, 64, 0.6) 0%, rgba(20, 29, 51, 0.6) 100%);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 24px 48px -12px rgba(0, 0, 0, 0.4);
}
.saad-note-glow {
  position: absolute;
  top: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.18) 0%, transparent 60%);
  filter: blur(40px);
  pointer-events: none;
}
.saad-note-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: flex-start;
}
@media (max-width: 768px) {
  .saad-note { padding: 32px 24px; }
  .saad-note-inner { grid-template-columns: 1fr; gap: 20px; }
}
.saad-note-avatar { position: relative; flex-shrink: 0; }
.avatar-circle {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  border-radius: 50%;
  font-family: 'Instrument Serif', serif;
  font-size: 36px;
  font-weight: 400;
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.15) inset,
    0 8px 24px -4px rgba(99, 102, 241, 0.4);
}
.avatar-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  border: 2px solid #060d1f;
  border-radius: 50%;
  color: #0a1628;
  box-shadow: 0 2px 8px -2px rgba(251, 191, 36, 0.5);
}
.saad-note-content { display: flex; flex-direction: column; gap: 16px; }
.saad-note-eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(251, 191, 36, 0.85);
}
.saad-note-quote {
  font-family: 'Instrument Serif', serif;
  font-size: 22px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
  margin: 0;
  letter-spacing: -0.01em;
  font-weight: 400;
}
.saad-note-quote em {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-style: italic;
}
.saad-note-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}
.saad-note-name { font-weight: 600; color: #ffffff; }
.saad-note-divider { color: rgba(255, 255, 255, 0.25); }
.saad-note-role { color: rgba(251, 191, 36, 0.85); font-weight: 500; }

/* CTA */
.about-cta {
  margin-top: 80px;
  text-align: center;
  padding: 60px 32px;
  background: linear-gradient(180deg, rgba(26, 37, 64, 0.4) 0%, transparent 100%);
  border-radius: 24px;
}
.about-cta-title {
  font-family: 'Instrument Serif', serif;
  font-size: 40px;
  font-weight: 400;
  color: #ffffff;
  margin: 0 0 12px 0;
  letter-spacing: -0.02em;
}
.about-cta-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.65);
  margin: 0 0 32px 0;
}
.about-cta-buttons {
  display: inline-flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
body.about-page .about-cta .btn-primary {
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  color: #0a1628;
  border: 1px solid rgba(251, 191, 36, 0.5);
  padding: 14px 28px;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 8px 24px -8px rgba(251,191,36,0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
body.about-page .about-cta .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 32px -8px rgba(251,191,36,0.6); }
body.about-page .about-cta .btn-secondary {
  background: rgba(255,255,255,0.04);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.12);
  padding: 14px 28px;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}
body.about-page .about-cta .btn-secondary:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.2); }

/* Defensive overrides — kill any legacy navy text on about page */
body.about-page section h2,
body.about-page h1, body.about-page h2, body.about-page h3, body.about-page h4 { color: #ffffff; }
body.about-page p, body.about-page li, body.about-page span, body.about-page strong, body.about-page label { color: inherit; }

@media (prefers-reduced-motion: reduce) {
  body.about-page .feature-card,
  body.about-page .feature-card:hover { transition: none; transform: none; }
  body.about-page .about-eyebrow .eyebrow-dot { animation: none; }
}


/* ============================================================
   SIGN IN MODAL — premium dark glass (Prompt 11)
   Scoped under .modal-overlay.signin-overlay
   ============================================================ */
.modal-overlay.signin-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6, 13, 31, 0.85);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.modal-overlay.signin-overlay.open { opacity: 1; }

.signin-modal {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: linear-gradient(180deg, rgba(26, 37, 64, 0.95) 0%, rgba(20, 29, 51, 0.95) 100%);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 40px 32px 24px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 32px 64px -16px rgba(0, 0, 0, 0.6),
    0 16px 32px -8px rgba(0, 0, 0, 0.4),
    0 0 80px -20px rgba(251, 191, 36, 0.15);
  animation: signin-rise 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  color: #ffffff;
}
@keyframes signin-rise {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.signin-modal-accent {
  position: absolute;
  top: 0; left: 32px; right: 32px;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(251, 191, 36, 0.4) 30%,
    rgba(251, 191, 36, 0.6) 50%,
    rgba(251, 191, 36, 0.4) 70%,
    transparent 100%);
}

.signin-modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}
.signin-modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.signin-modal-brand { display: flex; justify-content: center; margin-bottom: 24px; }
.signin-modal-brand svg { filter: drop-shadow(0 4px 12px rgba(251, 191, 36, 0.3)); }

.signin-modal-title {
  font-family: 'Instrument Serif', serif;
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: #ffffff;
  text-align: center;
  margin: 0 0 8px 0;
  line-height: 1.1;
}
.signin-modal-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  margin: 0 0 28px 0;
}

.signin-sso-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}
.signin-sso-btn {
  width: 100%;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0 16px;
}
.signin-sso-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.signin-divider {
  position: relative;
  text-align: center;
  margin: 24px 0;
}
.signin-divider::before {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}
.signin-divider-text {
  position: relative;
  display: inline-block;
  padding: 0 12px;
  background: rgb(23, 33, 57);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.02em;
}

.signin-form { display: flex; flex-direction: column; gap: 16px; }
.signin-field { display: flex; flex-direction: column; gap: 6px; }
.signin-label-row { display: flex; justify-content: space-between; align-items: center; }
.signin-label {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}
.signin-forgot {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: rgba(251, 191, 36, 0.85);
  text-decoration: none;
  transition: color 0.2s ease;
}
.signin-forgot:hover { color: #fbbf24; }

.signin-input-wrapper { position: relative; }
.signin-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 400;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02) inset;
  box-sizing: border-box;
}
.signin-input::placeholder { color: rgba(255, 255, 255, 0.3); }
.signin-input:hover { border-color: rgba(255, 255, 255, 0.14); }
.signin-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(251, 191, 36, 0.4);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 0 0 4px rgba(251, 191, 36, 0.1);
}
.signin-input-wrapper .signin-input { padding-right: 44px; }

.signin-password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
  padding: 0;
}
.signin-password-toggle:hover {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.8);
}

.signin-error {
  margin: 4px 0 0 0;
  padding: 10px 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 10px;
  color: #fca5a5;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  line-height: 1.4;
}

.signin-submit {
  width: 100%;
  height: 48px;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: #0a1628;
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  border: 1px solid rgba(251, 191, 36, 0.5);
  border-radius: 12px;
  cursor: pointer;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4) inset,
    0 0 0 1px rgba(251, 191, 36, 0.2),
    0 4px 12px -2px rgba(251, 191, 36, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.15);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.signin-submit:hover {
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.5) inset,
    0 0 0 1px rgba(251, 191, 36, 0.3),
    0 8px 20px -4px rgba(251, 191, 36, 0.5);
}
.signin-submit svg { transition: transform 0.2s ease; }
.signin-submit:hover svg { transform: translateX(2px); }
.signin-submit:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

.signin-modal-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
}
.signin-footer-text { color: rgba(255, 255, 255, 0.5); margin-right: 6px; }
.signin-footer-link {
  color: #fbbf24;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}
.signin-footer-link:hover { color: #fcd34d; }

.signin-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
}
.signin-trust .trust-item { display: inline-flex; align-items: center; gap: 4px; }
.signin-trust .trust-divider { color: rgba(255, 255, 255, 0.2); }

@media (prefers-reduced-motion: reduce) {
  .modal-overlay.signin-overlay { transition: none; }
  .signin-modal { animation: none; }
}

/* ============================================================
   DASHBOARD — premium dark overhaul (Prompt 12)
   Scoped under body.home-page #dashboard
   ============================================================ */
body.home-page #dashboard.dashboard-section {
  position: relative;
  background: #060d1f;
  padding: 0 0 80px;
  overflow: hidden;
}
body.home-page #dashboard.dashboard-section::before {
  content: '';
  position: absolute;
  top: -200px; right: -200px;
  width: 800px; height: 800px;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.08) 0%, transparent 60%);
  filter: blur(60px);
  pointer-events: none;
}
body.home-page #dashboard.dashboard-section::after {
  content: '';
  position: absolute;
  bottom: 0; left: -200px;
  width: 800px; height: 800px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 60%);
  filter: blur(60px);
  pointer-events: none;
}
body.home-page #dashboard .dashboard-inner {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
}

/* Welcome header */
body.home-page #dashboard .dashboard-welcome {
  padding: 60px 32px 40px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
body.home-page #dashboard .welcome-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(251, 191, 36, 0.9);
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.2);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}
body.home-page #dashboard .eyebrow-emoji { font-size: 12px; }
body.home-page #dashboard .welcome-title {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(40px, 5vw, 56px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: #ffffff;
  margin: 0 0 12px 0;
}
body.home-page #dashboard .welcome-name {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
body.home-page #dashboard .welcome-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.65);
  margin: 0;
  max-width: 520px;
}
body.home-page #dashboard .welcome-subtitle strong { color: #ffffff; font-weight: 600; }
body.home-page #dashboard .btn-primary--large {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 28px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #0a1628;
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  border: 1px solid rgba(251, 191, 36, 0.5);
  border-radius: 12px;
  text-decoration: none;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.4) inset,
    0 4px 12px -2px rgba(251,191,36,0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
body.home-page #dashboard .btn-primary--large:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.5) inset,
    0 8px 20px -4px rgba(251,191,36,0.5);
}
body.home-page #dashboard .btn-primary--large svg { transition: transform 0.2s ease; }
body.home-page #dashboard .btn-primary--large:hover svg { transform: translateX(2px); }

/* Stats grid */
body.home-page #dashboard .stats-grid {
  margin: 0 auto 32px;
  padding: 0 32px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 1024px) { body.home-page #dashboard .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { body.home-page #dashboard .stats-grid { grid-template-columns: 1fr; } }

body.home-page #dashboard .stat-card {
  position: relative;
  padding: 24px;
  background: linear-gradient(180deg, rgba(26, 37, 64, 0.5) 0%, rgba(20, 29, 51, 0.5) 100%);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.03) inset,
    0 4px 12px -2px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}
body.home-page #dashboard .stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.1);
}
body.home-page #dashboard .stat-card--wallet {
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.08) 0%, rgba(20, 29, 51, 0.5) 100%);
  border-color: rgba(251, 191, 36, 0.2);
}
body.home-page #dashboard .stat-card--wallet::before {
  content: '';
  position: absolute;
  top: -50px; right: -50px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.18) 0%, transparent 60%);
  filter: blur(30px);
  pointer-events: none;
}
body.home-page #dashboard .stat-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
}
body.home-page #dashboard .stat-card-label {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}
body.home-page #dashboard .stat-card-icon {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.5);
}
body.home-page #dashboard .stat-card-icon--gold {
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.2) 0%, rgba(245, 158, 11, 0.1) 100%);
  border-color: rgba(251, 191, 36, 0.3);
  color: #fbbf24;
}
body.home-page #dashboard .stat-card-value {
  font-family: 'Instrument Serif', serif;
  font-size: 48px;
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1;
  color: #ffffff;
  position: relative;
  z-index: 1;
}
body.home-page #dashboard .stat-card--wallet .stat-card-value { color: #fbbf24; }
body.home-page #dashboard .stat-card-meta {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  position: relative;
  z-index: 1;
}
body.home-page #dashboard .stat-card-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #fbbf24;
  text-decoration: none;
  transition: gap 0.2s ease, color 0.2s ease;
  position: relative;
  z-index: 1;
}
body.home-page #dashboard .stat-card-link:hover { gap: 6px; color: #fcd34d; }

/* Dashboard grid (panels) */
body.home-page #dashboard .dashboard-grid {
  padding: 0 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
body.home-page #dashboard .dashboard-grid .activity-panel { grid-column: 1 / -1; }
@media (max-width: 1024px) { body.home-page #dashboard .dashboard-grid { grid-template-columns: 1fr; } }

body.home-page #dashboard .dashboard-panel {
  background: linear-gradient(180deg, rgba(26, 37, 64, 0.5) 0%, rgba(20, 29, 51, 0.5) 100%);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 28px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.03) inset,
    0 4px 12px -2px rgba(0, 0, 0, 0.2);
}
body.home-page #dashboard .dashboard-panel-header { margin-bottom: 24px; }
body.home-page #dashboard .dashboard-panel-title {
  font-family: 'Instrument Serif', serif;
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: #ffffff;
  margin: 0 0 4px 0;
  display: inline-flex;
  align-items: center;
}
body.home-page #dashboard .dashboard-panel-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
}
body.home-page #dashboard .panel-link {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: rgba(251, 191, 36, 0.85);
  text-decoration: none;
  white-space: nowrap;
}
body.home-page #dashboard .panel-link:hover { color: #fbbf24; }

/* Grade tiles inside dashboard panel — 2-col compact override (fixes empty-tiles bug) */
body.home-page #dashboard .grades-panel .grade-grid-compact {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
body.home-page #dashboard .grades-panel .grade-card {
  padding: 16px;
  border-radius: 12px;
  min-height: 0;
}
body.home-page #dashboard .grades-panel .grade-card-eyebrow { font-size: 9px; }
body.home-page #dashboard .grades-panel .grade-card-icon {
  width: 36px; height: 36px;
  font-size: 18px;
}
body.home-page #dashboard .grades-panel .grade-card-title { font-size: 15px; }
body.home-page #dashboard .grades-panel .grade-card-meta { font-size: 12px; }
body.home-page #dashboard .grades-panel .grade-card-foot {
  padding-top: 10px;
}
body.home-page #dashboard .grades-panel .grade-card-age { font-size: 11px; }
body.home-page #dashboard .grades-panel .grade-card--popular .grade-card-badge { display: none; }
@media (max-width: 480px) {
  body.home-page #dashboard .grades-panel .grade-grid-compact { grid-template-columns: 1fr; }
}

/* Journey panel */
body.home-page #dashboard .journey-panel { position: relative; overflow: hidden; }
body.home-page #dashboard .journey-panel::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.08) 0%, transparent 60%);
  filter: blur(40px);
  pointer-events: none;
}
body.home-page #dashboard .journey-icon { font-size: 22px; margin-right: 8px; }
body.home-page #dashboard .journey-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 4px 0 24px;
  position: relative;
  z-index: 1;
}
@media (max-width: 768px) { body.home-page #dashboard .journey-stats { grid-template-columns: 1fr; } }

body.home-page #dashboard .journey-stat {
  display: flex;
  gap: 14px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  transition: all 0.3s ease;
}
body.home-page #dashboard .journey-stat--streak {
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
  border-color: rgba(239, 68, 68, 0.15);
}
body.home-page #dashboard .journey-stat-icon {
  flex-shrink: 0;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.6);
}
body.home-page #dashboard .journey-stat--streak .journey-stat-icon {
  color: #f87171;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
}
body.home-page #dashboard .journey-stat-content {
  display: flex; flex-direction: column;
  gap: 2px;
  min-width: 0;
}
body.home-page #dashboard .journey-stat-label {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}
body.home-page #dashboard .journey-stat-value {
  font-family: 'Instrument Serif', serif;
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
  color: #ffffff;
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 2px;
}
body.home-page #dashboard .journey-stat-unit {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0;
}
body.home-page #dashboard .journey-stat-hint {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 4px;
  line-height: 1.4;
}
body.home-page #dashboard .journey-cta {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #0a1628;
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  border: 1px solid rgba(251, 191, 36, 0.5);
  border-radius: 12px;
  text-decoration: none;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.4) inset,
    0 4px 12px -2px rgba(251,191,36,0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
body.home-page #dashboard .journey-cta:hover {
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.5) inset,
    0 8px 20px -4px rgba(251,191,36,0.5);
}
body.home-page #dashboard .journey-cta svg { transition: transform 0.2s ease; }
body.home-page #dashboard .journey-cta:hover svg { transform: translateX(2px); }

/* Activity panel */
body.home-page #dashboard .activity-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
body.home-page #dashboard .activity-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 24px;
  gap: 8px;
}
body.home-page #dashboard .activity-empty-icon {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  color: rgba(251, 191, 36, 0.7);
  margin-bottom: 8px;
}
body.home-page #dashboard .activity-empty-title {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
}
body.home-page #dashboard .activity-empty-text {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
  max-width: 420px;
}

@media (prefers-reduced-motion: reduce) {
  body.home-page #dashboard .stat-card,
  body.home-page #dashboard .journey-stat,
  body.home-page #dashboard .btn-primary--large,
  body.home-page #dashboard .journey-cta { transition: none; }
}

/* ============================================================
   DASHBOARD v2 — daily challenge, level pill, dashboard-grade-tile,
   achievements, compact activity (Prompt 13)
   ============================================================ */

/* Level pill (inside welcome) */
body.home-page #dashboard .level-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px 8px 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  margin-top: 18px;
}
body.home-page #dashboard .level-badge {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  border-radius: 50%;
  font-family: 'Instrument Serif', serif;
  font-size: 18px;
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 4px 12px -2px rgba(99,102,241,0.4);
}
body.home-page #dashboard .level-info {
  display: flex; flex-direction: column; gap: 4px; min-width: 220px;
}
body.home-page #dashboard .level-label {
  font-family: 'Inter', sans-serif;
  font-size: 12px; font-weight: 600;
  color: rgba(255,255,255,0.85);
}
body.home-page #dashboard .level-progress {
  display: flex; align-items: center; gap: 8px;
}
body.home-page #dashboard .level-progress-bar {
  flex: 1; height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px; overflow: hidden;
}
body.home-page #dashboard .level-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #818cf8, #6366f1);
  border-radius: 999px;
  box-shadow: 0 0 6px rgba(99,102,241,0.5);
}
body.home-page #dashboard .level-xp {
  font-family: 'Inter', sans-serif;
  font-size: 10px; font-weight: 500;
  color: rgba(255,255,255,0.45); white-space: nowrap;
}

/* Daily challenge */
body.home-page #dashboard .daily-challenge {
  position: relative;
  margin: 0 32px 32px;
  padding: 28px 32px;
  background: linear-gradient(135deg, rgba(251,191,36,0.12) 0%, rgba(20,29,51,0.6) 60%);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(251,191,36,0.25);
  border-radius: 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.06) inset,
    0 16px 40px -12px rgba(0,0,0,0.4),
    0 0 60px -16px rgba(251,191,36,0.3);
}
body.home-page #dashboard .challenge-glow {
  position: absolute;
  top: -150px; left: -100px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(251,191,36,0.25) 0%, transparent 60%);
  filter: blur(40px);
  pointer-events: none;
  animation: challenge-pulse 4s ease-in-out infinite;
}
@keyframes challenge-pulse { 0%,100% { opacity: 0.7; } 50% { opacity: 1; } }
body.home-page #dashboard .challenge-content { position: relative; z-index: 1; }
body.home-page #dashboard .challenge-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: #fbbf24;
  margin-bottom: 10px;
}
body.home-page #dashboard .challenge-fire {
  font-size: 14px;
  filter: drop-shadow(0 0 6px rgba(251,191,36,0.5));
}
body.home-page #dashboard .challenge-title {
  font-family: 'Instrument Serif', serif;
  font-size: 32px; font-weight: 400;
  color: #ffffff; letter-spacing: -0.02em; line-height: 1.1;
  margin: 0 0 8px 0;
}
body.home-page #dashboard .challenge-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 14px; color: rgba(255,255,255,0.7);
  margin: 0 0 20px 0; max-width: 480px;
}
body.home-page #dashboard .challenge-subtitle strong { color: #fbbf24; font-weight: 600; }
body.home-page #dashboard .challenge-progress {
  display: flex; align-items: center; gap: 16px;
}
body.home-page #dashboard .challenge-progress-track {
  flex: 1; display: flex; flex-direction: column; gap: 6px; max-width: 320px;
}
body.home-page #dashboard .challenge-progress-bar {
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.04);
}
body.home-page #dashboard .challenge-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(251,191,36,0.5);
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
}
body.home-page #dashboard .challenge-progress-text {
  font-family: 'Inter', sans-serif;
  font-size: 12px; font-weight: 600;
  color: rgba(255,255,255,0.85);
}
body.home-page #dashboard .challenge-reward {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: rgba(251,191,36,0.12);
  border: 1px solid rgba(251,191,36,0.3);
  border-radius: 999px;
  white-space: nowrap;
}
body.home-page #dashboard .reward-coin { font-size: 14px; }
body.home-page #dashboard .reward-amount {
  font-family: 'Inter', sans-serif;
  font-size: 13px; font-weight: 700; color: #fbbf24;
}
body.home-page #dashboard .challenge-actions {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
}
body.home-page #dashboard .challenge-cta {
  height: 48px; padding: 0 24px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 14px; font-weight: 600;
  color: #0a1628;
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  border: 1px solid rgba(251,191,36,0.5);
  border-radius: 12px;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset, 0 4px 12px -2px rgba(251,191,36,0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
body.home-page #dashboard .challenge-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.5) inset, 0 8px 20px -4px rgba(251,191,36,0.5);
}
body.home-page #dashboard .challenge-timer {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: 'Inter', sans-serif;
  font-size: 11px; color: rgba(255,255,255,0.5);
}
body.home-page #dashboard .challenge-timer strong {
  color: rgba(255,255,255,0.85); font-weight: 600;
}
@media (max-width: 768px) {
  body.home-page #dashboard .daily-challenge {
    grid-template-columns: 1fr; gap: 20px;
  }
  body.home-page #dashboard .challenge-actions { align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  body.home-page #dashboard .challenge-glow { animation: none; }
  body.home-page #dashboard .challenge-cta,
  body.home-page #dashboard .challenge-progress-fill { transition: none; }
}

/* Dashboard grade tiles (compact, with progress bar) */
body.home-page #dashboard .grades-panel .grade-grid-compact {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (max-width: 480px) {
  body.home-page #dashboard .grades-panel .grade-grid-compact { grid-template-columns: 1fr; }
}
body.home-page #dashboard .dashboard-grade-tile {
  position: relative;
  padding: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  text-decoration: none;
  display: flex; flex-direction: column; gap: 10px;
  transition: all 0.2s ease;
}
body.home-page #dashboard .dashboard-grade-tile:hover {
  background: rgba(251,191,36,0.06);
  border-color: rgba(251,191,36,0.25);
  transform: translateY(-2px);
}
body.home-page #dashboard .dashboard-grade-tile-header {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
body.home-page #dashboard .dashboard-grade-tile-eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(251,191,36,0.85);
}
body.home-page #dashboard .dashboard-grade-tile-icon {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 11px; font-weight: 600;
  color: rgba(255,255,255,0.7);
  flex-shrink: 0;
}
body.home-page #dashboard .dashboard-grade-tile-title {
  font-family: 'Inter', sans-serif;
  font-size: 15px; font-weight: 600;
  color: #ffffff !important;
  letter-spacing: -0.01em;
  margin: 0;
}
body.home-page #dashboard .dashboard-grade-tile-meta {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  margin: 0;
}
body.home-page #dashboard .dashboard-grade-tile-progress {
  display: flex; flex-direction: column; gap: 4px; margin-top: 4px;
}
body.home-page #dashboard .tile-progress-bar {
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
}
body.home-page #dashboard .tile-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  border-radius: 999px;
  box-shadow: 0 0 8px rgba(251,191,36,0.4);
  transition: width 1s cubic-bezier(0.4,0,0.2,1);
}
body.home-page #dashboard .tile-progress-text {
  font-family: 'Inter', sans-serif;
  font-size: 10px; font-weight: 500;
  color: rgba(255,255,255,0.5);
}

/* Achievements */
body.home-page #dashboard .achievements-panel { grid-column: 1 / -1; }
body.home-page #dashboard .achievements-header {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
}
body.home-page #dashboard .achievements-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}
@media (max-width: 1024px) {
  body.home-page #dashboard .achievements-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  body.home-page #dashboard .achievements-grid { grid-template-columns: repeat(2, 1fr); }
}
body.home-page #dashboard .achievement-card {
  position: relative;
  padding: 16px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: all 0.3s ease;
}
body.home-page #dashboard .achievement-card--unlocked {
  background: linear-gradient(180deg, rgba(251,191,36,0.1) 0%, rgba(255,255,255,0.02) 100%);
  border-color: rgba(251,191,36,0.25);
}
body.home-page #dashboard .achievement-card--unlocked:hover {
  transform: translateY(-2px);
  border-color: rgba(251,191,36,0.4);
  box-shadow: 0 0 24px -8px rgba(251,191,36,0.4);
}
body.home-page #dashboard .achievement-card--locked { opacity: 0.6; }
body.home-page #dashboard .achievement-icon { font-size: 28px; margin-bottom: 4px; }
body.home-page #dashboard .achievement-card--locked .achievement-icon {
  filter: grayscale(1) brightness(0.7);
}
body.home-page #dashboard .achievement-name {
  font-family: 'Inter', sans-serif;
  font-size: 12px; font-weight: 700;
  color: #ffffff;
}
body.home-page #dashboard .achievement-desc {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  line-height: 1.3;
}
body.home-page #dashboard .achievement-status {
  font-family: 'Inter', sans-serif;
  font-size: 9px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: 999px;
}
body.home-page #dashboard .achievement-card--unlocked .achievement-status {
  color: #fbbf24; background: rgba(251,191,36,0.12);
}
body.home-page #dashboard .achievement-card--locked .achievement-status {
  color: rgba(255,255,255,0.5); background: rgba(255,255,255,0.04);
}

/* Compact recent activity (bottom of dashboard) */
body.home-page #dashboard .activity-panel-compact { grid-column: 1 / -1; padding: 24px; }
body.home-page #dashboard .activity-panel-compact .activity-header {
  margin-bottom: 16px;
}
body.home-page #dashboard .activity-panel-compact .activity-empty {
  text-align: center; padding: 32px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
body.home-page #dashboard .activity-panel-compact .activity-empty-icon {
  display: inline-flex;
  width: 48px; height: 48px;
  align-items: center; justify-content: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  font-size: 22px;
  margin-bottom: 10px;
  color: rgba(251,191,36,0.85);
}
body.home-page #dashboard .activity-panel-compact .activity-empty-title {
  font-family: 'Inter', sans-serif;
  font-size: 15px; font-weight: 600;
  color: #ffffff; margin: 0;
}
body.home-page #dashboard .activity-panel-compact .activity-empty-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 13px; line-height: 1.5;
  color: rgba(255,255,255,0.55);
  max-width: 380px; margin: 0;
}
body.home-page #dashboard .activity-empty-cta {
  margin-top: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  height: 38px; padding: 0 18px;
  font-family: 'Inter', sans-serif;
  font-size: 13px; font-weight: 600;
  color: #ffffff;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.2s ease;
}
body.home-page #dashboard .activity-empty-cta:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(251,191,36,0.3);
}

/* ============================================================
   PRACTICE SELECT PAGE — premium dark grade picker (Prompt 14)
   ============================================================ */
body.practice-select-page {
  position: relative;
  background: #060d1f;
  min-height: 100vh;          /* fallback for older browsers */
  min-height: 100dvh;         /* dynamic viewport — accounts for iOS URL bar */
  color: rgba(255,255,255,0.85);
}
body.practice-select-page .site-header { background: transparent; border-bottom: 1px solid rgba(255,255,255,0.06); }
body.practice-select-page::before {
  content: '';
  position: fixed;
  top: -200px; right: -200px;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(251,191,36,0.08) 0%, transparent 60%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}
body.practice-select-page::after {
  content: '';
  position: fixed;
  bottom: -200px; left: -200px;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(99,102,241,0.06) 0%, transparent 60%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}
body.practice-select-page .practice-select-main {
  position: relative;
  z-index: 1;
  padding: 48px 32px 80px;
}
body.practice-select-page .practice-select-inner { max-width: 1280px; margin: 0 auto; }

body.practice-select-page .back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 13px; font-weight: 500;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  margin-bottom: 32px;
  transition: color 0.2s ease;
}
body.practice-select-page .back-link:hover { color: rgba(255,255,255,0.85); }

body.practice-select-page .practice-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(251,191,36,0.9);
  background: rgba(251,191,36,0.08);
  border: 1px solid rgba(251,191,36,0.2);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 24px;
}
body.practice-select-page .eyebrow-emoji { font-size: 13px; }

body.practice-select-page .practice-select-title {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(48px, 6vw, 72px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: #ffffff !important;
  margin: 0 0 16px 0;
}
body.practice-select-page .title-accent {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
body.practice-select-page .practice-select-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 16px; line-height: 1.5;
  color: rgba(255,255,255,0.65);
  margin: 0 0 32px 0;
  max-width: 560px;
}

body.practice-select-page .grade-recommendation {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 20px 28px;
  background: linear-gradient(135deg, rgba(251,191,36,0.12) 0%, rgba(20,29,51,0.6) 60%);
  border: 1px solid rgba(251,191,36,0.25);
  border-radius: 16px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.05) inset,
    0 8px 24px -8px rgba(0,0,0,0.3),
    0 0 32px -8px rgba(251,191,36,0.25);
  margin-bottom: 48px;
}
body.practice-select-page .recommendation-icon {
  font-size: 28px;
  filter: drop-shadow(0 0 8px rgba(251,191,36,0.4));
}
body.practice-select-page .recommendation-content { display: flex; flex-direction: column; gap: 4px; }
body.practice-select-page .recommendation-label {
  font-family: 'Inter', sans-serif;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(251,191,36,0.85);
}
body.practice-select-page .recommendation-text {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: rgba(255,255,255,0.85);
  margin: 0;
}
body.practice-select-page .recommendation-text strong { color: #ffffff; font-weight: 600; }
body.practice-select-page .recommendation-cta {
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 22px;
  font-family: 'Inter', sans-serif;
  font-size: 14px; font-weight: 600;
  color: #0a1628;
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  border: 1px solid rgba(251,191,36,0.5);
  border-radius: 11px;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset, 0 4px 12px -2px rgba(251,191,36,0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
body.practice-select-page .recommendation-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.5) inset, 0 8px 20px -4px rgba(251,191,36,0.5);
}
@media (max-width: 768px) {
  body.practice-select-page .grade-recommendation {
    grid-template-columns: 1fr; text-align: center; gap: 12px;
  }
  body.practice-select-page .recommendation-icon { margin: 0 auto; }
}

body.practice-select-page .practice-grid-header { margin-bottom: 24px; }
body.practice-select-page .practice-grid-title {
  font-family: 'Inter', sans-serif;
  font-size: 18px; font-weight: 600;
  color: #ffffff !important;
  letter-spacing: -0.01em;
  margin: 0 0 4px 0;
}
body.practice-select-page .practice-grid-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  margin: 0;
}

body.practice-select-page .practice-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 1024px) { body.practice-select-page .practice-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  { body.practice-select-page .practice-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { body.practice-select-page .practice-grid { grid-template-columns: 1fr; } }

/* "Your grade" green-accent variant */
body.practice-select-page .grade-card--current {
  border-color: rgba(16,185,129,0.3);
  background: linear-gradient(180deg, rgba(16,185,129,0.08) 0%, rgba(20,29,51,0.5) 100%);
}
body.practice-select-page .grade-card--current::after {
  content: 'Your grade';
  position: absolute;
  top: 12px; right: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 10px; font-weight: 600;
  color: #34d399;
  background: rgba(16,185,129,0.15);
  border: 1px solid rgba(16,185,129,0.3);
  padding: 3px 8px;
  border-radius: 999px;
  z-index: 2;
}
body.practice-select-page .grade-card--current:hover {
  border-color: rgba(16,185,129,0.5);
  box-shadow:
    0 0 0 1px rgba(16,185,129,0.25),
    0 16px 32px -8px rgba(0,0,0,0.4),
    0 0 24px -8px rgba(16,185,129,0.4);
}

/* Tips section */
body.practice-select-page .practice-tips {
  margin-top: 64px;
  padding: 40px;
  background: linear-gradient(180deg, rgba(26,37,64,0.4) 0%, rgba(20,29,51,0.4) 100%);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px;
  backdrop-filter: blur(12px);
}
body.practice-select-page .practice-tips-title {
  font-family: 'Instrument Serif', serif;
  font-size: 28px; font-weight: 400;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin: 0 0 24px 0;
}
body.practice-select-page .tips-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 768px) { body.practice-select-page .tips-grid { grid-template-columns: 1fr; } }
body.practice-select-page .tip-card {
  padding: 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  display: flex; flex-direction: column; gap: 8px;
}
body.practice-select-page .tip-icon { font-size: 22px; margin-bottom: 4px; }
body.practice-select-page .tip-card-title {
  font-family: 'Inter', sans-serif;
  font-size: 14px; font-weight: 600;
  color: #ffffff; margin: 0;
}
body.practice-select-page .tip-card-text {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  line-height: 1.5;
  margin: 0;
}

/* ============================================================
   PROMPT 15 — Premium practice question page (body.practice-page)
   ============================================================ */
body.practice-page {
  background: #060d1f;
  color: #ffffff;
  font-family: 'Inter', system-ui, sans-serif;
  min-height: 100vh;          /* fallback for older browsers */
  min-height: 100dvh;         /* dynamic viewport — accounts for iOS URL bar */
  position: relative;
  overflow-x: hidden;
}
body.practice-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 600px at 18% 6%, rgba(251,191,36,0.10), transparent 60%),
    radial-gradient(800px 600px at 88% 12%, rgba(99,102,241,0.10), transparent 60%),
    radial-gradient(700px 500px at 50% 96%, rgba(16,185,129,0.06), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
body.practice-page > * { position: relative; z-index: 1; }

/* Header */
body.practice-page .site-header {
  background: rgba(10, 22, 40, 0.72);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  z-index: 60;
}
body.practice-page .site-header .brand-text { color: #ffffff; }
body.practice-page .site-header .nav a {
  color: rgba(255,255,255,0.72);
  font-weight: 500;
}
body.practice-page .site-header .nav a:hover { color: #fde68a; }

body.practice-page section { padding: 32px 0 64px; }
body.practice-page #practice-root > p {
  color: rgba(255,255,255,0.65);
  text-align: center;
  padding: 80px 0;
  font-size: 16px;
}

/* Layout */
body.practice-page .practice-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 32px;
  align-items: start;
}
@media (max-width: 1024px) {
  body.practice-page .practice-layout {
    grid-template-columns: 1fr;
  }
}
body.practice-page .practice-main { position: relative; min-width: 0; }

/* Header row */
body.practice-page .practice-header { margin-bottom: 24px; }
body.practice-page .back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,0.65) !important;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 14px;
  transition: color 0.2s;
}
body.practice-page .back-link:hover { color: #fde68a !important; }

body.practice-page .practice-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
body.practice-page .practice-title-row h2 {
  font-family: 'Instrument Serif', Georgia, serif !important;
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: #ffffff !important;
  margin: 0;
}
body.practice-page .btn-restart {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  color: rgba(255,255,255,0.78);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
body.practice-page .btn-restart:hover {
  background: rgba(251,191,36,0.10);
  border-color: rgba(251,191,36,0.30);
  color: #fde68a;
}

/* Progress bar — wrapper holds track (clipped) + pulse (free to extend) */
body.practice-page .progress-bar {
  position: relative;
  height: 14px;
  background: transparent;
  overflow: visible;
  display: flex;
  align-items: center;
}
body.practice-page .progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 999px;
  overflow: hidden;
}
body.practice-page .progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #fde68a, #fbbf24 55%, #f59e0b);
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 0 16px rgba(251,191,36,0.45);
}
body.practice-page .progress-pulse {
  position: absolute;
  top: 50%;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fde68a;
  transform: translate(-50%, -50%);
  box-shadow:
    0 0 0 4px rgba(251,191,36,0.20),
    0 0 16px rgba(251,191,36,0.65),
    inset 0 0 0 1px rgba(255,255,255,0.35);
  animation: progress-pulse 2s ease-in-out infinite;
  transition: left 0.5s cubic-bezier(0.4,0,0.2,1);
  z-index: 2;
  pointer-events: none;
}
@keyframes progress-pulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 0 4px rgba(251,191,36,0.20), 0 0 16px rgba(251,191,36,0.60), inset 0 0 0 1px rgba(255,255,255,0.35);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.20);
    box-shadow: 0 0 0 6px rgba(251,191,36,0.14), 0 0 24px rgba(251,191,36,0.85), inset 0 0 0 1px rgba(255,255,255,0.45);
  }
}
body.practice-page .progress-text {
  text-align: right;
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  margin-top: 8px;
  font-weight: 500;
}
body.practice-page .progress-text #progress-num { color: #fde68a; font-weight: 700; }

/* Mastered banner */
body.practice-page .mastered-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, rgba(99,102,241,0.18), rgba(99,102,241,0.06));
  border: 1px solid rgba(129,140,248,0.30);
  border-radius: 16px;
  padding: 14px 18px;
  margin-bottom: 18px;
}
body.practice-page .mastered-star { font-size: 24px; }
body.practice-page .mastered-title { font-weight: 700; color: #ffffff; font-size: 14px; }
body.practice-page .mastered-sub { color: rgba(255,255,255,0.65); font-size: 13px; line-height: 1.5; margin-top: 2px; }

/* Question card */
body.practice-page .question-card {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  padding: 36px 40px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  overflow: hidden;
}
body.practice-page .question-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px 220px at 0% 0%, rgba(251,191,36,0.12), transparent 65%);
  pointer-events: none;
}
body.practice-page .question-card > * { position: relative; }

/* Q meta tags row */
body.practice-page .q-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
body.practice-page .q-meta > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.78);
  letter-spacing: 0.02em;
}
body.practice-page .q-reward {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: linear-gradient(135deg, rgba(251,191,36,0.18), rgba(245,158,11,0.10));
  border: 1px solid rgba(251,191,36,0.40);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #fde68a;
}
body.practice-page .q-reward-locked {
  background: rgba(99,102,241,0.14);
  border-color: rgba(129,140,248,0.35);
  color: #c7d2fe;
}

/* Prompt */
body.practice-page .q-prompt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 28px;
}
body.practice-page .q-prompt-text {
  font-family: 'Instrument Serif', Georgia, serif !important;
  font-weight: 400;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.20;
  letter-spacing: -0.01em;
  color: #ffffff;
}
body.practice-page .q-read-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
}
body.practice-page .q-read-btn:hover { background: rgba(251,191,36,0.14); border-color: rgba(251,191,36,0.30); }

/* Answer body */
body.practice-page .q-body { margin-bottom: 24px; }

/* Free-response input */
body.practice-page .q-body .num-input {
  width: 100%;
  height: 64px;
  padding: 0 22px;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.10);
  border-radius: 16px;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 28px;
  font-weight: 400;
  color: #ffffff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
body.practice-page .q-body .num-input::placeholder { color: rgba(255,255,255,0.35); font-family: 'Inter', sans-serif; font-size: 16px; }
body.practice-page .q-body .num-input:focus {
  border-color: rgba(251,191,36,0.55);
  background: rgba(251,191,36,0.05);
  box-shadow: 0 0 0 4px rgba(251,191,36,0.12);
}

/* MC choices */
body.practice-page .q-body .choice {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: rgba(255,255,255,0.03);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.18s;
  font-size: 17px;
  color: rgba(255,255,255,0.92);
}
body.practice-page .q-body .choice:hover {
  background: rgba(251,191,36,0.06);
  border-color: rgba(251,191,36,0.30);
  transform: translateY(-1px);
}
body.practice-page .q-body .choice input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.30);
  border-radius: 50%;
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
  position: relative;
}
body.practice-page .q-body .choice input[type="radio"]:checked {
  border-color: #fbbf24;
}
body.practice-page .q-body .choice input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fde68a, #fbbf24, #f59e0b);
  box-shadow: 0 0 10px rgba(251,191,36,0.6);
}
body.practice-page .q-body .choice:has(input:checked) {
  background: rgba(251,191,36,0.08);
  border-color: rgba(251,191,36,0.50);
}

/* Submit button */
body.practice-page .question-card .btn.btn-primary,
body.practice-page .question-card button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 26px;
  background: linear-gradient(135deg, #fde68a 0%, #fbbf24 50%, #f59e0b 100%);
  border: none;
  border-radius: 12px;
  color: #060d1f;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(251,191,36,0.30);
  transition: transform 0.15s, box-shadow 0.2s;
}
body.practice-page .question-card .btn.btn-primary:hover,
body.practice-page .question-card button[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(251,191,36,0.45);
}

/* Feedback */
body.practice-page .feedback {
  margin-top: 22px;
  padding: 22px 26px;
  border-radius: 18px;
  border: 1px solid;
  background: rgba(255,255,255,0.03);
}
body.practice-page .feedback.correct {
  border-color: rgba(52,211,153,0.40);
  background: linear-gradient(180deg, rgba(16,185,129,0.14), rgba(16,185,129,0.04));
}
body.practice-page .feedback.incorrect {
  border-color: rgba(248,113,113,0.40);
  background: linear-gradient(180deg, rgba(239,68,68,0.14), rgba(239,68,68,0.04));
}
body.practice-page .feedback-head {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 28px;
  margin-bottom: 8px;
  font-weight: 400;
}
body.practice-page .feedback.correct .feedback-head { color: #6ee7b7; }
body.practice-page .feedback.incorrect .feedback-head { color: #fca5a5; }
body.practice-page .feedback-body {
  color: rgba(255,255,255,0.85);
  font-size: 15px;
  line-height: 1.6;
}
body.practice-page .feedback-body p { margin: 0 0 10px; }
body.practice-page .feedback-body strong { color: #ffffff; }
body.practice-page .feedback-actions { margin-top: 16px; }
body.practice-page #next-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 22px;
  background: linear-gradient(135deg, #fde68a, #fbbf24, #f59e0b);
  border: none;
  border-radius: 12px;
  color: #060d1f;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(251,191,36,0.30);
}
body.practice-page #next-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(251,191,36,0.45); }

/* Tutor box */
body.practice-page .tutor-box { margin-top: 14px; }
body.practice-page .tutor-box .btn-primary {
  background: linear-gradient(135deg, #818cf8, #6366f1);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(99,102,241,0.35);
}
body.practice-page .tutor-output {
  margin-top: 12px;
  padding: 16px 18px;
  background: linear-gradient(180deg, rgba(20, 29, 51, 0.85) 0%, rgba(15, 22, 41, 0.85) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  color: rgba(255,255,255,0.95);
  font-size: 14.5px;
  line-height: 1.65;
  letter-spacing: -0.005em;
}
body.practice-page .tutor-msg.assistant { color: rgba(255,255,255,0.95); }
body.practice-page .tutor-msg.assistant.error,
body.practice-page .tutor-msg.error { color: #fca5a5; font-weight: 500; }
body.practice-page .tutor-msg.user { color: rgba(255,255,255,0.7); margin-top: 8px; }
body.practice-page .tutor-followup {
  display: flex; gap: 8px; margin-top: 10px;
}
body.practice-page .tutor-followup input {
  flex: 1;
  height: 40px;
  padding: 0 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  color: #ffffff;
  font-size: 14px;
  outline: none;
}
body.practice-page .tutor-followup input:focus {
  border-color: rgba(251,191,36,0.50);
  box-shadow: 0 0 0 3px rgba(251,191,36,0.12);
}
body.practice-page .tutor-send {
  width: 40px; height: 40px;
  border: none; border-radius: 10px;
  background: linear-gradient(135deg, #fde68a, #fbbf24, #f59e0b);
  color: #060d1f;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* Guest banner */
body.practice-page #guest-banner {
  background: linear-gradient(135deg, rgba(251,191,36,0.16), rgba(245,158,11,0.06)) !important;
  border: 1px solid rgba(251,191,36,0.40) !important;
  border-radius: 14px !important;
  padding: 12px 18px !important;
  color: #fde68a !important;
  margin-bottom: 18px !important;
}
body.practice-page #guest-banner strong { color: #ffffff; }

/* Sidebar */
body.practice-page .performance-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 88px;
}
body.practice-page .perf-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 20px 22px;
}
body.practice-page .perf-title,
body.practice-page .perf-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-bottom: 14px;
}
body.practice-page .perf-ring-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}
body.practice-page .perf-ring .accuracy-value {
  font-family: 'Instrument Serif', Georgia, serif;
  fill: #ffffff;
  font-weight: 400;
}
body.practice-page .perf-ring .accuracy-suffix { fill: rgba(255,255,255,0.55); }
body.practice-page .perf-ring .accuracy-label {
  fill: rgba(255,255,255,0.45);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}
body.practice-page .perf-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 14px;
}
body.practice-page .perf-stats .stat {
  padding: 12px 8px;
  background: rgba(255,255,255,0.03) !important;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  transition: background 0.2s ease, border-color 0.2s ease;
}
body.practice-page .perf-stats .stat:hover {
  background: rgba(255,255,255,0.05) !important;
  border-color: rgba(255,255,255,0.10);
}
body.practice-page .perf-stats .stat.has-streak {
  background: linear-gradient(180deg, rgba(239,68,68,0.10), rgba(255,255,255,0.02)) !important;
  border-color: rgba(239,68,68,0.22);
}
body.practice-page .perf-stats .stat-num {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 26px;
  color: #ffffff;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
}
body.practice-page .streak-emoji {
  font-size: 14px;
  filter: drop-shadow(0 0 4px rgba(239,68,68,0.45));
}
body.practice-page .perf-stats .stat-label {
  font-size: 10px;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-top: 6px;
}

/* Last 20 dots — 10 col grid */
body.practice-page .recent-dots {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
}
body.practice-page .recent-dots .dot {
  aspect-ratio: 1;
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
}
body.practice-page .recent-dots .dot.empty { background: rgba(255,255,255,0.05); }
body.practice-page .recent-dots .dot.correct {
  background: linear-gradient(135deg, #34d399, #10b981);
  box-shadow: 0 0 8px rgba(16,185,129,0.50);
}
body.practice-page .recent-dots .dot.incorrect {
  background: linear-gradient(135deg, #f87171, #ef4444);
  box-shadow: 0 0 8px rgba(239,68,68,0.45);
}

/* Mastery rows */
body.practice-page .unit-rows { display: flex; flex-direction: column; gap: 10px; }
body.practice-page .unit-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  align-items: center;
}
body.practice-page .unit-row-title {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  grid-column: 1 / 2;
}
body.practice-page .unit-row.dim .unit-row-title { color: rgba(255,255,255,0.62); }
body.practice-page .unit-row-pct {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.65);
  font-variant-numeric: tabular-nums;
  grid-column: 2 / 3;
}
body.practice-page .unit-row-bar {
  grid-column: 1 / 3;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 2px;
}
body.practice-page .unit-row-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* Points pop */
.points-pop {
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 64px;
  font-weight: 400;
  background: linear-gradient(135deg, #fde68a 0%, #fbbf24 50%, #f59e0b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  pointer-events: none;
  z-index: 5;
  animation: points-pop 1.2s cubic-bezier(0.4,0,0.2,1) forwards;
  filter: drop-shadow(0 4px 12px rgba(251,191,36,0.55));
}
@keyframes points-pop {
  0%   { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
  20%  { transform: translate(-50%, -80%) scale(1.2); opacity: 1; }
  100% { transform: translate(-50%, -180%) scale(1.0); opacity: 0; }
}


/* ============================================================
   Scratchpad — inline expandable, mounted directly below the
   question card on the practice page. Default collapsed.
   ============================================================ */
.scratchpad-inline {
  margin-top: 16px;
  background: linear-gradient(180deg, rgba(26, 37, 64, 0.5) 0%, rgba(20, 29, 51, 0.5) 100%);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Inter', system-ui, sans-serif;
  color: #ffffff;
}
.scratchpad-inline[data-state="expanded"] {
  border-color: rgba(251, 191, 36, 0.2);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 8px 24px -8px rgba(0, 0, 0, 0.3);
}

/* COLLAPSED — single-line toggle button */
.scratchpad-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
  text-align: left;
  font-family: inherit;
  color: inherit;
}
.scratchpad-toggle:hover { background: rgba(255, 255, 255, 0.02); }
.scratchpad-toggle-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.12) 0%, rgba(245, 158, 11, 0.04) 100%);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 8px;
  color: #fbbf24;
  flex-shrink: 0;
}
.scratchpad-toggle-label {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.005em;
}
.scratchpad-toggle-hint {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.scratchpad-toggle-hint kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.7);
}
.scratchpad-toggle-chevron {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.5);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
@media (max-width: 640px) {
  .scratchpad-toggle-hint { display: none; }
}

/* EXPANDED — body */
.scratchpad-body { display: none; }
.scratchpad-inline[data-state="expanded"] .scratchpad-body {
  display: flex;
  flex-direction: column;
  animation: scratchpad-expand 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.scratchpad-inline[data-state="expanded"] .scratchpad-toggle { display: none; }
@keyframes scratchpad-expand {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.scratchpad-body-header {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.scratchpad-body-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.scratchpad-body-title-icon { color: #fbbf24; display: flex; }
.scratchpad-body-hint {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-style: italic;
}
.scratchpad-body-actions { margin-left: auto; display: flex; gap: 6px; }

.scratchpad-action-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: all 0.15s ease;
}
.scratchpad-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.12);
}
.scratchpad-action-btn.scratchpad-clear-btn:hover {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.25);
}

.scratchpad-canvas-area {
  height: 280px;
  padding: 14px;
  position: relative;
}
.scratchpad-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    rgba(255, 255, 255, 0.015);
  background-size: 24px 24px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  cursor: crosshair;
  touch-action: none;
}

.scratchpad-toolbar {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.scratchpad-tool {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.scratchpad-tool:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}
.scratchpad-tool.is-active {
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.18) 0%, rgba(245, 158, 11, 0.08) 100%);
  border-color: rgba(251, 191, 36, 0.3);
  color: #fbbf24;
}
.scratchpad-tool-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.06);
  margin: 0 4px;
}

@media (max-width: 640px) {
  .scratchpad-canvas-area { height: 220px; }
}

/* Question clone — populated only in fullscreen mode (mobile).
   Hidden by default so desktop expanded mode is unchanged. */
.scratchpad-question-clone { display: none; }

/* Scroll buttons in toolbar — only relevant when the canvas overflows
   (fullscreen mode); hidden by default so the desktop side-panel
   toolbar stays unchanged. */
.scratchpad-scroll-btn,
.scratchpad-scroll-divider { display: none; }

/* ============================================================
   FULLSCREEN MODE — mobile only (<768px). Old behavior was a
   small inline panel that obscured the question; new behavior
   covers the screen with the question pinned at the top so the
   kid can re-read while drawing. CLOSE button discards (with
   confirm), MINIMIZE button preserves work. Desktop unchanged.
   ============================================================ */
@media (max-width: 767px) {
  /* When fullscreen, the host shell becomes a full-viewport overlay.
     We override several earlier rules (margin, border-radius, height) so
     the body fills inset:0. */
  .scratchpad-inline[data-state="fullscreen"] {
    position: fixed;
    inset: 0;
    z-index: 9000;          /* above question content, below toasts (10k+) */
    margin: 0;
    border-radius: 0;
    border: none;
    background: linear-gradient(180deg, #0a1224 0%, #050811 100%);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.85);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* §40 — respect iOS notch/header so [✕] + [⌄] don't sit under
       the browser chrome. env() falls back to 0 on browsers that
       don't support it. */
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .scratchpad-inline[data-state="fullscreen"] .scratchpad-toggle { display: none; }
  .scratchpad-inline[data-state="fullscreen"] .scratchpad-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    animation: none;
  }
  /* Header with title + actions sits at top of the overlay flow.
     Actions absolute-positioned to the top-right of the OVERLAY
     (not the viewport) so they sit below iOS browser chrome via
     the overlay's safe-area padding-top. */
  .scratchpad-inline[data-state="fullscreen"] .scratchpad-body-header {
    padding: 8px 16px;
    flex-shrink: 0;
    position: relative;
    min-height: 44px;
  }
  .scratchpad-inline[data-state="fullscreen"] .scratchpad-body-hint { display: none; }
  .scratchpad-inline[data-state="fullscreen"] .scratchpad-body-actions {
    position: absolute;
    top: 6px;
    right: 12px;
    z-index: 1;
    gap: 8px;
  }
  .scratchpad-inline[data-state="fullscreen"] .scratchpad-action-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    color: #ffffff;
  }
  .scratchpad-inline[data-state="fullscreen"] .scratchpad-action-btn.scratchpad-close-btn:hover {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.4);
  }
  /* Question clone — visible in fullscreen mode, capped at 18vh so
     the canvas claims the dominant share of the screen (§40). The
     stem is still scrollable inside the strip if it's long. */
  .scratchpad-inline[data-state="fullscreen"] .scratchpad-question-clone {
    display: block;
    flex-shrink: 0;
    max-height: 18vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 16px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
  }
  /* The clone reuses the live #qbox markup; tighten spacing for the
     fullscreen header context so it reads as a compact reference, not
     the primary interactive question. §40 — smaller stem font + line-
     height so the question still reads cleanly in 18vh. */
  .scratchpad-inline[data-state="fullscreen"] .scratchpad-question-clone .question-card {
    padding: 4px 0;
    background: transparent;
    border: none;
    box-shadow: none;
  }
  .scratchpad-inline[data-state="fullscreen"] .scratchpad-question-clone .q-prompt {
    font-size: 14px;
    line-height: 1.35;
    font-weight: 500;
    margin: 0;
  }
  .scratchpad-inline[data-state="fullscreen"] .scratchpad-question-clone .choice {
    padding: 4px 8px;
    margin: 2px 0;
    min-height: 28px;
    font-size: 13px;
    pointer-events: none;
    opacity: 0.85;
  }
  .scratchpad-inline[data-state="fullscreen"] .scratchpad-question-clone .q-meta,
  .scratchpad-inline[data-state="fullscreen"] .scratchpad-question-clone .feedback,
  .scratchpad-inline[data-state="fullscreen"] .scratchpad-question-clone .tutor-box,
  .scratchpad-inline[data-state="fullscreen"] .scratchpad-question-clone .feedback-actions,
  /* Hide the answer-interaction surfaces inside the scratch overlay.
     Kid uses scratch ONLY to work out the math; once they have the
     answer, they minimize/close and type/select on the real practice
     screen. Showing input + Check button here wastes vertical space
     and creates two answer paths. (Multi-choice .choice labels stay
     visible above as a read-only reference — see the .choice rule.) */
  .scratchpad-inline[data-state="fullscreen"] .scratchpad-question-clone .num-input,
  .scratchpad-inline[data-state="fullscreen"] .scratchpad-question-clone .question-card > button[type="submit"],
  .scratchpad-inline[data-state="fullscreen"] .scratchpad-question-clone .q-read-btn,
  .scratchpad-inline[data-state="fullscreen"] .scratchpad-question-clone .q-reward {
    display: none;
  }
  /* Drawing canvas takes the rest of the viewport AND is scrollable.
     The canvas itself is sized much taller than the visible area in
     sizeCanvas() (Word-document feel — kid swipes through pages).
     §40 — explicit min-height: 50vh as a safety floor so flex
     distribution can't accidentally squeeze the canvas-area when
     the body-header / question-clone / toolbar combine for >50vh. */
  .scratchpad-inline[data-state="fullscreen"] .scratchpad-canvas-area {
    flex: 1 1 auto;
    min-height: 50vh;
    height: auto;
    padding: 6px 10px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  /* Lock the toolbar from shrinking — without this, flex distribution
     can squeeze it when the canvas-area's min-height pushes the
     column over the viewport. */
  .scratchpad-inline[data-state="fullscreen"] .scratchpad-toolbar {
    flex-shrink: 0;
    padding: 8px 12px;
  }
  .scratchpad-inline[data-state="fullscreen"] .scratchpad-canvas {
    border-radius: 8px;
    /* The canvas is taller than the visible area; explicit display:block
       prevents inline-baseline gaps. */
    display: block;
  }
  /* Scroll button styling — only visible in fullscreen mode where the
     canvas overflows. Hidden on desktop expanded mode. */
  .scratchpad-inline[data-state="fullscreen"] .scratchpad-scroll-btn {
    display: flex;
  }
  .scratchpad-inline[data-state="fullscreen"] .scratchpad-scroll-divider {
    display: inline-block;
  }
  /* Push scroll buttons to the right edge of the toolbar so they're
     reachable with the thumb separately from the drawing tools. */
  .scratchpad-inline[data-state="fullscreen"] .scratchpad-scroll-divider {
    margin-left: auto;
  }
  .scratchpad-inline[data-state="fullscreen"] .scratchpad-toolbar {
    flex-shrink: 0;
    padding: 12px 14px;
  }
  .scratchpad-inline[data-state="fullscreen"] .scratchpad-tool {
    width: 40px;
    height: 40px;
  }
}
/* Lock body scroll while overlay is open so the page underneath doesn't
   bounce when the kid swipes inside the canvas. */
body.scratchpad-fullscreen-open { overflow: hidden; }

/* §45/§46 — surfaces that otherwise render above the scratch
   overlay and block its [✕] / [⌄] buttons. The site-header is
   the primary culprit: on body.practice-page the rule
   `body.practice-page > * { position: relative; z-index: 1; }`
   re-stacks every direct child of body, defeating .site-header's
   declared z-index. The scratchpad-inline overlay wins inside
   that stacking model but the site-header still paints above
   the overlay's top-right action buttons in iOS Safari. Cleanest
   fix is to hide the header (plus toast / pill surfaces) while
   the kid is in scratch — they don't need the global nav while
   drawing, and the [✕] / [⌄] buttons reach the top of the
   viewport unblocked. */
body.scratchpad-fullscreen-open .site-header,
body.scratchpad-fullscreen-open .cents-toast,
body.scratchpad-fullscreen-open .points-pill,
body.scratchpad-fullscreen-open .wallet-pill,
body.scratchpad-fullscreen-open .user-slot {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .scratchpad-inline { transition: none; }
  .scratchpad-inline[data-state="expanded"] .scratchpad-body { animation: none; }
}


/* ============================================================
   Premium AI Tutor — code blocks, chips, thinking dots
   ============================================================ */
body.practice-page .tutor-output { font-size: 14.5px; line-height: 1.6; }
body.practice-page .tutor-msg { margin-top: 8px; }
body.practice-page .tutor-msg p { margin: 0 0 8px; }
body.practice-page .tutor-msg p:last-child { margin-bottom: 0; }
body.practice-page .tutor-msg strong { color: #fde68a; font-weight: 600; }
body.practice-page .tutor-msg code {
  font-family: 'JetBrains Mono', 'Menlo', ui-monospace, monospace;
  font-size: 0.92em;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 1px 6px;
  border-radius: 6px;
  color: #fde68a;
}
body.practice-page .tutor-code,
body.practice-page .tutor-msg pre.tutor-code {
  font-family: 'JetBrains Mono', 'Menlo', ui-monospace, monospace;
  font-size: 17px;
  line-height: 1.5;
  color: #ffffff;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  padding: 14px 18px;
  border-radius: 12px;
  margin: 10px 0;
  display: block;
  white-space: pre;
  overflow-x: auto;
  letter-spacing: 0.04em;
}
body.practice-page .tutor-code code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}
body.practice-page .tutor-msg.user {
  color: rgba(255,255,255,0.72);
  font-style: italic;
  margin-top: 12px;
}
body.practice-page .tutor-msg.user strong { color: rgba(255,255,255,0.92); font-style: normal; }

/* Suggestion chips */
body.practice-page .tutor-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}
body.practice-page .tutor-chip {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #c7d2fe;
  background: rgba(99,102,241,0.10);
  border: 1px solid rgba(99,102,241,0.28);
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.15s;
}
body.practice-page .tutor-chip:hover {
  background: rgba(99,102,241,0.18);
  border-color: rgba(129,140,248,0.55);
  color: #e0e7ff;
  transform: translateY(-1px);
}
body.practice-page .tutor-chip:active { transform: translateY(0); }

/* Thinking dots */
body.practice-page .tutor-thinking {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 12px 0;
}
body.practice-page .thinking-dot {
  width: 7px;
  height: 7px;
  background: rgba(165,180,252,0.7);
  border-radius: 50%;
  animation: tutor-thinking 1.4s ease-in-out infinite;
}
body.practice-page .thinking-dot:nth-child(2) { animation-delay: 0.18s; }
body.practice-page .thinking-dot:nth-child(3) { animation-delay: 0.36s; }
@keyframes tutor-thinking {
  0%, 60%, 100% { opacity: 0.30; transform: translateY(0); }
  30%           { opacity: 1;    transform: translateY(-3px); }
}


/* ============================================================
   Admin: live users panel (Users tab)
   Stat cards + currently-online table.
   ============================================================ */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 18px 0 22px;
}
@media (max-width: 760px) { .admin-stats { grid-template-columns: 1fr; } }
.admin-stat-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 18px 20px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.admin-stat-card--online { border-color: rgba(99,102,241,0.30); }
.admin-stat-card--practicing { border-color: rgba(251,191,36,0.30); }
.admin-stat-label {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-bottom: 8px;
}
.admin-stat-value {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 32px; font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1;
}
.admin-stat-card--online .admin-stat-value { color: #c7d2fe; }
.admin-stat-card--practicing .admin-stat-value { color: #fde68a; }
.admin-stat-meta {
  margin-top: 6px;
  font-size: 12px;
  color: rgba(255,255,255,0.45);
}

/* Pulsing live dot (used in label and table rows) */
.live-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #818cf8;
  box-shadow: 0 0 0 0 rgba(129,140,248,0.6);
  animation: admin-live-pulse 1.8s ease-out infinite;
}
.live-dot--gold {
  background: #fbbf24;
  box-shadow: 0 0 0 0 rgba(251,191,36,0.6);
}
@keyframes admin-live-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(129,140,248,0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(129,140,248,0); }
  100% { box-shadow: 0 0 0 0   rgba(129,140,248,0); }
}
.live-dot--gold {
  animation-name: admin-live-pulse-gold;
}
@keyframes admin-live-pulse-gold {
  0%   { box-shadow: 0 0 0 0   rgba(251,191,36,0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(251,191,36,0); }
  100% { box-shadow: 0 0 0 0   rgba(251,191,36,0); }
}
@media (prefers-reduced-motion: reduce) {
  .live-dot, .live-dot--gold { animation: none; }
}

/* Live users header row */
.live-users-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin: 8px 0 12px;
  flex-wrap: wrap;
}
.live-users-meta {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  font-family: 'Inter', system-ui, sans-serif;
}
.live-users-wrap {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 6px;
  overflow-x: auto;
}
.live-users-empty {
  margin: 18px 14px;
  color: rgba(255,255,255,0.5);
}

/* Live users table */
.live-users-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Inter', system-ui, sans-serif;
}
.live-users-table thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.live-users-table tbody tr {
  transition: background 0.15s ease;
}
.live-users-table tbody tr + tr td {
  border-top: 1px solid rgba(255,255,255,0.04);
}
.live-users-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.live-users-table td {
  padding: 12px 14px;
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  vertical-align: middle;
}
.live-row--practicing { background: rgba(251,191,36,0.04); }
.live-row--practicing:hover { background: rgba(251,191,36,0.07); }

.live-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  border: 1px solid rgba(255,255,255,0.12);
}
.live-name { font-weight: 600; color: #ffffff; }
.live-uname { color: rgba(255,255,255,0.5); font-size: 13px; }
.live-time  { color: rgba(255,255,255,0.55); font-size: 13px; white-space: nowrap; }

.live-grade-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.02em;
}
.live-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px;
  font-weight: 500;
}
.live-status--online    { color: #c7d2fe; }
.live-status--practicing { color: #fde68a; font-weight: 600; }

.tab-badge--live {
  background: rgba(251,191,36,0.18);
  color: #fde68a;
  border: 1px solid rgba(251,191,36,0.35);
}

/* ============================================================
   ADMIN PAGE — premium dark theme (Prompt 24)
   Scoped under body.admin-page so we never collide with the
   legacy .admin-* classes used by the kid-facing app.
   ============================================================ */
body.admin-page {
  background: #060d1f;
  color: rgba(255, 255, 255, 0.92);
  min-height: 100vh;          /* fallback for older browsers */
  min-height: 100dvh;         /* dynamic viewport — accounts for iOS URL bar */
}

body.admin-page::before {
  content: '';
  position: fixed;
  top: -200px; right: -200px;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(251,191,36,0.06) 0%, transparent 60%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}
body.admin-page::after {
  content: '';
  position: fixed;
  bottom: -200px; left: -200px;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(99,102,241,0.06) 0%, transparent 60%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}
body.admin-page > * { position: relative; z-index: 1; }
body.admin-page .site-header { z-index: 60; }

body.admin-page .admin-shell {
  position: relative;
  padding: 60px 32px 80px;
  max-width: 1280px;
  margin: 0 auto;
}
@media (max-width: 720px) {
  body.admin-page .admin-shell { padding: 40px 18px 60px; }
}

/* Page header */
body.admin-page .admin-header { margin-bottom: 40px; }
body.admin-page .admin-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(165, 180, 252, 0.95);
  background: rgba(99, 102, 241, 0.10);
  border: 1px solid rgba(99, 102, 241, 0.25);
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}
body.admin-page .admin-eyebrow-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #818cf8;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.18), 0 0 8px rgba(99,102,241,0.5);
}
body.admin-page h1 {
  font-family: 'Instrument Serif', 'Times New Roman', serif;
  font-size: clamp(40px, 5vw, 56px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: #ffffff;
  margin: 0 0 10px 0;
}
body.admin-page h2 {
  font-family: 'Instrument Serif', 'Times New Roman', serif;
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.015em;
  color: #ffffff;
  margin: 0 0 16px 0;
}
body.admin-page h3 {
  color: rgba(255,255,255,0.9);
}
body.admin-page .page-subtitle {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.65);
  margin: 0 0 0 0;
  max-width: 600px;
  line-height: 1.5;
}

/* Tabs — gold-tinted active state */
body.admin-page .admin-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 32px 0 28px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
}
body.admin-page .admin-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
}
body.admin-page .admin-tab:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.04);
}
body.admin-page .admin-tab.active {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.10);
  border-color: rgba(251, 191, 36, 0.28);
}
body.admin-page .admin-tab .tab-badge {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.65);
  min-width: 20px;
  text-align: center;
  border: 0;
}
body.admin-page .admin-tab.active .tab-badge {
  background: rgba(251, 191, 36, 0.22);
  color: #fde68a;
}
body.admin-page .admin-tab .tab-badge--live {
  background: rgba(251, 191, 36, 0.18);
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.32);
}

/* Stat cards */
body.admin-page .admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 8px 0 40px;
}
@media (max-width: 768px) { body.admin-page .admin-stats { grid-template-columns: 1fr; } }
body.admin-page .admin-stat-card {
  padding: 24px;
  background: linear-gradient(180deg, rgba(26,37,64,0.55) 0%, rgba(20,29,51,0.55) 100%);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.03) inset,
    0 4px 12px -2px rgba(0,0,0,0.25);
}
body.admin-page .admin-stat-card--online    { border-color: rgba(99,102,241,0.30); }
body.admin-page .admin-stat-card--practicing{ border-color: rgba(251,191,36,0.30); }
body.admin-page .admin-stat-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 4px;
}
body.admin-page .admin-stat-value {
  font-family: 'Instrument Serif', 'Times New Roman', serif;
  font-size: 48px;
  font-weight: 400;
  letter-spacing: -0.03em;
  color: #ffffff;
  line-height: 1;
}
body.admin-page .admin-stat-card--online    .admin-stat-value { color: #c7d2fe; }
body.admin-page .admin-stat-card--practicing .admin-stat-value { color: #fde68a; }
body.admin-page .admin-stat-meta {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 2px;
}

/* Live-users panel */
body.admin-page .live-users-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin: 0 0 18px;
  flex-wrap: wrap;
}
body.admin-page .live-users-head h2 {
  margin: 0 !important;
}
body.admin-page .live-users-meta {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
}
body.admin-page .live-users-wrap {
  background: linear-gradient(180deg, rgba(26,37,64,0.55) 0%, rgba(20,29,51,0.55) 100%);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  overflow: hidden;
  padding: 0;
}
body.admin-page .live-users-empty {
  margin: 24px 22px;
  color: rgba(255,255,255,0.5);
  font-family: 'Inter', system-ui, sans-serif;
}

/* Live users table */
body.admin-page .live-users-table thead th {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  text-align: left;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}
body.admin-page .live-users-table tbody td {
  padding: 14px 20px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  border-top: 0;
  vertical-align: middle;
}
body.admin-page .live-users-table tbody tr:last-child td { border-bottom: none; }
body.admin-page .live-users-table tbody tr:hover td { background: rgba(255,255,255,0.02); }
body.admin-page .live-row--practicing { background: rgba(251,191,36,0.04); }
body.admin-page .live-row--practicing:hover { background: rgba(251,191,36,0.07); }
body.admin-page .live-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600;
  font-size: 13px;
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.12);
}
body.admin-page .live-name {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600;
  color: #ffffff;
}
body.admin-page .live-uname {
  font-family: 'JetBrains Mono', 'Menlo', ui-monospace, monospace;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}
body.admin-page .live-grade-pill {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px; font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
  min-width: 36px;
  text-align: center;
  letter-spacing: 0.02em;
}
body.admin-page .live-status {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
}
body.admin-page .live-status--online    { color: #c7d2fe; }
body.admin-page .live-status--practicing { color: #fde68a; font-weight: 600; }
body.admin-page .live-time {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
}

/* Inputs / form / table for Toys + Orders tabs (kept simple, dark) */
body.admin-page .auth-label {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  display: block;
  margin-bottom: 6px;
}
body.admin-page .auth-input {
  width: 100%;
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  color: #ffffff;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
body.admin-page .auth-input:focus {
  outline: none;
  border-color: rgba(251,191,36,0.45);
  background: rgba(255,255,255,0.06);
}
body.admin-page .admin-form .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
body.admin-page .admin-form .row.col1 { grid-template-columns: 1fr; }
body.admin-page .admin-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Inter', system-ui, sans-serif;
  margin-top: 10px;
}
body.admin-page .admin-table thead th {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
}
body.admin-page .admin-table tbody td {
  padding: 12px 16px;
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
body.admin-page .admin-table tbody tr:hover td { background: rgba(255,255,255,0.02); }
body.admin-page .admin-table img {
  width: 44px; height: 44px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
}
body.admin-page .admin-img-preview {
  max-width: 200px; max-height: 200px;
  margin-top: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
}

/* Ship panel (orders to fulfill) — gold tint */
body.admin-page .ship-panel {
  background: linear-gradient(180deg, rgba(251,191,36,0.10), rgba(245,158,11,0.04));
  border: 1px solid rgba(251,191,36,0.30);
  border-radius: 16px;
  padding: 20px 22px;
  margin-bottom: 28px;
}
body.admin-page .ship-panel-head {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 12px;
}
body.admin-page .ship-panel-head h2 {
  margin: 0;
  font-size: 22px;
  color: #fde68a;
}
body.admin-page .ship-count {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(251,191,36,0.25);
  color: #fde68a;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  margin-left: 6px;
}
body.admin-page .ship-panel-sub {
  color: rgba(255,255,255,0.6);
  font-size: 13px;
}

/* Buttons */
body.admin-page .btn-primary {
  background: linear-gradient(180deg, #fde68a 0%, #fbbf24 100%);
  color: #060d1f;
  border: 1px solid rgba(251,191,36,0.5);
  padding: 10px 18px;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600;
  font-size: 14px;
  border-radius: 10px;
  cursor: pointer;
}
body.admin-page .btn-ghost {
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.10);
  padding: 10px 18px;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 500;
  font-size: 14px;
  border-radius: 10px;
  cursor: pointer;
}

/* Footer */
body.admin-page .admin-footer {
  margin-top: 80px;
  padding: 22px 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  position: relative;
  z-index: 1;
}
body.admin-page .admin-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
body.admin-page .footer-logo-mini {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
}
body.admin-page .admin-footer-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  flex-wrap: wrap;
}
body.admin-page .admin-footer-meta strong {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
}
body.admin-page .dot-divider { color: rgba(255, 255, 255, 0.2); }

/* ============================================================
   PROMPT 26 — GLOBAL MOBILE PRIMITIVES
   Foundation for all per-page mobile work. Discipline rule:
   only @media (max-width: 1024 | 768 | 480) blocks below.
   ============================================================ */

/* ---- iOS zoom killer: inputs at 16px globally ---- */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="search"],
input[type="tel"],
textarea,
select {
  font-size: 16px;
}

/* ---- Eliminate 300ms tap delay on iOS ---- */
button,
a,
[role="button"],
.pill-button,
.btn,
.tab,
input[type="submit"],
input[type="button"] {
  touch-action: manipulation;
}

/* ---- Hover-only hover for the most exposed components ---- */
@media (hover: hover) {
  .grade-card:hover,
  .feature-card:hover { transform: translateY(-4px); }
  .toy-card:hover { transform: translateY(-6px); }
  .dashboard-grade-tile:hover,
  .stat-card:hover,
  .achievement-card--unlocked:hover { transform: translateY(-2px); }
  .btn-primary:hover,
  .question-submit:hover,
  .signin-submit:hover { transform: translateY(-1px); }
}
@media (hover: none) {
  .grade-card:hover,
  .toy-card:hover,
  .dashboard-grade-tile:hover,
  .stat-card:hover,
  .achievement-card--unlocked:hover,
  .feature-card:hover,
  .btn-primary:hover,
  .question-submit:hover,
  .signin-submit:hover {
    transform: none;
  }
}

/* ============================================================
   MOBILE HEADER — restructured for narrow viewports (<= 768px)
   ============================================================ */
@media (max-width: 768px) {
  .site-header { padding: 8px 16px; }
  .site-header .container { height: 48px; gap: 8px; }

  /* §70 — Hide center nav + chat-bell + admin badge on mobile.
     The .user-pill and .user-menu are EXPLICITLY NOT hidden here —
     §62's mobile rule below shows the avatar dropdown as the
     primary auth surface on phone. Block 1's old !important hiders
     for .user-pill / .user-menu would beat §62's non-important
     show-rule, leaving signed-in users with no avatar (Hamid screenshot
     12:50pm). Keep nav/chat/admin hidden — those route via the
     dropdown's links. */
  .site-header .nav,
  .site-header .chat-bell,
  .site-header #user-slot .chat-bell,
  .site-header #user-slot .admin-badge {
    display: none !important;
  }

  /* Brand smaller */
  .site-header .brand { font-size: 16px; }
  .site-header .brand svg { width: 28px; height: 28px; }

  /* Hamburger appears */
  .mobile-menu-toggle { display: inline-flex; }

  /* Wallet/points pill stays — kid dopamine */
  .site-header .wallet-pill,
  .site-header .points-pill,
  .site-header #user-slot .wallet-pill {
    display: inline-flex;
    padding: 5px 10px;
    font-size: 12px;
  }
}

/* ============================================================
   HAMBURGER MENU — toggle button + slide panel + scrim
   ============================================================ */
.mobile-menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  margin-left: auto;
  flex-shrink: 0;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.mobile-menu-toggle:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.08);
}
.mobile-menu-toggle svg {
  width: 20px;
  height: 20px;
  transition: transform 0.2s ease;
}
.mobile-menu-toggle[aria-expanded="true"] svg { transform: rotate(90deg); }

.mobile-menu-panel {
  position: fixed;
  top: 64px;
  left: 16px;
  right: 16px;
  z-index: 1300;
  background: linear-gradient(180deg, rgba(20, 29, 51, 0.98) 0%, rgba(15, 22, 41, 0.98) 100%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 16px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 16px 48px -12px rgba(0, 0, 0, 0.5);
  padding: 12px;
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.mobile-menu-panel[data-open="true"] {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.mobile-menu-scrim {
  position: fixed;
  inset: 0;
  z-index: 1290;
  background: rgba(6, 13, 31, 0.6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.mobile-menu-scrim[data-open="true"] {
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 500;
  transition: background 0.15s ease;
  min-height: 44px;
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.mobile-menu-row:active { background: rgba(255, 255, 255, 0.06); }
.mobile-menu-row[aria-current="page"] {
  background: rgba(251, 191, 36, 0.08);
  color: #fbbf24;
}
.mobile-menu-row .icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.5);
  flex-shrink: 0;
}
.mobile-menu-row[aria-current="page"] .icon { color: #fbbf24; }
.mobile-menu-row .meta {
  margin-left: auto;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 400;
}

.mobile-menu-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 14px 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.mobile-menu-user .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 15px;
  color: #ffffff;
}
.mobile-menu-user .info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mobile-menu-user .name {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
}
.mobile-menu-user .username {
  font-family: 'JetBrains Mono', 'Menlo', ui-monospace, monospace;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}
.mobile-menu-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 8px 0;
}
.mobile-menu-row--signout { color: rgba(248, 113, 113, 0.85); }
.mobile-menu-row--signout .icon { color: rgba(248, 113, 113, 0.6); }

/* Hide hamburger UI on desktop */
@media (min-width: 769px) {
  .mobile-menu-toggle,
  .mobile-menu-panel,
  .mobile-menu-scrim {
    display: none !important;
  }
}

/* ============================================================
   MOBILE SIGN-IN MODAL — bottom sheet + sticky submit
   ============================================================ */
@media (max-width: 768px) {
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .modal-card,
  .signin-modal {
    width: 100%;
    max-width: 100%;
    border-radius: 24px 24px 0 0;
    margin: 0;
    max-height: 90vh;
    max-height: 90dvh;
    display: flex;
    flex-direction: column;
    /* §61 — overflow-y:auto so the modal scrolls when contents
       exceed 90vh. Was overflow:hidden, which clipped the
       'Create an account' footer + trust strip below the fold on
       phone (the expected .signin-modal-body scroll wrapper isn't
       rendered by the JS markup). */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .signin-modal-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 16px;
  }
  /* §57 — Sign in button mobile rule. Previous version had
     position: sticky; bottom: 0 expecting a .signin-modal-body
     scroll wrapper that the JS doesn't actually render. With no
     scroll container, sticky degenerated and the button visually
     overlapped the password input field above it (Hamid screenshot
     12:45pm). Keep the visual treatment, drop the sticky. */
  .signin-submit {
    margin-top: 8px;
    background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.4) inset,
      0 0 0 1px rgba(251, 191, 36, 0.3),
      0 4px 12px -2px rgba(251, 191, 36, 0.4);
  }
}

/* ============================================================
   FLOATING PRACTICE CTA — mobile dashboard only
   ============================================================ */
.floating-practice-cta {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: #0a1628;
  text-decoration: none;
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  border: 1px solid rgba(251, 191, 36, 0.5);
  border-radius: 999px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4) inset,
    0 0 0 1px rgba(251, 191, 36, 0.3),
    0 12px 32px -4px rgba(251, 191, 36, 0.5),
    0 4px 8px rgba(0, 0, 0, 0.2);
  -webkit-tap-highlight-color: transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.floating-practice-cta:active { transform: translateX(-50%) scale(0.96); }
.floating-practice-cta .pulse-dot {
  width: 8px;
  height: 8px;
  background: rgba(10, 22, 40, 0.4);
  border-radius: 50%;
  animation: cta-pulse 2s ease-in-out infinite;
}
@keyframes cta-pulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.3); }
}
@media (max-width: 768px) {
  body.home-page .floating-practice-cta { display: inline-flex; }
  body.input-focused .floating-practice-cta { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .floating-practice-cta .pulse-dot { animation: none; }
}

/* ============================================================
   MOBILE: hide chat widget when input focused
   ============================================================ */
@media (max-width: 768px) {
  body.input-focused .chat-bell,
  body.input-focused .chat-widget,
  body.input-focused #chat-widget,
  body.input-focused [class*="chat-widget"],
  body.input-focused .sf-panel {
    display: none !important;
  }
}

/* ============================================================
   PROMPT 27 — MOBILE BOTTOM TAB BAR
   Primary nav on mobile. Hidden on desktop and on practice runner.
   Discipline: only @media (max-width: 768px) overrides below.
   ============================================================ */

.mobile-tabbar {
  display: none; /* shown on mobile via media query */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 60;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(20, 29, 51, 0.95) 0%, rgba(15, 22, 41, 0.98) 100%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 -1px 0 rgba(255, 255, 255, 0.04) inset,
    0 -8px 24px -8px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px;
  min-height: 56px;
  background: transparent;
  border: none;
  text-decoration: none;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.55);
  font-family: 'Inter', system-ui, sans-serif;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s ease;
}
.mobile-tab:active { color: rgba(255, 255, 255, 0.85); }
.mobile-tab.is-active { color: #fbbf24; }
.mobile-tab.is-active::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  border-radius: 999px;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}
.mobile-tab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
}
.mobile-tab-icon svg { display: block; }
.mobile-tab-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.mobile-tab-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 22px);
  min-width: 18px;
  height: 16px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  font-family: 'Inter', system-ui, sans-serif;
  color: #0a1628;
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  border-radius: 999px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4) inset,
    0 2px 6px rgba(251, 191, 36, 0.3);
}

.mobile-tab-avatar {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
}
.mobile-tab.is-active .mobile-tab-avatar {
  border-color: rgba(251, 191, 36, 0.6);
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.2);
}

.mobile-tab--center {
  flex: 0 0 auto;
  margin-top: -22px;
  padding: 0 8px;
  align-items: center;
  gap: 4px;
}
.mobile-tab-center-button {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  border: 3px solid #060d1f;
  border-radius: 50%;
  color: #0a1628;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4) inset,
    0 0 0 1px rgba(251, 191, 36, 0.4),
    0 8px 20px -4px rgba(251, 191, 36, 0.5),
    0 4px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.mobile-tab--center:active .mobile-tab-center-button { transform: scale(0.92); }
.mobile-tab--center.is-active::before { display: none; }
.mobile-tab-label--center {
  color: #fbbf24;
  font-weight: 700;
}

/* ----- Profile sheet (opened by Me tab) ----- */
.profile-sheet-scrim {
  position: fixed;
  inset: 0;
  z-index: 1310;
  background: rgba(6, 13, 31, 0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.profile-sheet-scrim[data-open="true"] {
  opacity: 1;
  pointer-events: auto;
}
.profile-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1320;
  max-height: 85vh;
  max-height: 85dvh;
  background: linear-gradient(180deg, rgba(26, 37, 64, 0.98) 0%, rgba(15, 22, 41, 0.98) 100%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-bottom: none;
  border-radius: 24px 24px 0 0;
  padding: 8px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 -16px 48px -12px rgba(0, 0, 0, 0.5);
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.profile-sheet[data-open="true"] { transform: translateY(0); }
.profile-sheet-handle {
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  margin: 8px auto 16px;
}
.profile-sheet-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 16px;
}
.profile-sheet-avatar {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-family: 'Instrument Serif', 'Times New Roman', serif;
  font-size: 22px;
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}
.profile-sheet-identity {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.profile-sheet-name {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.01em;
}
.profile-sheet-username {
  font-family: 'JetBrains Mono', 'Menlo', ui-monospace, monospace;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}
.profile-sheet-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.profile-sheet-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 20px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
}
.profile-stat {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.profile-stat-value {
  font-family: 'Instrument Serif', 'Times New Roman', serif;
  font-size: 24px;
  font-weight: 400;
  color: #ffffff;
  letter-spacing: -0.02em;
  line-height: 1;
}
.profile-stat-label {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}
.profile-sheet-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.profile-sheet-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease;
  width: 100%;
  text-align: left;
}
.profile-sheet-row:active { background: rgba(255, 255, 255, 0.06); }
.profile-sheet-row-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
}
.profile-sheet-row-chevron {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
}
.profile-sheet-row--signout {
  margin-top: 8px;
  color: rgba(248, 113, 113, 0.95);
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.15);
}
.profile-sheet-row--signout .profile-sheet-row-icon {
  color: rgba(248, 113, 113, 0.7);
}

/* ----- Mobile activation + supersedes Prompt 26 hamburger + floating CTA ----- */
@media (max-width: 768px) {
  .mobile-tabbar {
    display: flex;
    align-items: stretch;
    justify-content: space-around;
  }
  /* Tab bar slides down when keyboard is up */
  body.input-focused .mobile-tabbar {
    transform: translateY(100%);
  }
  /* Push body content up so the tab bar doesn't cover the footer */
  body {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }
  /* Practice page = full-screen, no tab bar */
  body.no-mobile-tabbar {
    padding-bottom: 0;
  }
  body.no-mobile-tabbar .mobile-tabbar { display: none !important; }

  /* Tab bar replaces hamburger + floating CTA from Prompt 26 */
  .mobile-menu-toggle,
  .mobile-menu-panel,
  .mobile-menu-scrim,
  .floating-practice-cta {
    display: none !important;
  }

  /* §62 — Header: brand left + Sign in / avatar dropdown right.
     Bottom nav is gone (§62 in auth.js); top-right is the only auth
     surface on phone now. Show the Sign in button (signed-out) and
     the user-pill/menu (signed-in). Hide everything else
     (chat-bell, admin-badge, primary nav links) — those route via
     the avatar dropdown's "Settings" / "Admin panel" links. */
  .site-header {
    padding-top: calc(6px + env(safe-area-inset-top, 0px));
  }
  .site-header .container { height: 44px; }
  .site-header .nav,
  .site-header .chat-bell,
  .site-header #user-slot .chat-bell,
  .site-header #user-slot .admin-badge {
    display: none !important;
  }
  .site-header #user-slot {
    margin-left: auto;
  }
  .site-header #user-slot .user-signin {
    display: inline-flex;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 600;
  }
  .site-header #user-slot .user-pill {
    display: inline-flex;
    padding: 4px 6px;
  }
  .site-header #user-slot .user-pill .user-pill-name { display: none; }
  .site-header .wallet-pill,
  .site-header #user-slot .wallet-pill {
    display: inline-flex;
    padding: 5px 10px;
    font-size: 12px;
  }
  /* user-menu uses JS-toggled [hidden] attribute → browser native
     hide. Don't override it here so the dropdown opens cleanly. */

  /* §62 — ReplyQuik chat widget repositioned bottom-LEFT. Best-effort
     selectors covering common ReplyQuik wrapper patterns since their
     widget injects from api.replyquik.com. */
  iframe[src*="replyquik"],
  div[class*="replyquik"],
  div[id*="replyquik"],
  [data-replyquik-widget] {
    left: 12px !important;
    right: auto !important;
  }

  /* Lift chat / friends widget above the tab bar */
  .chat-widget,
  #chat-widget,
  [class*="chat-widget"],
  [id*="tawk"],
  [class*="tawk"] {
    bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
  }
  body.no-mobile-tabbar .chat-widget,
  body.no-mobile-tabbar [id*="tawk"],
  body.no-mobile-tabbar [class*="tawk"] {
    bottom: 16px !important;
  }
}

/* Belt-and-suspenders: never show tab bar / sheet on desktop */
@media (min-width: 769px) {
  .mobile-tabbar,
  .profile-sheet,
  .profile-sheet-scrim {
    display: none !important;
  }
}

/* ============================================================
   PROMPT 28 — LANDING PAGE MOBILE RETHINK (kid-magnetic)
   Mobile-only overrides. Desktop unchanged.
   Selectors target REAL classes in index.html.
   ============================================================ */

/* Mobile-only footer link row + demo bubble live in DOM but
   are hidden on desktop. */
@media (min-width: 769px) {
  .footer-mobile-links { display: none !important; }
  .demo-reward-bubble { display: none !important; }
}

@media (max-width: 768px) {
  /* ---------- Status bar safe area ---------- */
  body.home-page .site-header {
    padding-top: calc(10px + env(safe-area-inset-top, 0px)) !important;
  }

  /* ---------- HERO: tighten + reorder mockup-first ---------- */
  body.home-page .hero {
    padding: 12px 16px 28px;
    min-height: auto;
  }
  body.home-page .hero .hero-content {
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: stretch;
    padding: 0;
  }
  /* Mockup goes FIRST visually on mobile */
  body.home-page .hero .hero-right { order: 1; }
  body.home-page .hero .hero-left  { order: 2; display: flex; flex-direction: column; }

  /* Hide social-proof pill on mobile — kid doesn't care */
  body.home-page .hero-live-pill { display: none !important; }

  /* Headline tighter */
  body.home-page .hero-headline {
    font-size: 44px;
    line-height: 1.04;
    letter-spacing: -0.025em;
    margin: 4px 0 10px;
    max-width: 100%;
  }

  /* Subhead clamped to 2 lines */
  body.home-page .hero-left p {
    font-size: 14px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.65);
    margin: 0 0 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Hide secondary "How it works" CTA — Learn tab covers it */
  body.home-page .hero-cta .btn-secondary { display: none !important; }

  /* Hero CTA layout */
  body.home-page .hero-cta {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 6px;
  }

  /* Primary CTA: kid-magnetic gold button, full width */
  body.home-page .hero-cta .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 56px;
    margin: 6px 0 4px;
    padding: 0 24px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #0a1628;
    background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
    border: 1px solid rgba(251, 191, 36, 0.55);
    border-radius: 16px;
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.4) inset,
      0 0 0 1px rgba(251, 191, 36, 0.3),
      0 8px 24px -4px rgba(251, 191, 36, 0.5),
      0 4px 8px rgba(0, 0, 0, 0.2);
  }

  /* ---------- HERO MOCKUP: front-and-center, interactive ---------- */
  body.home-page .hero-right {
    width: 100%;
    margin: 0;
    padding: 0;
    position: relative;
  }
  body.home-page .hero-visual {
    position: relative;
    width: 100%;
    height: auto;
    transform: none !important;
    margin: 0 auto;
    padding: 0;
  }
  body.home-page .hero-visual .mockup-card--main {
    position: relative;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
    transform: none !important;
    animation: mockup-float-mobile 4s ease-in-out infinite;
  }
  /* Hide RANK / LEGO floating accent cards on phones */
  body.home-page .mockup-card--accent-top,
  body.home-page .mockup-card--accent-bottom { display: none !important; }

  @keyframes mockup-float-mobile {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
  }

  /* Tap-friendly answer choices */
  body.home-page .mockup-card .mockup-options {
    gap: 8px;
  }
  body.home-page .mockup-card .mockup-option {
    min-height: 52px;
    padding: 12px 16px;
    font-size: 18px;
    font-family: 'Instrument Serif', 'Times New Roman', serif;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 14px;
    color: #ffffff;
    cursor: pointer;
    transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }
  body.home-page .mockup-card .mockup-option:active {
    transform: scale(0.97);
    background: rgba(255, 255, 255, 0.08);
  }
  /* Reset pre-revealed correct styling on mobile (interactive demo) */
  body.home-page .mockup-card .mockup-option--correct:not(.is-correct) {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.10);
    color: #ffffff;
  }
  body.home-page .mockup-card .mockup-option.is-correct {
    background: linear-gradient(180deg, rgba(34, 197, 94, 0.22) 0%, rgba(22, 163, 74, 0.12) 100%);
    border-color: rgba(34, 197, 94, 0.55);
    color: #4ade80;
    box-shadow:
      0 0 0 1px rgba(34, 197, 94, 0.25),
      0 0 18px -4px rgba(34, 197, 94, 0.55);
  }
  body.home-page .mockup-card .mockup-option.is-incorrect {
    background: rgba(239, 68, 68, 0.10);
    border-color: rgba(239, 68, 68, 0.45);
    color: #fca5a5;
  }

  /* Demo pulse on correct answer */
  .demo-pulse { animation: demo-pulse-anim 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
  @keyframes demo-pulse-anim {
    0%   { transform: scale(1);    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
    50%  { transform: scale(1.06); box-shadow: 0 0 0 12px rgba(34, 197, 94, 0); }
    100% { transform: scale(1);    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
  }
  .demo-shake { animation: demo-shake-anim 0.4s ease-in-out; }
  @keyframes demo-shake-anim {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-6px); }
    75%      { transform: translateX(6px); }
  }

  /* +15 cents reward bubble */
  .demo-reward-bubble {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.6);
    z-index: 5;
    padding: 12px 20px;
    font-family: 'Instrument Serif', 'Times New Roman', serif;
    font-size: 28px;
    font-weight: 500;
    color: #0a1628;
    background: linear-gradient(180deg, #fde68a 0%, #fbbf24 100%);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 999px;
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.6) inset,
      0 8px 24px -4px rgba(251, 191, 36, 0.6),
      0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    white-space: nowrap;
  }
  .demo-reward-bubble.is-shown {
    opacity: 1;
    transform: translate(-50%, -110%) scale(1);
  }

  /* CTA pulse after correct demo answer */
  .cta-pulse { animation: cta-pulse-anim 0.8s ease-in-out 2; }
  @keyframes cta-pulse-anim {
    0%, 100% {
      box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.4) inset,
        0 0 0 1px rgba(251, 191, 36, 0.3),
        0 8px 24px -4px rgba(251, 191, 36, 0.5);
    }
    50% {
      box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.5) inset,
        0 0 0 4px rgba(251, 191, 36, 0.4),
        0 12px 32px -4px rgba(251, 191, 36, 0.7);
      transform: scale(1.02);
    }
  }

  /* ---------- GRADES SECTION: 2-col compressed grid ---------- */
  body.home-page .grades-section { padding: 28px 14px 20px; }
  body.home-page .grades-section .grades-section-inner { padding: 0; }
  body.home-page .grades-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 14px;
  }
  body.home-page .grades-title {
    font-size: 30px;
    line-height: 1.05;
    margin: 0;
  }
  body.home-page .grades-subtitle {
    font-size: 13px;
    line-height: 1.4;
    margin: 2px 0 0 0;
  }
  /* Hide "10 grades · Math today, more soon" pill on mobile */
  body.home-page .grades-pill { display: none !important; }

  body.home-page .grade-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  body.home-page .grade-card {
    padding: 14px 12px 12px;
    border-radius: 14px;
    min-height: 0;
  }
  body.home-page .grade-card .grade-card-head {
    margin-bottom: 6px;
    gap: 6px;
  }
  body.home-page .grade-card .grade-card-eyebrow {
    font-size: 9px;
    padding: 3px 7px;
    letter-spacing: 0.06em;
  }
  body.home-page .grade-card .grade-card-icon {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
  body.home-page .grade-card .grade-card-title {
    font-size: 15px;
    line-height: 1.2;
    margin: 4px 0 2px;
  }
  body.home-page .grade-card .grade-card-meta {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.3;
  }
  body.home-page .grade-card .grade-card-foot {
    margin-top: 8px;
    padding-top: 8px;
    font-size: 11px;
  }
  body.home-page .grade-card .grade-card-age { font-size: 11px; }
  body.home-page .grade-card .grade-card-arrow {
    width: 24px;
    height: 24px;
  }
  body.home-page .grade-card .grade-card-arrow svg { width: 12px; height: 12px; }
  body.home-page .grade-card .grade-card-badge {
    font-size: 9px;
    padding: 3px 6px;
  }

  /* ---------- FOOTER: collapse to single column ---------- */
  body.home-page .footer { padding: 20px 16px 24px; }
  body.home-page .footer .footer-inner { padding: 0; }
  body.home-page .footer .footer-top {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    grid-template-columns: none !important;
  }
  body.home-page .footer .footer-nav-col { display: none !important; }
  body.home-page .footer .footer-brand-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    margin: 0 0 4px 0;
    width: 100%;
  }
  body.home-page .footer .footer-tagline {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
    margin: 0;
    max-width: 280px;
  }
  body.home-page .footer .footer-trust-row,
  body.home-page .footer .footer-trust-pill { display: none !important; }

  body.home-page .footer-mobile-links {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin: 8px 0 12px;
  }
  body.home-page .footer-mobile-links a {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
  }
  body.home-page .footer-mobile-links a:active { color: #fbbf24; }

  body.home-page .footer .footer-divider { display: none; }
  body.home-page .footer .footer-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding-top: 8px;
  }
  body.home-page .footer .footer-copy {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    margin: 0;
  }
  body.home-page .footer .footer-meta { display: none; }
  body.home-page .footer .footer-social {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 4px;
  }
  body.home-page .footer .footer-social-link {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
  }

  /* ---------- CHAT WIDGET: top-right, smaller, no auto-popup ---------- */
  /* Override Prompt 27 lift rule on home page so launcher sits top-right */
  body.home-page .chat-widget,
  body.home-page #chat-widget,
  body.home-page [class*="chat-widget"],
  body.home-page [id*="tawk"],
  body.home-page [class*="tawk"],
  body.home-page [id*="crisp"],
  body.home-page [class*="crisp"] {
    bottom: auto !important;
    top: calc(56px + env(safe-area-inset-top, 0px) + 8px) !important;
    right: 12px !important;
    transform: scale(0.75) !important;
    transform-origin: top right !important;
    z-index: 30 !important;
  }
  body.home-page [class*="tawk-tooltip"],
  body.home-page [class*="crisp-tooltip"],
  body.home-page [class*="chat-tooltip"],
  body.home-page [class*="auto-message"] {
    display: none !important;
  }
}

/* Smaller phones — let mockup fill width */
@media (max-width: 480px) {
  body.home-page .hero-visual .mockup-card--main { max-width: 100%; }
  body.home-page .hero-headline { font-size: 38px; }
}

/* Tiny phones — tighten grade grid gutters */
@media (max-width: 380px) {
  body.home-page .grade-grid { gap: 8px !important; }
  body.home-page .grade-card { padding: 12px 10px; }
}

/* ============================================================
   PROMPT 29 — Mobile landing fixes (mockup centering + redundant CTA cut)
   Mobile-only. Desktop pixel-identical to before.
   Appended last so cascade order wins over Prompt 28.
   ============================================================ */

/* Tagline element lives in DOM always; only visible on mobile */
.hero-tagline-mobile { display: none; }

@media (max-width: 768px) {
  /* ---------- Hero clip + container reset ---------- */
  body.home-page .hero {
    padding: 16px 16px 28px;
    overflow: hidden; /* safety net so nothing escapes the viewport */
  }
  body.home-page .hero .hero-content {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 0;
    margin: 0;
  }

  /* ---------- Hero left: centered, supporting role ---------- */
  body.home-page .hero .hero-left {
    width: 100%;
    text-align: center;
    align-items: center;
    order: 2;
  }
  body.home-page .hero-headline {
    font-size: 32px;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0;
    text-align: center;
    max-width: 100%;
  }

  /* Tagline — the one line the kid sees */
  body.home-page .hero-tagline-mobile {
    display: block;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    margin: 6px 0 0 0;
    letter-spacing: -0.005em;
    -webkit-line-clamp: unset;
    overflow: visible;
    text-overflow: clip;
    display: block;
  }

  /* Cut the marketing prose on mobile (kid doesn't read it) */
  body.home-page .hero .hero-left p:not(.hero-tagline-mobile) {
    display: none !important;
  }

  /* Cut the redundant hero CTA group — bottom tab Practice is the persistent CTA */
  body.home-page .hero .hero-cta,
  body.home-page .hero .hero-cta .btn,
  body.home-page .hero .hero-cta .btn-primary,
  body.home-page .hero .hero-cta .btn-secondary {
    display: none !important;
  }

  /* ---------- Hero right: full-width centered, mockup is the star ---------- */
  body.home-page .hero .hero-right {
    width: 100%;
    max-width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 0;
    transform: none !important;
    position: relative;
    order: 1;
  }
  body.home-page .hero .hero-visual {
    width: 100%;
    max-width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    padding: 0;
    transform: none !important;
  }

  /* The card itself — strictly within viewport */
  body.home-page .hero-visual .mockup-card--main {
    width: 100%;
    max-width: calc(100vw - 32px);
    margin: 0 auto !important;
    transform: none !important;
    position: relative;
    left: auto !important;
    right: auto !important;
    padding: 16px 14px 14px;
    animation: mockup-float-mobile 4s ease-in-out infinite;
  }

  /* Eyebrow tag */
  body.home-page .mockup-card .mockup-tag {
    font-size: 10px;
    padding: 4px 10px;
    letter-spacing: 0.06em;
  }

  /* Question — readable, not dominant */
  body.home-page .mockup-card .mockup-question {
    font-size: 22px;
    line-height: 1.2;
    margin: 8px 0 14px;
  }

  /* Answer choices: clean 2x2 grid that fits */
  body.home-page .mockup-card .mockup-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }
  body.home-page .mockup-card .mockup-option {
    width: 100%;
    min-width: 0;
    padding: 12px 10px;
    font-size: 17px;
    text-align: center;
  }

  /* Tap-hint pill replaces "7-day streak" — bouncing 👆 cue */
  body.home-page .mockup-card .mockup-footer {
    display: flex;
    justify-content: center;
    align-items: center;
  }
  body.home-page .mockup-card .mockup-footer .mockup-points { display: none; }
  body.home-page .mockup-meta--hint {
    transition: opacity 0.4s ease;
    display: inline-flex;
    justify-content: center;
  }
  body.home-page .mockup-tap-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: rgba(251, 191, 36, 0.92);
    padding: 6px 12px;
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: 999px;
  }
  body.home-page .mockup-tap-hint .tap-icon {
    font-size: 14px;
    animation: tap-bounce 1.5s ease-in-out infinite;
  }
  @keyframes tap-bounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-3px); }
  }

  /* ---------- Status bar: tighter header ---------- */
  body.home-page .site-header {
    padding-top: env(safe-area-inset-top, 0px) !important;
    padding-bottom: 0 !important;
  }
  body.home-page .site-header .container {
    height: 44px;
    padding: 6px 14px;
  }

  /* ---------- Starfield: ~70% fewer stars on mobile, slower ---------- */
  body.home-page .starfield .star {
    animation-duration: 5s !important;
  }
  body.home-page .starfield .star:nth-child(3n+1),
  body.home-page .starfield .star:nth-child(3n+2) {
    display: none;
  }
}

/* Hard cap on tiny phones */
@media (max-width: 380px) {
  body.home-page .hero-visual .mockup-card--main {
    max-width: calc(100vw - 24px);
  }
  body.home-page .mockup-card .mockup-options {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  body.home-page .mockup-card .mockup-option {
    padding: 14px 12px;
  }
  body.home-page .hero-headline { font-size: 28px; }
}

/* ============================================================
   PROMPT 30 — Mobile reduction (one-card-only philosophy)
   Mobile-only. Desktop pixel-identical to before.
   Appended last so cascade order wins over earlier prompts.
   ============================================================ */
@media (max-width: 768px) {
  /* Hide the "Practice → Earn → Unlock real toys" rewards card on mobile.
     Mockup demonstrates value; bottom-tab Practice provides the action. */
  body.home-page .rewards-section,
  body.home-page #earn-banner,
  body.home-page .rewards-callout {
    display: none !important;
  }

  /* ---------- Mockup card: airy, alive, premium ---------- */
  body.home-page .hero-visual .mockup-card--main {
    padding: 14px 14px 12px;
    border-radius: 18px;
    background: linear-gradient(180deg,
      rgba(40, 53, 91, 0.7) 0%,
      rgba(20, 29, 51, 0.6) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.08) inset,    /* top highlight */
      0 -1px 0 rgba(0, 0, 0, 0.2) inset,          /* bottom shade */
      0 8px 24px -8px rgba(0, 0, 0, 0.4);
  }

  /* Card header tightening */
  body.home-page .mockup-card .mockup-card-header {
    margin-bottom: 8px;
  }
  body.home-page .mockup-card .mockup-progress {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
  }

  /* Question — slightly tighter */
  body.home-page .mockup-card .mockup-question {
    font-size: 24px;
    line-height: 1.15;
    margin: 6px 0 14px;
  }

  /* Answer choices — tighter padding, modern radius */
  body.home-page .mockup-card .mockup-option {
    padding: 14px 10px;
    font-size: 18px;
    border-radius: 12px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Footer divider */
  body.home-page .mockup-card .mockup-footer {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: center;
  }

  /* Correct / incorrect states — refined */
  body.home-page .mockup-card .mockup-option.is-correct {
    background: linear-gradient(180deg, rgba(34, 197, 94, 0.18) 0%, rgba(22, 163, 74, 0.08) 100%) !important;
    border-color: rgba(34, 197, 94, 0.5) !important;
    color: #4ade80 !important;
    box-shadow:
      0 0 0 1px rgba(34, 197, 94, 0.3),
      0 0 20px -2px rgba(34, 197, 94, 0.5) !important;
  }
  body.home-page .mockup-card .mockup-option.is-incorrect {
    background: rgba(239, 68, 68, 0.10) !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
    color: #fca5a5 !important;
  }

  /* Demo animations — refined */
  .demo-pulse  { animation: demo-pulse-anim 0.7s cubic-bezier(0.34, 1.56, 0.64, 1); }
  @keyframes demo-pulse-anim {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.08); }
    100% { transform: scale(1); }
  }
  .demo-shake  { animation: demo-shake-anim 0.45s ease-in-out; }
  @keyframes demo-shake-anim {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    50% { transform: translateX(8px); }
    80% { transform: translateX(-4px); }
  }

  /* Reward bubble — bigger, brighter */
  .demo-reward-bubble {
    top: 38%;
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.6) inset,
      0 12px 32px -4px rgba(251, 191, 36, 0.7),
      0 4px 12px rgba(0, 0, 0, 0.4) !important;
  }

  /* Bottom-tab Practice button pulse on correct demo answer */
  .demo-cta-pulse {
    animation: tab-cta-pulse 0.8s ease-in-out 2;
    transform-origin: center;
  }
  @keyframes tab-cta-pulse {
    0%, 100% {
      transform: scale(1);
      box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.4) inset,
        0 0 0 1px rgba(251, 191, 36, 0.4),
        0 8px 20px -4px rgba(251, 191, 36, 0.5);
    }
    50% {
      transform: scale(1.12);
      box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.5) inset,
        0 0 0 6px rgba(251, 191, 36, 0.4),
        0 16px 40px -4px rgba(251, 191, 36, 0.8);
    }
  }

  /* ---------- Headline: drop down, smaller, supporting ---------- */
  body.home-page .hero-headline,
  body.home-page .hero h1 {
    font-size: 24px;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 16px 0 4px 0;
    color: rgba(255, 255, 255, 0.92);
    text-align: center;
    font-weight: 400;
  }
  body.home-page .hero-tagline-mobile {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.55);
    margin: 0 0 8px 0;
    font-weight: 400;
  }

  /* ---------- Modern airy: lighter atmosphere ---------- */
  body.home-page::before {
    width: 320px;
    height: 320px;
    opacity: 0.6;
  }
  body.home-page::after {
    width: 320px;
    height: 320px;
    opacity: 0.4;
  }

  /* Brand top-left — calmer */
  .site-header .brand { gap: 8px; }
  .site-header .brand-icon,
  .site-header .brand svg {
    width: 22px;
    height: 22px;
  }
  .site-header .brand-text,
  .site-header .brand span {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.005em;
  }

  /* ---------- Spacing rhythm ---------- */
  body.home-page .hero {
    padding: 14px 16px 32px;
  }
  body.home-page .hero .hero-content {
    gap: 14px;
  }
  body.home-page .grades-section {
    padding-top: 28px;
  }
}

@media (max-width: 480px) {
  body.home-page .hero-headline,
  body.home-page .hero h1 {
    font-size: 22px;
  }
}

/* ============================================================
   PROMPT 31 — Ruthless mobile reduction (one-purpose first screen)
   Mobile-only. Desktop pixel-identical.
   "Pick your grade." → vertical grade list. Nothing else.
   ============================================================ */
.mobile-grade-intro { display: none; }

@media (max-width: 768px) {
  /* ---------- Step 1: Kill the entire mockup card on mobile ---------- */
  body.home-page .hero-right,
  body.home-page .hero-visual,
  body.home-page .mockup-card,
  body.home-page .mockup-card--main,
  body.home-page .mockup-card--accent-top,
  body.home-page .mockup-card--accent-bottom {
    display: none !important;
  }

  /* ---------- Step 2: Kill hero text block on mobile ---------- */
  body.home-page .hero-left,
  body.home-page .hero-headline,
  body.home-page .hero-tagline-mobile,
  body.home-page .hero-live-pill,
  body.home-page .hero .hero-cta,
  body.home-page .hero-left p {
    display: none !important;
  }
  body.home-page .hero {
    padding: 12px 16px 8px !important;
    min-height: 0 !important;
  }
  body.home-page .hero .hero-spotlight,
  body.home-page .hero-bottom-fade {
    display: none !important;
  }

  /* ---------- Step 3: Mobile-only "Pick your grade." intro ---------- */
  body.home-page .mobile-grade-intro {
    display: block;
    text-align: left;
    padding: 32px 18px 16px;
  }
  body.home-page .mobile-grade-title {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 36px;
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.025em;
    color: #ffffff;
    margin: 0 0 6px 0;
  }
  body.home-page .mobile-grade-subtitle {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
    letter-spacing: -0.005em;
  }

  /* Hide desktop "Choose your grade" header — replaced by mobile intro */
  body.home-page .grades-section .grades-header,
  body.home-page .grades-section .grades-title,
  body.home-page .grades-section .grades-subtitle,
  body.home-page .grades-section .grades-pill {
    display: none !important;
  }

  body.home-page .grades-section,
  body.home-page .grades-section-inner {
    padding: 0 16px 24px !important;
  }

  /* ---------- Step 4: Single-column grade list ---------- */
  body.home-page .grade-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  body.home-page .grade-card {
    display: grid !important;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto;
    grid-template-areas: "title number";
    align-items: center;
    padding: 16px 18px !important;
    border-radius: 14px !important;
    background: linear-gradient(180deg,
      rgba(40, 53, 91, 0.5) 0%,
      rgba(20, 29, 51, 0.5) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    position: relative;
    overflow: hidden;
    min-height: 0 !important;
    transition: background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }
  body.home-page .grade-card:active {
    background: linear-gradient(180deg,
      rgba(50, 63, 101, 0.6) 0%,
      rgba(30, 39, 61, 0.6) 100%) !important;
  }

  /* Hide everything except title + icon badge */
  body.home-page .grade-card .grade-card-head .grade-card-eyebrow,
  body.home-page .grade-card .grade-card-eyebrow,
  body.home-page .grade-card .grade-card-meta,
  body.home-page .grade-card .grade-card-foot,
  body.home-page .grade-card .grade-card-age,
  body.home-page .grade-card .grade-card-arrow,
  body.home-page .grade-card .grade-card-badge,
  body.home-page .grade-card .grade-card-badge--current,
  body.home-page .grade-card .grade-card-badge--locked {
    display: none !important;
  }

  /* The .grade-card-head wrapper unwraps visually — flatten */
  body.home-page .grade-card .grade-card-head {
    display: contents !important;
  }

  /* Title — left */
  body.home-page .grade-card .grade-card-title {
    grid-area: title;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 17px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 !important;
    letter-spacing: -0.01em;
    line-height: 1.2;
  }

  /* Grade number badge — right */
  body.home-page .grade-card .grade-card-icon {
    grid-area: number;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px !important;
    height: 40px !important;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* "Most picked" indicator on grade-card--popular */
  body.home-page .grade-card.grade-card--popular {
    grid-template-areas:
      "title  number"
      "meta   number" !important;
    background: linear-gradient(180deg,
      rgba(251, 191, 36, 0.08) 0%,
      rgba(251, 191, 36, 0.02) 100%) !important;
    border-color: rgba(251, 191, 36, 0.25) !important;
  }
  body.home-page .grade-card.grade-card--popular::after {
    content: '⭐ Most picked';
    grid-area: meta;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: rgba(251, 191, 36, 0.95);
    margin-top: 2px;
  }
  body.home-page .grade-card.grade-card--popular .grade-card-icon {
    background: rgba(251, 191, 36, 0.15);
    border-color: rgba(251, 191, 36, 0.3);
    color: #fbbf24;
  }

  /* ---------- Step 5: Footer reduction ---------- */
  body.home-page .footer {
    padding: 32px 18px calc(20px + env(safe-area-inset-bottom, 0px)) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    margin-top: 24px !important;
  }
  body.home-page .footer .footer-top {
    display: none !important;
  }
  body.home-page .footer .footer-divider {
    display: none !important;
  }
  /* Inline mobile links — already exist as nav.footer-mobile-links */
  body.home-page .footer-mobile-links {
    display: flex !important;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
  }
  body.home-page .footer-mobile-links a {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    text-decoration: none;
    font-weight: 400;
  }
  body.home-page .footer-bottom {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }
  body.home-page .footer-copy {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.3);
    text-align: center;
    margin: 0;
    order: 2;
  }
  body.home-page .footer-meta {
    display: none !important;
  }
  body.home-page .footer-social {
    display: none !important;
  }

  /* ---------- Step 6: Header refinement ---------- */
  .site-header {
    background: transparent !important;
    border-bottom: none !important;
    padding-top: env(safe-area-inset-top, 0px);
  }
  .site-header .container {
    height: 44px;
    padding: 4px 16px !important;
  }
  .site-header .brand { gap: 6px !important; }
  .site-header .brand svg,
  .site-header .brand-icon {
    width: 18px !important;
    height: 18px !important;
  }
  .site-header .brand-text,
  .site-header .brand span {
    font-size: 14px !important;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: -0.005em;
  }

  /* ---------- Step 7: Background atmosphere — pulled back ---------- */
  body.home-page::before {
    width: 280px !important;
    height: 280px !important;
    opacity: 0.4 !important;
  }
  body.home-page::after {
    width: 280px !important;
    height: 280px !important;
    opacity: 0.25 !important;
  }
  body.home-page .background-grid,
  body.home-page .hero-stars {
    display: none !important;
  }

  /* ---------- Step 8: Body bottom padding for tab bar ---------- */
  body.home-page {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }
}

/* ============================================================
   PROMPT 32 — Mobile premium polish (17-point sweep)
   Mobile-only. Desktop pixel-identical.
   Restrained, deliberate, integrated. Premium = right-sized.
   ============================================================ */
.grade-group-label { display: none; }

@media (max-width: 768px) {
  /* ---------- Step 1: Header — no seam ---------- */
  .site-header {
    background: linear-gradient(180deg,
      rgba(6, 13, 31, 0.7) 0%,
      rgba(6, 13, 31, 0) 100%) !important;
    border-bottom: none !important;
    box-shadow: none !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  /* ---------- Step 2: Brand wordmark refinement ---------- */
  .site-header .brand { gap: 7px !important; }
  .site-header .brand svg,
  .site-header .brand-icon {
    width: 20px !important;
    height: 20px !important;
  }
  .site-header .brand-text,
  .site-header .brand span {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 16px !important;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: rgba(255, 255, 255, 0.95) !important;
  }
  .site-header .brand .logo-accent,
  .site-header .brand-text .brand-accent {
    color: #fbbf24 !important;
    font-weight: 600;
  }

  /* ---------- Step 3: Headline right-size ---------- */
  body.home-page .mobile-grade-intro {
    padding: 28px 20px 20px !important;
  }
  body.home-page .mobile-grade-title {
    font-size: 28px !important;
    line-height: 1.08 !important;
    letter-spacing: -0.02em !important;
    color: rgba(255, 255, 255, 0.96) !important;
    margin: 0 0 4px 0 !important;
  }
  body.home-page .mobile-grade-subtitle {
    font-size: 13px !important;
    color: rgba(255, 255, 255, 0.45) !important;
  }

  /* ---------- Step 4: Compact cards + ghost numerals ---------- */
  body.home-page .grade-grid {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
    padding: 0 !important;
  }
  body.home-page .grade-card {
    grid-template-columns: 1fr auto !important;
    grid-template-areas: "title number" !important;
    align-items: center;
    padding: 14px 18px !important;
    min-height: 0 !important;
    border-radius: 14px !important;
    background: linear-gradient(180deg,
      rgba(40, 53, 91, 0.5) 0%,
      rgba(20, 29, 51, 0.5) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset !important;
    transition: transform 0.18s cubic-bezier(0.4,0,0.2,1),
                background 0.18s cubic-bezier(0.4,0,0.2,1),
                border-color 0.18s cubic-bezier(0.4,0,0.2,1) !important;
  }
  body.home-page .grade-card:active {
    transform: scale(0.985);
    background: linear-gradient(180deg,
      rgba(50, 63, 101, 0.6) 0%,
      rgba(30, 39, 61, 0.6) 100%) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
  }

  /* Title — refined weight */
  body.home-page .grade-card .grade-card-title {
    grid-area: title;
    font-size: 15px !important;
    font-weight: 500 !important;
    color: rgba(255, 255, 255, 0.92) !important;
    margin: 0 !important;
    letter-spacing: -0.01em !important;
    line-height: 1.2 !important;
  }

  /* Ghost numeral — strip the box */
  body.home-page .grade-card .grade-card-icon {
    grid-area: number;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    font-family: 'Instrument Serif', Georgia, serif !important;
    font-size: 28px !important;
    font-weight: 400 !important;
    color: rgba(255, 255, 255, 0.18) !important;
    line-height: 1 !important;
    letter-spacing: -0.02em !important;
    transition: color 0.18s ease;
  }
  body.home-page .grade-card:active .grade-card-icon {
    color: rgba(255, 255, 255, 0.4) !important;
  }

  /* ---------- Step 5: Popular card — restrained gold ---------- */
  body.home-page .grade-card.grade-card--popular {
    grid-template-areas:
      "title  number"
      "meta   number" !important;
    background: linear-gradient(180deg,
      rgba(40, 53, 91, 0.5) 0%,
      rgba(20, 29, 51, 0.5) 100%) !important;
    border-color: rgba(251, 191, 36, 0.35) !important;
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.04) inset,
      0 0 0 1px rgba(251, 191, 36, 0.1) !important;
    align-items: start;
  }
  body.home-page .grade-card.grade-card--popular .grade-card-icon {
    color: rgba(251, 191, 36, 0.95) !important;
    grid-row: span 2;
    align-self: center;
  }
  body.home-page .grade-card.grade-card--popular::after {
    content: 'Most picked' !important;
    grid-area: meta;
    font-family: 'Inter', system-ui, sans-serif !important;
    font-size: 9.5px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
    color: rgba(251, 191, 36, 0.85) !important;
    margin-top: 3px !important;
  }

  /* ---------- Step 6: Group labels ---------- */
  body.home-page .grade-group-label {
    display: block;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.35);
    padding: 22px 4px 8px;
    margin: 0;
  }
  body.home-page .grade-group-label:first-child,
  body.home-page .grade-group-label:first-of-type {
    padding-top: 4px;
  }

  /* ---------- Step 7: Tab bar backdrop blur ---------- */
  .mobile-tabbar {
    background: linear-gradient(180deg,
      rgba(20, 29, 51, 0.85) 0%,
      rgba(15, 22, 41, 0.92) 100%) !important;
    backdrop-filter: blur(28px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(180%) !important;
    border-top: none !important;
    box-shadow:
      0 -1px 0 rgba(255, 255, 255, 0.06) inset,
      0 -12px 24px -8px rgba(0, 0, 0, 0.4) !important;
    position: fixed;
  }
  .mobile-tabbar::before {
    content: '';
    position: absolute;
    top: -32px;
    left: 0;
    right: 0;
    height: 32px;
    background: linear-gradient(180deg,
      rgba(6, 13, 31, 0) 0%,
      rgba(6, 13, 31, 0.6) 100%);
    pointer-events: none;
    z-index: -1;
  }

  /* ---------- Step 8: Center Practice button — refined ---------- */
  .mobile-tabbar .mobile-tab-center-button {
    width: 52px !important;
    height: 52px !important;
    border: 2.5px solid #060d1f !important;
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.35) inset,
      0 0 0 1px rgba(251, 191, 36, 0.3),
      0 6px 16px -4px rgba(251, 191, 36, 0.4),
      0 2px 6px rgba(0, 0, 0, 0.25) !important;
  }
  .mobile-tabbar .mobile-tab--center {
    margin-top: -18px !important;
  }
  .mobile-tabbar .mobile-tab--center .mobile-tab-label--center {
    font-size: 9.5px !important;
    margin-top: 2px !important;
  }

  /* ---------- Step 9: Atmosphere — softer ---------- */
  body.home-page::before {
    width: 240px !important;
    height: 240px !important;
    opacity: 0.35 !important;
    top: -100px !important;
    right: -80px !important;
  }
  body.home-page::after {
    width: 240px !important;
    height: 240px !important;
    opacity: 0.2 !important;
    bottom: 100px !important;
    left: -80px !important;
  }

  /* ---------- Step 10: Status bar zone fix ---------- */
  body.home-page {
    padding-top: 0 !important;
  }
  .site-header {
    padding-top: env(safe-area-inset-top, 0px) !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
  }
  body.home-page > .top-spacer,
  body.home-page > [class*="safe-area-spacer"] {
    display: none !important;
  }

  /* ---------- Step 11: Footer minor refinement ---------- */
  body.home-page .footer {
    background: transparent !important;
    border-top: 1px solid rgba(255, 255, 255, 0.04) !important;
    margin-top: 32px !important;
    padding: 24px 18px calc(20px + env(safe-area-inset-bottom, 0px)) !important;
  }
  body.home-page .footer-mobile-links {
    gap: 18px !important;
  }
  body.home-page .footer-mobile-links a {
    font-size: 11px !important;
    color: rgba(255, 255, 255, 0.4) !important;
    letter-spacing: -0.005em;
    transition: color 0.15s ease;
  }
  body.home-page .footer-mobile-links a:active {
    color: rgba(251, 191, 36, 0.85) !important;
  }
}

@media (max-width: 380px) {
  body.home-page .mobile-grade-title {
    font-size: 26px !important;
  }
}

/* ============================================================
   PROMPT 33 — Hero + ruthless reduction + 3-tab + personality
   Mobile-only. Desktop pixel-identical.
   ============================================================ */
.mobile-hero { display: none; }

@media (max-width: 768px) {
  /* ---------- Step 1: Strip "Math" suffix on mobile only ---------- */
  body.home-page .grade-card .grade-subject-suffix {
    display: none !important;
  }

  /* ---------- Step 2: Cut "Most picked" treatment on mobile ---------- */
  body.home-page .grade-card.grade-card--popular {
    background: linear-gradient(180deg,
      rgba(40, 53, 91, 0.5) 0%,
      rgba(20, 29, 51, 0.5) 100%) !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset !important;
    grid-template-areas: "title number" !important;
    align-items: center !important;
  }
  body.home-page .grade-card.grade-card--popular .grade-card-icon {
    color: rgba(255, 255, 255, 0.18) !important;
    grid-row: auto !important;
    align-self: center !important;
  }
  body.home-page .grade-card.grade-card--popular::after {
    content: none !important;
  }

  /* ---------- Step 3: Hide group labels on mobile (cut per Elon) ---------- */
  body.home-page .grade-group-label {
    display: none !important;
  }

  /* ---------- Step 4: Cut ghost numerals — text-only cards ---------- */
  body.home-page .grade-card .grade-card-icon {
    display: none !important;
  }
  body.home-page .grade-card {
    display: flex !important;
    align-items: center !important;
    grid-template-columns: none !important;
    grid-template-areas: none !important;
  }

  /* ---------- Step 5: Hide old mobile-grade-intro; show new mobile-hero ---------- */
  body.home-page .mobile-grade-intro {
    display: none !important;
  }

  body.home-page .mobile-hero {
    display: block;
    text-align: left;
    padding: 32px 20px 24px;
    position: relative;
  }

  body.home-page .mobile-hero-star {
    display: inline-block;
    width: 36px;
    height: 36px;
    color: #fbbf24;
    margin: 0 0 16px 0;
    filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.4));
    animation: hero-star-breathe 4s ease-in-out infinite;
    transform-origin: center;
    -webkit-tap-highlight-color: transparent;
  }
  body.home-page .mobile-hero-star svg {
    display: block;
  }
  @keyframes hero-star-breathe {
    0%, 100% {
      transform: scale(1) rotate(0deg);
      filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.4));
    }
    50% {
      transform: scale(1.06) rotate(-2deg);
      filter: drop-shadow(0 0 18px rgba(251, 191, 36, 0.6));
    }
  }
  body.home-page .mobile-hero-star.is-celebrating {
    animation: hero-star-wiggle 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  @keyframes hero-star-wiggle {
    0% { transform: scale(1) rotate(0); }
    25% { transform: scale(1.2) rotate(-15deg); }
    50% { transform: scale(1.15) rotate(12deg); }
    75% { transform: scale(1.18) rotate(-6deg); }
    100% { transform: scale(1) rotate(0); }
  }

  /* Headline — period dropped, gold first line */
  body.home-page .mobile-hero-headline {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 38px;
    font-weight: 400;
    line-height: 1.02;
    letter-spacing: -0.025em;
    color: #ffffff;
    margin: 0 0 10px 0;
  }
  body.home-page .mobile-hero-headline .mobile-hero-line1 {
    color: #fbbf24;
  }
  body.home-page .mobile-hero-subhead {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.55);
    margin: 0;
    letter-spacing: -0.005em;
  }

  /* ---------- Step 6: Tab bar — 3 tabs distribution ---------- */
  .mobile-tabbar {
    justify-content: space-around !important;
    padding: 6px 24px calc(6px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .mobile-tabbar .mobile-tab:not(.mobile-tab--center) {
    flex: 1;
    max-width: 96px;
  }
  .mobile-tabbar .mobile-tab--center {
    flex: 0 0 auto;
    min-width: 80px;
  }

  /* ---------- Step 7: Profile sheet — Toy Marketplace featured row ---------- */
  .profile-sheet-row--featured {
    background: linear-gradient(180deg,
      rgba(251, 191, 36, 0.08) 0%,
      rgba(251, 191, 36, 0.02) 100%) !important;
    border-color: rgba(251, 191, 36, 0.2) !important;
  }
  .profile-sheet-row--featured .profile-sheet-row-icon {
    color: #fbbf24 !important;
  }
  .profile-sheet-row--featured .profile-sheet-row-text {
    color: #ffffff !important;
    font-weight: 600;
  }
  .profile-sheet-row-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .profile-sheet-row-meta {
    font-size: 11px;
    font-weight: 400;
    color: rgba(251, 191, 36, 0.75);
  }
}

@media (max-width: 380px) {
  body.home-page .mobile-hero-headline {
    font-size: 34px;
  }
}

/* ============================================================
   PROMPT 34 — Parent layer (below grade list)
   Mobile-first; desktop refinement at 769+.
   ============================================================ */

.parent-layer {
  padding: 64px 20px;
  max-width: 720px;
  margin: 0 auto;
  position: relative;
}

.parent-layer + .parent-layer {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.parent-eyebrow {
  display: inline-block;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(251, 191, 36, 0.8);
  margin: 0 0 12px 0;
}

.parent-h2 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 36px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: 0 0 12px 0;
}

.parent-h2-sub {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
  max-width: 480px;
}

.parent-layer-head {
  margin-bottom: 28px;
}

/* HOW IT WORKS */
.how-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.how-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: start;
  padding: 20px 18px;
  background: linear-gradient(180deg,
    rgba(40, 53, 91, 0.4) 0%,
    rgba(20, 29, 51, 0.4) 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.how-step-num {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 22px;
  font-weight: 400;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 10px;
  flex-shrink: 0;
}

.how-step-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.how-step-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.01em;
}

.how-step-text {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

/* TOY SHOWCASE */
.toy-showcase {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.toy-showcase-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.toy-showcase-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.toy-showcase-label {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  padding: 4px 10px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  background: rgba(6, 13, 31, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 999px;
  text-align: center;
  letter-spacing: -0.005em;
}

/* TRUST LIST */
.trust-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.trust-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  padding: 4px 0;
}

.trust-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  flex-shrink: 0;
}

.trust-text {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: -0.005em;
  padding-top: 4px;
}

/* PARENT QUOTE */
.parent-layer--quote {
  text-align: center;
  padding: 56px 24px;
}

.parent-quote {
  margin: 0;
  padding: 0;
  position: relative;
}

.parent-quote::before {
  content: '"';
  display: block;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 80px;
  line-height: 0.8;
  color: rgba(251, 191, 36, 0.25);
  margin-bottom: 8px;
}

.parent-quote-text {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: rgba(255, 255, 255, 0.92);
  max-width: 480px;
  margin: 0 auto 18px auto;
}

.parent-quote-attr {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  font-family: 'Inter', system-ui, sans-serif;
}

.parent-quote-name {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
}

.parent-quote-meta {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

/* PRICING + FOUNDER NOTE */
.founder-note {
  margin-top: 28px;
  padding: 22px 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
}

.founder-note-text {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.75);
  margin: 0 0 8px 0;
  letter-spacing: -0.005em;
}

.founder-note-sig {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: rgba(251, 191, 36, 0.8);
  margin: 0;
}

@media (max-width: 768px) {
  .parent-layer {
    padding: 48px 18px;
    max-width: 100%;
  }
  .parent-h2 { font-size: 28px; }
  .parent-h2-sub { font-size: 14px; }
  .how-step { padding: 16px; gap: 14px; }
  .how-step-num { width: 32px; height: 32px; font-size: 18px; }
  .how-step-title { font-size: 15px; }
  .how-step-text { font-size: 13px; }
  .parent-quote-text { font-size: 19px; }
  .parent-quote::before { font-size: 60px; }
  .trust-text { font-size: 14px; }
}

@media (max-width: 380px) {
  .parent-h2 { font-size: 26px; }
  .parent-quote-text { font-size: 17px; }
}

@media (min-width: 769px) {
  .parent-layer { padding: 96px 32px; max-width: 960px; }
  .parent-h2 { font-size: 48px; }
  .parent-h2-sub { font-size: 17px; }
  .how-steps { flex-direction: row; gap: 16px; }
  .how-step { flex: 1; flex-direction: column; gap: 16px; display: flex; }
  .how-step-num { width: 44px; height: 44px; font-size: 26px; }
  .toy-showcase { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .trust-list { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
  .parent-quote-text { font-size: 28px; }
  .parent-quote::before { font-size: 100px; }
}

/* ============================================================
   PROMPT 35 — Parent layer bug fixes + polish (overrides)
   Appended last so it wins cascade. No new strategic rules.
   ============================================================ */

/* ---------- Quote section: hard containment ---------- */
.parent-layer--quote {
  text-align: center;
  padding: 56px 24px;
  overflow: hidden;
  isolation: isolate;
}

.parent-quote-wrap {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.parent-quote-mark {
  display: block;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 80px;
  line-height: 0.6;
  font-weight: 400;
  color: rgba(251, 191, 36, 0.3);
  margin: 0 0 4px 0;
  user-select: none;
}

/* Replace the old ::before quote glyph (no longer needed) */
.parent-quote::before { content: none !important; }

.parent-quote-text {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 22px;
  font-weight: 400;
  font-style: italic;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: rgba(255, 255, 255, 0.92);
  margin: 0 0 20px 0;
  max-width: none;
}

.parent-quote-attr {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  font-family: 'Inter', system-ui, sans-serif;
}

.parent-quote-name {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: -0.005em;
}

.parent-quote-name::before {
  content: '— ';
  color: rgba(255, 255, 255, 0.4);
}

.parent-quote-meta {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: -0.005em;
}

/* ---------- Toy showcase: background-image cropping ---------- */
.toy-showcase-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  line-height: 1;
}
.toy-showcase-image--lego   { background: radial-gradient(circle at 30% 30%, #fde047 0%, #f59e0b 55%, #b45309 100%); }
.toy-showcase-image--camera { background: radial-gradient(circle at 30% 30%, #60a5fa 0%, #2563eb 55%, #1e3a8a 100%); }
.toy-showcase-image--watch  { background: radial-gradient(circle at 30% 30%, #c4b5fd 0%, #7c3aed 55%, #4c1d95 100%); }
.toy-showcase-image--roblox { background: radial-gradient(circle at 30% 30%, #fca5a5 0%, #ef4444 55%, #7f1d1d 100%); }

.toy-showcase-label {
  bottom: 10px;
  left: 10px;
  right: 10px;
  padding: 5px 12px;
  background: rgba(6, 13, 31, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Quote responsive sizing */
@media (max-width: 768px) {
  .parent-layer--quote { padding: 48px 24px; }
  .parent-quote-mark { font-size: 60px; }
  .parent-quote-text { font-size: 19px; }

  /* ---------- Footer clears the bottom tab bar ---------- */
  body.home-page footer,
  body.home-page .footer {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* ---------- Tighter grade cards (~56px tall) ---------- */
  body.home-page .grade-card {
    padding: 12px 18px !important;
  }
  body.home-page .grade-card .grade-card-title,
  body.home-page .grade-card .grade-title,
  body.home-page .grade-card h3 {
    font-size: 15px;
    line-height: 1.15;
  }

  /* ---------- Star breathe animation safety net ---------- */
  body.home-page .mobile-hero-star {
    animation: hero-star-breathe 4s ease-in-out infinite !important;
  }
}

@media (max-width: 380px) {
  .parent-quote-text { font-size: 17px; }
}

@media (min-width: 769px) {
  .parent-quote-mark { font-size: 100px; }
  .parent-quote-text { font-size: 28px; }
}

/* ============================================================
   STATE PICKER — landing page primary CTA (Prompt 36b)
   Both mobile and desktop, with shared base styles.
   ============================================================ */

.state-picker-section {
  padding: 48px 32px 64px;
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
}

.state-picker-head {
  text-align: left;
  margin-bottom: 32px;
}

.state-picker-eyebrow {
  display: inline-block;
  font-family: 'Inter';
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(251, 191, 36, 0.85);
  margin: 0 0 14px 0;
}

.state-picker-title {
  font-family: 'Instrument Serif', serif;
  font-size: 48px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: #ffffff;
  margin: 0 0 12px 0;
}

.state-picker-sub {
  font-family: 'Inter';
  font-size: 16px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
  max-width: 540px;
}

.state-picker-detecting {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  margin-bottom: 16px;
  font-family: 'Inter';
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}

.state-picker-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(251, 191, 36, 0.2);
  border-top-color: #fbbf24;
  border-radius: 50%;
  animation: state-picker-spin 0.7s linear infinite;
}

@keyframes state-picker-spin {
  to { transform: rotate(360deg); }
}

.state-picker-detected {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  margin-bottom: 28px;
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.1) 0%, rgba(251, 191, 36, 0.04) 100%);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 16px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.state-picker-detected[data-shown="true"] {
  opacity: 1;
  transform: translateY(0);
}

.state-picker-detected-pin {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 10px;
  color: #fbbf24;
  flex-shrink: 0;
}

.state-picker-detected-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.state-picker-detected-label {
  font-family: 'Inter';
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 400;
}

.state-picker-detected-name {
  font-family: 'Inter';
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.state-picker-detected-go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  font-family: 'Inter';
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: #0a1628;
  text-decoration: none;
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  border: 1px solid rgba(251, 191, 36, 0.5);
  border-radius: 999px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4) inset,
    0 4px 8px -2px rgba(251, 191, 36, 0.4);
  transition: transform 0.15s ease;
}

.state-picker-detected-go:active {
  transform: scale(0.97);
}

.state-picker-trigger {
  display: none;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  font-family: 'Inter';
  text-align: left;
  background: linear-gradient(180deg, rgba(40, 53, 91, 0.5) 0%, rgba(20, 29, 51, 0.5) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.2s ease;
}

.state-picker-trigger:active {
  transform: scale(0.99);
  background: linear-gradient(180deg, rgba(50, 63, 101, 0.6) 0%, rgba(30, 39, 61, 0.6) 100%);
}

.state-picker-trigger-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.state-picker-trigger-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 2px;
}

.state-picker-trigger-value {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
}

.state-picker-trigger-chevron {
  color: rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  margin-left: auto;
}

.state-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.state-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(40, 53, 91, 0.4) 0%, rgba(20, 29, 51, 0.4) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  font-family: 'Inter';
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .state-tile:hover {
    transform: translateY(-2px);
    background: linear-gradient(180deg, rgba(50, 63, 101, 0.5) 0%, rgba(30, 39, 61, 0.5) 100%);
    border-color: rgba(251, 191, 36, 0.3);
  }
}

.state-tile:active {
  transform: scale(0.98);
}

.state-tile--home {
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.08) 0%, rgba(251, 191, 36, 0.02) 100%);
  border-color: rgba(251, 191, 36, 0.25);
}

.state-tile-abbr {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Instrument Serif', serif;
  font-size: 18px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  flex-shrink: 0;
}

.state-tile--home .state-tile-abbr {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.3);
}

.state-tile-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.state-tile-name {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.state-tile-test {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
}

.state-sheet-scrim {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(6, 13, 31, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.state-sheet-scrim[data-open="true"] {
  opacity: 1;
}

.state-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 96;
  max-height: 85vh;
  max-height: 85dvh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(26, 37, 64, 0.98) 0%, rgba(15, 22, 41, 0.98) 100%);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: none;
  border-radius: 24px 24px 0 0;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 -16px 48px -12px rgba(0, 0, 0, 0.5);
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}

.state-sheet[data-open="true"] {
  transform: translateY(0);
}

.state-sheet-handle {
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  margin: 8px auto;
  flex-shrink: 0;
}

.state-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 20px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.state-sheet-title {
  font-family: 'Instrument Serif', serif;
  font-size: 22px;
  font-weight: 400;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.015em;
}

.state-sheet-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.state-sheet-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.state-sheet-search svg {
  color: rgba(255, 255, 255, 0.4);
}

.state-sheet-search input {
  flex: 1;
  border: none;
  background: transparent;
  color: #ffffff;
  font-family: 'Inter';
  font-size: 16px;
  outline: none;
  padding: 4px 0;
}

.state-sheet-search input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.state-sheet-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  list-style: none;
  margin: 0;
  padding: 8px 12px calc(20px + env(safe-area-inset-bottom, 0px));
}

.state-sheet-empty {
  padding: 32px 20px;
  text-align: center;
  font-family: 'Inter';
  font-size: 14px;
  color: rgba(255, 255, 255, 0.4);
}

.state-sheet-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 14px;
  background: transparent;
  border: none;
  border-radius: 12px;
  text-align: left;
  font-family: 'Inter';
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease;
}

.state-sheet-item:active {
  background: rgba(255, 255, 255, 0.06);
}

.state-sheet-item-abbr {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Instrument Serif', serif;
  font-size: 17px;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  flex-shrink: 0;
}

.state-sheet-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.state-sheet-item-name {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.005em;
}

.state-sheet-item-test {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.state-sheet-item-chevron {
  color: rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .state-picker-section {
    padding: 28px 18px 36px;
  }
  .state-picker-title {
    font-size: 30px;
  }
  .state-picker-sub {
    font-size: 14px;
  }
  .state-picker-detected {
    padding: 14px 16px;
    gap: 10px;
  }
  .state-picker-detected-pin {
    width: 32px;
    height: 32px;
  }
  .state-picker-detected-name {
    font-size: 14px;
  }
  .state-picker-detected-go {
    padding: 8px 14px;
    font-size: 12px;
  }
  .state-picker-trigger {
    display: flex;
  }
  .state-picker-grid {
    display: none;
  }
}

@media (max-width: 380px) {
  .state-picker-title {
    font-size: 26px;
  }
  .state-picker-detected {
    flex-wrap: wrap;
  }
  .state-picker-detected-go {
    flex-basis: 100%;
    justify-content: center;
    margin-top: 6px;
  }
}

@media (min-width: 769px) {
  .state-sheet,
  .state-sheet-scrim,
  .state-picker-trigger {
    display: none !important;
  }
}

/* ============================================================
   STATE PAGE — /states/?s=<slug>
   Mobile + desktop, single page handles all 51 states.
   ============================================================ */

body.state-page {
  min-height: 100vh;
  min-height: 100dvh;
  background: #060d1f;
  color: rgba(255, 255, 255, 0.92);
  position: relative;
  overflow-x: hidden;
}

body.state-page::before {
  content: '';
  position: fixed;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.05) 0%, transparent 60%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

body.state-page::after {
  content: '';
  position: fixed;
  bottom: -200px;
  left: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.05) 0%, transparent 60%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

body.state-page > * {
  position: relative;
  z-index: 1;
}

.breadcrumb-nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 40px 0;
}

.breadcrumb {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter';
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}

.breadcrumb-item a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  letter-spacing: -0.005em;
  transition: color 0.15s ease;
}

.breadcrumb-item a:hover {
  color: #fbbf24;
}

.breadcrumb-item--current {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

.breadcrumb-item:not(:last-child)::after {
  content: '/';
  margin-left: 8px;
  color: rgba(255, 255, 255, 0.2);
}

.state-page-loading {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: 'Inter';
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
}
/* The HTML [hidden] attribute must beat the display: flex above. */
.state-page-loading[hidden] { display: none !important; }

.state-loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(251, 191, 36, 0.2);
  border-top-color: #fbbf24;
  border-radius: 50%;
  animation: state-picker-spin 0.7s linear infinite;
}

.state-page-error {
  max-width: 480px;
  margin: 80px auto;
  padding: 48px 32px;
  text-align: center;
}

.state-error-icon {
  display: inline-flex;
  margin-bottom: 16px;
  color: rgba(251, 191, 36, 0.7);
}

.state-error-title {
  font-family: 'Instrument Serif', serif;
  font-size: 32px;
  font-weight: 400;
  color: #ffffff;
  margin: 0 0 10px 0;
}

.state-error-text {
  font-family: 'Inter';
  font-size: 15px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 0 24px 0;
}

.state-error-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  font-family: 'Inter';
  font-size: 15px;
  font-weight: 600;
  color: #0a1628;
  text-decoration: none;
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  border: 1px solid rgba(251, 191, 36, 0.5);
  border-radius: 12px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4) inset,
    0 4px 12px -2px rgba(251, 191, 36, 0.4);
  transition: transform 0.15s ease;
}

.state-error-cta:active {
  transform: scale(0.97);
}

.state-content {
  max-width: 1100px;
  margin: 0 auto;
  padding-top: 32px;
}

.state-hero {
  padding: 4px 32px 16px;
}

.state-hero-inner {
  max-width: 760px;
}

.state-hero-title {
  font-family: 'Instrument Serif', serif;
  font-size: 45px;
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: #ffffff;
  margin: 0 0 20px 0;
  max-width: 620px;
}

.state-hero-title .hero-test-name {
  color: #fbbf24;
}

.state-hero-title .hero-state-name {
  color: rgba(255, 255, 255, 0.95);
}

.state-hero-sub {
  font-family: 'Inter';
  font-size: 17px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 40px 0;
  max-width: 600px;
}

.state-fold {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 72px;
  padding: 0 40px;
  align-items: stretch;
}

.state-fold > .state-hero,
.state-fold > .state-grade-section {
  padding-left: 0;
  padding-right: 0;
  max-width: none;
}

.state-hero-meta {
  margin-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 20px;
  max-width: 620px;
}

.state-hero-meta-list {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 16px 48px;
  align-items: baseline;
}

.state-hero-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.state-hero-meta-label {
  font-family: 'Inter';
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  margin: 0;
}

.state-hero-meta-value {
  font-family: 'Inter';
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: -0.005em;
  margin: 0;
}

.state-hero-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 18px;
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 12px;
  font-family: 'Inter';
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
}

.state-hero-note-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: -2px;
}

.state-grade-section {
  padding: 8px 32px 48px;
}

.state-grade-head {
  margin-bottom: 24px;
}

.state-grade-title {
  font-family: 'Instrument Serif', serif;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: 0 0 10px 0;
}

.state-grade-sub {
  font-family: 'Inter';
  font-size: 15px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

.state-grade-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.state-grade-grid > .state-grade-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.state-grade-card {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 64px;
  padding: 18px 22px 18px 24px;
  background: linear-gradient(180deg,
    rgba(40, 53, 91, 0.5) 0%,
    rgba(20, 29, 51, 0.5) 100%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  text-decoration: none;
  font-family: 'Inter';
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

@media (hover: hover) {
  .state-grade-card:hover {
    transform: translateY(-2px);
    background: linear-gradient(180deg,
      rgba(50, 63, 101, 0.6) 0%,
      rgba(30, 39, 61, 0.6) 100%);
    border-color: rgba(251, 191, 36, 0.3);
  }
}

.state-grade-card:active {
  transform: scale(0.98);
}

.state-grade-card-name {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.005em;
}

.state-trust-section {
  padding: 64px 40px 56px;
  margin-top: 48px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.state-trust-head {
  margin-bottom: 28px;
}

.state-trust-eyebrow {
  display: inline-block;
  font-family: 'Inter';
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(251, 191, 36, 0.85);
  margin: 0 0 12px 0;
}

.state-trust-title {
  font-family: 'Instrument Serif', serif;
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: 0;
}

.state-trust-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.state-trust-card {
  padding: 22px;
  background: linear-gradient(180deg,
    rgba(40, 53, 91, 0.4) 0%,
    rgba(20, 29, 51, 0.4) 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.state-trust-card-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 10px;
  color: #fbbf24;
  margin-bottom: 14px;
}

.state-trust-card-title {
  font-family: 'Inter';
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 6px 0;
  letter-spacing: -0.005em;
}

.state-trust-card-text {
  font-family: 'Inter';
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

.state-trust-card-text a {
  color: rgba(251, 191, 36, 0.85);
  text-decoration: none;
  font-weight: 500;
}

.state-trust-card-text a:hover {
  color: #fbbf24;
}

.state-cta-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 32px;
  margin: 32px 32px 48px;
  background: linear-gradient(180deg,
    rgba(251, 191, 36, 0.08) 0%,
    rgba(251, 191, 36, 0.02) 100%);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 16px;
}

.state-cta-strip-text {
  font-family: 'Inter';
  font-size: 15px;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
}

.state-cta-strip-text strong {
  color: #fbbf24;
  font-weight: 600;
}

.state-cta-strip-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  font-family: 'Inter';
  font-size: 14px;
  font-weight: 600;
  color: #0a1628;
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  border: 1px solid rgba(251, 191, 36, 0.5);
  border-radius: 999px;
  cursor: pointer;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4) inset,
    0 4px 12px -2px rgba(251, 191, 36, 0.4);
  transition: transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.state-cta-strip-btn:active {
  transform: scale(0.97);
}

@media (min-width: 769px) {
  .state-fold > .state-hero {
    display: flex;
    flex-direction: column;
    height: 100%;
  }
  .state-fold > .state-hero > .state-hero-inner {
    display: flex;
    flex-direction: column;
    flex: 1;
  }
  .state-fold > .state-hero .state-hero-meta {
    margin-top: auto;
    padding-top: 32px;
  }
}

@media (max-width: 768px) {
  .breadcrumb-nav { padding: 24px 20px 0; }
  .state-content { padding-top: 20px; }
  .state-hero { padding: 20px 20px 32px; }
  .state-hero-title { font-size: 29px; max-width: 100%; }
  .state-hero-meta { max-width: 100%; }
  .state-hero-sub { font-size: 15px; margin-bottom: 28px; }
  .state-fold {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 0 20px;
  }
  .state-hero-meta {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 16px;
  }
  .state-hero-meta-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px 32px;
  }
  .state-hero-meta-label { font-size: 10px; }
  .state-hero-meta-value { font-size: 14px; }
  .state-grade-section { padding: 8px 20px 32px; }
  .state-grade-title { font-size: 22px; }
  .state-grade-sub { font-size: 14px; }
  .state-grade-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .state-grade-card { padding: 16px 20px 16px 22px; min-height: 60px; }
  .state-grade-card-name { font-size: 15px; }
  .state-trust-section { padding: 32px 20px; margin-top: 32px; }
  .state-trust-title { font-size: 26px; }
  .state-trust-grid { grid-template-columns: 1fr; gap: 10px; }
  .state-trust-card { padding: 18px; }
  .state-cta-strip {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 20px;
    margin: 24px 20px 32px;
    text-align: center;
  }
  .state-cta-strip-btn { justify-content: center; }
  body.state-page {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 380px) {
  .state-hero-title { font-size: 26px; }
  .state-grade-title { font-size: 20px; }
}

@media (min-width: 1024px) {
  .state-fold > .state-hero { padding-top: 8px; padding-bottom: 24px; }
  .state-hero-title { font-size: 45px; }
  .state-hero-sub { font-size: 18px; }
  .state-fold > .state-grade-section { padding-top: 8px; padding-bottom: 16px; }
  .state-trust-section { padding: 80px 40px 72px; margin-top: 64px; }
  .state-trust-title { font-size: 32px; }
  .state-trust-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}

/* ============================================================
   GRADE DETAIL PAGE — grade.html?s=<state>&g=<grade>
   Mobile + desktop. Subject sub-cards.
   ============================================================ */

body.grade-page {
  min-height: 100vh;
  min-height: 100dvh;
  background: #060d1f;
  color: rgba(255, 255, 255, 0.92);
  position: relative;
  overflow-x: hidden;
}

body.grade-page::before {
  content: '';
  position: fixed;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.05) 0%, transparent 60%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

body.grade-page::after {
  content: '';
  position: fixed;
  bottom: -200px;
  left: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.05) 0%, transparent 60%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

body.grade-page > * {
  position: relative;
  z-index: 1;
}

.grade-content {
  max-width: 1100px;
  margin: 0 auto;
}

.grade-hero {
  padding: 32px 32px 40px;
}

.grade-hero-inner {
  max-width: 760px;
}

.grade-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  margin-bottom: 18px;
  font-family: 'Inter';
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(251, 191, 36, 0.95);
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 999px;
}

.grade-hero-pin {
  display: inline-flex;
  color: #fbbf24;
}

.grade-hero-title {
  font-family: 'Instrument Serif', serif;
  font-size: 56px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: #ffffff;
  margin: 0 0 14px 0;
}

.grade-hero-title .grade-hero-grade { color: #ffffff; }
.grade-hero-title .grade-hero-test { color: #fbbf24; }

.grade-hero-sub {
  font-family: 'Inter';
  font-size: 16px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.65);
  margin: 0;
  max-width: 600px;
}

.subject-section {
  padding: 24px 32px 48px;
}

.subject-section-head {
  margin-bottom: 28px;
}

.subject-section-eyebrow {
  display: inline-block;
  font-family: 'Inter';
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(251, 191, 36, 0.85);
  margin: 0 0 12px 0;
}

.subject-section-title {
  font-family: 'Instrument Serif', serif;
  font-size: 40px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: 0 0 8px 0;
}

.subject-section-sub {
  font-family: 'Inter';
  font-size: 15px;
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
}

.subject-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.subject-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  background: linear-gradient(180deg,
    rgba(40, 53, 91, 0.5) 0%,
    rgba(20, 29, 51, 0.5) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  text-decoration: none;
  font-family: 'Inter';
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
}

.subject-card--live {
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.subject-card--live::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(251, 191, 36, 0.06) 0%,
    rgba(251, 191, 36, 0) 70%);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

@media (hover: hover) {
  .subject-card--live:hover {
    transform: translateY(-3px);
    border-color: rgba(251, 191, 36, 0.4);
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.06) inset,
      0 12px 32px -8px rgba(251, 191, 36, 0.3);
  }
  .subject-card--live:hover::before { opacity: 1; }
}

.subject-card--live:active { transform: scale(0.98); }

.subject-card--soon {
  cursor: not-allowed;
  opacity: 0.65;
}

.subject-card--soon .subject-card-icon { filter: grayscale(0.5); }

.subject-card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: var(--subject-color, #fbbf24);
  flex-shrink: 0;
}

.subject-card--live .subject-card-icon {
  background: color-mix(in srgb, var(--subject-color, #fbbf24) 12%, transparent);
  border-color: color-mix(in srgb, var(--subject-color, #fbbf24) 30%, transparent);
}

.subject-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.subject-card-name {
  font-family: 'Instrument Serif', serif;
  font-size: 26px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: 0;
}

.subject-card-tagline {
  font-family: 'Inter';
  font-size: 13px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
  letter-spacing: -0.005em;
}

.subject-card-action {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  color: #fbbf24;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  position: relative;
  z-index: 1;
}

.subject-card-badge {
  flex-shrink: 0;
  padding: 5px 12px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.what-to-expect {
  padding: 48px 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.what-to-expect-head {
  margin-bottom: 28px;
}

.what-to-expect-eyebrow {
  display: inline-block;
  font-family: 'Inter';
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(251, 191, 36, 0.85);
  margin: 0 0 12px 0;
}

.what-to-expect-title {
  font-family: 'Instrument Serif', serif;
  font-size: 36px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: 0;
}

.what-to-expect-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.expect-card {
  padding: 24px;
  background: linear-gradient(180deg,
    rgba(40, 53, 91, 0.4) 0%,
    rgba(20, 29, 51, 0.4) 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.expect-card-num {
  font-family: 'Instrument Serif', serif;
  font-size: 56px;
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: #fbbf24;
  margin-bottom: 14px;
}

.expect-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.expect-card-title {
  font-family: 'Inter';
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.005em;
}

.expect-card-text {
  font-family: 'Inter';
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
}

@media (max-width: 768px) {
  .grade-hero { padding: 20px 16px 28px; }
  .grade-hero-eyebrow { font-size: 11px; padding: 5px 12px; margin-bottom: 14px; flex-wrap: wrap; }
  .grade-hero-title { font-size: 36px; margin-bottom: 12px; }
  .grade-hero-sub { font-size: 14px; }
  .subject-section { padding: 16px 16px 32px; }
  .subject-section-title { font-size: 28px; }
  .subject-section-sub { font-size: 14px; }
  .subject-grid { grid-template-columns: 1fr; gap: 10px; }
  .subject-card { padding: 18px 18px; gap: 14px; }
  .subject-card-icon { width: 40px; height: 40px; }
  .subject-card-name { font-size: 22px; }
  .subject-card-tagline { font-size: 12px; }
  .subject-card-action { font-size: 13px; }
  .subject-card-badge { font-size: 9px; padding: 4px 10px; }
  .what-to-expect { padding: 32px 16px; }
  .what-to-expect-title { font-size: 26px; }
  .what-to-expect-grid { grid-template-columns: 1fr; gap: 10px; }
  .expect-card {
    padding: 20px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;
    align-items: center;
  }
  .expect-card-num { font-size: 44px; margin-bottom: 0; }
  body.grade-page {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 380px) {
  .grade-hero-title { font-size: 30px; }
  .subject-section-title { font-size: 24px; }
  .subject-card { padding: 16px; }
}

@media (min-width: 1024px) {
  .grade-hero { padding: 56px 32px 48px; }
  .grade-hero-title { font-size: 64px; }
  .grade-hero-sub { font-size: 18px; }
  .subject-section { padding: 32px 32px 64px; }
  .subject-section-title { font-size: 44px; }
  .subject-card { padding: 28px 30px; }
  .subject-card-icon { width: 56px; height: 56px; }
  .subject-card-name { font-size: 30px; }
  .what-to-expect { padding: 64px 32px; }
  .what-to-expect-title { font-size: 44px; }
}

/* ============================================================
   PRACTICE PAGE HEADER PILLS — state + grade + subject context
   ============================================================ */

.practice-context-bar {
  margin: 0 0 8px 0;
}

.practice-breadcrumb {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  flex-wrap: wrap;
}

.practice-breadcrumb-back {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  flex-shrink: 0;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .practice-breadcrumb-back:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.15);
  }
}

.practice-breadcrumb-back:active { transform: scale(0.94); }

.practice-breadcrumb-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.practice-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-family: 'Inter';
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.005em;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.85);
}

.practice-pill--state {
  background: linear-gradient(180deg,
    rgba(251, 191, 36, 0.10) 0%,
    rgba(251, 191, 36, 0.04) 100%);
  border-color: rgba(251, 191, 36, 0.25);
  color: rgba(251, 191, 36, 0.95);
  padding: 6px 8px 6px 12px;
}

.practice-pill-state-abbr {
  font-family: 'Instrument Serif', serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: #fbbf24;
}

.practice-pill-state-test {
  padding: 2px 8px;
  background: rgba(251, 191, 36, 0.15);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fbbf24;
}

.practice-pill--grade { color: rgba(255, 255, 255, 0.85); }

.practice-pill--subject {
  color: rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.02);
}

@media (max-width: 768px) {
  .practice-breadcrumb { padding: 12px 0; gap: 10px; }
  .practice-breadcrumb-back { width: 32px; height: 32px; }
  .practice-pill { font-size: 11px; padding: 5px 10px; }
  .practice-pill-state-abbr { font-size: 13px; }
  .practice-pill-state-test { font-size: 9px; padding: 2px 6px; }
}

@media (max-width: 380px) {
  .practice-breadcrumb-pills { gap: 4px; }
  .practice-pill { font-size: 10px; padding: 4px 8px; }
}

/* ============================================================
   STATE-AWARE LOGGED-IN DASHBOARD
   ============================================================ */

.state-dashboard {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 32px 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.state-dashboard-welcome {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 8px;
}

.state-dashboard-welcome-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.state-dashboard-greeting {
  font-family: 'Inter';
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: -0.005em;
}

.state-dashboard-name {
  font-family: 'Instrument Serif', serif;
  font-size: 44px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: #ffffff;
  margin: 0;
}

.state-dashboard-streak {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(180deg,
    rgba(251, 191, 36, 0.12) 0%,
    rgba(251, 191, 36, 0.04) 100%);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 999px;
  font-family: 'Inter';
}

.state-dashboard-streak-icon { font-size: 14px; }
.state-dashboard-streak-count {
  font-family: 'Instrument Serif', serif;
  font-size: 20px;
  font-weight: 400;
  color: #fbbf24;
  letter-spacing: -0.02em;
}
.state-dashboard-streak-label {
  font-size: 12px;
  font-weight: 500;
  color: rgba(251, 191, 36, 0.85);
  letter-spacing: -0.005em;
}

/* TEST COUNTDOWN */
.test-countdown {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  background: linear-gradient(180deg,
    rgba(251, 191, 36, 0.06) 0%,
    rgba(251, 191, 36, 0.02) 100%);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 14px;
}

.test-countdown[data-urgency="urgent"] {
  background: linear-gradient(180deg,
    rgba(251, 191, 36, 0.12) 0%,
    rgba(251, 191, 36, 0.04) 100%);
  border-color: rgba(251, 191, 36, 0.35);
}

.test-countdown[data-urgency="very-urgent"] {
  background: linear-gradient(180deg,
    rgba(239, 68, 68, 0.10) 0%,
    rgba(239, 68, 68, 0.03) 100%);
  border-color: rgba(239, 68, 68, 0.30);
}

.test-countdown[data-urgency="far"] {
  background: linear-gradient(180deg,
    rgba(99, 102, 241, 0.06) 0%,
    rgba(99, 102, 241, 0.02) 100%);
  border-color: rgba(99, 102, 241, 0.20);
}

.test-countdown-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.30);
  border-radius: 10px;
  color: #fbbf24;
  flex-shrink: 0;
}
.test-countdown[data-urgency="very-urgent"] .test-countdown-icon {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.30);
  color: #f87171;
}
.test-countdown[data-urgency="far"] .test-countdown-icon {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.30);
  color: #818cf8;
}

.test-countdown-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.test-countdown-eyebrow {
  font-family: 'Inter';
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(251, 191, 36, 0.85);
}
.test-countdown[data-urgency="very-urgent"] .test-countdown-eyebrow { color: rgba(248, 113, 113, 0.95); }
.test-countdown[data-urgency="far"] .test-countdown-eyebrow { color: rgba(165, 180, 252, 0.85); }

.test-countdown-message {
  font-family: 'Inter';
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: -0.005em;
}

.test-countdown-days {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  margin-left: auto;
}
.test-countdown-days-num {
  font-family: 'Instrument Serif', serif;
  font-size: 38px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.03em;
  color: #fbbf24;
}
.test-countdown[data-urgency="very-urgent"] .test-countdown-days-num { color: #f87171; }
.test-countdown[data-urgency="far"] .test-countdown-days-num { color: #818cf8; }
.test-countdown-days-label {
  font-family: 'Inter';
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
}

/* CONTINUE PRACTICING CARD */
.continue-card {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  padding: 32px;
  background: linear-gradient(135deg,
    rgba(251, 191, 36, 0.10) 0%,
    rgba(40, 53, 91, 0.50) 60%);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 20px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 16px 48px -12px rgba(251, 191, 36, 0.20);
  position: relative;
  overflow: hidden;
}
.continue-card::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.15) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}
.continue-card-content { position: relative; z-index: 1; }
.continue-card-eyebrow {
  display: inline-block;
  font-family: 'Inter';
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(251, 191, 36, 0.95);
  margin: 0 0 10px 0;
}
.continue-card-title {
  font-family: 'Instrument Serif', serif;
  font-size: 36px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: #ffffff;
  margin: 0 0 8px 0;
}
.continue-card-sub {
  font-family: 'Inter';
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.65);
  margin: 0 0 20px 0;
  max-width: 460px;
}
.continue-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  font-family: 'Inter';
  font-size: 15px;
  font-weight: 700;
  color: #0a1628;
  text-decoration: none;
  letter-spacing: -0.005em;
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  border: 1px solid rgba(251, 191, 36, 0.5);
  border-radius: 12px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4) inset,
    0 8px 20px -4px rgba(251, 191, 36, 0.5);
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  .continue-card-cta:hover {
    transform: translateY(-2px);
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.5) inset,
      0 12px 28px -4px rgba(251, 191, 36, 0.6);
  }
}
.continue-card-cta:active { transform: scale(0.98); }
.continue-card-cta-icon { display: inline-flex; align-items: center; justify-content: center; }

.continue-card-context {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  position: relative;
  z-index: 1;
}
.continue-context-item { display: flex; flex-direction: column; gap: 2px; }
.continue-context-label {
  font-family: 'Inter';
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}
.continue-context-value {
  font-family: 'Inter';
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.005em;
}

/* STATS GRID */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.stat-tile {
  padding: 18px 20px;
  background: linear-gradient(180deg,
    rgba(40, 53, 91, 0.4) 0%,
    rgba(20, 29, 51, 0.4) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}
.stat-tile--gold {
  background: linear-gradient(180deg,
    rgba(251, 191, 36, 0.06) 0%,
    rgba(40, 53, 91, 0.4) 100%);
  border-color: rgba(251, 191, 36, 0.20);
}
.stat-tile-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.6);
}
.stat-tile--gold .stat-tile-icon {
  background: rgba(251, 191, 36, 0.10);
  border-color: rgba(251, 191, 36, 0.25);
  color: #fbbf24;
}
.stat-tile-value {
  font-family: 'Instrument Serif', serif;
  font-size: 32px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.025em;
  color: #ffffff;
}
.stat-tile--gold .stat-tile-value { color: #fbbf24; }
.stat-tile-label {
  font-family: 'Inter';
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: -0.005em;
}

/* PRACTICE AHEAD */
.dashboard-grades { margin-top: 8px; }
.dashboard-grades-head { margin-bottom: 14px; }
.dashboard-grades-title {
  font-family: 'Instrument Serif', serif;
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: 0 0 4px 0;
}
.dashboard-grades-sub {
  font-family: 'Inter';
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
}
.dashboard-grades-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}
.dashboard-grade-quick {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  font-family: 'Inter';
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  letter-spacing: -0.005em;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  .dashboard-grade-quick:hover {
    background: rgba(251, 191, 36, 0.08);
    border-color: rgba(251, 191, 36, 0.25);
    color: #fbbf24;
    transform: translateX(2px);
  }
}
.dashboard-grade-quick svg { color: rgba(255, 255, 255, 0.3); }

/* MOBILE */
@media (max-width: 768px) {
  .state-dashboard { padding: 18px 16px 32px; gap: 14px; }
  .state-dashboard-welcome { flex-direction: column; align-items: flex-start; gap: 10px; }
  .state-dashboard-name { font-size: 32px; }
  .state-dashboard-streak { padding: 8px 14px; }
  .test-countdown { padding: 14px 16px; gap: 12px; }
  .test-countdown-icon { width: 36px; height: 36px; }
  .test-countdown-message { font-size: 13px; }
  .test-countdown-days-num { font-size: 28px; }
  .continue-card { grid-template-columns: 1fr; gap: 16px; padding: 20px; }
  .continue-card-title { font-size: 26px; }
  .continue-card-sub { font-size: 13px; margin-bottom: 16px; }
  .continue-card-cta { width: 100%; justify-content: center; padding: 14px 20px; }
  .continue-card-context {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px;
  }
  .continue-context-item { flex: 1; min-width: 80px; }
  .continue-context-label { font-size: 9px; }
  .continue-context-value { font-size: 13px; }
  .dashboard-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-tile { padding: 14px; }
  .stat-tile-value { font-size: 26px; }
  .dashboard-grades-list { grid-template-columns: 1fr 1fr; }
  body.state-dashboard-active {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 380px) {
  .state-dashboard-name { font-size: 28px; }
  .continue-card-title { font-size: 22px; }
  .test-countdown { flex-wrap: wrap; }
  .test-countdown-days {
    margin-left: 0;
    flex-direction: row;
    gap: 6px;
    align-items: baseline;
  }
}

/* ============================================================
   ADMIN — STATES TAB + USERS STATE FILTER
   ============================================================ */

body.admin-page .admin-filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

body.admin-page .admin-filter-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 7px 32px 7px 14px;
  font-family: 'Inter';
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  background-color: rgba(255, 255, 255, 0.04);
  background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="rgba(255,255,255,0.5)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3E%3Cpolyline points="6 9 12 15 18 9"/%3E%3C/svg%3E');
  background-repeat: no-repeat;
  background-position: right 10px center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  cursor: pointer;
  outline: none;
}
body.admin-page .admin-filter-select:hover {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}
body.admin-page .admin-filter-select:focus {
  border-color: rgba(251, 191, 36, 0.4);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.1);
}

/* States table column sizing */
body.admin-page .admin-table-wrap { width: 100%; }
body.admin-page .admin-table--states {
  width: 100%;
  border-collapse: collapse;
}
body.admin-page .admin-table--states th,
body.admin-page .admin-table--states td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
body.admin-page .admin-table--states thead th {
  font-family: 'Inter';
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.02);
}
body.admin-page .admin-table--states th:nth-child(3),
body.admin-page .admin-table--states td:nth-child(3) { width: 80px; text-align: right; }
body.admin-page .admin-table--states th:nth-child(4),
body.admin-page .admin-table--states td:nth-child(4) { width: 220px; }
body.admin-page .admin-table--states th:nth-child(5),
body.admin-page .admin-table--states td:nth-child(5) { width: 100px; text-align: right; }
body.admin-page .admin-table--states th:nth-child(6),
body.admin-page .admin-table--states td:nth-child(6) { width: 130px; text-align: right; }
body.admin-page .admin-table--states tbody tr {
  cursor: pointer;
  transition: background 0.15s ease;
}
body.admin-page .admin-table--states tbody tr:hover td {
  background: rgba(251, 191, 36, 0.04);
}

body.admin-page .admin-state-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}
body.admin-page .admin-state-cell-abbr {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Instrument Serif', serif;
  font-size: 17px;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  flex-shrink: 0;
}
body.admin-page .admin-state-cell-abbr.is-top {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.3);
}
body.admin-page .admin-state-cell-name {
  font-weight: 600;
  color: #ffffff;
  font-family: 'Inter';
  font-size: 14px;
}
body.admin-page .admin-state-cell-rank {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  margin-left: 6px;
  font-family: 'Inter';
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 4px;
}

body.admin-page .admin-test-pill {
  display: inline-flex;
  padding: 3px 10px;
  font-family: 'Inter';
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

body.admin-page .admin-user-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
}

body.admin-page .admin-distribution-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  overflow: hidden;
}
body.admin-page .admin-distribution-bar {
  height: 100%;
  background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%);
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body.admin-page .admin-signups-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: #34d399;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 999px;
}
body.admin-page .admin-zero {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.3);
}
body.admin-page .admin-cents-cell {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: rgba(251, 191, 36, 0.85);
}

/* User table — state mini cell */
body.admin-page .admin-state-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  font-family: 'Inter';
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}
body.admin-page .admin-state-mini--none {
  padding: 4px 10px;
  color: rgba(255, 255, 255, 0.3);
}
body.admin-page .admin-state-mini-abbr {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  font-family: 'Instrument Serif', serif;
  font-size: 12px;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border-radius: 999px;
}

/* Empty state for states tab */
body.admin-page .admin-empty {
  padding: 56px 24px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 14px;
}
body.admin-page .admin-empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
}
body.admin-page .admin-empty-title {
  font-family: 'Instrument Serif', serif;
  font-size: 22px;
  margin: 0 0 6px;
  color: #ffffff;
}
body.admin-page .admin-empty-text {
  font-family: 'Inter';
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
}

@media (max-width: 768px) {
  body.admin-page .admin-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  body.admin-page .admin-table--states { min-width: 720px; }
  body.admin-page .admin-stats { grid-template-columns: 1fr 1fr; }
  body.admin-page .admin-stat-card:first-child { grid-column: span 2; }
  body.admin-page .admin-filter-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  body.admin-page .admin-filter-select { width: 100%; }
  body.admin-page .live-users-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/* ============================================================
   ABOUT PAGE — about.html (state-aware via ?s=<slug>)
   ============================================================ */

body.about-page {
  background: #060d1f;
  color: #e8eaf2;
  position: relative;
  overflow-x: hidden;
}
body.about-page::before {
  content: '';
  position: fixed;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(251,191,36,0.12) 0%, rgba(251,191,36,0) 70%);
  pointer-events: none;
  z-index: 0;
}
body.about-page main { position: relative; z-index: 1; }

/* HERO */
.about-hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 56px 32px 48px;
}
.about-hero-eyebrow {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fbbf24;
  font-weight: 600;
  margin-bottom: 24px;
}
.about-hero-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-size: 72px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 28px;
  color: #fff;
}
.about-hero-state {
  color: #fbbf24;
  font-style: italic;
}
.about-hero-sub {
  font-size: 20px;
  line-height: 1.55;
  color: rgba(232,234,242,0.78);
  max-width: 720px;
  margin: 0;
}
.about-hero-sub em { color: #fbbf24; font-style: italic; }
.about-hero-sub strong { color: #fff; font-weight: 600; }

/* SECTION SHARED */
.about-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 56px 32px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.about-section-head { margin-bottom: 40px; max-width: 760px; }
.about-section-eyebrow {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fbbf24;
  font-weight: 600;
  margin-bottom: 16px;
}
.about-section-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-size: 48px;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 16px;
  color: #fff;
}
.about-section-sub {
  font-size: 17px;
  line-height: 1.6;
  color: rgba(232,234,242,0.72);
  margin: 0;
}

/* FOUNDER CARD */
.about-founder-card {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 48px;
  background: linear-gradient(135deg, rgba(20,28,52,0.85) 0%, rgba(14,20,40,0.7) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  padding: 48px;
}
.about-founder-text p {
  font-size: 17px;
  line-height: 1.65;
  color: rgba(232,234,242,0.82);
  margin: 0 0 20px;
}
.about-founder-text p:last-child { margin-bottom: 0; }
.about-founder-text strong { color: #fff; font-weight: 600; }
.about-founder-eyebrow {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fbbf24;
  font-weight: 600;
  margin-bottom: 12px;
}
.about-founder-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-size: 36px;
  line-height: 1.15;
  margin: 0 0 24px;
  color: #fff;
}
.about-founder-meta {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 32px;
  border: 1px solid rgba(251,191,36,0.25);
  border-radius: 18px;
  background: rgba(251,191,36,0.04);
  align-self: start;
}
.about-founder-stat { display: flex; flex-direction: column; gap: 6px; }
.about-founder-stat-num {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 44px;
  line-height: 1;
  color: #fbbf24;
  font-weight: 400;
}
.about-founder-stat-label {
  font-size: 13px;
  color: rgba(232,234,242,0.7);
  line-height: 1.4;
}

/* STEPS */
.about-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.about-step {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 24px;
  padding: 24px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  transition: border-color 0.2s, background 0.2s;
}
.about-step:hover {
  border-color: rgba(251,191,36,0.25);
  background: rgba(251,191,36,0.03);
}
.about-step-num {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(251,191,36,0.15) 0%, rgba(251,191,36,0.05) 100%);
  border: 1px solid rgba(251,191,36,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 28px;
  color: #fbbf24;
}
.about-step-title {
  font-size: 18px;
  font-weight: 600;
  margin: 4px 0 8px;
  color: #fff;
}
.about-step-text {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(232,234,242,0.75);
  margin: 0;
}
.about-step-text strong { color: #fff; font-weight: 600; }
.about-step-text em { color: #fbbf24; font-style: italic; }

/* STATES PREVIEW (generic path) */
.about-states-preview { text-align: center; }
.about-states-preview-text {
  font-size: 14px;
  color: rgba(232,234,242,0.65);
  margin: 0 0 20px;
}
.about-states-preview-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
}
.about-state-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  font-size: 13px;
  color: #e8eaf2;
}
.about-state-chip-name { font-weight: 600; }
.about-state-chip-count {
  font-size: 11px;
  color: rgba(232,234,242,0.55);
  padding-left: 8px;
  border-left: 1px solid rgba(255,255,255,0.12);
}
.about-states-preview-cta {
  display: inline-block;
  font-size: 15px;
  color: #fbbf24;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid rgba(251,191,36,0.3);
  padding-bottom: 2px;
  transition: border-color 0.2s;
}
.about-states-preview-cta:hover { border-color: #fbbf24; }

/* STATE DETAIL CARD (state path) */
.about-state-detail {
  background: linear-gradient(135deg, rgba(251,191,36,0.06) 0%, rgba(251,191,36,0.02) 100%);
  border: 1px solid rgba(251,191,36,0.2);
  border-radius: 20px;
  padding: 36px;
}
.about-state-detail-header {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 20px;
}
.about-state-detail-pin {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(251,191,36,0.15);
  border: 1px solid rgba(251,191,36,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fbbf24;
}
.about-state-detail-eyebrow {
  display: block;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fbbf24;
  font-weight: 600;
  margin-bottom: 6px;
}
.about-state-detail-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-size: 28px;
  line-height: 1.2;
  margin: 0;
  color: #fff;
}
.about-state-detail-desc {
  font-size: 16px;
  line-height: 1.6;
  color: rgba(232,234,242,0.78);
  margin: 0 0 28px;
}
.about-state-detail-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 24px;
  background: rgba(0,0,0,0.18);
  border-radius: 12px;
  margin-bottom: 28px;
}
.about-state-detail-meta-item { display: flex; flex-direction: column; gap: 6px; }
.about-state-detail-meta-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(232,234,242,0.55);
  font-weight: 600;
}
.about-state-detail-meta-value {
  font-size: 15px;
  color: #fff;
  font-weight: 500;
}
.about-state-detail-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #060d1f;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  transition: transform 0.15s, box-shadow 0.2s;
}
.about-state-detail-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -10px rgba(251,191,36,0.4);
}

/* TESTIMONIAL */
.about-testimonial-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.about-quote {
  position: relative;
  padding: 36px 32px 32px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  margin: 0;
}
.about-quote::before {
  content: '\201C';
  position: absolute;
  top: -8px;
  left: 20px;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 90px;
  line-height: 1;
  color: rgba(251,191,36,0.35);
}
.about-quote p {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 22px;
  line-height: 1.4;
  color: #fff;
  margin: 0 0 18px;
  position: relative;
  z-index: 1;
}
.about-quote footer {
  font-size: 13px;
  color: rgba(232,234,242,0.6);
}
.about-quote cite { font-style: normal; }

/* FAQ */
.about-faq-list { display: flex; flex-direction: column; gap: 10px; }
.about-faq-item {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.2s, background 0.2s;
}
.about-faq-item[open] {
  border-color: rgba(251,191,36,0.25);
  background: rgba(251,191,36,0.03);
}
.about-faq-q {
  list-style: none;
  cursor: pointer;
  padding: 20px 24px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  position: relative;
  padding-right: 56px;
}
.about-faq-q::-webkit-details-marker { display: none; }
.about-faq-q::after {
  content: '+';
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 24px;
  color: #fbbf24;
  font-weight: 300;
  transition: transform 0.2s;
}
.about-faq-item[open] .about-faq-q::after {
  content: '\2013';
}
.about-faq-a {
  padding: 0 24px 22px;
  font-size: 15px;
  line-height: 1.65;
  color: rgba(232,234,242,0.78);
}
.about-faq-a em { color: #fbbf24; font-style: italic; }

/* FINAL CTA */
.about-cta-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 56px 32px 80px;
}
.about-cta-card {
  background: linear-gradient(135deg, rgba(251,191,36,0.12) 0%, rgba(251,191,36,0.04) 100%);
  border: 1px solid rgba(251,191,36,0.25);
  border-radius: 24px;
  padding: 56px 40px;
  text-align: center;
}
.about-cta-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-size: 44px;
  line-height: 1.1;
  margin: 0 0 14px;
  color: #fff;
}
.about-cta-sub {
  font-size: 17px;
  color: rgba(232,234,242,0.78);
  margin: 0 0 32px;
}
.about-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #060d1f;
  text-decoration: none;
  border-radius: 14px;
  font-weight: 700;
  font-size: 16px;
  transition: transform 0.15s, box-shadow 0.2s;
}
.about-cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px -10px rgba(251,191,36,0.45);
}

/* RESPONSIVE */
@media (max-width: 768px) {
  body.about-page { padding-bottom: 80px; }
  .about-hero { padding: 40px 20px 32px; }
  .about-hero-title { font-size: 44px; }
  .about-hero-sub { font-size: 17px; }
  .about-section { padding: 36px 16px; }
  .about-section-title { font-size: 32px; }
  .about-founder-card {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 28px;
  }
  .about-founder-title { font-size: 28px; }
  .about-step { padding: 18px; gap: 16px; grid-template-columns: 48px 1fr; }
  .about-step-num { width: 48px; height: 48px; font-size: 22px; }
  .about-state-detail { padding: 24px; }
  .about-state-detail-meta {
    grid-template-columns: 1fr;
    padding: 18px;
    gap: 14px;
  }
  .about-testimonial-grid { grid-template-columns: 1fr; }
  .about-quote p { font-size: 18px; }
  .about-cta-card { padding: 36px 24px; }
  .about-cta-title { font-size: 30px; }
  .about-cta-section { padding: 36px 16px 60px; }
}
@media (max-width: 380px) {
  .about-hero-title { font-size: 36px; }
  .about-section-title { font-size: 26px; }
  .about-founder-stat-num { font-size: 36px; }
}
@media (min-width: 1024px) {
  .about-hero { padding: 88px 32px 64px; }
  .about-hero-title { font-size: 88px; }
  .about-section { padding: 80px 32px; }
  .about-section-title { font-size: 56px; }
}

/* ============================================================
   PWA INSTALL PROMPT
   Bottom-sheet style modal, mobile-first
   ============================================================ */

.pwa-install-scrim {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(6, 13, 31, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.pwa-install-scrim[data-open="true"] { opacity: 1; }

.pwa-install-card {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 201;
  max-width: 480px;
  margin: 0 auto;
  padding: 28px 28px calc(28px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(26, 37, 64, 0.98) 0%, rgba(15, 22, 41, 0.98) 100%);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: none;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 -16px 48px -12px rgba(0, 0, 0, 0.5);
  text-align: center;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
}
.pwa-install-card[data-open="true"] { transform: translateY(0); }

.pwa-install-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pwa-install-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 8px 24px -4px rgba(251, 191, 36, 0.3);
}
.pwa-install-icon img { width: 100%; height: 100%; object-fit: cover; }

.pwa-install-title {
  font-family: 'Instrument Serif', serif;
  font-size: 26px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: 0 0 8px 0;
}
.pwa-install-sub {
  font-family: 'Inter';
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 0 24px 0;
  letter-spacing: -0.005em;
}

.pwa-install-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  margin-bottom: 12px;
  font-family: 'Inter';
  font-size: 15px;
  font-weight: 700;
  color: #0a1628;
  letter-spacing: -0.005em;
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  border: 1px solid rgba(251, 191, 36, 0.5);
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset, 0 8px 20px -4px rgba(251, 191, 36, 0.5);
  transition: transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.pwa-install-cta:active { transform: scale(0.98); }

.pwa-ios-steps {
  list-style: none;
  margin: 0 0 16px 0;
  padding: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pwa-ios-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
}
.pwa-ios-step-num {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Instrument Serif', serif;
  font-size: 14px;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 50%;
  flex-shrink: 0;
}
.pwa-ios-step-text {
  font-family: 'Inter';
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: -0.005em;
}
.pwa-ios-step-text strong { color: #fbbf24; font-weight: 600; }

.pwa-ios-share-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  width: 22px;
  height: 22px;
  margin: 0 2px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 5px;
  color: #818cf8;
}

.pwa-ios-tip {
  font-family: 'Inter';
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  margin: 0 0 16px 0;
  font-style: italic;
}

.pwa-install-later {
  display: block;
  width: 100%;
  padding: 12px;
  font-family: 'Inter';
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  background: transparent;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.pwa-install-later:hover { color: rgba(255, 255, 255, 0.8); }

@media (min-width: 769px) {
  .pwa-install-card {
    bottom: 50%;
    left: 50%;
    right: auto;
    width: 420px;
    margin: 0;
    border-radius: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transform: translate(-50%, 50%) scale(0.95);
  }
  .pwa-install-card[data-open="true"] {
    transform: translate(-50%, 50%) scale(1);
  }
}

/* ============================================================
   STANDALONE MODE — when installed as PWA
   ============================================================ */

body.is-standalone .site-footer { display: none; }
body.is-standalone .pwa-install-wrap { display: none !important; }
body.is-standalone .mobile-tab-bar { border-top-width: 1.5px; }

/* ============================================================
   READING PASSAGE — practice page (R2)
   ============================================================ */
.reading-passage {
  margin-bottom: 28px;
  padding: 24px 26px;
  background: linear-gradient(180deg, rgba(40,53,91,0.35) 0%, rgba(20,29,51,0.35) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset;
  position: relative;
}
.reading-passage::before {
  content: '';
  position: absolute; top: 0; left: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, rgba(251,191,36,0.5) 0%, rgba(251,191,36,0.1) 100%);
  border-radius: 16px 0 0 16px;
}
.reading-passage-header {
  display: flex; align-items: flex-start; gap: 12px;
  margin-bottom: 14px; padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.reading-passage-type {
  display: inline-block; flex-shrink: 0;
  padding: 3px 10px;
  font-family: 'Inter', sans-serif;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: #fbbf24;
  background: rgba(251,191,36,0.1);
  border: 1px solid rgba(251,191,36,0.25);
  border-radius: 999px;
}
.reading-passage-title {
  flex: 1; margin: 0;
  font-family: 'Instrument Serif', serif;
  font-size: 22px; font-weight: 400;
  line-height: 1.2; letter-spacing: -0.015em;
  color: #ffffff;
}
.reading-passage-toggle {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  font-family: 'Inter', sans-serif;
  font-size: 12px; font-weight: 500;
  color: rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.reading-passage-toggle:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
}
.reading-passage-toggle-icon { transition: transform 0.2s ease; }
.reading-passage--collapsed .reading-passage-toggle-icon { transform: rotate(180deg); }
.reading-passage-text {
  font-family: 'Inter', sans-serif;
  font-size: 15px; line-height: 1.65;
  color: rgba(255,255,255,0.85);
  letter-spacing: -0.005em;
}
.reading-passage-text p { margin: 0 0 14px 0; }
.reading-passage-text p:last-child { margin-bottom: 0; }
.reading-passage--collapsed { padding: 14px 18px; }
.reading-passage--collapsed .reading-passage-header {
  margin-bottom: 0; padding-bottom: 0; border-bottom: none;
}
.reading-passage--collapsed .reading-passage-title { font-size: 17px; }
.reading-passage--collapsed .reading-passage-text { display: none; }

@media (max-width: 768px) {
  .reading-passage { padding: 18px 20px; margin-bottom: 20px; }
  .reading-passage-title { font-size: 18px; }
  .reading-passage-text { font-size: 14px; line-height: 1.6; }
  .reading-passage-toggle { padding: 5px 10px; font-size: 11px; }
  .reading-passage-toggle-label { display: none; }
  .reading-passage--collapsed { padding: 12px 16px; }
  .reading-passage--collapsed .reading-passage-title { font-size: 15px; }
}

@media (min-width: 1024px) {
  .reading-passage { padding: 28px 32px; margin-bottom: 32px; }
  .reading-passage-title { font-size: 26px; }
  .reading-passage-text { font-size: 16px; line-height: 1.7; }
}

/* Unavailable subject card (R1) */
.subject-card--unavailable {
  cursor: default;
  opacity: 0.4;
}
.subject-card--unavailable .subject-card-icon { filter: grayscale(1); }
.subject-card--unavailable .subject-card-tagline {
  font-style: italic;
  color: rgba(255,255,255,0.4);
}

/* ============================================================
   HERO — STATE DROPDOWN + GO  (added 2026-04-27)
   Desktop intent only. No mobile media-query overrides.
   ============================================================ */

/* Visually-hidden label, keeps the <label> for screen readers */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Wraps the <select> + custom chevron */
.hero-state-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: stretch;
}

/* The dropdown itself — matches .btn-secondary glass aesthetic */
.hero-state-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  height: 48px;
  padding: 0 44px 0 18px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.005em;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 220px;
  outline: none;
}
.hero-state-select:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
}
.hero-state-select:focus-visible {
  border-color: rgba(251, 191, 36, 0.7);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.25);
}
/* Native option styling — limited control, but force readable colors
   for browsers that respect it (Chrome on Linux, Firefox). */
.hero-state-select option {
  background: #0a1628;
  color: #ffffff;
}
.hero-state-select option:disabled {
  color: rgba(255, 255, 255, 0.4);
}
/* Empty/placeholder selection (value="") shows muted */
.hero-state-select:invalid,
.hero-state-select option[value=""] {
  color: rgba(255, 255, 255, 0.55);
}

/* Custom chevron, sits over the right edge of the select */
.hero-state-select-chevron {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: rgba(255, 255, 255, 0.7);
  display: inline-flex;
}

/* Go button — inherits .btn-primary visuals; just ensure disabled is unmistakable */
.hero-go-btn[disabled],
.hero-go-btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.2) inset,
    0 0 0 1px rgba(251, 191, 36, 0.2);
  filter: saturate(0.7);
}
.hero-go-btn[disabled]:hover,
.hero-go-btn[aria-disabled="true"]:hover {
  transform: none !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.2) inset,
    0 0 0 1px rgba(251, 191, 36, 0.2);
}

/* ============================================================
   Unified state-picker + Practice pill (Elon-pass)
   One container, one border, one radius, hairline divider.
   Inherits select + button visuals; overrides only what's needed
   to merge them visually.
   ============================================================ */
.hero-cta-pill {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
  transition: border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.hero-cta-pill:hover {
  border-color: rgba(255, 255, 255, 0.22);
}
.hero-cta-pill:focus-within {
  border-color: rgba(251, 191, 36, 0.7);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.25);
}
.hero-cta-pill .hero-state-select-wrap {
  border-right: 1px solid rgba(255, 255, 255, 0.10);
}
.hero-cta-pill .hero-state-select {
  height: 52px;
  min-width: 200px;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 0;
  border-radius: 0;
}
.hero-cta-pill .hero-state-select:hover,
.hero-cta-pill .hero-state-select:focus-visible {
  background: transparent;
  border: 0;
  box-shadow: none;
}
.hero-cta-pill .hero-go-btn {
  height: 52px;
  border-radius: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 24px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.hero-cta-pill .hero-go-btn:not([disabled]):hover {
  transform: none !important;
  filter: brightness(1.05);
}
@media (max-width: 768px) {
  .hero-cta-pill {
    width: 100%;
  }
  .hero-cta-pill .hero-state-select-wrap { flex: 1; }
  .hero-cta-pill .hero-state-select { min-width: 0; width: 100%; }
}

/* ============================================================
   HOMEPAGE — hide the legacy state-picker section on desktop.
   The hero dropdown + Go button replace it; the picker grid
   remains for mobile only (where the hero CTA stacks small).
   Per breakpoint contract: desktop is base, mobile overrides.
   ============================================================ */
.home-page .state-picker-section { display: none; }
@media (max-width: 768px) {
  .home-page .state-picker-section { display: block; }
}

/* ============================================================
   Global [hidden] safety net.
   Several component rules use display: flex / grid / block
   which override the user-agent [hidden] { display: none } rule.
   This single line guarantees the HTML hidden attribute always
   wins. Use !important deliberately — this is the contract.
   ============================================================ */
[hidden] { display: none !important; }

/* ============================================================
 * PRACTICE SURFACE — MOBILE OVERRIDES (May 2)
 * Responsive rules for the kid's most-used screen.
 * Breakpoints match marketplace grid: 1024 / 768 / 480.
 * Touch targets ≥ 44px, no new colors, premium understated.
 *
 * Note: .performance-panel already has a single existing rule at
 * @media (max-width: 900px) on line ~1491 (position: static). The
 * rules below cascade with it cleanly — they do not conflict.
 *
 * Note: .session-summary is inline-styled by js/practice.js at
 * render time. Mobile overrides need !important to defeat the
 * inline style. The inline style remains the desktop default.
 * ============================================================ */

@media (max-width: 1024px) {
  body.practice-page .question-card { padding: 20px; }
  body.practice-page .feedback { padding: 16px; }
  body.practice-page .tutor-output { padding: 12px 14px; }
  body.practice-page .choice { padding: 13px 14px; min-height: 44px; }
}

@media (max-width: 768px) {
  body.practice-page .question-card { padding: 18px; border-radius: 8px; }
  body.practice-page .q-prompt { font-size: 1.15rem; line-height: 1.45; }

  body.practice-page .choice { padding: 14px; min-height: 44px; gap: 12px; }
  body.practice-page .choice .choice-symbol { font-size: 1.4rem; }

  body.practice-page .feedback { padding: 14px; margin-top: 12px; }
  body.practice-page .feedback-actions { display: flex; flex-wrap: wrap; gap: 8px; }
  body.practice-page .feedback-actions .btn { flex: 1 1 auto; min-height: 44px; }

  body.practice-page .tutor-box { margin-top: 10px; padding-top: 10px; }
  body.practice-page .tutor-output { padding: 12px 14px; line-height: 1.5; }
  body.practice-page .tutor-followup { gap: 6px; }
  body.practice-page .tutor-followup input { padding: 11px 12px; font-size: 1rem; min-height: 44px; }
  body.practice-page .tutor-send { width: 44px; height: 44px; }
  body.practice-page .tutor-suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
  body.practice-page .tutor-chip { min-height: 44px; }

  body.practice-page .session-summary {
    padding: 10px 12px !important;
    font-size: 0.95rem !important;
    margin: 12px 0 !important;
  }

  /* Perf-panel docks to the bottom of the viewport. The existing
     @media (max-width: 900px) rule already sets position:static;
     this further repositions to fixed-bottom and compacts contents. */
  body.practice-page .performance-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 50;
    margin: 0;
    padding: 8px 12px;
    background: var(--surface);
    border: 0;
    border-top: 1px solid var(--border);
    border-radius: 0;
  }
  body.practice-page .performance-panel .perf-title,
  body.practice-page .performance-panel .perf-section-title,
  body.practice-page .performance-panel .perf-ring-wrap {
    display: none;
  }
  body.practice-page .performance-panel .perf-stats {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    gap: 12px;
    margin: 0;
  }
  body.practice-page .performance-panel .stat { text-align: center; }
  body.practice-page .performance-panel .stat-num { font-size: 1.05rem; }
  body.practice-page .performance-panel .stat-label { font-size: 0.75rem; }

  /* Reserve space at the bottom of the page so docked panel doesn't
     overlap the last question / next-button row. */
  body.practice-page { padding-bottom: 72px; }

  /* End-of-set "Try again" / "Back to unit" buttons stack on small
     viewports. Override the inline margin-left on the secondary button. */
  body.practice-page .card .btn-primary,
  body.practice-page .card .btn-secondary {
    display: block;
    width: 100%;
    margin-left: 0 !important;
    margin-top: 8px;
  }
  body.practice-page .card .btn-primary:first-of-type {
    margin-top: 16px;
  }
}

@media (max-width: 480px) {
  body.practice-page .question-card { padding: 14px; }
  body.practice-page .q-prompt { font-size: 1.1rem; }
  body.practice-page .q-meta { font-size: 0.75rem; }

  body.practice-page .choice { padding: 14px 12px; min-height: 48px; gap: 10px; }
  body.practice-page .choice .choice-symbol { font-size: 1.25rem; }
  body.practice-page .choice .choice-hint { font-size: 0.9rem; }

  body.practice-page .feedback { padding: 12px; margin-top: 10px; border-radius: 8px; }
  body.practice-page .feedback-head { font-size: 1rem; }
  body.practice-page .feedback-body p { margin: 5px 0; font-size: 0.95rem; }

  body.practice-page .tutor-output { padding: 10px 12px; line-height: 1.5; font-size: 0.95rem; }
  body.practice-page .tutor-msg { padding: 6px 0; }
  body.practice-page .tutor-followup input { padding: 12px; font-size: 1rem; }

  /* Chips wrap to roughly 2 per row on phone. */
  body.practice-page .tutor-suggestions { gap: 6px; }
  body.practice-page .tutor-chip {
    flex: 1 1 calc(50% - 6px);
    min-height: 44px;
    padding: 10px 12px;
    text-align: center;
    font-size: 0.9rem;
  }

  body.practice-page .session-summary {
    padding: 8px 10px !important;
    font-size: 0.9rem !important;
    margin: 10px 0 !important;
  }

  body.practice-page .performance-panel { padding: 6px 10px; }
  body.practice-page .performance-panel .stat-num { font-size: 0.95rem; }
  body.practice-page .performance-panel .stat-label { font-size: 0.75rem; }
  body.practice-page { padding-bottom: 64px; }

  /* Submit button (Check answer) gets full-width on phone for thumb reach.
     Stays in the document flow; sticky-bottom-of-viewport pattern needs
     an HTML restructure and is logged as a deferred TODO. */
  body.practice-page .question-card .btn,
  body.practice-page .question-card form .btn {
    width: 100%;
    min-height: 48px;
  }
}

/* ============================================================
 * PRACTICE SURFACE — generic .card dark-theme override (May 3)
 *
 * PRODUCTION BUG FIX: js/practice.js renders the end-of-set
 * screen, the loading state, and a few other paths as
 * <div class="card">…</div>. The generic .card rule (line 1124)
 * sets background: var(--surface) which is #ffffff (white).
 * body.practice-page sets `color: #ffffff` on the body, so all
 * inherited text inside that white card was rendered as white
 * on white — invisible content. Hamid screenshotted this on his
 * iPhone after completing a practice session — the end-of-set
 * "X / Y correct" line was unreadable.
 *
 * This rule only fires when the .card is on the practice page,
 * so other pages (marketplace, dashboard, settings) that use
 * .card with light-theme bodies are unaffected. Desktop AND
 * mobile both benefit — the bug was never viewport-specific.
 *
 * Mirrors body.practice-page .question-card (line ~6078) for
 * visual consistency: same subtle white-on-dark gradient,
 * matching border, matching shadow.
 * ============================================================ */

body.practice-page .card {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  color: #ffffff;
}
body.practice-page .card h1,
body.practice-page .card h2,
body.practice-page .card h3,
body.practice-page .card h4,
body.practice-page .card p,
body.practice-page .card li,
body.practice-page .card label {
  color: #ffffff;
}
body.practice-page .card strong { color: #fde68a; }
body.practice-page .card a:not(.btn) { color: #fde68a; }

/* PRODUCTION BUG FIX (May 3, second pass): the §18 mobile rule docked
   the perf-panel to bottom: 0 with position: fixed but only hid the
   titles + ring. The .recent-dots strip (10×2 grid of dots) and the
   .unit-rows list (7+ rows of topics like "Place Value", "Fractions",
   "Addition", etc.) stayed visible. With those rendered, the
   docked-bottom strip grew tall enough to overlap the actual question
   content above — Hamid screenshotted the stats panel + topic list
   stacked on top of "In the number 515,531, what is the value of the
   5?" making the page unusable.

   Fix per Option 1 (immediate ship): hide the entire .performance-panel
   at <768px. Kid sees the question only. Mobile loses the
   accuracy/progress sidebar but the practice surface works.

   Future TODO §14: rebuild stats + topic progress as a collapsible
   top drawer triggered by a tap-target — kid keeps progress visibility
   on mobile. Out of scope for this hotfix. */
@media (max-width: 768px) {
  body.practice-page .performance-panel {
    display: none !important;
  }
  /* The §18 rule reserved 72px at body bottom for the docked panel.
     Now that the panel is hidden, return that space to the kid. */
  body.practice-page {
    padding-bottom: 0;
  }
}

/* ============================================================
   Footer suppression on focused-practice surfaces (May 5)

   Hamid screenshotted his iPhone showing the homepage marketing
   footer (GradeEarn star + AI tagline + 'All 50 states supported'
   + Product/For Parents/Company/Legal nav columns) rendering
   below the active practice question. That footer block is in
   the HTML of practice.html and grades.html — copy-pasted from
   the homepage when those pages were built.

   Fix: hide the marketing footer on the two kid-focused
   surfaces. Homepage (body.home-page), marketplace (body.
   marketplace-page), about/admin/etc. keep the footer.

   Markup is preserved (not deleted) so any future redesign that
   wants a slim footer on practice — e.g. a single legal-link
   row — has the structure to draw from.
   ============================================================ */
body.practice-page footer.footer,
body.practice-select-page footer.footer {
  display: none;
}

/* ============================================================
   §39 — Landing-page collapse: when there's a saved state, the
   Continue card is the primary CTA; the state-picker dropdown
   below it demotes to a small text-link rather than a competing
   card-style button. Apple "one logo per screen" + Elon "one
   primary action" applied to a returning visitor's first paint.

   Only applies when body.has-saved-state (set by state-picker.js
   showDetected). Mobile-focused but harmless on desktop because
   the desktop layout already shows the grid as the primary picker;
   the trigger button is mobile-only via earlier rules.
   ============================================================ */
body.has-saved-state .state-picker-trigger {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 8px 4px;
  margin-top: 4px;
  min-height: 0;
  border-radius: 0;
  display: inline-flex;
  width: auto;
  align-self: center;
  color: rgba(251, 191, 36, 0.85);   /* muted gold link */
  font-weight: 500;
  text-decoration: none;
}
body.has-saved-state .state-picker-trigger:hover,
body.has-saved-state .state-picker-trigger:focus-visible {
  color: #fbbf24;
  text-decoration: underline;
  text-underline-offset: 3px;
  background: transparent;
}
body.has-saved-state .state-picker-trigger:active {
  background: transparent;
  transform: none;
}
body.has-saved-state .state-picker-trigger .state-picker-trigger-info {
  flex-direction: row;
  gap: 4px;
}
body.has-saved-state .state-picker-trigger .state-picker-trigger-label {
  font-size: 14px;
  color: inherit;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}
body.has-saved-state .state-picker-trigger .state-picker-trigger-value {
  display: none;
}
body.has-saved-state .state-picker-trigger .state-picker-trigger-chevron {
  width: auto;
  height: auto;
  background: transparent;
  border: none;
  color: inherit;
}
body.has-saved-state .state-picker-trigger .state-picker-trigger-chevron svg {
  width: 14px;
  height: 14px;
  transform: rotate(-90deg);   /* point right, like a "→" affordance */
}
/* Tighten the section under the Continue card: the inline picker
   grid (mobile) is opened on tap, so we don't need it taking space
   above the demoted link. Also reduce the section's eyebrow + title
   styling to feel less like a primary headline once the user is
   already a returning visitor. */
body.has-saved-state .state-picker-eyebrow {
  font-size: 11px;
  opacity: 0.7;
}
body.has-saved-state .state-picker-title {
  font-size: 18px;
}
body.has-saved-state .state-picker-sub {
  font-size: 13px;
}
/* Tighten the gap between hero copy and Step 1 block since the
   removed star left ~36px of vertical headroom. Mobile-only —
   desktop already collapses .mobile-hero with display:none. */
@media (max-width: 768px) {
  .mobile-hero {
    padding-top: 8px;
    padding-bottom: 12px;
  }
}

/* ============================================================
   §41 — State-detail page: hide marketing surfaces, surface
   the grade picker.

   Per Hamid screenshot at 5:19pm: kids who already chose their
   state landed on a page with 6 paragraphs of marketing copy
   (STAAR/TEKS description, fact grid, trust cards, CTA strip)
   above the grade buttons. Grade 3 was below the fold. The
   page is step 2 of an onboarding flow — they need to PICK A
   GRADE AND PRACTICE, not read.

   Markup is preserved (marketing copy stays in the HTML for SEO
   crawlers and any future redesign that wants to bring it back
   on a separate parent-facing route). It's hidden via display:
   none here so the grade picker becomes the first visible
   surface under the breadcrumb.

   Same trim applies on desktop because (a) the marketing copy
   is redundant once a state is picked, (b) the kid is the
   primary user of this page, (c) parents who want test details
   can find them on /about.
   ============================================================ */
body.state-page .state-hero,
body.state-page .state-trust-section,
body.state-page .state-cta-strip {
  display: none;
}
/* Tighten the grade-section spacing now that it's the first
   content under the breadcrumb. */
body.state-page .state-grade-section {
  margin-top: 8px;
}

/* ============================================================
   §42 — Subject-picker page (grade.html): hide the redundant
   hero block + step eyebrow + "Math is live" subhead so the
   subject cards become the first interactive surface under the
   breadcrumb.

   Per Hamid screenshot at 5:24pm: arriving here, the kid saw the
   same context (Texas / Grade 3 / STAAR) repeated 3-4 ways:
     1. Breadcrumb says "← Texas / Grade 3"
     2. Pill says "TEXAS · STAAR · GRADE 3"
     3. Headline says "Grade 3 STAAR practice"
     4. Subhead says "Practice questions aligned to STAAR..."
     5. "Step 3 of 3"
     6. "Pick a subject"
     7. "Math is live. More subjects coming soon."
   THEN finally the Math card. Below the fold.

   Markup is preserved (JS still populates #hero-title etc. so
   any future SEO/parent-facing redesign can opt back in). Just
   visually hidden so the page reads:
     [breadcrumb] → [Pick a subject] → [Math card]

   Same trim applies on desktop because the marketing copy is
   redundant on that path too (kid arrived from a state page).
   ============================================================ */
body.grade-page .grade-hero {
  display: none;
}
/* Tighten the subject-section spacing now that it's the first
   content under the breadcrumb (no hero pushing it down). */
body.grade-page .subject-section {
  margin-top: 8px;
}

/* ============================================================
   §44 — Practice question screen: question becomes the hero.

   Hamid screenshot 5:44pm: kid loaded a question and saw 8
   competing visual elements before the actual stem:
     1. TX/STAAR pill row
     2. "← Back to Grade 3 Math" link
     3. "Grade 3 Math" h2 headline
     4. Restart button
     5. Progress bar + "1/25" counter
     6. ADDITION & SUBTRACTION ... TEKS 3.4A pill
     7. ±2 PTS pill
     8. (finally) the question

   Apple/Elon: question is the hero; everything else demoted.

   Mobile-only — desktop side-panel + perf panel layout left
   intact (kids on desktop have more screen real estate and the
   layout already breathes).
   ============================================================ */
@media (max-width: 767px) {
  /* (1) Collapse the .practice-context-bar pills into a unified
     breadcrumb-text style so it reads "← TX · Grade 3 · Math". */
  body.practice-page #practice-context-bar { padding: 8px 4px; }
  body.practice-page .practice-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    position: relative;
  }
  body.practice-page .practice-breadcrumb-back {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.04);
  }
  body.practice-page .practice-breadcrumb-pills {
    display: inline-flex;
    align-items: center;
    gap: 0;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
  }
  body.practice-page .practice-pill {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
  }
  /* Collapse state pill to just the abbr; hide the test name to
     keep the breadcrumb tight. Test name is on the previous page. */
  body.practice-page .practice-pill-state-test { display: none; }
  /* Insert "·" separators between pills via ::before. */
  body.practice-page .practice-pill + .practice-pill::before {
    content: ' · ';
    color: rgba(255, 255, 255, 0.35);
    margin: 0 6px;
  }

  /* (2) Overflow menu styling */
  body.practice-page .practice-breadcrumb-overflow {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    margin-left: auto;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.7);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }
  body.practice-page .practice-breadcrumb-overflow:hover,
  body.practice-page .practice-breadcrumb-overflow[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
  }
  body.practice-page .practice-breadcrumb-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 4px;
    z-index: 50;
    min-width: 180px;
    background: rgba(20, 29, 51, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.5);
  }
  body.practice-page .practice-breadcrumb-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #ffffff;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
  }
  body.practice-page .practice-breadcrumb-menu-item:hover {
    background: rgba(255, 255, 255, 0.06);
  }

  /* (3) Hide the in-card redundant header block: back-link + h2 +
     in-card restart button. The breadcrumb above is the only path
     indicator now; restart lives in the overflow menu. */
  body.practice-page .practice-header .back-link,
  body.practice-page .practice-header .practice-title-row h2,
  body.practice-page .practice-header .btn-restart {
    display: none;
  }
  /* The .practice-title-row only contained h2 + restart-btn; with
     both hidden the row collapses to zero height — no extra
     spacing rules needed. */
  body.practice-page .practice-header .practice-title-row {
    margin: 0;
    padding: 0;
  }

  /* (4) Compact progress bar + inline counter, top-right of the
     practice-header row. */
  body.practice-page .practice-header {
    padding: 4px 0 12px;
  }
  body.practice-page .practice-header .progress-bar {
    margin-top: 0;
  }
  body.practice-page .practice-header .progress-track {
    height: 4px;
  }
  body.practice-page .practice-header .progress-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    text-align: right;
    margin-top: 4px;
  }

  /* (5) Demote .q-meta to a quiet footer chip BELOW the question
     by reordering it inside the form.
     §68 — added explicit order for .q-inline-fb (3) and the Next
     button (4) since both were missing from the flex order list
     and rendering at TOP (order:0 default) — Hamid screenshot
     10:47am showed feedback + Next ABOVE the question. Targeting
     .q-cta covers both type=submit (Check) and type=button (Next). */
  body.practice-page .question-card {
    display: flex;
    flex-direction: column;
  }
  body.practice-page .question-card .q-prompt        { order: 1; }
  body.practice-page .question-card .q-body          { order: 2; }
  body.practice-page .question-card .q-inline-fb     { order: 3; }
  body.practice-page .question-card > button[type="submit"],
  body.practice-page .question-card > button.q-cta,
  body.practice-page .question-card > .q-autoadvance { order: 4; }
  body.practice-page .question-card .q-meta {
    order: 99;
    margin-top: 14px;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }
  /* Drop the loud "±N pts" pill background — render as muted text
     "+N pts" instead. The main reward feedback fires after the
     answer is checked anyway; this is just a kid-glance hint. */
  body.practice-page .question-card .q-meta .q-reward {
    background: transparent;
    border: none;
    padding: 0;
    color: rgba(251, 191, 36, 0.7);
    font-weight: 500;
  }

  /* (6) Question is the hero — bump font + weight. */
  body.practice-page .question-card .q-prompt {
    font-size: 22px;
    line-height: 1.35;
    font-weight: 500;
    color: #ffffff;
    margin: 0 0 16px;
  }
}

/* ============================================================
   §47 — Texas-only pivot: grade-pill picker
   Replaces the multi-state state-picker UI on the landing page.
   Reuses the same anchor id (#state-picker) so existing in-page
   links scroll to the right place. Brand: navy + gold, no new
   colors per CLAUDE.md §10.
   ============================================================ */

.grade-picker-section {
  padding: 48px 32px 64px;
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
}

.grade-picker-head {
  text-align: left;
  margin-bottom: 24px;
}

.grade-picker-title {
  font-family: 'Instrument Serif', serif;
  font-size: 40px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: #ffffff;
  margin: 0 0 8px 0;
}

.grade-picker-sub {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

.grade-picker-pills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.grade-pill,
.hero-grade-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 14px 18px;
  border-radius: 14px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(251, 191, 36, 0.28);
  text-decoration: none;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}
.grade-pill:hover,
.hero-grade-pill:hover {
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(251, 191, 36, 0.55);
}
.grade-pill:active,
.hero-grade-pill:active {
  transform: scale(0.98);
}

.hero-cta-grades {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 20px;
  max-width: 520px;
}

@media (max-width: 768px) {
  .grade-picker-section { padding: 32px 16px 48px; }
  .grade-picker-title   { font-size: 32px; }
  .grade-picker-pills   { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .grade-pill           { min-height: 60px; font-size: 16px; }
  .hero-cta-grades      { grid-template-columns: repeat(2, 1fr); }
  .hero-grade-pill      { min-height: 52px; font-size: 14px; padding: 12px 14px; }
}

/* §50 — forgot-password modal additions */
.auth-modal .modal-cta { width: 100%; margin-top: 8px; }
.auth-success {
  color: #047857;
  background: rgba(167, 243, 208, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.9rem;
  line-height: 1.45;
  margin: 12px 0 0;
}
.modal-footer-row {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}
.auth-modal .auth-link {
  color: var(--navy, #0b1726);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
}
.auth-modal .auth-link:hover { color: #f59e0b; text-decoration: underline; }

/* §52 — verify-email 6-digit code input */
.verify-code-input {
  text-align: center;
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.4em;
  padding-left: 0.4em; /* visual recentre with letter-spacing */
}
.verify-code-input::placeholder { letter-spacing: 0.4em; opacity: 0.35; }

/* ============================================================
   §54 — Practice question card state machine
   States: data-state="asking" | "correct" | "wrong"
   - asking: default border, input editable, gold Check button
   - correct: green border, input read-only, gold Next button
   - wrong: red border, input read-only, gold Next button
   Footer chip (.q-meta) demoted from caps-pill pair to single
   muted sentence-case line.
   ============================================================ */

/* Question card border reflects state. The default border lives
   on .question-card; we override on data-state with !important
   to beat the body.practice-page-scoped border rules. */
.question-card[data-state="correct"] {
  border-color: rgba(16, 185, 129, 0.55) !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12) !important;
}
.question-card[data-state="wrong"] {
  border-color: rgba(239, 68, 68, 0.55) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}

/* Lock the input visually — readOnly leaves the kid's text visible
   so they can see what they answered, but no edit affordance. */
.question-card[data-state="correct"] .num-input,
.question-card[data-state="wrong"] .num-input {
  cursor: default;
  caret-color: transparent;
}
.question-card[data-state="correct"] .num-input {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.06);
  color: #047857;
}
.question-card[data-state="wrong"] .num-input {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.06);
  color: #b91c1c;
}

/* MC choices: lock pointer events on every label, then re-style
   the kid's selected one + the canonical correct one. */
.question-card[data-state="correct"] .choice,
.question-card[data-state="wrong"] .choice {
  pointer-events: none;
  opacity: 0.7;
}
.question-card[data-state="correct"] .choice:has(input:checked) {
  border-color: rgba(16, 185, 129, 0.55) !important;
  background: rgba(16, 185, 129, 0.10) !important;
  opacity: 1;
}
.question-card[data-state="wrong"] .choice:has(input:checked) {
  border-color: rgba(239, 68, 68, 0.55) !important;
  background: rgba(239, 68, 68, 0.10) !important;
  opacity: 1;
}

/* Demote the q-meta footer chip from loud-caps to muted single-line.
   Beats the older .q-meta { text-transform: uppercase; ... } at
   line 1230 because this rule is more specific (selector chain). */
.question-card .q-meta {
  display: block;
  margin: 14px 0 0;
  padding: 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.45);
  text-align: left;
}
.question-card .q-meta-text { display: inline; }
.question-card .q-meta-earn { color: rgba(16, 185, 129, 0.85); font-weight: 600; }
.question-card .q-meta-lose { color: rgba(239, 68, 68, 0.7); }

/* On light surfaces (admin etc.) muted gray instead of off-white. */
body:not(.practice-page) .question-card .q-meta { color: var(--muted, #6b7280); }

/* ============================================================
   §56 — Practice card layout cleanup
   - Inline feedback chip lives BETWEEN body and primary button
   - Footer (.q-meta) demoted from caps-pill to muted single line
     (overrides earlier body.practice-page .q-meta pill chrome)
   - 'Need scratch paper?' link hidden once question is answered
   - Guest banner styled as quiet bottom footer
   ============================================================ */

/* Inline feedback chip — sits inside the question card. */
body.practice-page .question-card .q-inline-fb {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  font-size: 0.95rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
}
body.practice-page .question-card[data-state="correct"] .q-inline-fb {
  background: rgba(16, 185, 129, 0.10);
  border-color: rgba(16, 185, 129, 0.35);
}
body.practice-page .question-card[data-state="wrong"] .q-inline-fb {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.30);
}
body.practice-page .q-inline-fb-head {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 6px;
  color: #ffffff;
}
body.practice-page .question-card[data-state="correct"] .q-inline-fb-head { color: #6ee7b7; }
body.practice-page .question-card[data-state="wrong"]   .q-inline-fb-head { color: #fca5a5; }
body.practice-page .q-inline-fb-pts {
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: #6ee7b7;
  margin-left: 6px;
}
body.practice-page .q-inline-fb-correct {
  font-weight: 500;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  margin-left: 6px;
}
body.practice-page .q-inline-fb-correct strong { color: #fde68a; font-weight: 700; }
body.practice-page .q-inline-fb-body {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.9rem;
  line-height: 1.55;
}

/* Demote the footer chip — override the body.practice-page caps-pill rules
   from line 6097-6117. Use double-class selector for higher specificity
   plus !important on the visual properties to win the cascade. */
body.practice-page .question-card .q-meta {
  display: block !important;
  margin: 14px 0 0 !important;
  padding: 0 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 0.78rem !important;
  font-weight: 500 !important;
  color: rgba(255, 255, 255, 0.5) !important;
  text-align: left !important;
  background: transparent !important;
  border: 0 !important;
  flex-wrap: nowrap !important;
}
body.practice-page .question-card .q-meta > span,
body.practice-page .question-card .q-meta > span:first-child {
  display: inline !important;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  letter-spacing: 0 !important;
  color: inherit !important;
  text-transform: none !important;
}

/* Hide 'Need scratch paper?' surface when an answer has been checked.
   Re-shows on next question render (body.q-answered is removed). */
body.q-answered .scratchpad-inline[data-state="collapsed"] { display: none; }

/* Slim out-of-card tutor box (WRONG only). No header, no padding stack
   above the tutor — was 22px+22px space; now just 14px breathing room. */
body.practice-page .feedback--tutor-only {
  margin-top: 14px;
  padding: 0;
  background: transparent;
  border: 0;
}
body.practice-page .feedback--placeholder { display: none; }

/* §58 — Practice flow chrome rule.
   Hide the marketing footer on any page that's in the practice
   flow (grade-picker → subject-picker → practice runner). The
   header stays (kid uses brand link to navigate home). Keeps the
   marketing footer for landing / about / marketplace. */
body.practice-mode .site-footer,
body.practice-mode .footer {
  display: none !important;
}

/* §59 — when q-inline-fb holds the AI tutor (WRONG state), strip
   the chip's own border/bg/padding so the tutor's own styling
   shows through cleanly. The tutor IS the feedback; no double-frame. */
body.practice-page .question-card .q-inline-fb.q-inline-fb--tutor {
  background: transparent !important;
  border-color: transparent !important;
  padding: 0 !important;
  margin-top: 8px;
}

/* ============================================================
   §63 — Landing page premium polish pass
   - Hero headline split: bold "STAAR Math practice," / italic
     thin gold "built for Texas kids." (was equal-weight serif)
   - Two-line declarative tagline: "Real toys. / Real progress."
   - Trust signal: 20,000+ TEKS-aligned questions · Built by parents
   - Grade picker: muted caps section label, taller tactile buttons
     with gradient + inner shadow + scale-on-tap micro-animation
   ============================================================ */

@media (max-width: 768px) {
  /* §63 Hero — premium typography hierarchy. */
  body.home-page .mobile-hero {
    padding: 36px 24px 28px !important;
  }
  body.home-page .mobile-hero-headline {
    font-family: 'Instrument Serif', Georgia, serif !important;
    font-size: 44px !important;
    line-height: 1.02 !important;
    letter-spacing: -0.028em !important;
    margin: 0 0 24px !important;
  }
  body.home-page .mobile-hero-headline .mobile-hero-line1 {
    display: block !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-style: normal !important;
  }
  body.home-page .mobile-hero-headline .mobile-hero-line2 {
    display: block !important;
    color: #fbbf24 !important;
    font-style: italic !important;
    font-weight: 300 !important;
    font-size: 36px !important;
    margin-top: 4px !important;
  }
  body.home-page .mobile-hero-tagline {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 17px;
    font-weight: 500;
    line-height: 1.25;
    color: rgba(255, 255, 255, 0.92);
    margin: 0 0 16px;
  }
  body.home-page .mobile-hero-trust {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
    letter-spacing: 0.01em;
  }

  /* §63 Grade picker — muted section label, tactile buttons. */
  body.home-page .grade-picker-section {
    padding: 24px 24px 56px !important;
  }
  body.home-page .section-label {
    display: block;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    margin: 0 0 16px;
  }
  body.home-page .grade-picker-pills {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  body.home-page .grade-picker-pills .grade-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 96px !important;
    padding: 18px 16px !important;
    border-radius: 12px !important;
    font-family: 'Inter', system-ui, sans-serif !important;
    font-size: 17px !important;
    font-weight: 500 !important;
    color: #ffffff !important;
    background: linear-gradient(180deg, #0d2249 0%, #061230 100%) !important;
    border: 1px solid rgba(251, 191, 36, 0.35) !important;
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.05) inset,
      0 4px 12px -2px rgba(0, 0, 0, 0.3) !important;
    text-decoration: none;
    transition: transform 0.12s ease, border-color 0.18s ease, box-shadow 0.18s ease !important;
  }
  body.home-page .grade-picker-pills .grade-pill:active {
    transform: scale(0.98);
    border-color: rgba(251, 191, 36, 0.7) !important;
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.05) inset,
      0 0 18px -2px rgba(251, 191, 36, 0.4),
      0 4px 12px -2px rgba(0, 0, 0, 0.3) !important;
  }
}

@media (min-width: 769px) {
  /* §63 Desktop adapts: same patterns, more breathing room. */
  body.home-page .mobile-hero { padding: 56px 32px 36px; }
  body.home-page .grade-picker-section { padding: 28px 32px 80px; }
  body.home-page .grade-picker-pills .grade-pill {
    min-height: 120px;
    font-size: 18px;
  }
}

/* ============================================================
   §64 — Premium polish pass 2 (mobile)
   - Headline italic line scaled smaller (was visually dominant
     due to gold-on-navy contrast vs white-on-navy)
   - Section label anchored with thin gold rule above + breathing
   - Grade buttons: deeper gradient + top-edge inner highlight
     for tactile catchlight
   ============================================================ */

@media (max-width: 768px) {
  /* §64 — italic line ~75% of bold size for clear hierarchy. */
  body.home-page .mobile-hero-headline .mobile-hero-line2 {
    font-size: 32px !important;
    margin-top: 2px !important;
  }

  /* §64 — Section anchor: 1px gold-tint horizontal rule above
     the 'PICK A GRADE' label, plus generous breathing. */
  body.home-page .grade-picker-section .section-label {
    position: relative;
    margin-top: 32px;
    padding-top: 32px;
  }
  body.home-page .grade-picker-section .section-label::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(251, 191, 36, 0.13);
  }

  /* §64 — Grade buttons: deeper gradient + top-edge highlight
     (catches light) + bottom-edge shadow (sits firmly on surface). */
  body.home-page .grade-picker-pills .grade-pill {
    background: linear-gradient(180deg, #122a55 0%, #050d22 100%) !important;
    border-color: rgba(251, 191, 36, 0.40) !important;
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.08) inset,
      0 -1px 0 rgba(0, 0, 0, 0.30) inset,
      0 4px 12px -2px rgba(0, 0, 0, 0.30) !important;
  }
  body.home-page .grade-picker-pills .grade-pill:active {
    transform: scale(0.98);
    border-color: rgba(251, 191, 36, 0.75) !important;
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.10) inset,
      0 -1px 0 rgba(0, 0, 0, 0.30) inset,
      0 0 18px -2px rgba(251, 191, 36, 0.45),
      0 4px 12px -2px rgba(0, 0, 0, 0.30) !important;
  }
}

/* ============================================================
   §65 — Premium polish pass 3 (band fix + Sign in depth +
   italic saturation + section anchor quieter)
   ============================================================ */

@media (max-width: 768px) {
  /* §65 BAND FIX — Hide the desktop .hero entirely on phone.
     showDashboard() un-hides it for guests (heroAnon.hidden=false)
     so the user-agent display:none from [hidden] no longer applies.
     On phone the responsive rules collapsed its CONTENT but its
     starfield + hero-grid + amber/blue drift glows kept rendering
     as a visible band-with-dots under the header. .mobile-hero
     below already carries the proper hero markup; .hero is pure
     visual noise on phone. */
  body.home-page .hero,
  body.home-page #hero-anon {
    display: none !important;
  }
}

/* §65 Sign in button — premium depth without losing ghost feel.
   Subtle inner ring (gold) + soft drop shadow + 8px backdrop blur
   so it sits with weight on whatever's behind it. Stays
   transparent fill, gold border, gold text. */
.user-slot .user-signin,
.user-slot .user-signin.btn {
  box-shadow:
    0 0 0 1px rgba(251, 191, 36, 0.18) inset,
    0 1px 2px rgba(0, 0, 0, 0.30),
    0 0 14px rgba(251, 191, 36, 0.10);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.user-slot .user-signin:hover,
.user-slot .user-signin.btn:hover {
  box-shadow:
    0 0 0 1px rgba(251, 191, 36, 0.28) inset,
    0 2px 4px rgba(0, 0, 0, 0.35),
    0 0 18px rgba(251, 191, 36, 0.18);
}

@media (max-width: 768px) {
  /* §65 Italic line — reduce gold saturation. Was 100% gold
     (#fbbf24) which read heavier than the bold-white headline
     above it because gold-on-navy contrasts harder than
     white-on-navy. Now ~82% saturation: still gold-tinted,
     visually subordinate to the heavy line. */
  body.home-page .mobile-hero-headline .mobile-hero-line2 {
    color: rgba(251, 191, 36, 0.82) !important;
  }

  /* §65 Section anchor — quieter + full content width.
     Was rgba(251,191,36,0.13) which read as a small bracket;
     now rgba(...,0.07) full width — barely-there breathing
     anchor instead of a visible line. */
  body.home-page .grade-picker-section .section-label::before {
    background: rgba(251, 191, 36, 0.07);
  }
}

/* ============================================================
   §66 — Premium polish pass 4 (8 surgical pixel fixes)
   1. Top bar 24/32px gutter
   2. Star icon optical-center alignment
   3. Headline punctuation (HTML, no CSS)
   4. Letter-spacing weight balance (line1 tighter, line2 default)
   5. Tagline rgba(255,255,255,0.92) — already in §63, no change
   6. Trust signal em-dash separator (HTML, no CSS)
   7. Section label letter-spacing 0.16em
   8. Section label parent-voice copy (HTML, no CSS)
   ============================================================ */

/* §66 fix 1 — Top bar gutters. .site-header .container is the
   flex row; pad it 24px mobile / 32px desktop so the wordmark
   and Sign in button don't touch screen edges. */
@media (max-width: 768px) {
  .site-header .container {
    padding-left: 24px !important;
    padding-right: 24px !important;
  }
}
@media (min-width: 769px) {
  .site-header .container {
    padding-left: 32px !important;
    padding-right: 32px !important;
  }
}

/* §66 fix 2 — Star icon optical-center. .brand has
   align-items:center; flex centers bounding boxes, but the
   visual mass of the star sits below text x-height. Nudge up
   by 1px for true optical balance. */
.site-header .brand .brand-logo,
.site-header .brand > svg {
  position: relative;
  top: -1px;
}

@media (max-width: 768px) {
  /* §66 fix 4 — Letter-spacing weight balance. Bold line gets
     slightly condensed (-0.02em); italic stays default. Compensates
     for italic gold reading heavier than bold white at same nominal
     spacing. */
  body.home-page .mobile-hero-headline .mobile-hero-line1 {
    letter-spacing: -0.02em !important;
  }
  body.home-page .mobile-hero-headline .mobile-hero-line2 {
    letter-spacing: 0 !important;
  }

  /* §66 fix 7 — Caps label letter-spacing 0.16em (was 0.15em).
     Tighter premium tracking. */
  body.home-page .grade-picker-section .section-label {
    letter-spacing: 0.16em !important;
  }
}

/* ============================================================
   §67 — Sign-in modal compaction
   Sign in button was below-the-fold on iPhone (Hamid 10:43am).
   Cut the chrome so the button is visible without scroll on
   any viewport ≥568px tall.
   ============================================================ */

/* Modal container — tighter padding + max-height that never
   exceeds viewport. Internal overflow-y for the rare overflow. */
.signin-modal {
  padding: 28px 24px 20px !important;
  max-height: min(90vh, 700px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Title / subtitle — tightened margins. */
.signin-modal-title {
  font-size: 28px !important;
  margin-bottom: 6px !important;
}
.signin-modal-subtitle {
  margin-bottom: 18px !important;
  font-size: 13px !important;
}

/* OAuth button stack — tighter gap + smaller bottom margin. */
.signin-sso-buttons {
  gap: 8px !important;
  margin-bottom: 14px !important;
}

/* §67 Auth divider — bare 1px line, no text label. Replaces
   the noisy '.signin-divider' / '.signin-divider-text' chrome. */
.auth-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
  margin: 14px 0 18px;
  border: 0;
}

/* Form fields — tighter vertical rhythm. */
.signin-form { gap: 12px !important; }
.signin-field { gap: 4px !important; }

/* Modal footer ('New to GradeEarn? Create an account') —
   tighter top spacing. */
.signin-modal-footer {
  margin-top: 16px !important;
  padding-top: 14px !important;
}

/* §67 — On phone, ensure the modal+contents fit a 568px+ viewport
   even with iOS bottom safe-area. The mobile @media at line ~7973
   already sets max-height: 90vh / 90dvh on .signin-modal; the
   tighter padding above brings the button above the fold. */

/* ============================================================
   §68 — Practice page polish
   - Hide wordmark on practice + practice-flow pages (breadcrumb
     identifies the page; redundant)
   - Auto-advance progress indicator on CORRECT state
   - Single-line inline feedback chip
   ============================================================ */

/* Hide the GradeEarn brand on practice flow pages — breadcrumb
   'TX · Grade 3 · Math' carries the identity. */
body.practice-mode .site-header .brand {
  display: none !important;
}

/* §68 Auto-advance indicator (CORRECT state). Replaces the Check
   button slot. Subtle, drains over 1.5s to signal motion. */
.q-autoadvance {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 0 4px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}
.q-autoadvance-text { letter-spacing: 0.01em; }
.q-autoadvance-bar {
  width: 80px;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}
.q-autoadvance-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  transform-origin: left center;
  animation: q-autoadvance-drain 1.5s linear forwards;
}
@keyframes q-autoadvance-drain {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* §68 Single-line CORRECT inline feedback. Pts + middle-dot +
   explanation, all on one row. Wraps gracefully if explanation
   pushes past viewport width. */
body.practice-page .q-inline-fb-sep {
  color: rgba(255, 255, 255, 0.30);
  margin: 0 4px;
}
body.practice-page .q-inline-fb-body-inline {
  color: rgba(255, 255, 255, 0.80);
  font-weight: 400;
  font-size: 0.92rem;
}
body.practice-page .q-inline-fb-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 0;
  font-size: 0.95rem;
  font-weight: 600;
}
body.practice-page .question-card[data-state="correct"] .q-inline-fb-pts { color: #6ee7b7; }

/* §68b — Question-card cross-fade on render (after auto-advance
   from CORRECT, after Next on WRONG, on initial mount).
   Brief 320ms opacity rise so the swap feels intentional, not
   a hard cut. data-state='asking' is the entry state for any
   freshly rendered question; the keyframe runs once. */
body.practice-page .question-card[data-state="asking"] {
  animation: question-fade-in 320ms cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes question-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  body.practice-page .question-card[data-state="asking"] { animation: none; }
}

/* ==========================================================
   §70 — User-menu dropdown polish + sign-out flow
   Hamid screenshot 12:50pm: signed-in user saw NO avatar +
   NO sign-out path (constitutional right violation per
   Owners' Room). Block 1's old !important hider for
   .user-pill / .user-menu was removed at line 7779; this
   block adds the dropdown's Material-spec polish:
     - dropdown header (name + @username, no email locally)
     - section divider before destructive actions
     - red-tinted "Sign out" button
     - 44px tap target on avatar (extends invisible hit area)
   ========================================================== */
.user-menu-header {
  padding: 10px 12px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 4px;
}
.user-menu-header-name {
  display: block;
  color: #f9fafb;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 2px;
}
.user-menu-header-handle {
  display: block;
  color: rgba(255, 255, 255, 0.55);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.78rem;
}
.user-menu-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 4px 4px;
}
.user-menu button.user-menu-signout,
.user-menu .user-menu-signout {
  color: rgba(248, 113, 113, 0.92);
}
.user-menu button.user-menu-signout:hover {
  background: rgba(239, 68, 68, 0.10);
  color: rgba(252, 165, 165, 1);
}

/* Avatar tap target — visible 36px circle, invisible hit area
   extends to 44x44pt per Material/Apple HIG.
   Use ::before pseudo to extend hit area without disturbing layout. */
.site-header .user-pill {
  position: relative;
}
.site-header .user-pill::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 999px;
  /* No background — purely a hit area. */
}
