/* Robot Reflex Room: self-contained module stylesheet.
   Inherits root tokens + topbar from ../styles.css, then defines everything else. */
@import url("../styles.css");

/* ---- Module identity: steel-teal / metallic green ---- */
:root {
  --robot: #3f6b2e;          /* primary accent */
  --robot-deep: #1f6e44;
  --robot-soft: #e8eedb;
  --steel: #5d6b4f;          /* metallic steel-blue */
  --steel-soft: #e7eddc;
  --sense: #466f96;
  --think: #a8543a;
  --act: #2f8f5b;
  --learn: #9a7d2e;
}

/* tint the logo square */
.mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(135deg, var(--robot) 0%, var(--steel) 120%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25), 0 3px 8px rgba(31, 110, 68, .35);
}
.mark-text { color: var(--robot-deep); }

nav a { transition: color .18s ease; }
nav a:hover { color: var(--robot-deep); }

/* ===================== STICKY LEVEL RAIL ===================== */
.level-rail {
  position: fixed;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(251, 252, 245, .9);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}
.level-rail a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px 6px 6px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 800;
  font-size: .82rem;
  transition: background .2s ease, color .2s ease;
}
.level-rail a b {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--steel-soft);
  color: var(--steel);
  font-size: .82rem;
}
.level-rail a span { white-space: nowrap; }
.level-rail a:hover { background: var(--robot-soft); color: var(--ink); }
.level-rail a.active { background: var(--robot); color: #fff; }
.level-rail a.active b { background: rgba(255, 255, 255, .25); color: #fff; }

/* ===================== HERO ===================== */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(300px, .96fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  padding: clamp(40px, 6vw, 84px) clamp(18px, 4vw, 56px);
  min-height: auto;
}
.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(2.2rem, 5.4vw, 4.6rem);
  line-height: 1.03;
  letter-spacing: -0.01em;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
}
.chip {
  padding: 7px 13px;
  border-radius: 999px;
  font-weight: 900;
  font-size: .78rem;
  letter-spacing: .06em;
  color: #fff;
}
.chip.s { background: var(--sense); }
.chip.t { background: var(--think); }
.chip.a { background: var(--act); }
.chip.l { background: var(--learn); }
.chip-row .arrow { color: var(--muted); font-weight: 900; }
.chip-row .arrow.loop { font-size: 1.3rem; color: var(--robot); }

.hero-visual { position: relative; }
.button.primary {
  border-color: var(--robot);
  background: var(--robot);
}
.button.primary:hover { background: var(--robot-deep); border-color: var(--robot-deep); }
.button { transition: transform .12s ease, background .18s ease, border-color .18s ease; }
.button:hover { transform: translateY(-1px); }

/* ===================== CANVAS ===================== */
canvas {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}
#heroCanvas { aspect-ratio: 16 / 11; }
#loopCanvas { aspect-ratio: 16 / 8; margin: 8px 0 14px; }
#gridCanvas, #ctrlCanvas { aspect-ratio: 4 / 3; }
.canvas-wrap { min-width: 0; }

/* ===================== LEVEL SECTIONS ===================== */
.level, .recap {
  padding: clamp(46px, 6vw, 84px) clamp(18px, 4vw, 56px) clamp(36px, 5vw, 60px);
  border-top: 1px solid var(--line);
  scroll-margin-top: 70px;
}
.level[data-level="1"] { background: var(--robot-soft); }
.level[data-level="2"] { background: var(--paper); }
.level[data-level="3"] { background: var(--steel-soft); }
.level[data-level="4"] { background: var(--paper); }
.recap { background: var(--robot-soft); }

.level-head { max-width: 880px; margin-bottom: 30px; }
.level-head h2 {
  margin: 4px 0 12px;
  font-size: clamp(1.7rem, 3.6vw, 3rem);
  line-height: 1.06;
}
.level-head .lead { margin: 0; }

/* reveal-on-scroll */
.level .panel,
.level .analogy-grid,
.level .split-2,
.level .note-list,
.level .math-card,
.level .example-box,
.level .svg-card,
.recap .recap-grid {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal { opacity: 1 !important; transform: none !important; }
@media (prefers-reduced-motion: reduce) {
  .level .panel, .level .analogy-grid, .level .split-2, .level .note-list,
  .level .math-card, .level .example-box, .level .svg-card, .recap .recap-grid {
    opacity: 1; transform: none; transition: none;
  }
}

/* ===================== ANALOGY CARDS ===================== */
.analogy-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 30px;
}
.analogy {
  border: 1px solid var(--line);
  border-top: 4px solid var(--robot);
  border-radius: 12px;
  padding: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: transform .16s ease;
}
.analogy:hover { transform: translateY(-3px); }
.analogy.s { border-top-color: var(--sense); }
.analogy.t { border-top-color: var(--think); }
.analogy.a { border-top-color: var(--act); }
.analogy.l { border-top-color: var(--learn); }
.analogy .ico { font-size: 1.7rem; }
.analogy h3 { margin: 6px 0 8px; font-size: 1.12rem; }
.analogy p { margin: 0 0 8px; line-height: 1.55; font-size: .94rem; }
.analogy .muted { color: var(--muted); }

/* ===================== PANELS / LAB ===================== */
.panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: clamp(18px, 3vw, 26px);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.panel.lab { margin-bottom: 26px; }
.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.panel-title h3 { margin: 0; font-size: 1.25rem; }
.badge {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--robot);
  color: #fff;
  font-weight: 900;
  font-size: .76rem;
  letter-spacing: .05em;
}

.controls-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }

.lab-layout {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(0, 1.6fr);
  gap: 20px;
  margin-top: 14px;
}
.control-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--steel-soft);
}
.control-panel label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-weight: 800;
  font-size: .9rem;
}
.control-panel output { color: var(--robot-deep); font-weight: 900; }
.control-panel .check-row { flex-direction: row; align-items: center; gap: 8px; }
.tip { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }

input[type="range"] {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--robot), var(--steel));
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--robot);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--robot);
  cursor: pointer;
}

.narration {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-left: 4px solid var(--robot);
  border-radius: 0 8px 8px 0;
  background: var(--robot-soft);
  color: var(--ink);
  font-size: .95rem;
  line-height: 1.55;
  min-height: 1.2em;
}
.note { color: var(--muted); }
.muted { color: var(--muted); }

/* ===================== SPLIT / NOTE LISTS ===================== */
.split-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-bottom: 26px;
}
.note-list { display: grid; gap: 12px; }
.note-list.two { grid-template-columns: 1fr 1fr; margin: 22px 0; }
.note-list article {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--robot);
  border-radius: 0 10px 10px 0;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.note-list strong { display: block; margin-bottom: 4px; }
.note-list span { color: var(--muted); line-height: 1.55; font-size: .92rem; }

/* ===================== SVG CARDS ===================== */
.svg-card {
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.svg-card.wide { margin-bottom: 26px; }
.svg-card svg { width: 100%; height: auto; }
.svg-card figcaption { margin-top: 10px; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.svg-node rect { fill: var(--steel-soft); stroke: var(--steel); stroke-width: 1.4; }
.svg-hub rect { fill: #fff; stroke: var(--robot); stroke-width: 1.8; }
.svg-accent rect { fill: var(--robot-soft); stroke: var(--robot); stroke-width: 1.8; }
.svg-card text { fill: var(--ink); font-size: 12px; font-weight: 800; text-anchor: middle; font-family: Inter, system-ui, sans-serif; }
.svg-card text.sub { fill: var(--muted); font-size: 11px; }
.svg-card text.lbl { fill: var(--muted); font-size: 10px; font-weight: 700; text-anchor: middle; }

/* ===================== MATH CARDS ===================== */
.math-card {
  margin: 0 0 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.math-render {
  padding: 22px 18px;
  background: linear-gradient(180deg, var(--robot-soft), #fff);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.math-card figcaption { padding: 18px 20px; }
.math-card figcaption p { margin: 0 0 12px; line-height: 1.6; }
.legend { margin: 0 0 6px; padding-left: 18px; display: grid; gap: 6px; }
.legend li { color: var(--muted); line-height: 1.5; }
.legend strong { color: var(--ink); }
.note.inline { display: block; margin: 8px 0 0; padding: 10px 12px; background: var(--steel-soft); border-radius: 8px; font-size: .9rem; }

.mini-viz {
  display: flex; align-items: center; gap: 12px;
  margin: 12px 0 0; font-weight: 900; font-size: 1.05rem;
}
.vz-o { color: var(--sense); }
.vz-pi { color: var(--think); }
.vz-a { color: var(--act); }
.vz-arr { color: var(--muted); }

.inline-slider {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  margin-top: 14px; font-weight: 800;
}
.inline-slider input[type="range"] { flex: 1 1 160px; max-width: 100%; min-width: 0; }
.inline-slider output { color: var(--robot-deep); font-weight: 900; }

/* discount bars viz */
.discount-viz {
  display: flex; align-items: flex-end; gap: 6px;
  height: 70px; margin-top: 14px;
  padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--steel-soft);
}
.discount-viz .bar {
  flex: 1;
  background: linear-gradient(180deg, var(--robot), var(--steel));
  border-radius: 4px 4px 0 0;
  transition: height .25s ease;
  min-height: 2px;
}

/* ===================== EXAMPLE BOX ===================== */
.example-box {
  margin-top: 10px;
  padding: 18px 20px;
  border: 1px dashed var(--robot);
  border-radius: 12px;
  background: var(--panel);
}
.example-box strong { display: block; margin-bottom: 8px; color: var(--robot-deep); }
.example-box p { margin: 8px 0 0; line-height: 1.6; }
.walk { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 8px; line-height: 1.55; }
.t-s { color: var(--sense); } .t-t { color: var(--think); }
.t-a { color: var(--act); }  .t-l { color: var(--learn); }

/* ===================== CODE PANEL ===================== */
.code-panel { margin-top: 8px; }
.code-block {
  margin: 14px 0 0;
  padding: 16px;
  border-radius: 10px;
  background: #10211a;
  color: #cdeede;
  overflow-x: auto;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .86rem;
  line-height: 1.6;
}
.code-explanation { margin-top: 12px; display: grid; gap: 8px; }
.code-explanation p { margin: 0; color: var(--muted); line-height: 1.5; }
.code-explanation strong { color: var(--ink); font-family: ui-monospace, monospace; }

/* ===================== QUIZ ===================== */
.quiz { margin-top: 22px; }
.quiz .q { padding: 14px 0; border-top: 1px solid var(--line); }
.quiz .q:first-of-type { border-top: none; }
.qtext { margin: 0 0 10px; line-height: 1.5; }
.opt {
  display: block; width: 100%; text-align: left;
  margin: 6px 0; padding: 11px 14px;
  border: 1px solid var(--line); border-radius: 9px;
  background: #fff; font-weight: 700; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.opt:hover { background: var(--steel-soft); transform: translateX(2px); }
.opt.correct { background: var(--robot-soft); border-color: var(--robot); }
.opt.wrong { background: #f4e3da; border-color: var(--think); }
.opt:disabled { cursor: default; }
.qfb { margin: 8px 0 0; padding: 10px 12px; border-radius: 8px; font-size: .9rem; line-height: 1.5; }
.qfb.ok { background: var(--robot-soft); color: var(--robot-deep); }
.qfb.no { background: #f4e3da; color: var(--think); }

/* ===================== RECAP ===================== */
.recap-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.recap-grid article {
  padding: 16px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--robot);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.recap-grid b { display: block; margin-bottom: 6px; color: var(--robot-deep); }
.recap-grid span { color: var(--muted); line-height: 1.55; font-size: .92rem; }

/* ===================== FOOTER / BACK-TO-TOP ===================== */
footer a { font-weight: 800; }
footer a:hover { color: var(--robot-deep); }

.back-to-top {
  position: fixed;
  right: 18px; bottom: 18px;
  z-index: 25;
  padding: 10px 14px;
  border: 1px solid var(--robot);
  border-radius: 999px;
  background: var(--robot);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease, transform .12s ease;
  box-shadow: var(--shadow);
}
.back-to-top.show { opacity: 1; pointer-events: auto; }
.back-to-top:hover { transform: translateY(-2px); background: var(--robot-deep); }

/* ===================== RESPONSIVE ===================== */

/* Global guard: nothing in the module may push past the viewport. */
.hero, .level, .recap, .panel, .svg-card, .math-card, .example-box,
.note-list, .split-2, .lab-layout, .analogy-grid, .recap-grid,
.controls-row, .panel-title, .chip-row, .hero-actions { min-width: 0; }
.panel, .svg-card, .math-card, .example-box { max-width: 100%; overflow-wrap: break-word; }

/* Use fluid minmax so wide grids never demand more than the viewport. */
.analogy-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.recap-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Hero second column shouldn't force a fixed 300px min. */
@media (max-width: 1100px) {
  .hero { grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr); }
}

/* ---- Below the level-rail's room: turn it into a compact bottom bar ---- */
@media (max-width: 1040px) {
  .level-rail {
    top: auto;
    bottom: 12px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    flex-direction: row;
    gap: 4px;
    padding: 6px 8px;
    max-width: calc(100% - 24px);
    overflow: hidden;
  }
  .level-rail a {
    padding: 6px 8px;
    gap: 6px;
    font-size: .76rem;
  }
  /* hide the long text labels, keep just the numbered chips */
  .level-rail a span { display: none; }
  /* keep the bottom bar clear of the back-to-top button */
  .back-to-top { bottom: 64px; }
}

/* ---- Tablet / large phone: collapse the two-column structures ---- */
@media (max-width: 860px) {
  .hero, .split-2, .lab-layout, .note-list.two, .recap-grid {
    grid-template-columns: 1fr;
  }
  .analogy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { flex-direction: column; align-items: flex-start; gap: 10px; }
  /* When the control panel stacks above the canvas, give the canvas room. */
  .lab-layout { gap: 16px; }
}

/* ---- Small phones: single column + tighter rhythm ---- */
@media (max-width: 520px) {
  .analogy-grid, .recap-grid { grid-template-columns: 1fr; }

  .level, .recap { padding: clamp(34px, 9vw, 46px) 16px clamp(28px, 7vw, 36px); }
  .hero { padding: clamp(32px, 9vw, 46px) 16px; gap: 22px; }

  .panel { padding: 16px; }
  .panel-title { flex-wrap: wrap; gap: 8px; }
  .panel-title h3 { font-size: 1.12rem; }

  /* Stack action button rows full-width so they stay easily tappable. */
  .controls-row { flex-direction: column; align-items: stretch; }
  .controls-row .button { width: 100%; }
  .hero-actions { gap: 10px; }
  .hero-actions .button { flex: 1 1 100%; }

  .level-head { margin-bottom: 22px; }
  .analogy h3 { font-size: 1.05rem; }
  .math-render { padding: 16px 14px; }
  .math-card figcaption { padding: 14px 14px; }
  .example-box { padding: 16px; }
}

/* ---- Very small phones (<=360px): final overflow safety net ---- */
@media (max-width: 360px) {
  .level, .recap { padding-left: 12px; padding-right: 12px; }
  .hero { padding-left: 12px; padding-right: 12px; }
  .panel { padding: 14px; }
  .chip { padding: 6px 10px; font-size: .72rem; }
  .badge { padding: 4px 9px; font-size: .72rem; }
  .level-rail a { padding: 5px 6px; }
  .level-rail a b { width: 22px; height: 22px; }
}

/* ===================== BEAUTIFUL-MATH CALLOUT ===================== */
.beauty-note {
  margin: 18px 0;
  padding: 16px 18px 14px;
  background: linear-gradient(180deg, var(--robot-soft) 0%, var(--panel) 70%);
  border: 1px solid var(--line);
  border-left: 4px solid var(--robot);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(31, 110, 68, .08);
}
.beauty-label {
  display: inline-block;
  margin-bottom: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--robot);
  color: #fbfcf5;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.beauty-name {
  margin: 0 0 6px;
  color: var(--robot-deep);
  font-weight: 800;
  font-size: 1.02rem;
}
.beauty-render {
  margin: 4px 0 10px;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow-x: auto;
}
.beauty-why {
  margin: 0;
  color: var(--muted);
  line-height: 1.62;
}
.beauty-why em { color: var(--ink); font-style: italic; }
@media (max-width: 600px) {
  .beauty-note { padding: 14px; }
  .beauty-render { padding: 10px 12px; }
}

/* ===================== VALUE-MAP BUILDER (intermediate bridge viz) ===================== */
#viCanvas { aspect-ratio: 6 / 5; }

/* ============================================================
   POLISH PASS: additive, CSS-only micro-interactions.
   All transitions are guarded by prefers-reduced-motion below.
   Reuses existing class names + the --robot accent family only.
   ============================================================ */

/* ---- Accessible keyboard focus rings (none existed before) ---- */
.button:focus-visible,
.opt:focus-visible,
.level-rail a:focus-visible,
.back-to-top:focus-visible,
nav a:focus-visible,
.brand:focus-visible,
footer a:focus-visible {
  outline: 3px solid var(--robot);
  outline-offset: 2px;
  border-radius: 8px;
}
input[type="range"]:focus-visible {
  outline: 3px solid var(--robot);
  outline-offset: 3px;
}
input[type="range"]:focus-visible::-webkit-slider-thumb { border-color: var(--robot-deep); }
input[type="range"]:focus-visible::-moz-range-thumb { border-color: var(--robot-deep); }
input[type="checkbox"]:focus-visible {
  outline: 3px solid var(--robot);
  outline-offset: 2px;
}

/* ---- Gentle shadow-lift on content cards (matches .analogy) ---- */
.note-list article,
.svg-card,
.math-card,
.recap-grid article {
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.note-list article:hover,
.svg-card:hover,
.math-card:hover,
.recap-grid article:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(31, 110, 68, .14);
}
.analogy { transition: transform .16s ease, box-shadow .16s ease; }
.analogy:hover { box-shadow: 0 8px 22px rgba(31, 110, 68, .16); }

/* Lab panels glow softly while a control inside them holds focus. */
.panel.lab { transition: box-shadow .2s ease, border-color .2s ease; }
.panel.lab:focus-within { box-shadow: 0 6px 20px rgba(31, 110, 68, .16); border-color: var(--robot); }

/* Subtle sheen lift on the typeset math strip when its card is hovered. */
.math-card:hover .math-render { background: linear-gradient(180deg, var(--robot-soft), #fbfdf7); }
.math-render { transition: background .2s ease; }

/* ---- Frontier tier: give level 5 the same tier-background rhythm ---- */
.level[data-level="5"] { background: var(--steel-soft); }

/* ---- Typography / spacing refinements ---- */
.level-head .lead { max-width: 70ch; }
.legend li { line-height: 1.55; }
.note-list span { letter-spacing: .002em; }
.example-box p { max-width: 72ch; }

/* Tip text inside control panels reads as a quiet aside. */
.control-panel .tip { padding-top: 2px; border-top: 1px solid var(--line); }

/* ---- Responsive hardening for wide media ---- */
/* Wide SVGs already scale to width; keep their captions comfortable. */
.svg-card.wide svg { min-width: 0; }
.code-block { max-height: 60vh; }
@media (max-width: 520px) {
  .code-block { font-size: .8rem; padding: 14px; }
  .level-head .lead { max-width: none; }
  .mini-viz { font-size: .98rem; gap: 9px; }
}

/* ---- Honor reduced-motion: drop all new transforms/transitions ---- */
@media (prefers-reduced-motion: reduce) {
  .note-list article,
  .svg-card,
  .math-card,
  .recap-grid article,
  .analogy,
  .panel.lab,
  .math-render {
    transition: none;
  }
  .note-list article:hover,
  .svg-card:hover,
  .math-card:hover,
  .recap-grid article:hover,
  .analogy:hover {
    transform: none;
  }
}
