/* Full-book calculus workspace */
.hero::after { content: "∫"; right: 26%; top: 0; font-size: 330px; font-style: italic; }
.hero::before { right: 31%; }
.book-hero { min-height: 312px; }
.book-hero h1 { font-size: clamp(34px, 4.2vw, 56px); }
.hero-description { max-width: 640px; }
.mastery-footer b { font-weight: 700; }
.volume-progress-list { display: grid; gap: 9px; margin: 2px 0 16px; }
.volume-progress-row { display: grid; grid-template-columns: 33px 1fr auto; align-items: center; gap: 9px; color: #b9c9bd; font-size: 9px; }
.volume-progress-row strong { color: #eef4ef; font-size: 9px; font-weight: 650; }
.volume-track { height: 4px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.12); }
.volume-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: #c8dfcf; transition: width .35s ease; }

.formula-nav-icon { width: 17px; text-align: center; color: currentColor; font-family: var(--serif); font-size: 16px; font-weight: 600; }
.sidebar-volume { display: contents; }
.chapter-nav-item { min-height: 38px; padding: 0 10px; gap: 9px; font-size: 11.2px; }
.chapter-nav-index { width: 19px; color: #92968e; font-family: var(--serif); font-size: 9px; text-align: center; flex: 0 0 auto; }
.chapter-nav-item.is-active .chapter-nav-index { color: var(--green); }

.book-dashboard { grid-template-columns: minmax(0, 1.56fr) minmax(290px, .64fr); }
.book-map-card { padding: 23px 24px; }
.book-map-intro { margin: 12px 0 16px; color: var(--muted); font-size: 10px; line-height: 1.65; }
.book-map-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.map-volume { padding: 13px; border: 1px solid #e6e2d8; border-radius: 12px; background: #fdfcf8; }
.map-volume-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid #ece8df; }
.map-volume-head div { display: flex; flex-direction: column; gap: 2px; }
.map-volume-head span { color: var(--muted); font-size: 8px; letter-spacing: .08em; }
.map-volume-head strong { font-family: var(--serif); font-size: 15px; font-weight: 570; }
.map-volume-head b { color: var(--green); font-family: var(--serif); font-size: 15px; font-weight: 560; }
.map-chapter-list { display: grid; gap: 4px; margin-top: 8px; }
.map-chapter { width: 100%; min-height: 32px; display: grid; grid-template-columns: 7px 18px 1fr auto; align-items: center; gap: 7px; padding: 5px 7px; border: 0; border-radius: 7px; background: transparent; text-align: left; cursor: pointer; }
.map-chapter:hover { background: #f2f0e8; }
.map-chapter i { width: 6px; height: 6px; border-radius: 50%; background: var(--topic-color); }
.map-chapter span { color: var(--topic-color); font-family: var(--serif); font-size: 8px; }
.map-chapter strong { overflow: hidden; color: var(--ink-soft); font-size: 9.5px; font-weight: 560; text-overflow: ellipsis; white-space: nowrap; }
.map-chapter small { color: #a3a69e; font-size: 7.5px; }
.map-chapter.is-complete strong { color: var(--green); }
.map-chapter.is-complete small { color: var(--green); }

.volume-heading-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 38px 0 15px; }
.volume-heading-row h2 { margin: 0; font-family: var(--serif); font-size: 27px; font-weight: 560; letter-spacing: -.02em; }
.volume-heading-row p:last-child { margin: 6px 0 0; color: var(--muted); font-size: 10px; }
.volume-heading-row .section-kicker { margin-bottom: 5px; }
.volume-count-pill { padding: 6px 10px; border: 1px solid #dedacf; border-radius: 99px; color: var(--muted); background: rgba(255,255,255,.4); font-size: 9px; white-space: nowrap; }
.chapter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.chapter-card {
  position: relative; min-height: 232px; padding: 18px; overflow: hidden; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: 17px; background: var(--card);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.chapter-card:hover { transform: translateY(-3px); border-color: #c7c2b5; box-shadow: 0 16px 32px rgba(40,45,37,.07); }
.chapter-card::after { content: ""; position: absolute; right: -70px; bottom: -95px; width: 170px; height: 170px; border-radius: 50%; background: var(--topic-pale); opacity: .7; }
.chapter-card.is-complete { border-color: #b7cdbb; background: linear-gradient(145deg, #fbfaf6, #f2f8f3); }
.chapter-card.is-current { border-color: #c7c2b4; box-shadow: 0 6px 20px rgba(39,47,40,.055); }
.chapter-card-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; }
.chapter-index { color: var(--topic-color); font-family: var(--serif); font-size: 12px; }
.chapter-state { padding: 4px 7px; border-radius: 99px; color: var(--muted); background: #f1efe8; font-size: 7.8px; }
.chapter-state.ready { color: var(--green); background: var(--green-pale); }
.chapter-state.is-complete { color: #fff; background: var(--green); }
.chapter-symbol { position: relative; z-index: 1; height: 62px; margin: 8px 0 0; display: grid; place-items: center; color: var(--topic-color); font-family: var(--serif); font-size: 30px; font-style: italic; letter-spacing: -.04em; }
.chapter-symbol::before { content: ""; position: absolute; width: 80px; height: 80px; border: 1px solid var(--topic-pale); border-radius: 50%; }
.chapter-symbol span { position: relative; z-index: 1; }
.chapter-card h3 { position: relative; z-index: 1; margin: 3px 0 6px; font-family: var(--serif); font-size: 18px; font-weight: 570; }
.chapter-card p { position: relative; z-index: 1; max-width: 93%; min-height: 30px; margin: 0; color: var(--muted); font-size: 9.5px; line-height: 1.6; }
.chapter-meta { position: absolute; left: 18px; bottom: 16px; z-index: 1; color: #969a92; font-size: 8px; }

.topic-green { --topic-color: var(--green); --topic-pale: var(--green-pale); }
.topic-amber { --topic-color: var(--amber); --topic-pale: var(--amber-pale); }
.topic-blue { --topic-color: var(--blue); --topic-pale: var(--blue-pale); }
.topic-coral { --topic-color: var(--coral); --topic-pale: var(--coral-pale); }
.topic-violet { --topic-color: var(--violet); --topic-pale: var(--violet-pale); }

/* Chapter detail */
.chapter-hero { position: relative; overflow: hidden; padding: 31px 34px 28px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--topic-pale); }
.chapter-hero::after { content: attr(data-index); position: absolute; right: 28px; bottom: -52px; color: rgba(255,255,255,.46); font-family: var(--serif); font-size: 168px; line-height: 1; }
.chapter-hero-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.chapter-chip { display: inline-flex; align-items: center; gap: 7px; color: var(--topic-color); font-size: 9px; font-weight: 700; letter-spacing: .07em; }
.chapter-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--topic-color); }
.chapter-progress-label { color: color-mix(in srgb, var(--topic-color) 70%, #555); font-size: 9px; }
.chapter-hero h1 { position: relative; z-index: 1; max-width: 800px; margin: 13px 0 11px; font-family: var(--serif); font-size: clamp(34px, 5vw, 52px); font-weight: 520; letter-spacing: -.035em; }
.chapter-hero > p { position: relative; z-index: 1; max-width: 760px; margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.85; }
.chapter-hero-meta { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chapter-goal-row { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 7px; max-width: 790px; margin-top: 15px; }
.chapter-goal-row span { padding: 5px 8px; border: 1px solid color-mix(in srgb, var(--topic-color) 18%, transparent); border-radius: 7px; color: var(--topic-color); background: rgba(255,255,255,.38); font-size: 8.5px; }
.chapter-layout { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(290px, .64fr); gap: 19px; margin-top: 19px; }
.chapter-lesson { padding: 29px 31px; }
.chapter-lesson-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin: 25px 0 14px; }
.chapter-lesson-heading:first-child { margin-top: 0; }
.chapter-lesson-heading h2 { margin: 0; font-family: var(--serif); font-size: 24px; font-weight: 560; }
.chapter-lesson-heading .section-kicker { margin-bottom: 4px; }
.chapter-lesson-heading > span { color: var(--muted); font-size: 8.5px; }
.lesson-intro { margin: 0 0 21px; color: var(--ink-soft); font-size: 13px; line-height: 1.9; }
.section-list { display: grid; gap: 9px; }
.section-card { border: 1px solid #e5e1d7; border-radius: 12px; background: #fdfcf8; overflow: hidden; }
.section-card summary { display: grid; grid-template-columns: 31px 1fr 20px; align-items: center; gap: 10px; padding: 13px 14px; cursor: pointer; list-style: none; }
.section-card summary::-webkit-details-marker { display: none; }
.section-number { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: var(--topic-color); background: var(--topic-pale); font-family: var(--serif); font-size: 9px; }
.section-summary-copy { display: flex; flex-direction: column; min-width: 0; gap: 3px; }
.section-summary-copy strong { font-size: 11.5px; font-weight: 650; }
.section-summary-copy small { overflow: hidden; color: var(--muted); font-size: 8.5px; text-overflow: ellipsis; white-space: nowrap; }
.section-toggle { color: #9da098; font-size: 14px; transition: transform .2s ease; }
.section-card[open] .section-toggle { transform: rotate(45deg); }
.section-body { padding: 0 15px 15px 55px; }
.section-formulas { display: grid; gap: 6px; margin-bottom: 12px; }
.section-formula { padding: 9px 11px; border-radius: 8px; color: var(--topic-color); background: var(--topic-pale); font-family: var(--serif); font-size: 13px; line-height: 1.65; overflow-x: auto; }
.section-note { display: grid; grid-template-columns: 18px 1fr; gap: 8px; margin-top: 8px; padding: 9px 10px; border-radius: 8px; background: #f1efe8; }
.section-note > span { width: 17px; height: 17px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--topic-color); font-family: var(--serif); font-size: 8px; }
.section-note p { margin: 0; color: var(--ink-soft); font-size: 9.5px; line-height: 1.7; }
.pitfall-note { background: #f6eee9; }
.pitfall-note > span { background: var(--coral); }
.chapter-practice { margin-top: 29px; padding-top: 2px; border-top: 1px solid #ebe7dd; }
.practice-list { display: grid; gap: 10px; }
.practice-item { padding: 14px 15px; border: 1px solid #e5e1d7; border-radius: 11px; background: #faf8f2; }
.practice-item p { margin: 0 0 9px; color: var(--ink-soft); font-size: 11px; line-height: 1.75; }
.practice-item p span { display: block; margin-bottom: 3px; color: var(--topic-color); font-size: 8px; font-weight: 700; letter-spacing: .08em; }
.practice-toggle { color: var(--topic-color); font-weight: 700; }
.practice-answer { margin-top: 10px; padding: 10px 11px; border-radius: 8px; color: var(--ink-soft); background: var(--topic-pale); font-size: 10px; line-height: 1.75; }
.practice-answer[hidden] { display: none; }

.chapter-side { display: flex; flex-direction: column; gap: 15px; }
.chapter-formula-card, .exam-focus-card, .chapter-note-card, .chapter-actions { padding: 21px 22px; }
.chapter-formula-card h3, .exam-focus-card h3, .chapter-note-card h3, .chapter-actions h3 { margin: 0 0 8px; font-family: var(--serif); font-size: 19px; font-weight: 560; }
.chapter-formula-list { display: grid; gap: 9px; }
.chapter-formula-item { padding: 10px 11px; border: 1px solid #e7e3d9; border-radius: 9px; background: #fdfcf8; }
.chapter-formula-item span { display: block; color: var(--muted); font-size: 8px; }
.chapter-formula-item strong { display: block; margin-top: 4px; color: var(--topic-color); font-family: var(--serif); font-size: 14px; font-weight: 560; line-height: 1.55; }
.chapter-formula-item small { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.55; }
.exam-focus-card ul { margin: 8px 0 0; padding-left: 16px; color: var(--ink-soft); font-size: 9.5px; line-height: 1.75; }
.exam-focus-card li + li { margin-top: 4px; }
.chapter-note-card > p:not(.section-kicker) { margin: 0 0 10px; color: var(--muted); font-size: 8.5px; line-height: 1.6; }
.chapter-note-input { width: 100%; min-height: 118px; resize: vertical; padding: 10px 11px; border: 1px solid #e0dcd1; border-radius: 9px; outline: 0; color: var(--ink-soft); background: #fdfcf8; font-family: var(--sans); font-size: 10.5px; line-height: 1.7; }
.chapter-note-input:focus { border-color: var(--topic-color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--topic-color) 12%, transparent); }
.note-status { display: block; min-height: 14px; margin-top: 6px; color: var(--muted); font-size: 8px; }
.chapter-actions p { margin: 0 0 12px; color: var(--muted); font-size: 9px; line-height: 1.65; }
.chapter-actions .complete-button { width: 100%; }
.chapter-actions .complete-button.is-done { color: #fff; background: var(--green); }

/* Formula library */
.library-hero { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 30px; padding: 33px 35px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: linear-gradient(120deg, #eef3ee, #f8f5ed 58%, #ece8f1); }
.library-hero .eyebrow { display: flex; align-items: center; gap: 8px; color: var(--green); }
.library-hero .eyebrow span { width: 20px; height: 1px; background: var(--green); }
.library-hero h1 { margin: 0; font-family: var(--serif); font-size: clamp(34px, 5vw, 50px); font-weight: 520; letter-spacing: -.035em; }
.library-hero p:last-child { max-width: 690px; margin: 12px 0 0; color: var(--ink-soft); font-size: 12px; line-height: 1.8; }
.library-count-card { min-width: 155px; padding: 18px; border: 1px solid rgba(32,95,72,.15); border-radius: 17px; background: rgba(255,255,255,.52); text-align: center; }
.library-count-card span { display: block; color: var(--muted); font-size: 8px; letter-spacing: .1em; }
.library-count-card strong { display: block; margin: 3px 0 0; color: var(--green); font-family: var(--serif); font-size: 42px; font-weight: 520; }
.library-count-card small { color: var(--muted); font-size: 8px; }
.formula-search-bar { display: flex; align-items: center; gap: 11px; margin: 18px 0; padding: 0 14px; height: 46px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.formula-search-bar .search-glyph { width: 16px; height: 16px; color: var(--muted); }
.formula-search-bar input { flex: 1; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.formula-search-bar input::placeholder { color: #a0a49c; }
.formula-search-bar .text-button { color: var(--muted); }
.formula-group { margin-top: 14px; padding: 17px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.formula-group-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 2px 12px; border-bottom: 1px solid #ebe7dd; }
.formula-group-head button { display: flex; align-items: center; gap: 8px; border: 0; padding: 0; background: transparent; text-align: left; cursor: pointer; }
.formula-group-head button span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; color: var(--topic-color); background: var(--topic-pale); font-family: var(--serif); font-size: 9px; }
.formula-group-head button strong { font-family: var(--serif); font-size: 18px; font-weight: 570; }
.formula-group-head button small { color: var(--muted); font-size: 8px; }
.formula-group-head > b { color: var(--topic-color); font-size: 8px; font-weight: 650; }
.formula-library-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; padding-top: 12px; }
.formula-library-card { min-height: 125px; padding: 13px; border: 1px solid #e8e4da; border-radius: 10px; background: #fdfcf8; }
.formula-library-card span { color: var(--muted); font-size: 8px; }
.formula-library-card strong { display: block; margin: 7px 0; color: var(--topic-color); font-family: var(--serif); font-size: 15px; font-weight: 560; line-height: 1.55; }
.formula-library-card p { margin: 0; color: var(--muted); font-size: 8.5px; line-height: 1.6; }
.empty-library { padding: 65px 20px; border: 1px dashed #d9d5c9; border-radius: 16px; color: var(--muted); text-align: center; }
.empty-library strong { display: block; color: var(--ink); font-family: var(--serif); font-size: 20px; font-weight: 560; }
.empty-library p { margin: 7px 0 0; font-size: 10px; }
.search-section-label { margin: 8px 10px 4px; color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .1em; }

/* Shared interactive pieces */
.focus-pill.is-running { color: #fff; background: var(--green); }
.focus-pill.is-running .pulse-dot { background: #a7e0b9; box-shadow: 0 0 0 4px rgba(167,224,185,.16); animation: pulse 1.7s ease infinite; }
@keyframes pulse { 50% { opacity: .45; transform: scale(.8); } }
#start-focus.is-running { background: var(--green); }
#start-focus.is-running:hover { background: #277257; }
.learning-step small { max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quiz-card .answer-list button { font-size: 10.5px; }
.quiz-card .quiz-question h3 { font-size: 18px; }
.quiz-card .quiz-feedback { font-size: 10px; }
.quiz-card .quiz-feedback strong { color: var(--green); }
.quiz-card .quiz-feedback.is-wrong strong { color: var(--coral); }
.search-result .result-num { font-style: italic; }
.search-result strong { font-size: 12px; }
.search-result small { font-size: 9px; }

@media (max-width: 1180px) {
  .book-dashboard { grid-template-columns: minmax(0, 1.45fr) minmax(270px, .65fr); }
  .chapter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chapter-layout { grid-template-columns: minmax(0, 1.45fr) minmax(260px, .65fr); }
  .formula-library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .book-dashboard { grid-template-columns: 1fr; }
  .book-map-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chapter-layout { grid-template-columns: 1fr; }
  .chapter-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chapter-actions { grid-column: span 2; }
  .library-hero { grid-template-columns: 1fr; }
  .library-count-card { display: flex; align-items: baseline; gap: 8px; justify-self: start; min-width: 0; padding: 11px 14px; }
  .library-count-card strong { font-size: 30px; }
  .formula-library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .book-hero { padding: 27px 23px; }
  .book-hero h1 { font-size: 37px; }
  .volume-heading-row { align-items: flex-start; margin-top: 30px; }
  .volume-heading-row h2 { font-size: 23px; }
  .chapter-grid { grid-template-columns: 1fr; }
  .chapter-card { min-height: 215px; }
  .book-map-grid { grid-template-columns: 1fr; }
  .chapter-hero { padding: 26px 22px; }
  .chapter-hero h1 { font-size: 38px; }
  .chapter-hero-top { align-items: flex-start; flex-direction: column; gap: 5px; }
  .chapter-lesson { padding: 22px 18px; }
  .chapter-lesson-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .section-body { padding-left: 15px; }
  .section-summary-copy small { white-space: normal; }
  .chapter-side { grid-template-columns: 1fr; }
  .chapter-actions { grid-column: auto; }
  .library-hero { padding: 26px 22px; }
  .formula-search-bar { height: 43px; }
  .formula-library-grid { grid-template-columns: 1fr; }
  .formula-group { padding: 14px; }
}

/* Deep lecture notes */
.lecture-deep-dive {
  margin: 20px 0 28px;
  padding: 22px 23px;
  border: 1px solid color-mix(in srgb, var(--topic-color) 18%, #e5e1d7);
  border-radius: 15px;
  background: linear-gradient(145deg, #fdfcf8, color-mix(in srgb, var(--topic-pale) 58%, #ffffff));
}
.lecture-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.lecture-heading h2 { margin: 0; font-family: var(--serif); font-size: 25px; font-weight: 560; letter-spacing: -.02em; }
.lecture-heading > span { color: var(--muted); font-size: 8.5px; white-space: nowrap; }
.lecture-principle { margin: 16px 0 18px; background: rgba(255,255,255,.48); }
.lecture-prose p { margin: 0 0 12px; color: var(--ink-soft); font-size: 12.5px; line-height: 2; text-align: justify; }
.lecture-prose p:last-child { margin-bottom: 0; }
.lecture-method-box, .lecture-terms-box { margin-top: 19px; padding-top: 17px; border-top: 1px solid #e8e4da; }
.lecture-method-box h3, .lecture-terms-box h3 { margin: 0 0 11px; font-family: var(--serif); font-size: 18px; font-weight: 560; }
.lecture-method-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.lecture-method-list li { display: grid; grid-template-columns: 24px 1fr; gap: 9px; align-items: start; }
.lecture-method-list li > span { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; color: var(--topic-color); background: var(--topic-pale); font-family: var(--serif); font-size: 8px; }
.lecture-method-list p { margin: 1px 0 0; color: var(--ink-soft); font-size: 10.5px; line-height: 1.7; }
.lecture-term-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.lecture-term { padding: 10px 11px; border: 1px solid #e8e4da; border-radius: 9px; background: rgba(255,255,255,.5); }
.lecture-term strong { display: block; color: var(--topic-color); font-size: 10px; font-weight: 700; }
.lecture-term p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.65; }
.lecture-examples { margin-top: 29px; padding-top: 2px; border-top: 1px solid #ebe7dd; }
.worked-example { margin-bottom: 12px; padding: 17px 18px; border: 1px solid #e5e1d7; border-radius: 12px; background: #faf8f2; }
.worked-example:last-child { margin-bottom: 0; }
.worked-example-head { display: flex; align-items: baseline; gap: 9px; }
.worked-example-head span { color: var(--topic-color); font-size: 8px; font-weight: 700; letter-spacing: .08em; }
.worked-example-head h3 { margin: 0; font-family: var(--serif); font-size: 17px; font-weight: 560; }
.worked-question { margin: 10px 0 12px; color: var(--ink-soft); font-size: 11.5px; line-height: 1.8; }
.worked-steps { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.worked-steps li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; }
.worked-steps li span { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--topic-color); font-size: 8px; }
.worked-steps li p { margin: 1px 0 0; color: var(--ink-soft); font-size: 10.5px; line-height: 1.75; }
.worked-answer { display: grid; grid-template-columns: auto 1fr; gap: 9px; margin-top: 12px; padding: 10px 11px; border-radius: 8px; background: var(--topic-pale); }
.worked-answer span { color: var(--topic-color); font-size: 8px; font-weight: 750; letter-spacing: .08em; }
.worked-answer p { margin: 0; color: var(--ink); font-size: 10.5px; line-height: 1.7; }
.perspective-card { padding: 20px 21px; }
.perspective-card h3 { margin: 0 0 8px; font-family: var(--serif); font-size: 18px; font-weight: 560; }
.perspective-card p:last-child { margin: 0; color: var(--ink-soft); font-size: 9.5px; line-height: 1.75; }
.exam-tip { margin-top: 13px; padding: 11px 12px; border-radius: 9px; background: #f1efe7; }
.exam-tip strong { display: block; color: var(--topic-color); font-size: 8px; letter-spacing: .08em; }
.exam-tip p { margin: 4px 0 0; color: var(--ink-soft); font-size: 9px; line-height: 1.7; }

@media (max-width: 700px) {
  .lecture-deep-dive { padding: 18px 16px; }
  .lecture-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .lecture-heading > span { white-space: normal; }
  .lecture-prose p { font-size: 12px; text-align: left; }
  .lecture-term-grid { grid-template-columns: 1fr; }
  .worked-example { padding: 15px 14px; }
}

/* Formula derivations and proofs */
.derivation-section { margin: 4px 0 30px; }
.derivation-list { display: grid; gap: 10px; }
.derivation-card { border: 1px solid color-mix(in srgb, var(--topic-color) 20%, #e5e1d7); border-radius: 12px; background: #fdfcf8; overflow: hidden; }
.derivation-card summary { display: grid; grid-template-columns: 29px 1fr 18px; align-items: center; gap: 10px; padding: 13px 14px; cursor: pointer; list-style: none; }
.derivation-card summary::-webkit-details-marker { display: none; }
.derivation-index { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; color: #fff; background: var(--topic-color); font-family: var(--serif); font-size: 8px; }
.derivation-summary { display: flex; flex-direction: column; min-width: 0; gap: 3px; }
.derivation-summary strong { font-size: 11.5px; font-weight: 650; }
.derivation-summary small { overflow: hidden; color: var(--muted); font-size: 8.5px; text-overflow: ellipsis; white-space: nowrap; }
.derivation-card summary i { color: var(--topic-color); font-size: 14px; font-style: normal; transition: transform .2s ease; }
.derivation-card[open] summary i { transform: rotate(45deg); }
.derivation-body { padding: 0 15px 16px 54px; }
.derivation-steps { display: grid; gap: 11px; margin: 0; padding: 0; list-style: none; }
.derivation-steps li { display: grid; grid-template-columns: 23px 1fr; gap: 9px; align-items: start; }
.derivation-step-number { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 50%; color: var(--topic-color); background: var(--topic-pale); font-size: 8px; font-weight: 700; }
.derivation-step-content p { margin: 2px 0 6px; color: var(--ink-soft); font-size: 10.5px; line-height: 1.75; }
.derivation-formula { padding: 9px 11px; border-radius: 8px; color: var(--topic-color); background: var(--topic-pale); font-family: var(--serif); font-size: 14px; line-height: 1.65; overflow-x: auto; }
.derivation-conclusion, .derivation-warning { display: grid; grid-template-columns: auto 1fr; gap: 9px; margin-top: 12px; padding: 10px 11px; border-radius: 8px; }
.derivation-conclusion { background: var(--topic-pale); }
.derivation-warning { background: #f6eee9; }
.derivation-conclusion span, .derivation-warning span { color: var(--topic-color); font-size: 8px; font-weight: 750; letter-spacing: .08em; }
.derivation-warning span { color: var(--coral); }
.derivation-conclusion p, .derivation-warning p { margin: 0; color: var(--ink-soft); font-size: 9.5px; line-height: 1.7; }

@media (max-width: 700px) {
  .derivation-body { padding-left: 14px; }
  .derivation-summary small { white-space: normal; }
  .derivation-formula { font-size: 13px; }
}

/* Per-section detailed explanation and derivation */
.section-deep-dive { margin: 4px 0 14px; padding: 14px; border: 1px solid color-mix(in srgb, var(--topic-color) 17%, #e5e1d7); border-radius: 11px; background: linear-gradient(145deg, #fdfcf8, color-mix(in srgb, var(--topic-pale) 48%, #ffffff)); }
.section-deep-block + .section-deep-block { margin-top: 14px; padding-top: 13px; border-top: 1px solid #e8e4da; }
.section-deep-block h4 { margin: 0 0 8px; color: var(--topic-color); font-size: 9px; font-weight: 750; letter-spacing: .09em; }
.section-deep-block p { margin: 0 0 8px; color: var(--ink-soft); font-size: 10.5px; line-height: 1.8; }
.section-deep-block p:last-child { margin-bottom: 0; }
.section-derivation-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.section-derivation-list li { display: grid; grid-template-columns: 21px 1fr; gap: 8px; align-items: start; }
.section-derivation-list li > span { width: 19px; height: 19px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--topic-color); font-size: 7.5px; }
.section-derivation-list p { margin: 1px 0 5px; font-size: 10px; }
.section-derivation-formula { padding: 8px 10px; border-radius: 7px; color: var(--topic-color); background: var(--topic-pale); font-family: var(--serif); font-size: 12.5px; line-height: 1.6; overflow-x: auto; }
.section-deep-conclusion { display: grid; grid-template-columns: auto 1fr; gap: 8px; margin-top: 12px; padding: 9px 10px; border-radius: 8px; background: var(--topic-pale); }
.section-deep-conclusion span { color: var(--topic-color); font-size: 8px; font-weight: 750; letter-spacing: .08em; }
.section-deep-conclusion p { margin: 0; color: var(--ink-soft); font-size: 9.5px; line-height: 1.7; }

@media (max-width: 700px) {
  .section-deep-dive { padding: 12px; }
  .section-deep-block p { font-size: 10px; }
}
