/* macrow — design system
   Light default, dark optional. Single accent (warm amber). Serif headings + sans body.
   Component-level styles for: page, breadcrumb, module card, lesson card, glossary,
   simulator, course view, simulator side panel. */

:root {
  --bg: #FAF8F4;
  --surface: #FFFFFF;
  --surface-2: #F4F1EA;
  --surface-3: #ECE7DC;
  --text: #0F172A;
  --text-2: #334155;
  --muted: #64748B;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;

  --accent: #B45309;
  --accent-hover: #92400E;
  --accent-soft: #FEF3C7;
  --accent-text: #7C2D12;

  --danger: #B91C1C;
  --success: #15803D;

  --chart-ad: #DC2626;
  --chart-as: #2563EB;
  --chart-lras: #16A34A;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.08);

  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Source Serif 4", "Source Serif Pro", ui-serif, Georgia, "Iowan Old Style", "Apple Garamond", serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

html[data-theme="dark"] {
  --bg: #0B1220;
  --surface: #111827;
  --surface-2: #0F172A;
  --surface-3: #1F2937;
  --text: #E5E7EB;
  --text-2: #CBD5E1;
  --muted: #94A3B8;
  --border: #1F2937;
  --border-strong: #334155;

  --accent: #F59E0B;
  --accent-hover: #FBBF24;
  --accent-soft: #422006;
  --accent-text: #FDE68A;

  --danger: #F87171;
  --success: #4ADE80;

  --chart-ad: #F87171;
  --chart-as: #60A5FA;
  --chart-lras: #4ADE80;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-bottom: calc(40px + env(safe-area-inset-bottom));
}
h1, h2, h3, h4 { font-family: var(--font-serif); color: var(--text); margin: 0; line-height: 1.2; font-weight: 600; }
h1 { font-size: clamp(1.85rem, 1.4rem + 1.4vw, 2.5rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.35rem, 1.15rem + 0.5vw, 1.6rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 0.9em; }
a { color: var(--accent); text-decoration: none; }
a:hover, a:focus-visible { color: var(--accent-hover); text-decoration: underline; }
button { font: inherit; }
input, textarea, select { font: inherit; color: inherit; }
hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }

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

/* Skip link */
.skip-link {
  position: absolute; top: -40px; left: 8px;
  background: var(--accent); color: #fff;
  padding: 8px 14px; border-radius: var(--radius);
  z-index: 100; font-weight: 600;
}
.skip-link:focus { top: 8px; }

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

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

/* ---------- Header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
  height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.sidebarToggle { display: none; }
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  color: var(--text); text-decoration: none;
  flex: 1; min-width: 0;
  padding: 6px 0;
}
.brand:hover { text-decoration: none; }
.brand__logo { width: 36px; height: 36px; flex: 0 0 auto; border-radius: 8px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand__name { font-family: var(--font-serif); font-weight: 700; font-size: 20px; color: var(--text); }
.brand__tag { font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.topbar__actions { display: flex; align-items: center; gap: 8px; }

.themeToggle {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
}
.themeToggle:hover { background: var(--surface-2); color: var(--text); }
.themeToggle__icon { font-size: 16px; line-height: 1; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; left: 0; top: 64px; bottom: 0;
  width: 240px; flex: 0 0 240px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 20px 12px;
  overflow-y: auto;
  z-index: 20;
}
.sidebar__head { display: none; }
.sidebar__title { font-family: var(--font-serif); font-weight: 600; font-size: 14px; color: var(--text); }
.sidebar__list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.sidebar__foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); }
.sidebar__hint { font-size: 11px; color: var(--muted); }

.navBtn {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-2);
  font-weight: 500; font-size: 14px;
  text-align: left;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.12s ease, color 0.12s ease;
}
.navBtn:hover { background: var(--surface-2); color: var(--text); }
.navBtn[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-text);
  border-color: transparent;
  font-weight: 600;
  position: relative;
}
.navBtn[aria-current="page"]::before {
  content: '';
  position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.navIcon { flex: 0 0 18px; color: currentColor; }

.sidebarBackdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0; pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 18;
}
.sidebarBackdrop--open { opacity: 1; pointer-events: auto; }
body.sidebar-open { overflow: hidden; }

/* ---------- Main shell ---------- */
.shell {
  margin-left: 240px;
  padding: 36px 28px 64px;
  min-height: calc(100vh - 64px);
}
.view { display: block; }
.view[hidden] { display: none; }
[hidden] { display: none !important; }

.page { max-width: 920px; margin: 0 auto 32px; }
.page--narrow { max-width: 760px; }
.page--wide { max-width: 1120px; }

.page__eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin: 0 0 10px;
}
.page__title { margin: 0 0 12px; }
.page__lede { font-size: 17px; color: var(--text-2); margin: 0 0 24px; max-width: 60ch; line-height: 1.55; }
.page__actions { display: flex; gap: 10px; flex-wrap: wrap; }

.sectionHeading { margin: 0 0 6px; }
.sectionSub { color: var(--muted); margin: 0 0 20px; font-size: 14px; }

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted);
  margin: 0 0 20px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--text); text-decoration: none; }
.breadcrumb__sep { color: var(--border-strong); }
.breadcrumb__current { color: var(--text); font-weight: 600; }

.linkBack {
  background: none; border: 0; padding: 0;
  font-size: 13px; color: var(--muted);
  cursor: pointer; margin: 0 0 16px;
  font-weight: 500;
}
.linkBack:hover { color: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 600; font-size: 14px;
  cursor: pointer; min-height: 40px;
  text-decoration: none;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-2); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn--ghost { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--full { width: 100%; }
.btn--mini { padding: 6px 10px; font-size: 12px; min-height: 32px; }

.iconBtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  padding: 0;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}
.iconBtn:hover { background: var(--surface-2); color: var(--text); }

/* ---------- Continue card (Home) ---------- */
.continueCard {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  padding: 24px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.continueCard__body { flex: 1; min-width: 0; }
.continueCard__meta { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); font-weight: 700; margin-bottom: 6px; }
.continueCard__title { font-family: var(--font-serif); font-size: 20px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.continueCard__sub { font-size: 14px; color: var(--muted); }

/* ---------- Progress bar ---------- */
.progressRow { display: flex; align-items: center; gap: 14px; }
.progressRow__label { font-size: 13px; font-weight: 600; color: var(--text-2); min-width: 130px; }
.progressRow__bar {
  flex: 1; height: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.progressRow__fill { height: 100%; background: var(--accent); transition: width 0.4s ease; }
.progressRow__count { font-size: 13px; font-weight: 600; color: var(--muted); min-width: 70px; text-align: right; }

/* ---------- Module grid (Home) ---------- */
.moduleGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.moduleCard {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease;
  min-height: 140px;
  color: var(--text);
  text-decoration: none;
}
.moduleCard:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.moduleCard__code {
  font-family: var(--font-serif); font-weight: 700;
  font-size: 12px; letter-spacing: 0.08em;
  color: var(--accent); margin-bottom: 6px;
}
.moduleCard__title { font-family: var(--font-serif); font-size: 18px; font-weight: 600; margin-bottom: 4px; color: var(--text); }
.moduleCard__blurb { font-size: 13px; color: var(--muted); line-height: 1.5; flex: 1; }
.moduleCard__foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.moduleCard__count { font-size: 12px; color: var(--muted); font-weight: 500; }
.moduleCard__progress { font-size: 12px; font-weight: 600; color: var(--success); }
.moduleCard__progress--inprogress { color: var(--accent); }

/* ---------- Course list ---------- */
.filterRow { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 24px; }
.filterChip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  cursor: pointer;
  font-size: 13px; color: var(--text-2);
  font-weight: 500;
}
.filterChip input { accent-color: var(--accent); margin: 0; }
.filterChip:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }

.moduleList {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.moduleListItem {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color 0.12s ease, transform 0.12s ease;
  text-decoration: none; color: var(--text);
}
.moduleListItem:hover { border-color: var(--accent); transform: translateY(-1px); }
.moduleListItem__code {
  font-family: var(--font-serif); font-weight: 700; font-size: 13px;
  color: var(--accent);
  min-width: 36px;
}
.moduleListItem__body { flex: 1; min-width: 0; }
.moduleListItem__title { font-family: var(--font-serif); font-weight: 600; font-size: 16px; margin-bottom: 2px; }
.moduleListItem__blurb { font-size: 13px; color: var(--muted); line-height: 1.4; }
.moduleListItem__meta { font-size: 12px; color: var(--muted); font-weight: 500; min-width: 90px; text-align: right; }
.moduleListItem__arrow { color: var(--muted); }

/* ---------- Outcomes box ---------- */
.outcomesBox {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin: 24px 0;
}
.outcomesBox__title { font-family: var(--font-serif); font-weight: 600; font-size: 14px; color: var(--text); margin-bottom: 12px; }
.outcomesList { margin: 0; padding-left: 20px; }
.outcomesList li { margin: 6px 0; color: var(--text-2); }

/* ---------- Lesson list ---------- */
.lessonList {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.lessonListItem {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
  text-decoration: none; color: var(--text);
  min-height: 56px;
}
.lessonListItem:hover { border-color: var(--accent); background: var(--surface-2); }
.lessonListItem__index {
  font-family: var(--font-serif); font-weight: 600; font-size: 13px;
  color: var(--accent);
  min-width: 48px;
}
.lessonListItem__body { flex: 1; min-width: 0; }
.lessonListItem__title { font-weight: 600; font-size: 15px; color: var(--text); }
.lessonListItem__meta { font-size: 12px; color: var(--muted); }
.lessonListItem__status {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 3px 8px; border-radius: 999px;
}
.lessonListItem__status--done { background: var(--accent-soft); color: var(--accent-text); }
.lessonListItem__status--current { background: var(--surface-3); color: var(--text); }

/* ---------- Lesson view ---------- */
.lessonMeta { display: flex; gap: 8px; margin: 0 0 20px; flex-wrap: wrap; align-items: center; }
.lessonMeta__chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  color: var(--text-2);
}
.lessonMeta__chip svg { color: var(--muted); }
.lessonMeta__chip--muted { color: var(--muted); }
.lessonMeta__chip--done {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-text);
}

.lessonBody { font-size: 16px; line-height: 1.7; color: var(--text); }
.lessonBody p { margin: 0 0 16px; }
.lessonBody ul, .lessonBody ol { margin: 0 0 16px; padding-left: 24px; }
.lessonBody li { margin: 6px 0; }
.lessonBody strong { color: var(--text); font-weight: 700; }
.lessonBody em { color: var(--text-2); font-style: italic; }

.formulaCallout {
  margin: 24px 0;
  padding: 18px 22px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-left-width: 3px;
  border-radius: var(--radius-lg);
  font-family: var(--font-serif);
  font-size: 19px;
  color: var(--accent-text);
  text-align: center;
  font-weight: 600;
}
.formulaCallout__label { display: block; font-family: var(--font-sans); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 8px; opacity: 0.75; }

.diagramFrame {
  margin: 32px 0 8px;
  padding: 16px 20px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column; align-items: stretch;
  box-shadow: var(--shadow-sm);
}
.diagramImg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: contain;
  border-radius: var(--radius);
}
.diagramFrame__caption {
  margin: 14px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-2);
  text-align: left;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.diagramCaption { margin-top: 12px; font-size: 13px; color: var(--muted); text-align: center; max-width: 50ch; }

.diagramSplit { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.diagramSplit__cell {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.diagramSplit__title { font-size: 13px; font-weight: 600; text-align: center; margin-bottom: 8px; color: var(--text-2); }

.keyTermsBox {
  margin: 32px 0 0;
  padding: 20px 22px;
  background: var(--surface-2);
  border-radius: var(--radius-lg);
}
.keyTermsBox__title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--muted); margin-bottom: 10px; }
.keyTerms { display: flex; flex-wrap: wrap; gap: 6px; }
.keyTerm {
  display: inline-flex; align-items: center;
  padding: 5px 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  color: var(--text);
  transition: border-color 0.12s ease, color 0.12s ease;
}
.keyTerm:hover { border-color: var(--accent); color: var(--accent); }

.lessonNav {
  display: flex; justify-content: space-between; align-items: center;
  margin: 40px 0 0;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  gap: 12px;
}
.lessonNav__center { display: flex; gap: 8px; }

/* ---------- Glossary ---------- */
.searchBox {
  position: relative;
  display: flex; align-items: center;
  margin: 0 0 20px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0 12px;
}
.searchBox__icon { color: var(--muted); flex: 0 0 auto; }
.searchBox__input {
  flex: 1;
  border: 0; outline: 0;
  background: transparent;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text);
  min-height: 40px;
}
.searchBox:focus-within { border-color: var(--accent); }

.glossaryList { display: flex; flex-direction: column; gap: 4px; }
.glossaryItem {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; gap: 12px;
  align-items: flex-start;
}
.glossaryItem:last-child { border-bottom: 0; }
.glossaryItem__term { font-weight: 700; color: var(--text); min-width: 200px; flex: 0 0 auto; }
.glossaryItem__def { color: var(--text-2); flex: 1; line-height: 1.55; }
.glossaryItem--hl { background: var(--accent-soft); border-radius: var(--radius); border-bottom: 0; }

@media (max-width: 600px) {
  .glossaryItem { flex-direction: column; gap: 2px; }
  .glossaryItem__term { min-width: 0; }
}

/* ---------- About ---------- */
.aboutGrid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin: 24px 0;
}
.aboutCard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
}
.aboutCard__title { font-family: var(--font-serif); font-weight: 600; font-size: 15px; margin-bottom: 8px; }
.aboutCard p { margin: 0 0 6px; color: var(--text-2); }

.toggle {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-weight: 600; font-size: 13px; color: var(--text);
  cursor: pointer; min-height: 40px;
}
.toggle input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }
.toggle.toggle--compact { padding: 6px 10px; font-size: 12px; }

.shortcutList { list-style: none; padding: 0; margin: 12px 0 0; font-size: 13px; color: var(--text-2); }
.shortcutList li { margin: 4px 0; }
kbd {
  display: inline-block;
  padding: 1px 7px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}

/* ---------- Simulator ---------- */
.simLayout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: start;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.cardHeader {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.cardTitle { font-family: var(--font-serif); font-weight: 600; font-size: 17px; color: var(--text); }
.cardSubtitle { font-size: 12px; color: var(--muted); margin-top: 2px; }

.legend { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.legendItem { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.dot { width: 10px; height: 10px; border-radius: 999px; flex: 0 0 auto; }
.dot--ad { background: var(--chart-ad); }
.dot--as { background: var(--chart-as); }
.dot--lras { background: var(--chart-lras); }

.chartWrap {
  margin: 16px;
  height: min(60vh, 520px);
  min-height: 420px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface-2);
  overflow: hidden;
}
.chartWrap svg { width: 100%; height: 100%; display: block; }

.underChart { padding: 0 20px 20px; }
.chipsRow { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--text-2); }
.stateLabel { font-size: 13px; color: var(--muted); font-weight: 600; padding: 6px 12px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.stateLabel[data-state="recessionary"] { background: #EFF6FF; color: #1E40AF; border-color: #BFDBFE; }
.stateLabel[data-state="inflationary"] { background: #FEF2F2; color: #991B1B; border-color: #FECACA; }
.stateLabel[data-state="pressure"] { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent); }
html[data-theme="dark"] .stateLabel[data-state="recessionary"] { background: rgba(96,165,250,0.15); color: #BFDBFE; border-color: rgba(96,165,250,0.3); }
html[data-theme="dark"] .stateLabel[data-state="inflationary"] { background: rgba(248,113,113,0.15); color: #FECACA; border-color: rgba(248,113,113,0.3); }

.eqSummary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.eqSummary__stat { padding: 12px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.eqSummary__label { font-size: 12px; color: var(--muted); font-weight: 600; }
.eqSummary__value { margin-top: 4px; font-family: var(--font-serif); font-weight: 700; font-size: 22px; color: var(--text); }
.eqSummary__delta { margin-top: 4px; font-size: 12px; color: var(--text-2); font-weight: 600; }

.chartControls { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; align-items: center; }

.viewToggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.viewToggle__btn {
  background: transparent;
  border: 0;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  font-family: var(--font-sans);
  letter-spacing: 0.01em;
  transition: background 0.12s ease, color 0.12s ease;
}
.viewToggle__btn:hover { color: var(--text); background: var(--bg-2, rgba(0,0,0,0.03)); }
.viewToggle__btn.is-active {
  background: var(--accent);
  color: #fff;
}
.viewToggle__btn + .viewToggle__btn { border-left: 1px solid var(--border); }
.viewToggle__btn.is-active + .viewToggle__btn,
.viewToggle__btn + .viewToggle__btn.is-active { border-left-color: var(--accent); }

#viewLabel { color: var(--accent); font-weight: 600; }

.stateLabel[data-state="monetarist"] { color: var(--accent); }

.quickActions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.actionCard {
  text-align: left;
  border-radius: var(--radius);
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  display: flex; flex-direction: column; gap: 2px;
  color: var(--text);
  transition: border-color 0.12s ease, background 0.12s ease;
}
.actionCard:hover { border-color: var(--border-strong); background: var(--surface-2); }
.actionCard__title { display: block; font-weight: 700; font-size: 13px; }
.actionCard__text { display: block; font-size: 11px; color: var(--muted); }
.actionCard--recession { border-left: 3px solid var(--chart-as); }
.actionCard--demand { border-left: 3px solid var(--chart-ad); }
.actionCard--cost { border-left: 3px solid var(--accent); }
.actionCard--clear { border-left: 3px solid var(--border-strong); }

.presetList { display: flex; flex-direction: column; gap: 6px; }
.presetBtn {
  text-align: left;
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  cursor: pointer;
  color: var(--text-2);
  font-weight: 500;
  transition: border-color 0.12s ease, color 0.12s ease;
}
.presetBtn:hover { border-color: var(--accent); color: var(--text); }

.simSide { position: sticky; top: 88px; }
.simSide .sideHeader { padding: 16px 18px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.simSide .sideTitle { font-family: var(--font-serif); font-weight: 600; font-size: 15px; }
.sideBody { padding: 4px 0; }
.sideSection { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.sideSection:last-child { border-bottom: 0; }
.sideSection__title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 10px; }

.slider { margin: 0 0 12px; }
.slider:last-child { margin-bottom: 0; }
.slider__top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.slider__label { font-weight: 600; font-size: 12px; color: var(--text); }
.slider__hint { margin-top: 2px; font-size: 11px; color: var(--muted); }
.slider__value { font-weight: 700; background: var(--surface-2); border: 1px solid var(--border); padding: 2px 8px; border-radius: 999px; font-size: 11px; color: var(--text); }
.slider input[type="range"] { width: 100%; accent-color: var(--accent); }

.sharePanel {
  margin-top: 12px; padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.sharePanel__header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.sharePanel__title { font-weight: 700; font-size: 13px; }
.sharePanel__hint { font-size: 11px; color: var(--muted); margin-top: 2px; }
.sharePanel__controls { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.sharePanel__link {
  padding: 8px 10px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border-strong);
  font-size: 12px; line-height: 1.4; word-break: break-all; margin-bottom: 8px;
}
.sharePreview { display: flex; justify-content: center; margin-bottom: 8px; }
.sharePreview canvas, .sharePreview svg { max-width: 180px; height: auto; }
.shareScanner { padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); }
.shareScanner video { width: 100%; max-height: 200px; border-radius: var(--radius); background: #000; }
.shareScanner__title { font-weight: 700; font-size: 12px; margin-bottom: 6px; }
.shareScanner__hint { margin: 6px 0; font-size: 11px; }

/* ---------- Modals / overlays ---------- */
.overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 18px; z-index: 50;
}
.modal {
  width: min(780px, 100%);
  max-height: 90vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modalHeader {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.modalTitle { font-family: var(--font-serif); font-weight: 600; font-size: 17px; }
.modalBody { padding: 8px 0; max-height: 70vh; overflow: auto; }

.scenarioToolbar { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 18px; align-items: center; }
.scenarioActions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.scenarioActions .btn { width: 100%; }

.textInput {
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  min-height: 40px;
  width: 100%;
}
textarea.textInput { min-height: 70px; resize: vertical; }

.sectionTitle { font-weight: 700; font-size: 13px; margin: 14px 18px 6px; color: var(--text); }
.sectionHint { margin: 0 18px 12px; color: var(--muted); font-size: 12px; line-height: 1.45; }

.scenarioCompare { padding: 0 18px; }
.scenarioCompare__controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin: 10px 0; }
.scenarioCompare__control { display: flex; flex-direction: column; gap: 4px; flex: 1 1 200px; }
.scenarioCompare__control span { font-size: 12px; color: var(--muted); font-weight: 600; }
.scenarioCompare__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.scenarioCompare__card { padding: 12px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); min-height: 100px; font-size: 12px; }
.scenarioCompare__diff { margin-top: 10px; font-size: 12px; color: var(--text-2); }

.scenarioFilters { padding: 0 18px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.scenarioComments { padding: 12px 18px; border-top: 1px solid var(--border); margin-top: 12px; }
.scenarioComments__header { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; margin-bottom: 8px; }
.scenarioComments__status { font-size: 12px; color: var(--muted); }
.scenarioComments__list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }

#qrArea, #qrScannerArea { padding: 0 18px; margin-top: 10px; }
#qrArea canvas, #qrArea svg { max-width: 240px; display: block; margin: 0 auto; }
#qrVideo { width: 100%; max-height: 280px; border-radius: var(--radius); background: #000; }

.chartTooltip {
  position: absolute; pointer-events: none;
  background: var(--text); color: var(--surface);
  padding: 6px 10px; border-radius: var(--radius);
  font-size: 12px; line-height: 1.3;
  box-shadow: var(--shadow-md);
  z-index: 60;
  max-width: 220px;
}
.appStatus {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--surface);
  padding: 10px 16px; border-radius: var(--radius);
  font-size: 13px; z-index: 80;
  box-shadow: var(--shadow-md);
}
.appStatus[data-type="error"] { background: var(--danger); }

.footer {
  margin-top: 32px;
  margin-left: 240px;
  padding: 24px 28px calc(24px + env(safe-area-inset-bottom));
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--muted);
}

body.accessibility-mode { font-size: 17px; }
body.accessibility-mode .btn, body.accessibility-mode .navBtn { min-height: 48px; }

.hidden { display: none !important; }

/* ---------- Lesson callouts (takeaways / worked example / mistakes) ---------- */
.takeawaysCallout {
  margin: 24px 0;
  padding: 18px 22px 18px 22px;
  background: var(--surface-2, rgba(180, 83, 9, 0.05));
  border-left: 4px solid var(--accent);
  border-radius: 0 6px 6px 0;
}
.takeawaysCallout__label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 10px;
}
.takeawaysCallout__list {
  margin: 0;
  padding-left: 20px;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}
.takeawaysCallout__list li { margin-bottom: 6px; }
.takeawaysCallout__list li:last-child { margin-bottom: 0; }

.exampleCallout {
  margin: 24px 0;
  padding: 18px 22px;
  background: var(--bg-2, rgba(15, 23, 42, 0.03));
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}
.exampleCallout__label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 10px;
}
.exampleCallout__scenario {
  font-style: italic;
  color: var(--text-2);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border);
}
.exampleCallout__steps {
  margin: 0 0 12px;
  padding-left: 22px;
}
.exampleCallout__steps li { margin-bottom: 6px; }
.exampleCallout__answer {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
}
.exampleCallout__answerLabel {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 4px;
}

.mistakesCallout {
  margin: 24px 0;
  padding: 18px 22px;
  background: rgba(220, 38, 38, 0.04);
  border-left: 4px solid #DC2626;
  border-radius: 0 6px 6px 0;
}
.mistakesCallout__label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #DC2626;
  margin-bottom: 10px;
}
.mistakesCallout__list {
  margin: 0;
  padding-left: 20px;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}
.mistakesCallout__list li { margin-bottom: 6px; }
.mistakesCallout__list li:last-child { margin-bottom: 0; }

/* ---------- Module quiz CTA + modal ---------- */
.moduleQuizCta {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
}
.moduleQuizCta__eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 4px;
}
.moduleQuizCta__title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.moduleQuizCta__sub {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
  max-width: 540px;
}

#moduleQuizOverlay { z-index: 50; }
#moduleQuizOverlay .modal--wide { max-width: 760px; width: 100%; }
.quizIntro {
  margin-bottom: 16px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.55;
}
.quizIntro p { margin: 0 0 12px; }
.quizProgress { display: flex; align-items: center; gap: 10px; }
.quizProgress__label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
  min-width: 130px;
}
.quizProgress__bar {
  flex: 1;
  height: 6px;
  background: var(--bg-2, rgba(0,0,0,0.04));
  border-radius: 3px;
  overflow: hidden;
}
.quizProgress__fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.2s ease;
}

.quizCard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius, 6px);
  padding: 16px 18px;
  margin-bottom: 12px;
  font-family: var(--font-sans);
}
.quizCard--correct { border-color: var(--accent); background: linear-gradient(180deg, var(--surface), rgba(180, 83, 9, 0.04)); }
.quizCard--wrong { border-color: #DC2626; background: linear-gradient(180deg, var(--surface), rgba(220, 38, 38, 0.04)); }
.quizCard__q {
  display: flex;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 12px;
}
.quizCard__num {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  min-width: 22px;
}
.quizOptions { display: flex; flex-direction: column; gap: 6px; }
.quizOption {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.quizOption:hover { background: var(--bg-2, rgba(0,0,0,0.03)); }
.quizOption.is-selected { border-color: var(--accent); background: rgba(180, 83, 9, 0.05); }
.quizOption--correct { border-color: var(--accent); background: rgba(180, 83, 9, 0.08); }
.quizOption--wrong { border-color: #DC2626; background: rgba(220, 38, 38, 0.06); }
.quizOption:disabled { cursor: default; }
.quizOption__mark {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  min-width: 16px;
  text-align: center;
}
.quizOption--correct .quizOption__mark { color: var(--accent); }
.quizOption--wrong .quizOption__mark { color: #DC2626; }
.quizShortInput {
  width: 100%;
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  resize: vertical;
  min-height: 60px;
}
.quizShortInput:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.quizCard__actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.quizCard__verdict {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.quizCard__verdict--ok { color: var(--accent); }
.quizCard__verdict--bad { color: #DC2626; }
.quizCard__explain {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--bg-2, rgba(0,0,0,0.02));
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}
.quizCard__explain p { margin: 0 0 6px; }
.quizCard__explain p:last-child { margin-bottom: 0; }
.quizCard__explainLabel {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 6px;
}
.quizCard__model { font-style: italic; color: var(--text-2); font-size: 12px; }

.quizFooter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.quizFooter__score { font-family: var(--font-sans); color: var(--text); }
.quizFooter__scoreNum {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.quizFooter__scoreLabel {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
}
.quizFooter__scoreSub {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 6px;
}
.quizFooter__actions { display: flex; gap: 8px; }

/* ---------- Active Recall ---------- */
.recallLayout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  margin-top: 24px;
}
.recallList {
  padding: 20px;
  position: sticky;
  top: 24px;
  align-self: start;
}
.recallList__title {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.recallDeckList { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.recallDeckList__item {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 10px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.recallDeckList__item:hover { background: var(--bg-2, rgba(0,0,0,0.03)); }
.recallDeckList__item.is-active {
  background: var(--surface-2, rgba(180, 83, 9, 0.08));
  border-color: var(--accent);
}
.recallDeckList__code {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 2px 6px;
  text-align: center;
  line-height: 1.2;
}
.recallDeckList__title {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 2px;
}
.recallDeckList__meta {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-2);
}

.recallPanel { padding: 0; overflow: hidden; }
.recallPanel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.recallPanel__eyebrow {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 4px;
}
.recallPanel__title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  line-height: 1.2;
}
.recallPanel__meta {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-2);
  margin-top: 6px;
}
.recallPanel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.recallPanel__body { padding: 24px 28px; }
.recallPanel__hint {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-2);
  margin: 0 0 20px;
  line-height: 1.5;
}
.recallPanel__footer {
  padding: 16px 28px 20px;
  background: var(--bg-2, rgba(0,0,0,0.02));
  border-top: 1px solid var(--border);
}
.recallPanel__footer__note {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
}

.recallPreviewHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.recallPreviewHeader__label {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
}
.recallPreviewHeader__count {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-2);
}
.recallPreview {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.recallPreview__item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  min-height: 110px;
}
.recallPreview__face {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.4;
}
.recallPreview__face--front {
  background: var(--surface);
  border-right: 1px dashed var(--border);
}
.recallPreview__face--back {
  background: var(--bg-2, rgba(0,0,0,0.02));
  color: var(--text);
  font-size: 11.5px;
}
.recallPreview__tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 3px;
  padding: 1px 5px;
}
.recallPreview__term {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}
.recallPreview__more,
.recallPreview__empty {
  grid-column: 1 / -1;
  padding: 16px;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 6px;
}

@media (max-width: 980px) {
  .recallLayout { grid-template-columns: 1fr; }
  .recallList { position: static; }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.18s ease;
    box-shadow: var(--shadow-md);
    z-index: 40;
    width: 280px;
  }
  .sidebar--open { transform: translateX(0); }
  .sidebar__head { display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 12px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
  .sidebarToggle { display: inline-flex; }
  .shell { margin-left: 0; padding: 24px 18px 48px; }
  .simLayout { grid-template-columns: 1fr; }
  .simSide { position: static; }
  .aboutGrid { grid-template-columns: 1fr; }
  .footer { margin-left: 0; }
}
@media (max-width: 680px) {
  .topbar { padding: 0 14px; }
  .brand__tag { display: none; }
  .themeToggle__label { display: none; }
  .eqSummary { grid-template-columns: 1fr; }
  .quickActions { grid-template-columns: 1fr; }
  .scenarioActions { grid-template-columns: 1fr; }
  .scenarioCompare__grid { grid-template-columns: 1fr; }
  .diagramSplit { grid-template-columns: 1fr; }
  .chartWrap { height: min(58vh, 380px); min-height: 320px; padding: 8px; }
  .underChart { padding: 0 14px 14px; }
  .cardHeader { flex-direction: column; align-items: flex-start; gap: 10px; }
  .legend { padding-left: 0; }
  .btn { min-height: 44px; }
  .continueCard { flex-direction: column; align-items: flex-start; }
  .progressRow { flex-wrap: wrap; }
  .progressRow__label { min-width: 0; flex: 1 0 100%; }
  .moduleListItem { flex-wrap: wrap; }
  .moduleListItem__meta { text-align: left; }
}
