/* =====================================================================
   BolEnglish — Shared Core Styles
   Used by all Phase-2 topic pages. Mirrors the design language of
   index.html and grammar-tenses.html.
   ===================================================================== */

:root {
  --primary-purple:  #7c3aed;
  --electric-blue:   #3b82f6;
  --sunshine-yellow: #fbbf24;
  --mint-fresh:      #10b981;
  --coral-pop:       #f97316;
  --pink-playful:    #ec4899;
  --lavender-soft:   #a78bfa;
  --sky-light:       #0ea5e9;

  --bg:          #fafaff;
  --bg-soft:     #f3f0ff;
  --surface:     #ffffff;
  --text:        #1f1b3a;
  --text-muted:  #5b5878;
  --border:      rgba(124,58,237,0.12);
  --shadow-md:   0 8px 24px -8px rgba(124,58,237,0.18);

  /* default (overridden per module) */
  --module:      #7c3aed;
  --module-2:    #a78bfa;
  --module-grad: linear-gradient(135deg, #7c3aed, #a78bfa);
  --module-shadow: rgba(124,58,237,0.5);
}
html[data-theme="dark"] {
  --bg:         #0d0a1f;
  --bg-soft:    #151030;
  --surface:    #1a1540;
  --text:       #f1efff;
  --text-muted: #a8a2c9;
  --border:     rgba(167,139,250,0.18);
}

/* Module themes */
.mod-grammar   { --module:#7c3aed; --module-2:#a78bfa; --module-grad:linear-gradient(135deg,#7c3aed,#a78bfa); --module-shadow:rgba(124,58,237,0.5); }
.mod-reading   { --module:#3b82f6; --module-2:#0ea5e9; --module-grad:linear-gradient(135deg,#3b82f6,#0ea5e9); --module-shadow:rgba(59,130,246,0.5); }
.mod-writing   { --module:#f97316; --module-2:#fb923c; --module-grad:linear-gradient(135deg,#f97316,#fb923c); --module-shadow:rgba(249,115,22,0.5); }
.mod-speaking  { --module:#ec4899; --module-2:#f472b6; --module-grad:linear-gradient(135deg,#ec4899,#f472b6); --module-shadow:rgba(236,72,153,0.5); }
.mod-listening { --module:#10b981; --module-2:#34d399; --module-grad:linear-gradient(135deg,#10b981,#34d399); --module-shadow:rgba(16,185,129,0.5); }
.mod-vocab     { --module:#f59e0b; --module-2:#fbbf24; --module-grad:linear-gradient(135deg,#f59e0b,#fbbf24); --module-shadow:rgba(251,191,36,0.5); }
.mod-phonetics { --module:#14b8a6; --module-2:#5eead4; --module-grad:linear-gradient(135deg,#0d9488,#14b8a6,#5eead4); --module-shadow:rgba(20,184,166,0.5); }
.mod-prep      { --module:#6366f1; --module-2:#8b5cf6; --module-grad:linear-gradient(135deg,#4f46e5,#6366f1,#8b5cf6); --module-shadow:rgba(99,102,241,0.5); }

* { -webkit-font-smoothing: antialiased; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.4s ease, color 0.4s ease;
  margin: 0;
}
h1, h2, h3, h4 { font-family: 'Fredoka', sans-serif; letter-spacing: -0.02em; }
.handwrite { font-family: 'Caveat', cursive; }

.mesh-bg {
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(at 20% 10%, color-mix(in srgb, var(--module) 25%, transparent) 0px, transparent 50%),
    radial-gradient(at 80% 80%, color-mix(in srgb, var(--module-2) 22%, transparent) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(236,72,153,0.08) 0px, transparent 50%);
}

.glass {
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}
.glass-strong {
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--border);
}
.gradient-text {
  background: var(--module-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.35rem 0.75rem; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600;
}
.btn-primary {
  background: var(--module-grad);
  color: #fff; padding: 0.8rem 1.5rem; border-radius: 12px;
  font-weight: 600;
  box-shadow: 0 8px 20px -8px var(--module-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  display: inline-flex; align-items: center; gap: 0.5rem;
  border: none; cursor: pointer; font-family: inherit;
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px) scale(1.02); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost {
  padding: 0.8rem 1.4rem; border-radius: 12px;
  border: 2px solid var(--border); background: transparent;
  color: var(--text); font-weight: 600;
  transition: all 0.2s;
  display: inline-flex; align-items: center; gap: 0.5rem;
  cursor: pointer; font-family: inherit;
}
.btn-ghost:hover { border-color: var(--module); color: var(--module); }

/* Top progress bar */
#progressBar { height: 8px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
#progressBar > div { height: 100%; background: var(--module-grad); width: 0%; transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1); }

/* Concept cards */
.concept-card {
  position: relative;
  padding: 1.5rem;
  border-radius: 20px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}
.concept-card::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--tint, var(--module-grad));
  opacity: 0.08;
}
.concept-card:hover { transform: translateY(-4px); }
.concept-card > * { position: relative; }
.concept-body {
  max-height: 0; opacity: 0;
  transform: translateY(-6px);
  transition: max-height 0.6s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.45s ease 0.1s,
              transform 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.1s;
  overflow: hidden;
}
.concept-card.open {
  box-shadow: 0 16px 36px -16px var(--tint-solid, rgba(124,58,237,0.28));
}
.concept-card.open .concept-body {
  max-height: 600px;
  opacity: 1;
  transform: translateY(0);
  margin-top: 1rem;
}

/* Quiz options */
.opt {
  position: relative;
  padding: 1rem 1.2rem;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
  display: flex; align-items: center; gap: 0.8rem;
  width: 100%;
  color: inherit; font-family: inherit; font-size: inherit;
}
.opt:hover { border-color: var(--module); transform: translateX(4px); }
.opt .dot {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--border);
  display: grid; place-items: center;
  font-size: 0.75rem; font-weight: 700;
  flex-shrink: 0;
  transition: all 0.2s;
}
.opt:hover .dot { border-color: var(--module); color: var(--module); }
.opt.correct { border-color: #10b981; background: rgba(16,185,129,0.08); animation: pop 0.4s; }
.opt.correct .dot { background: #10b981; color: #fff; border-color: #10b981; }
.opt.wrong   { border-color: #ef4444; background: rgba(239,68,68,0.08); animation: shake 0.4s; }
.opt.wrong .dot { background: #ef4444; color: #fff; border-color: #ef4444; }
.opt.locked  { pointer-events: none; opacity: 0.6; }

@keyframes pop {
  0% { transform: scale(1); } 50% { transform: scale(1.04); } 100% { transform: scale(1); }
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* Word chips & blanks */
.word-chip {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--module-grad);
  color: #fff;
  border-radius: 10px;
  font-weight: 600;
  cursor: grab;
  user-select: none;
  box-shadow: 0 4px 10px -4px var(--module-shadow);
  transition: transform 0.2s;
}
.word-chip:hover { transform: translateY(-2px); }
.word-chip.dragging { opacity: 0.4; }
.word-chip.used { opacity: 0.3; cursor: default; pointer-events: none; }
.blank-slot {
  display: inline-block;
  min-width: 110px; min-height: 40px;
  padding: 0.4rem 0.8rem;
  border: 2px dashed var(--module);
  border-radius: 10px;
  margin: 0 0.25rem;
  text-align: center;
  vertical-align: middle;
  transition: all 0.2s;
}
.blank-slot.drag-over { background: color-mix(in srgb, var(--module) 12%, transparent); border-style: solid; }
.blank-slot.filled { border-style: solid; background: color-mix(in srgb, var(--module) 8%, transparent); }
.blank-slot.correct { border-color: #10b981; background: rgba(16,185,129,0.12); color: #059669; }
.blank-slot.wrong { border-color: #ef4444; background: rgba(239,68,68,0.12); color: #dc2626; }

/* Rearrange tiles */
.tile {
  display: inline-block;
  padding: 0.7rem 1.1rem;
  border-radius: 12px;
  background: var(--surface);
  border: 2px solid var(--border);
  font-weight: 600;
  cursor: grab;
  user-select: none;
  transition: all 0.2s;
}
.tile:hover { border-color: var(--module); transform: translateY(-2px); }
.tile.dragging { opacity: 0.4; }
.answer-box {
  min-height: 70px;
  padding: 0.8rem;
  border: 2px dashed var(--module);
  border-radius: 14px;
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-start;
  background: color-mix(in srgb, var(--module) 4%, transparent);
}
.answer-box.correct { border-color: #10b981; background: rgba(16,185,129,0.08); }
.answer-box.wrong   { border-color: #ef4444; background: rgba(239,68,68,0.08); }

/* Error spotting */
.sentence-box {
  padding: 1rem; border-radius: 12px; background: var(--bg-soft);
  font-size: 1.1rem; line-height: 1.8;
}
.sentence-word {
  display: inline-block;
  padding: 0.25rem 0.45rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.sentence-word:hover { background: color-mix(in srgb, var(--module) 10%, transparent); }
.sentence-word.correct { background: rgba(16,185,129,0.2); color: #059669; font-weight: 700; }
.sentence-word.wrong { background: rgba(239,68,68,0.2); color: #dc2626; font-weight: 700; }

/* Rapid fire timer */
.timer-bar { height: 10px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.timer-bar > div {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #fbbf24, #ef4444);
  width: 100%;
  transition: width 0.1s linear;
}

/* Feedback */
.feedback {
  margin-top: 0.8rem;
  padding: 0.8rem 1.1rem;
  border-radius: 12px;
  font-weight: 600;
  animation: slideIn 0.3s;
}
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.feedback.good { background: rgba(16,185,129,0.12); color: #059669; }
.feedback.bad { background: rgba(239,68,68,0.12); color: #dc2626; }
.feedback.info { background: color-mix(in srgb, var(--module) 12%, transparent); color: var(--module); }

/* XP float */
.xp-float {
  position: fixed;
  font-weight: 800; font-size: 1.3rem;
  color: var(--module);
  pointer-events: none;
  animation: floatUp 1.3s ease-out forwards;
  z-index: 100;
}
@keyframes floatUp {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-80px) scale(1.3); }
}

/* Modal */
.modal {
  position: fixed; inset: 0;
  background: rgba(15, 10, 40, 0.7);
  backdrop-filter: blur(8px);
  display: none; place-items: center;
  z-index: 200;
  animation: fadeIn 0.3s;
}
.modal.show { display: grid; }
.modal-card {
  background: var(--surface);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  max-width: 500px;
  width: calc(100% - 2rem);
  text-align: center;
  animation: scaleIn 0.4s cubic-bezier(0.22, 1.6, 0.36, 1);
  border: 1px solid var(--border);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}

/* Hoots peek */
.peek-owl {
  position: fixed;
  bottom: 20px; right: 20px;
  width: 72px; height: 72px;
  cursor: pointer;
  z-index: 50;
  filter: drop-shadow(0 10px 20px var(--module-shadow));
  animation: bob 3.5s ease-in-out infinite;
  transition: transform 0.2s;
}
.peek-owl:hover { transform: scale(1.1); }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.peek-speech {
  position: fixed;
  bottom: 100px; right: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.8rem 1.1rem;
  font-size: 0.85rem;
  max-width: 240px;
  box-shadow: var(--shadow-md);
  opacity: 0; transform: translateY(10px);
  pointer-events: none;
  transition: all 0.25s;
  z-index: 51;
}
.peek-speech.show { opacity: 1; transform: translateY(0); }

/* Audio button */
.audio-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--module) 12%, transparent);
  color: var(--module);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1rem;
  border: none;
}
.audio-btn:hover { background: var(--module); color: #fff; transform: scale(1.08); }

/* Reveal */
.reveal {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* Toast */
.toast {
  position: fixed; bottom: 100px; left: 50%;
  transform: translate(-50%, 30px);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  border-radius: 16px;
  padding: 0.8rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
  z-index: 60;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Flashcards */
.flashcard {
  perspective: 1200px;
  width: 100%;
  aspect-ratio: 16 / 10;
  cursor: pointer;
}
.flashcard-inner {
  position: relative; width: 100%; height: 100%;
  transition: transform 0.7s cubic-bezier(0.22, 1.6, 0.36, 1);
  transform-style: preserve-3d;
}
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.flashcard-face {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  border-radius: 22px;
  display: grid; place-items: center;
  padding: 1.5rem;
  text-align: center;
}
.flashcard-front {
  background: var(--module-grad);
  color: #fff;
  box-shadow: 0 20px 40px -12px var(--module-shadow);
}
.flashcard-back {
  background: var(--surface);
  border: 2px solid var(--module);
  color: var(--text);
  transform: rotateY(180deg);
}

/* Dictation input */
.dictation-input {
  width: 100%;
  padding: 0.9rem 1.1rem;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.dictation-input:focus { border-color: var(--module); }

/* Swipe card for true/false */
.swipe-card {
  position: relative;
  padding: 2rem; border-radius: 20px;
  background: var(--module-grad);
  color: #fff;
  min-height: 200px;
  display: grid; place-items: center;
  text-align: center;
  font-size: 1.2rem; font-weight: 600;
  box-shadow: 0 20px 40px -12px var(--module-shadow);
  transition: transform 0.5s, opacity 0.4s;
}
.swipe-card.left  { transform: translateX(-120%) rotate(-12deg); opacity: 0; }
.swipe-card.right { transform: translateX(120%) rotate(12deg);  opacity: 0; }

/* Matching pairs */
.match-item {
  padding: 0.9rem 1.1rem;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}
.match-item:hover { border-color: var(--module); }
.match-item.selected {
  background: var(--module-grad); color: #fff; border-color: transparent;
  box-shadow: 0 6px 14px -6px var(--module-shadow);
}
.match-item.matched { opacity: 0.4; pointer-events: none; border-style: dashed; }

/* Writing area */
.write-area {
  width: 100%; min-height: 140px;
  padding: 1rem;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  outline: none;
}
.write-area:focus { border-color: var(--module); }

/* Dark-mode auto-invert avoidance */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--primary-purple), var(--pink-playful));
  border-radius: 999px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ============================================================
   RESPONSIVE — mobile-first refinements
   ============================================================ */
@media (max-width: 768px) {
  .flashcard { aspect-ratio: 4 / 3; }
}

@media (max-width: 640px) {
  /* Type scale */
  h1 { font-size: clamp(1.6rem, 7vw, 2rem) !important; line-height: 1.15; }
  h2 { font-size: clamp(1.4rem, 6vw, 1.9rem) !important; line-height: 1.2; }
  h3 { font-size: 1.25rem !important; }
  h4 { font-size: 1.05rem !important; }

  /* Buttons — tighter but still tappable (44px min target) */
  .btn-primary, .btn-ghost {
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    min-height: 44px;
  }

  /* Glass/quiz blocks — reduce padding */
  .glass, .glass-strong { padding-left: 1rem; padding-right: 1rem; }
  .rounded-3xl.p-7 { padding: 1.1rem !important; }
  .rounded-3xl.p-8, .rounded-3xl.p-10, .md\:p-10, .md\:p-12, .md\:p-14 {
    padding-left: 1.1rem !important; padding-right: 1.1rem !important;
  }

  /* Concept cards */
  .concept-card { padding: 1.1rem; border-radius: 16px; }
  .concept-card h4 { font-size: 1rem; }

  /* Quiz options — slightly smaller */
  .opt { padding: 0.8rem 0.9rem; font-size: 0.92rem; }
  .opt .dot { width: 22px; height: 22px; font-size: 0.7rem; }
  .opt:hover { transform: none; } /* translateX can overflow on mobile */

  /* Word chips & tiles — smaller, wrap better */
  .word-chip { padding: 0.4rem 0.75rem; font-size: 0.85rem; }
  .tile { padding: 0.55rem 0.85rem; font-size: 0.9rem; }
  .blank-slot { min-width: 90px; min-height: 36px; padding: 0.3rem 0.6rem; font-size: 0.9rem; }

  /* Answer box / banks */
  .answer-box { padding: 0.6rem; gap: 0.35rem; }

  /* Sentence box */
  .sentence-box { padding: 0.85rem; font-size: 1rem; line-height: 1.7; }
  .sentence-word { padding: 0.2rem 0.35rem; }

  /* Feedback */
  .feedback { padding: 0.7rem 0.9rem; font-size: 0.9rem; }

  /* Flashcards */
  .flashcard { aspect-ratio: 4 / 3; }
  .flashcard-face { padding: 1rem; }
  .flashcard-front .text-4xl { font-size: 1.75rem !important; }

  /* Matching pairs */
  .match-item { padding: 0.7rem 0.85rem; font-size: 0.9rem; }

  /* Swipe card */
  .swipe-card { padding: 1.4rem; font-size: 1.05rem; min-height: 160px; border-radius: 16px; }

  /* Writing area */
  .write-area { min-height: 120px; font-size: 0.95rem; }
  .dictation-input { font-size: 0.95rem; }

  /* Modal — safer padding so buttons don't clip */
  .modal-card { padding: 1.6rem 1.2rem; border-radius: 18px; }
  .modal-card .text-6xl { font-size: 3rem; }

  /* Peek owl — smaller + safe-area */
  .peek-owl {
    width: 56px; height: 56px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    right: 12px;
  }
  .peek-owl svg { width: 56px; height: 56px; }
  .peek-speech {
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    right: 12px;
    max-width: min(240px, calc(100vw - 24px));
    font-size: 0.8rem;
    padding: 0.6rem 0.85rem;
  }

  /* Toast — sit above the owl */
  .toast { bottom: 80px; font-size: 0.82rem; padding: 0.7rem 1rem; max-width: calc(100vw - 24px); }

  /* XP float */
  .xp-float { font-size: 1.05rem; }

  /* Audio buttons — still tappable */
  .audio-btn { width: 34px; height: 34px; font-size: 0.95rem; }

  /* Prevent text overflow in tight containers */
  .truncate-mobile { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* Make sure drag interactions also respond to touch */
.tile, .word-chip { touch-action: manipulation; }

/* Fix horizontal overflow from blobs & large decorations */
html, body { overflow-x: hidden; max-width: 100%; }

/* Site-wide: Inter for headings (replaces Fredoka); keep Caveat for .handwrite */
h1,h2,h3,h4,h5,h6,.display,.section-title{font-family:'Inter',system-ui,sans-serif !important;letter-spacing:normal !important;}

/* Concept cards always expanded (no collapse) */
.concept-body{max-height:none !important;opacity:1 !important;overflow:visible !important;}

/* Theory cards: top-aligned grid — cards hug their content (no stretch blank) */
#conceptCards{ align-items:start; }

/* ===== Theory wizard (engine-wide) ===== */
#conceptCards{ display:block !important; }
.wz-head{ display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-bottom:.6rem; }
.wz-center{ font-size:.85rem; font-weight:600; color:var(--module); }
.wz-label{ font-size:.85rem; color:var(--text-muted); white-space:nowrap; }
.wz-prog{ display:flex; gap:.4rem; margin-bottom:1.1rem; }
.wz-seg{ height:5px; border-radius:3px; flex:1; background:var(--border); transition:background .35s ease; }
.wz-seg.on{ background:linear-gradient(90deg,#7c3aed,#ec4899); }
.wz-stage{ position:relative; border-radius:18px; padding:1.4rem 1.5rem; animation:wzRise .3s ease; }
@keyframes wzRise{ from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }
.wz-chip{ display:inline-flex; align-items:center; gap:.4rem; padding:.35rem .8rem; border-radius:999px; font-size:.78rem; font-weight:700; }
.wz-title{ font-size:1.3rem; font-weight:700; margin:.8rem 0 .5rem; }
.wz-sub{ color:var(--text-muted); margin-bottom:1rem; }
.wz-ex{ margin-bottom:.55rem; line-height:1.6; }
.wz-nav{ display:flex; align-items:center; justify-content:space-between; margin-top:1.2rem; }
.wz-spk{ position:absolute; top:1rem; right:1rem; width:2rem; height:2rem; border-radius:999px; display:grid; place-items:center; font-size:.85rem; background:color-mix(in srgb,var(--surface) 70%,transparent); border:1px solid var(--border); cursor:pointer; color:var(--text); }
/* rich content helpers usable inside theory examples */
.subcard{ border:1px solid var(--border); border-radius:14px; padding:.8rem 1rem; margin-bottom:.6rem; background:var(--surface); }
.subcard-label{ font-weight:700; font-size:.8rem; margin-bottom:.2rem; }
.rule-row{ display:flex; gap:1rem; border-left:4px solid; padding:.55rem 0 .55rem 1rem; margin-bottom:.35rem; align-items:flex-start; }
.rule-level{ min-width:64px; font-size:.92rem; font-weight:700; }
.rule-text{ font-weight:600; line-height:1.4; }
.rule-ex{ color:var(--text-muted); font-size:.85rem; margin-top:.15rem; }
.err-box{ border:1px solid var(--border); border-radius:14px; padding:.75rem 1rem; margin-bottom:.6rem; background:var(--surface); }
.err-wrong{ color:#dc2626; font-weight:600; } .err-right{ color:#059669; font-weight:600; }
.err-why{ color:var(--text-muted); font-size:.85rem; margin-top:.3rem; }
.note{ background:color-mix(in srgb,var(--module) 7%,transparent); border-radius:12px; padding:.7rem 1rem; color:var(--text-muted); font-size:.9rem; line-height:1.5; }
.ans{ color:#059669; font-weight:600; }
.wz-ex code{ font-family:ui-monospace,Menlo,monospace; background:color-mix(in srgb,var(--text) 8%,transparent); padding:.05rem .3rem; border-radius:5px; font-size:.92em; }