
* { box-sizing: border-box; }
body { font-family: Georgia, serif; max-width: 860px; margin: 0 auto; padding: 0 1.5em 3em; color: #222; line-height: 1.6; }
nav { padding: 0.8em 0; border-bottom: 1px solid #ddd; margin-bottom: 2em; font-size: 0.9em; color: #555; }
nav a { color: #1565c0; text-decoration: none; }
nav a:hover { text-decoration: underline; }
.breadcrumb { margin-left: 1em; }
h1.chapter-title { font-size: 1.6em; margin-bottom: 1.5em; }

/* ── Index ── */
.index a { color: #1565c0; text-decoration: none; }
.index a:hover { text-decoration: underline; }
.idx-book { margin: 1.5em 0; border: 1px solid #ddd; border-radius: 4px; }
.idx-book > summary { cursor: pointer; padding: 0.6em 1em; background: #1565c0; color: #fff;
  border-radius: 3px; list-style: none; font-size: 1.1em; font-weight: bold; }
.idx-book > summary::-webkit-details-marker { display: none; }
.idx-book > summary::before { content: "▶ "; font-size: 0.8em; }
.idx-book[open] > summary::before { content: "▼ "; }
.idx-topic { margin: 0.5em 1em; border: 1px solid #eee; border-radius: 3px; }
.idx-topic > summary { cursor: pointer; padding: 0.4em 0.8em; background: #f5f5f5;
  color: #333; list-style: none; font-weight: bold; }
.idx-topic > summary::-webkit-details-marker { display: none; }
.idx-topic > summary::before { content: "▶ "; font-size: 0.75em; color: #888; }
.idx-topic[open] > summary::before { content: "▼ "; }
.idx-topic ul { margin: 0.4em 0; padding-left: 1.5em; }
.idx-topic li { margin: 0.3em 0; }

/* ── Chapter footer (prev/next) ── */
footer { display: flex; justify-content: space-between; margin-top: 3em;
  padding-top: 1em; border-top: 1px solid #ddd; font-size: 0.9em; }
footer a { color: #1565c0; text-decoration: none; max-width: 45%; }
footer a:hover { text-decoration: underline; }

/* ── Knowledge blocks ── */
.mdc-block { margin: 1.5em 0; border-radius: 2px; overflow: hidden; }
.mdc-header { padding: 0.4em 0.9em; font-weight: bold; font-size: 0.95em; }
.mdc-body { padding: 0.8em 1em; }
.mdc-body > * + * { margin-top: 0.6em; }

.mdc-theorem  { border: 1px solid #1565c0; }
.mdc-theorem  .mdc-header { background: #1565c0; color: #fff; }

.mdc-definition { border: 1px solid #b71c1c; }
.mdc-definition .mdc-header { background: #b71c1c; color: #fff; }

.mdc-lemma    { border: 1px solid #311b92; }
.mdc-lemma    .mdc-header { background: #311b92; color: #fff; }

.mdc-corollary { border: 1px solid #004d40; }
.mdc-corollary .mdc-header { background: #004d40; color: #fff; }

.mdc-exercise { border: 1px solid #2e7d32; }
.mdc-exercise .mdc-header { background: #2e7d32; color: #fff; }

.mdc-example  { border: 1px solid #558b2f; }
.mdc-example  .mdc-header { background: #558b2f; color: #fff; }

.mdc-recall   { border: 1px solid #e65100; }
.mdc-recall   .mdc-header { background: #e65100; color: #fff; }

.mdc-equation { border: 1px solid #6a1b9a; }
.mdc-equation .mdc-header { background: #6a1b9a; color: #fff; }

.mdc-figure   { border: 1px solid #4527a0; }
.mdc-figure   .mdc-header { background: #4527a0; color: #fff; }

.mdc-recipe   { border: 1px solid #4e342e; }
.mdc-recipe   .mdc-header { background: #4e342e; color: #fff; }

.mdc-note, .mdc-summary { border: 1px solid #546e7a; }
.mdc-note .mdc-header, .mdc-summary .mdc-header { background: #546e7a; color: #fff; }

/* ── Pedagogical (collapsible) ── */
.mdc-motivation, .mdc-insight, .mdc-context, .mdc-warning {
  border-left: 3px solid #bbb; margin: 1em 0; padding: 0;
}
.mdc-motivation { border-color: #f57f17; }
.mdc-insight    { border-color: #0277bd; }
.mdc-context    { border-color: #558b2f; }
.mdc-warning    { border-color: #c62828; }
.mdc-ped-label  { padding: 0.3em 0.8em; font-style: italic; color: #555; font-size: 0.9em; }
.mdc-motivation summary, .mdc-insight summary, .mdc-context summary, .mdc-warning summary {
  cursor: pointer; padding: 0.4em 0.8em; list-style: none;
}
.mdc-motivation summary::before { content: "💡 "; }
.mdc-insight    summary::before { content: "🔍 "; }
.mdc-context    summary::before { content: "ℹ️ "; }
.mdc-warning    summary::before { content: "⚠️ "; }
.mdc-motivation > *:not(summary),
.mdc-insight    > *:not(summary),
.mdc-context    > *:not(summary),
.mdc-warning    > *:not(summary) { padding: 0.5em 1em; }

/* ── Slots ── */
.mdc-slot { margin-top: 0.8em; border-top: 1px solid rgba(0,0,0,0.1); }
.mdc-slot summary { cursor: pointer; padding: 0.3em 0; color: #555; font-style: italic; font-size: 0.9em; list-style: none; }
.mdc-slot summary::before { content: "▶ "; font-size: 0.7em; }
.mdc-slot[open] summary::before { content: "▼ "; }

/* ── Layout ── */
.mdc-collapse { margin: 1em 0; border: 1px solid #ddd; border-radius: 4px; }
.mdc-collapse summary { cursor: pointer; padding: 0.5em 0.8em; background: #f5f5f5; }
.mdc-collapse > *:not(summary) { padding: 0.5em 1em; }
.mdc-grid { display: flex; flex-wrap: wrap; gap: 1em; }

/* ── Inline ── */
.mdc-def  { font-weight: bold; color: #1565c0; }
.mdc-dref { text-decoration: underline dotted #888; text-underline-offset: 3px; }
.mdc-ref  { color: #1565c0; text-decoration: none; }
.mdc-ref:hover { text-decoration: underline; }
.mdc-caption { font-size: 0.88em; color: #555; margin-top: 0.4em; }
.mdc-ext-link { color: #1565c0; }

/* ── Prose ── */
p { margin: 0.5em 0; }
ul, ol { padding-left: 1.5em; margin: 0.5em 0; }
h2 { font-size: 1.3em; margin: 1.8em 0 0.5em; border-bottom: 1px solid #eee; }
h3 { font-size: 1.1em; margin: 1.4em 0 0.4em; }
table { border-collapse: collapse; margin: 1em 0; }
th, td { border: 1px solid #ddd; padding: 0.4em 0.7em; }
th { background: #f5f5f5; }
img { max-width: 100%; }
code { background: #f5f5f5; padding: 0.1em 0.3em; border-radius: 3px; font-size: 0.9em; }
pre code { background: none; padding: 0; }
pre { background: #f5f5f5; padding: 0.8em 1em; overflow-x: auto; border-radius: 4px; }
