:root {
  --ink: #1c1917;
  --muted: #57534e;
  --paper: #f4efe6;
  --card: #fffdf8;
  --rule: #d6c4a8;
  --rust: #9a3412;
  --rust-deep: #7c2d12;
  --teal: #134e4a;
  --indigo: #1e1b4b;
  --gold: #a16207;
  --line: rgba(28, 25, 23, 0.12);
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", serif;
  --text: "Literata", "Iowan Old Style", Georgia, serif;
  --sans: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
.mag-root {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.05rem;
  line-height: 1.65;
}
a { color: var(--rust-deep); }
img, svg { max-width: 100%; }

.mast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  background: #1c1917;
  color: #faf7f2;
  position: sticky;
  top: 0;
  z-index: 40;
}
.mast a { color: inherit; text-decoration: none; }
.brand {
  font-family: var(--serif);
  font-weight: 560;
  letter-spacing: -0.03em;
  font-size: 1.25rem;
}
.brand small {
  display: block;
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #d6c4a8;
  font-weight: 500;
}
.mast-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.mast-nav a {
  font-family: var(--sans);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.mast-nav a:hover, .mast-nav a.active {
  border-color: #d6c4a8;
  color: #fff;
}
.menu-btn {
  display: none;
  background: transparent;
  color: #fff;
  border: 1px solid #d6c4a8;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 1.1rem;
}

.shell { display: flex; min-height: calc(100vh - 64px); }
.mag-root .sidebar {
  width: 300px;
  flex-shrink: 0;
  background: #fffdf8;
  border-right: 1px solid var(--rule);
  padding: 18px 14px 40px;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow: auto;
}
.mag-root .sidebar h2 {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 12px;
}
.side-chapter { margin: 0 0 14px; }
.side-module {
  margin: 10px 0 4px;
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}
.side-chapter > a {
  display: block;
  font-family: var(--serif);
  color: var(--ink);
  text-decoration: none;
  font-weight: 560;
  margin-bottom: 6px;
}
.side-chapter ol { list-style: none; margin: 0; padding: 0; }
.side-chapter li a {
  display: block;
  text-decoration: none;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.84rem;
  line-height: 1.35;
  padding: 6px 8px;
  border-radius: 8px;
}
.side-chapter li a.active, .side-chapter li a:hover {
  background: #f4efe6;
  color: var(--rust-deep);
}
.close-side { display: none; }

.main { flex: 1; min-width: 0; padding: 28px 22px 72px; }
.sheet {
  max-width: 860px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--rule);
  box-shadow: 0 18px 50px rgba(68, 48, 20, 0.06);
  padding: 36px 40px 48px;
}

.kicker {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rust);
  margin: 0 0 8px;
}
.feature-title, .module-title, h1.cover-title {
  font-family: var(--serif);
  font-weight: 560;
  font-size: clamp(2rem, 4vw, 3.15rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
}
.hook {
  font-family: var(--serif);
  font-size: 1.28rem;
  line-height: 1.4;
  color: #44403c;
  margin: 0 0 18px;
}
.source-line {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
  margin-bottom: 22px;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 22px;
}
.toolbar select, .toolbar button, .text-btn {
  font-family: var(--sans);
  font-size: 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: #fff;
  padding: 8px 14px;
  cursor: pointer;
  color: var(--ink);
}
.toolbar button.primary, a.primary {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
  text-decoration: none;
}

.section-label {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 28px 0 8px;
}
.source-notes {
  margin: 0 0 22px;
  padding: 18px 18px 8px;
  background: #fffdf8;
  border: 1px solid var(--rule);
  border-left: 6px solid var(--gold);
}
.concept-block { line-height: 1.75; color: #334155; }
.concept-block p, .concept-block li { margin: 0 0 12px; }
.concept-block h2, .concept-block h3 { font-family: var(--serif); color: var(--ink); }
.concept-block table { width: 100%; border-collapse: collapse; margin: 12px 0 18px; font-size: 0.95rem; }
.concept-block th, .concept-block td { border: 1px solid var(--rule); padding: 6px 8px; text-align: left; vertical-align: top; }
.school .section-label { color: var(--teal); }
.higher .section-label { color: var(--indigo); }
.school, .higher, .exam-lens, .points, .cues, .oneliners, .mcq-block {
  margin-top: 8px;
}
.layer {
  border-radius: 16px;
  padding: 18px 18px 8px;
  margin: 12px 0 18px;
}
.layer.school { background: #f0fdfa; border: 1px solid #99f6e4; }
.layer.higher { background: #eef2ff; border: 1px solid #c7d2fe; }
.layer h3, .exam-lens h3, .points h3, .cues h3 {
  font-family: var(--serif);
  font-size: 1.35rem;
  margin: 0 0 8px;
}
.layer p, .exam-lens p, .points li, .cues li, .oneliners li { margin: 0 0 12px; }
.steps { margin: 0 0 12px; padding-left: 1.2rem; }
.steps li { margin: 0 0 8px; }
.memory, .example {
  background: #fff;
  border-left: 4px solid var(--teal);
  padding: 10px 14px;
  margin: 0 0 14px;
}
.higher .memory, .example.num { border-left-color: var(--indigo); }
.pull {
  font-family: var(--serif);
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
  line-height: 1.25;
  color: var(--rust-deep);
  margin: 26px 0;
  padding: 8px 0 8px 18px;
  border-left: 3px solid var(--rust);
}
.magazine-fig {
  margin: 22px 0;
  padding: 16px;
  background: #faf7f2;
  border: 1px solid var(--rule);
}
.magazine-fig h3 { font-family: var(--serif); margin: 0 0 12px; font-size: 1.25rem; }
.fig-kicker, .stat-kicker {
  font-family: var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: var(--gold);
  margin: 0 0 4px;
}
.fig-flow, .fig-time { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fig-flow li, .fig-time li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  background: #fff;
  padding: 10px 12px;
  border-radius: 10px;
}
.fig-num {
  grid-row: span 2;
  font-family: var(--serif);
  font-size: 1.4rem;
  color: var(--rust);
}
.fig-flow li strong, .fig-time li strong { font-family: var(--sans); }
.fig-flow li span, .fig-time li span { color: var(--muted); grid-column: 2; }
.fig-bars { display: grid; gap: 8px; }
.fig-bar-row { display: grid; grid-template-columns: minmax(120px, 34%) 1fr auto; gap: 8px; align-items: center; font-family: var(--sans); font-size: 0.86rem; }
.fig-bar-track { background: #e7e5e4; height: 10px; border-radius: 99px; overflow: hidden; }
.fig-bar-fill { display: block; height: 100%; background: linear-gradient(90deg, #134e4a, #9a3412); border-radius: 99px; }
.fig-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fig-split > div { background: #fff; padding: 12px; border-radius: 10px; }
.fig-split-h { font-family: var(--sans); letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.75rem; color: var(--teal); margin: 0 0 6px; }
.fig-formula p {
  font-family: var(--serif);
  font-size: 1.25rem;
  margin: 0 0 6px;
}
.fig-svg { width: 100%; height: auto; background: #fff; border-radius: 8px; }
.magazine-fig figcaption, .stat-note { color: var(--muted); font-size: 0.92rem; }

.stat-row { display: grid; gap: 12px; margin: 16px 0 8px; }
.stat-card {
  margin: 0;
  padding: 14px 16px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
}
.stat-value { font-family: var(--serif); font-size: 2rem; margin: 0; line-height: 1; }
.stat-label { margin: 4px 0 8px; font-family: var(--sans); }
.stat-meta { margin: 0; display: grid; gap: 6px; }
.stat-meta div { display: grid; grid-template-columns: 88px 1fr; gap: 8px; font-size: 0.9rem; }
.stat-meta dt { font-family: var(--sans); color: var(--gold); }
.stat-meta dd { margin: 0; }

.exam-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.exam-grid article {
  background: #fff;
  border-top: 3px solid var(--rust);
  padding: 10px 12px;
}
.exam-grid h4 { margin: 0 0 6px; font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; }
.points ul, .cues ol, .oneliners ol { margin: 0; padding-left: 1.15rem; }
.points { background: #fff7ed; border: 1px solid #fed7aa; padding: 14px 16px; }
.cues { background: #faf7f2; border-left: 4px solid var(--indigo); padding: 4px 8px 4px 16px; }

.mcq {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}
.mcq-tag {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
}
.mcq-tag.added { color: var(--indigo); }
.mcq-q { font-weight: 650; }
.mcq-options { margin: 8px 0; padding-left: 1.1rem; }
.mcq-options li.correct { background: #ecfdf5; border-radius: 6px; padding: 2px 6px; }
.answer-line { font-family: var(--sans); font-size: 0.95rem; }
.answer-line strong { color: var(--teal); }

.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  font-family: var(--sans);
}
.pager a { text-decoration: none; border-bottom: 1px solid var(--rust); }

.cover-grid { display: grid; gap: 16px; }
.chapter-card {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 18px;
  border: 1px solid var(--rule);
  background: #fffdf8;
}
.chapter-card:hover { border-color: var(--rust); }
.chapter-card h2 { font-family: var(--serif); margin: 6px 0; font-size: 1.7rem; }
.deck { color: var(--muted); }
.contents ol { padding-left: 1.2rem; }
.contents a { text-decoration: none; }
.contents li { margin: 0 0 10px; }
.footer-note { max-width: 860px; margin: 18px auto 0; color: var(--muted); font-size: 0.9rem; font-family: var(--sans); }

@media (max-width: 900px) {
  .menu-btn, .close-side { display: inline-flex; }
  .mag-root .sidebar {
    position: fixed;
    z-index: 50;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: 8px 0 30px rgba(0,0,0,0.12);
  }
  .mag-root .sidebar.open { transform: none; }
  .close-side {
    border: 0;
    background: transparent;
    font-size: 1.4rem;
    float: right;
  }
  .sheet { padding: 22px 16px 36px; }
  .exam-grid, .fig-split, .stat-meta div, .fig-bar-row {
    grid-template-columns: 1fr;
  }
  .fig-bar-row { grid-template-columns: 1fr auto; }
  .fig-bar-name { grid-column: 1 / -1; }
  .overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(28,25,23,0.35);
    z-index: 45;
  }
  .overlay.show { display: block; }
}

/* Module body, inside the existing curriculum chrome. */
.content-area .magazine-sheet {
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
  background: var(--card);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.05rem;
  line-height: 1.65;
  padding: 36px 40px 48px;
  border: 1px solid var(--rule);
  box-shadow: 0 18px 50px rgba(68, 48, 20, 0.06);
  border-radius: 2px;
}
.content-area { background: var(--paper); }
.magazine-sheet .feature-title,
.magazine-sheet .module-title {
  font-family: var(--serif);
  font-weight: 560;
  font-size: clamp(2rem, 4vw, 3.05rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
  color: var(--ink);
}
.magazine-sheet .toolbar,
.magazine-sheet .tts-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.magazine-sheet .tts-btn,
.magazine-sheet .pdf-btn,
.magazine-sheet .lang-dropdown,
.magazine-sheet .speed-dropdown,
.magazine-sheet .voice-selector {
  font-family: var(--sans);
  font-size: 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: #fff;
  color: var(--ink);
  height: auto;
  padding: 8px 14px;
}
.magazine-sheet .tts-btn { background: var(--teal); color: #fff; border-color: var(--teal); }
.magazine-sheet .pdf-btn { background: var(--rust); color: #fff; border-color: var(--rust); }
.magazine-feature {
  margin: 28px 0 8px;
  padding-top: 8px;
  border-top: 1px solid var(--rule);
}
.magazine-feature .feature-title { font-size: clamp(1.55rem, 3vw, 2.15rem); }
.spread-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 8px 0 14px;
  font-family: var(--sans);
}
.spread-nav button {
  border: 0;
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--sans);
}
.spread-nav button:disabled { opacity: 0.35; cursor: default; }
.spread-count { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.spread-panel[hidden] { display: none !important; }
.spread-panel.is-on { animation: mag-rise 0.35s ease; }
@keyframes mag-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.magazine-sheet .fig-bar-fill {
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.55s ease;
}
.magazine-sheet .spread-panel.is-on .fig-bar-fill,
.magazine-sheet .lesson-stack .fig-bar-fill { transform: scaleX(1); }
.q-stack { position: relative; }
.q-card:not(.is-on) {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  visibility: visible;
}
.q-card:not(.is-on),
.q-card:not(.is-on) * {
  pointer-events: none !important;
}
.q-card.is-on { position: relative; opacity: 1; z-index: 1; }
.q-feedback:not(.is-revealed),
.q-answer:not(.is-revealed),
.magazine-sheet .modern-explanation-box:not(.is-revealed) {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
.q-feedback.is-revealed,
.q-answer.is-revealed,
.magazine-sheet .modern-explanation-box.is-revealed {
  position: static;
  width: auto;
  height: auto;
  margin: 0 0 8px;
  padding: 10px 12px;
  overflow: visible;
  opacity: 1;
  pointer-events: auto;
}
#google_translate_element { display: inline-flex; align-items: center; min-height: 42px; }

body .content-area {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 4px 10px 4px;
  background: #f3f4f6;
}
.content-area .magazine-sheet,
.content-area .magazine-sheet:has(.topic-row) {
  max-width: none;
  width: 100%;
  margin: 0;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.content-area .topic-row { margin-bottom: 8px; flex: 0 0 auto; }
.content-area .pipeline-flow-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.content-area .pipeline-flow-body > hr { display: none; }
.content-area .unit-block,
.content-area .topic-study-unit {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
}
.content-area .pipeline-flow-body > .unit-block { display: none !important; }
.content-area .pipeline-flow-body > .unit-block.is-on,
.content-area .pipeline-flow-body > .unit-block.is-on .topic-study-unit {
  display: flex !important;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}
.study-split {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) 64px minmax(0, 0.75fr);
  align-items: stretch;
  gap: 8px;
  width: 100%;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  border: 0;
  background: transparent;
}
.study-split:has(.topic-rail[hidden]) {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
}
.topic-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  align-self: center;
}
.topic-rail[hidden] { display: none !important; }
.topic-arrow {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0;
  background: #1e3a8a;
  color: #fff;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  font-weight: 700;
}
.topic-next {
  background: #1e3a8a;
  color: #fff;
  border: 0;
  border-radius: 4px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
}
.topic-pos {
  font-size: 0.72rem;
  font-weight: 700;
  color: #1e3a8a;
  text-align: center;
  line-height: 1.25;
}
.topic-arrow:disabled,
.topic-next:disabled {
  opacity: 0.35;
  cursor: default;
}
.study-lesson,
.study-questions {
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 14px 16px 12px;
  border-radius: 8px;
  border: 1px solid #1e3a8a;
}
.study-lesson .subtopic-stage {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}
.study-questions .q-stage:not([hidden]) {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.study-questions .q-deck {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: 0;
}
.study-questions .q-stack {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.study-lesson { background: #f8fafc; }
.study-questions { background: #fffdf8; }
.subtopic { display: none; }
.subtopic.is-on { display: block; }
.q-stage[hidden] { display: none !important; }
.exam-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #cbd5e1;
}
.sub-count { font-size: 0.78rem; font-weight: 700; color: #1e3a8a; }
.sub-nav, .study-questions .q-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}
.sub-nav button, .study-questions .q-nav button {
  background: #1e3a8a;
  color: #fff;
  border: 0;
  border-radius: 4px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
}
.sub-nav button:disabled, .study-questions .q-nav button:disabled {
  opacity: 0.45;
  cursor: default;
}
.content-area .completion-card { display: none; }
.content-area .module-footer { margin-top: 4px; padding-top: 4px; }
.content-area .magazine-sheet .topic-row { gap: 2px; margin-bottom: 4px; }
.content-area .magazine-sheet .topic-heading .kicker,
.content-area .magazine-sheet .topic-heading .modern-breadcrumb,
.content-area .magazine-sheet .topic-heading .hook { display: none; }
.content-area .magazine-sheet .topic-heading .module-title {
  font-size: 1rem;
  line-height: 1.2;
  margin: 0;
}
.content-area .magazine-sheet .nav-btn { padding: 6px 12px; }
.study-questions .q-card.is-on { position: relative; }
@media (max-width: 900px) {
  body .content-area {
    display: block;
    overflow-x: hidden;
    overflow-y: auto;
  }
  .content-area .magazine-sheet,
  .content-area .magazine-sheet:has(.topic-row),
  .content-area .pipeline-flow-body,
  .content-area .topic-study-unit {
    display: block;
    overflow: visible;
    height: auto;
    flex: none;
  }
  .content-area .pipeline-flow-body > .unit-block.is-on,
  .content-area .pipeline-flow-body > .unit-block.is-on .topic-study-unit {
    display: block !important;
    overflow: visible;
    height: auto;
  }
  .study-split,
  .study-split:has(.topic-rail[hidden]) {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
    gap: 10px;
  }
  .topic-rail {
    flex-direction: row;
    align-self: stretch;
    order: 2;
    justify-content: center;
  }
  .study-questions { order: 3; }
  .study-lesson,
  .study-questions {
    width: 100%;
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .study-lesson {
    display: flex;
    max-height: 72vh;
    overflow: hidden;
  }
  .study-lesson .subtopic-stage { overflow-y: auto; }
  .study-questions .q-stage:not([hidden]),
  .study-questions .q-deck,
  .study-questions .q-stack {
    overflow: visible;
    height: auto;
    flex: none;
  }
  .magazine-sheet .function-list {
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  .magazine-sheet .function-list .tts-btn,
  .magazine-sheet .function-list .pdf-btn {
    width: auto;
    flex: 0 0 auto;
  }
}

.content-area .magazine-sheet:has(.topic-row) {
  max-width: none;
  margin: 0;
}
.magazine-sheet .topic-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  margin-bottom: 10px;
}
.magazine-sheet .function-list {
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  overflow-x: auto;
}
.magazine-sheet .function-list .tts-btn,
.magazine-sheet .function-list .pdf-btn,
.magazine-sheet .function-list .lang-dropdown,
.magazine-sheet .function-list .speed-dropdown,
.magazine-sheet .function-list .voice-selector {
  white-space: nowrap;
  flex: 0 0 auto;
}
.magazine-sheet .function-list .voice-selector {
  max-width: 170px;
}
.magazine-sheet .topic-heading {
  flex: 1 1 auto;
  min-width: 0;
}
.magazine-sheet .topic-heading .modern-breadcrumb {
  font-family: Outfit, "Segoe UI", sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #78716c;
  margin: 0 0 6px;
}
.magazine-sheet .topic-heading .hook {
  margin-bottom: 0;
}
@media (max-width: 900px) {
  .magazine-sheet .topic-row {
    flex-direction: column;
    align-items: stretch;
  }
  .magazine-sheet .function-list {
    max-width: 100%;
    width: 100%;
  }
}
/* SSC-style paper: compact headings, justified topic, exam questions. */
.magazine-sheet .topic-heading .kicker,
.study-lesson .kicker,
.study-questions .kicker {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  margin: 0 0 4px;
}
.magazine-sheet .topic-heading .module-title,
.magazine-sheet .topic-heading .feature-title,
.study-lesson .feature-title,
.study-lesson h2,
.magazine-feature .feature-title {
  font-size: 1.15rem;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 8px;
}
.magazine-sheet .topic-heading .hook,
.study-lesson .pull {
  font-size: 0.98rem;
  line-height: 1.45;
  margin: 0 0 10px;
  padding: 0 0 0 10px;
}
.study-lesson .section-label,
.study-questions .section-label {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  margin: 12px 0 4px;
}
.study-lesson .layer,
.study-lesson .source-notes {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  margin: 8px 0;
}
.study-lesson p,
.study-lesson li,
.study-lesson .concept-block,
.study-lesson .hook,
.study-lesson .pull {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}
.study-lesson h1,
.study-lesson h2,
.study-lesson h3,
.study-lesson .kicker,
.study-lesson .section-label,
.study-lesson .feature-title,
.magazine-sheet .topic-heading .module-title,
.magazine-sheet .topic-heading .kicker {
  text-align: left;
  hyphens: manual;
}
.study-lesson p,
.study-lesson li {
  font-size: 0.98rem;
  line-height: 1.55;
  color: #111827;
}
.study-questions .q-prompt,
.study-questions .mcq-question {
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 0.98rem;
  line-height: 1.45;
  font-weight: 650;
  margin: 0 0 8px;
}
.study-questions .modern-option-btn {
  border-radius: 2px;
  background: #fff;
  border: 1px solid #94a3b8;
  padding: 7px 10px;
  margin-bottom: 6px;
  font-size: 0.95rem;
}
.study-questions .q-deck {
  margin: 8px 0;
  padding-top: 0;
  border-top: 0;
}
.goog-te-gadget { font-family: Outfit, "Segoe UI", sans-serif !important; color: #134e4a !important; font-size: 0.85rem !important; }
.goog-te-gadget .goog-te-combo { padding: 8px 10px; border-radius: 8px; border: 1px solid #e2e8f0; }
iframe.goog-te-banner-frame { display: none !important; }
body { top: 0 !important; }
.q-deck { margin: 26px 0 8px; padding-top: 8px; border-top: 1px solid var(--rule); }
.q-deck .section-label { margin-bottom: 4px; }
.deck-hint { margin: 0 0 10px; color: var(--muted); font-family: var(--sans); font-size: 0.92rem; }
.q-prompt { font-family: var(--serif); font-size: 1.2rem; margin: 0 0 10px; }
.q-form { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }
.q-form input[type="text"] {
  flex: 1;
  min-width: 180px;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  font-family: var(--sans);
  background: #fff;
}
.q-form button {
  border: 0;
  background: var(--teal);
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--sans);
}
.q-answer[hidden], .q-feedback[hidden] { display: none !important; }
.q-feedback { margin: 0 0 8px; font-family: var(--sans); font-weight: 600; }
.q-answer { background: #f0fdfa; padding: 10px 12px; border-left: 4px solid var(--teal); margin: 0; }
.q-count { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.lesson-stack .lesson-block { margin: 0 0 8px; }
.magazine-sheet .options-grid { display: grid; gap: 8px; }
.magazine-sheet .mcq-section-wrapper {
  background: #faf7f2;
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 18px 16px;
  margin: 18px 0 28px;
}
.magazine-sheet .mcq-section-title {
  font-family: var(--serif);
  font-size: 1.35rem;
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 8px;
  margin-bottom: 12px;
}
.magazine-sheet .modern-mcq-card {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 14px 14px 8px;
  margin-bottom: 12px;
}
.magazine-sheet .modern-option-btn {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  background: #fffdf8;
  border: 1px solid var(--rule);
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 8px;
  color: var(--ink);
  font-family: var(--sans);
}
.magazine-sheet .modern-option-btn:hover { border-color: var(--rust); }
.magazine-sheet .completion-card {
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  padding: 22px;
  text-align: center;
  margin: 12px 0;
}
.magazine-sheet .completion-title { font-family: var(--serif); color: var(--teal); font-size: 1.4rem; }
.magazine-sheet .completion-btn, .magazine-sheet .nav-btn {
  font-family: var(--sans);
  text-decoration: none;
  border-radius: 999px;
  padding: 10px 16px;
  background: var(--ink);
  color: #fff;
  display: inline-flex;
}
.magazine-sheet .module-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
}
.magazine-sheet .nav-btn-disabled { opacity: 0.4; pointer-events: none; }
.magazine-sheet .next-btn { margin-left: auto; background: var(--rust); }
@media (max-width: 700px) {
  .content-area .magazine-sheet { padding: 20px 14px 32px; }
  .magazine-sheet .spread-nav button,
  .magazine-sheet .nav-btn,
  .magazine-sheet .tts-btn,
  .magazine-sheet .pdf-btn { width: 100%; justify-content: center; }
  .magazine-sheet .function-list .tts-btn,
  .magazine-sheet .function-list .pdf-btn,
  .magazine-sheet .q-nav button,
  .magazine-sheet .sub-nav button { width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .spread-panel.is-on { animation: none; }
  .magazine-sheet .fig-bar-fill { transform: none; transition: none; }
  .mag-root .sidebar { transition: none; }
}
