:root {
  color-scheme: light;
  --paper: #f4f5f2;
  --surface: #fffefa;
  --ink: #18343b;
  --body-ink: #263b40;
  --muted: #61757a;
  --line: #dce4e0;
  --accent: #23665f;
  --accent-dark: #174f4a;
  --accent-soft: #e5f0eb;
  --gold: #bd8a48;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --reading-width: 48rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 6rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--body-ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}
button, a { font: inherit; }
a { color: var(--accent-dark); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: #0e403d; }
a:focus-visible, button:focus-visible { outline: 3px solid #b27a35; outline-offset: 3px; border-radius: 4px; }
.skip-link {
  position: absolute; z-index: 20; left: 1rem; top: -4rem; padding: .65rem 1rem;
  color: #fff; background: var(--accent-dark); border-radius: .4rem;
}
.skip-link:focus { top: 1rem; }

.progress-track { height: 3px; position: fixed; inset: 0 0 auto; z-index: 30; background: transparent; }
.progress-bar { height: 100%; width: 0; background: var(--gold); transition: width .15s linear; }
.site-header {
  position: sticky; top: 3px; z-index: 15;
  border-bottom: 1px solid rgba(220, 228, 224, .9);
  background: rgba(255, 254, 250, .94); backdrop-filter: blur(12px);
}
.header-inner {
  max-width: 1320px; min-height: 72px; padding: .75rem 2rem; margin: 0 auto;
  display: flex; align-items: center; gap: 1.4rem;
}
.brand { display: inline-flex; align-items: center; gap: .75rem; color: var(--ink); text-decoration: none; min-width: 15rem; }
.brand img { height: 42px; width: 42px; object-fit: contain; border-radius: 50%; background: var(--accent-soft); }
.brand-name { display: block; font: 600 1.03rem/1.2 var(--serif); letter-spacing: .01em; }
.brand-subtitle { display: block; margin-top: .15rem; color: var(--muted); font-size: .69rem; letter-spacing: .08em; text-transform: uppercase; }
.header-context { margin-left: auto; color: var(--muted); font-size: .86rem; }
.chapter-chip { padding: .4rem .72rem; border: 1px solid var(--line); border-radius: 999px; color: var(--accent-dark); font-size: .78rem; font-weight: 650; white-space: nowrap; }

.page-shell { max-width: 1320px; margin: 0 auto; padding: 2.7rem 2rem 5rem; }
.reader-layout { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.toc-panel { position: sticky; top: 6.2rem; align-self: start; max-height: calc(100vh - 7.2rem); overflow-y: auto; padding: 1.15rem 1rem 1.4rem; border-left: 2px solid var(--line); }
.toc-heading { margin: 0 0 .55rem; color: var(--muted); font-size: .69rem; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.toc-intro { margin: 0 0 1rem; color: var(--ink); font: 600 1.05rem/1.35 var(--serif); }
.toc-toggle { display: none; }
#toc-list { margin: 0; padding: 0; list-style: none; }
#toc-list li { margin: .1rem 0; }
#toc-list a {
  display: block; padding: .33rem .55rem; border-left: 2px solid transparent; border-radius: 0 .35rem .35rem 0;
  color: var(--muted); font-size: .79rem; line-height: 1.45; text-decoration: none; transition: color .15s ease, background .15s ease;
}
#toc-list li.level-3 a { padding-left: 1.05rem; font-size: .75rem; }
#toc-list a:hover { color: var(--accent-dark); background: #eaf0ec; }
#toc-list a[aria-current="location"] { border-left-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); font-weight: 680; }
.chapter-column { min-width: 0; }
.chapter-kicker { margin: 0 0 .8rem; color: var(--accent); font-size: .72rem; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
.chapter-status { display: inline-flex; align-items: center; gap: .45rem; margin-bottom: 1rem; color: var(--muted); font-size: .77rem; }
.status-dot { width: .48rem; height: .48rem; border-radius: 50%; background: var(--accent); }
.scope-note {
  display: flex; gap: .8rem; margin: 1.8rem 0 2rem; padding: 1rem 1.1rem;
  border: 1px solid #d5e5dc; border-left: 3px solid var(--accent); border-radius: .55rem;
  background: #eef5f0; color: #34554e; font-size: .88rem; line-height: 1.55;
}
.scope-icon { flex: 0 0 auto; display: grid; place-items: center; width: 1.35rem; height: 1.35rem; margin-top: .1rem; border-radius: 50%; background: var(--accent); color: white; font-size: .8rem; font-weight: 750; }
.scope-note p { margin: 0; }
.article-card { padding: clamp(1.4rem, 4vw, 3.6rem) clamp(1.25rem, 5vw, 4.2rem); border: 1px solid #e5e8e3; border-radius: 1rem; background: var(--surface); box-shadow: 0 14px 50px rgba(22, 48, 43, .045); }
.chapter-content { max-width: var(--reading-width); margin: 0 auto; }
.chapter-content h1, .chapter-content h2, .chapter-content h3 { color: var(--ink); scroll-margin-top: 7rem; }
.chapter-content h1 { margin: 0 0 1.8rem; font: 600 clamp(2.1rem, 4.3vw, 3.45rem)/1.13 var(--serif); letter-spacing: -.035em; text-wrap: balance; }
.chapter-content h2 { margin: 3.25rem 0 1rem; padding-top: 1.2rem; border-top: 1px solid var(--line); font: 600 clamp(1.45rem, 2.5vw, 1.85rem)/1.27 var(--serif); letter-spacing: -.02em; text-wrap: balance; }
.chapter-content h3 { margin: 2.15rem 0 .65rem; font: 600 1.22rem/1.38 var(--serif); }
.chapter-content p { margin: 0 0 1.08rem; }
.chapter-content strong { color: #163f3c; font-weight: 700; }
.chapter-content em { font-family: var(--serif); }
.chapter-content ul, .chapter-content ol { margin: .25rem 0 1.35rem; padding-left: 1.45rem; }
.chapter-content li { margin: .42rem 0; padding-left: .16rem; }
.chapter-content li::marker { color: var(--accent); }
.chapter-content blockquote { margin: 1.65rem 0; padding: .8rem 1.1rem; border-left: 3px solid var(--gold); background: #faf6ed; color: #4f5d5d; font: italic 1.04rem/1.65 var(--serif); }
.chapter-content blockquote p { margin: 0; }
.chapter-content code { padding: .12rem .32rem; border-radius: .25rem; background: #edf0eb; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
.citation { vertical-align: super; font: 650 .72em/1 var(--sans); }
.citation a { padding: 0 .08em; text-decoration: none; }
.reference-list { margin-top: 1rem !important; padding-left: 1.55rem !important; }
.reference-list li { padding-left: .25rem; overflow-wrap: anywhere; }
.reference-list a { font-size: .94rem; }
.reference-list a::after { content: " ↗"; font-size: .78em; text-decoration: none; }
.article-end { display: flex; align-items: center; gap: .7rem; margin-top: 3rem; padding-top: 1.3rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .83rem; }
.article-end-mark { width: 1.7rem; height: 1px; background: var(--gold); }
.site-footer { max-width: 1320px; margin: 0 auto; padding: 1.4rem 2rem 2.7rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .77rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; }

@media (max-width: 900px) {
  .header-inner { padding-inline: 1.2rem; }
  .page-shell { padding: 2rem 1.2rem 3rem; }
  .reader-layout { grid-template-columns: 12.5rem minmax(0, 1fr); gap: 1.35rem; }
  .toc-panel { padding-inline: .7rem; }
  .article-card { padding-inline: clamp(1.2rem, 3.5vw, 2rem); }
}
@media (max-width: 700px) {
  html { scroll-padding-top: 5.2rem; }
  .header-inner { min-height: 62px; gap: .7rem; padding: .55rem .95rem; }
  .brand { min-width: 0; gap: .55rem; }
  .brand img { height: 36px; width: 36px; }
  .brand-name { font-size: .92rem; }
  .brand-subtitle { font-size: .58rem; }
  .header-context { display: none; }
  .chapter-chip { margin-left: auto; padding: .33rem .6rem; font-size: .7rem; }
  .page-shell { padding: 1.1rem .75rem 2.3rem; }
  .reader-layout { display: block; }
  .toc-panel { position: relative; top: auto; max-height: none; overflow: visible; margin: 0 0 .9rem; padding: .75rem .85rem; border: 1px solid var(--line); border-radius: .7rem; background: var(--surface); }
  .toc-heading { margin-bottom: .2rem; }
  .toc-intro { display: none; }
  .toc-toggle { display: flex; width: 100%; align-items: center; justify-content: space-between; border: 0; padding: .35rem 0; background: transparent; color: var(--ink); font-weight: 650; text-align: left; cursor: pointer; }
  .toc-toggle::after { content: "＋"; color: var(--accent); font-size: 1.15rem; }
  .toc-toggle[aria-expanded="true"]::after { content: "−"; }
  #toc-list { display: none; max-height: 52vh; overflow-y: auto; margin-top: .5rem; padding-top: .45rem; border-top: 1px solid var(--line); }
  .toc-panel.is-open #toc-list { display: block; }
  #toc-list a { padding: .42rem .55rem; font-size: .83rem; }
  #toc-list li.level-3 a { font-size: .79rem; }
  .chapter-kicker { margin-bottom: .45rem; font-size: .66rem; }
  .chapter-status { margin-bottom: .55rem; }
  .scope-note { margin: .9rem 0 1rem; padding: .8rem .85rem; font-size: .82rem; }
  .article-card { padding: 1.35rem 1.15rem 1.8rem; border-radius: .75rem; }
  .chapter-content h1 { font-size: clamp(1.9rem, 8vw, 2.55rem); }
  .chapter-content h2 { margin-top: 2.6rem; font-size: 1.47rem; }
  .chapter-content h3 { margin-top: 1.8rem; font-size: 1.12rem; }
  .chapter-content p, .chapter-content li { font-size: .96rem; }
  .chapter-content blockquote { padding: .72rem .85rem; font-size: .98rem; }
  .site-footer { padding: 1.1rem .95rem 1.8rem; }
  .footer-inner { flex-direction: column; gap: .35rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print {
  body { background: #fff; color: #111; font-size: 11pt; }
  .progress-track, .site-header, .toc-panel, .site-footer, .chapter-status { display: none !important; }
  .page-shell { max-width: none; padding: 0; }
  .reader-layout { display: block; }
  .article-card { border: 0; padding: 0; box-shadow: none; }
  .chapter-content { max-width: none; }
  .chapter-content h2 { break-after: avoid; }
  a { color: inherit; }
  .scope-note { border: 1px solid #aaa; background: #fff; }
}


.chapter-switcher { margin-left: auto; display: inline-flex; align-items: center; gap: .2rem; padding: .22rem; border: 1px solid var(--line); border-radius: 999px; background: #f8f9f6; }
.chapter-switcher a { padding: .38rem .72rem; border-radius: 999px; color: var(--muted); font-size: .78rem; font-weight: 650; text-decoration: none; white-space: nowrap; }
.chapter-switcher a:hover { background: var(--accent-soft); color: var(--accent-dark); }
.chapter-switcher a[aria-current="page"] { background: var(--accent); color: #fff; }
.chapter-pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1rem; }
.pager-link { display: flex; flex-direction: column; gap: .22rem; max-width: 24rem; padding: .9rem 1.1rem; border: 1px solid var(--line); border-radius: .65rem; background: var(--surface); text-decoration: none; transition: border-color .15s ease, transform .15s ease; }
.pager-link:hover { border-color: #aac9bd; transform: translateY(-1px); }
.pager-next { margin-left: auto; text-align: right; }
.pager-previous { margin-right: auto; text-align: left; }
.pager-label { color: var(--muted); font-size: .71rem; letter-spacing: .06em; text-transform: uppercase; }
.pager-link strong { color: var(--accent-dark); font: 600 1rem/1.35 var(--serif); }
@media (max-width: 700px) {
  .chapter-switcher { gap: 0; padding: .15rem; }
  .chapter-switcher a { padding: .32rem .48rem; font-size: .68rem; }
  .brand-subtitle { display: none; }
  .chapter-pager { margin-top: .7rem; }
  .pager-link { padding: .75rem .85rem; }
  .pager-link strong { font-size: .89rem; }
}


.header-inner { position: relative; }
.book-navigation { margin-left: auto; display: flex; align-items: center; gap: .65rem; }
.contents-link, .book-menu summary { display: inline-flex; align-items: center; gap: .45rem; min-height: 2.35rem; padding: .4rem .78rem; border: 1px solid var(--line); border-radius: 999px; background: #f8f9f6; color: var(--accent-dark); font-size: .78rem; font-weight: 650; text-decoration: none; white-space: nowrap; cursor: pointer; }
.contents-link:hover, .book-menu summary:hover, .book-menu[open] summary { background: var(--accent-soft); color: var(--accent-dark); }
.book-menu { position: relative; }
.book-menu summary { list-style: none; }
.book-menu summary::-webkit-details-marker { display: none; }
.book-menu summary::after { content: "⌄"; color: var(--muted); font-size: .9rem; }
.book-menu-current { display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--accent); color: white; font-size: .65rem; }
.book-menu-panel { position: absolute; z-index: 25; top: calc(100% + .55rem); right: 0; width: min(31rem, calc(100vw - 2rem)); max-height: min(75vh, 42rem); overflow-y: auto; padding: .85rem; border: 1px solid var(--line); border-radius: .8rem; background: var(--surface); box-shadow: 0 18px 48px rgba(22, 48, 43, .16); }
.book-menu-panel > p { margin: .2rem .45rem .65rem; color: var(--muted); font-size: .69rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.book-menu-panel ol { display: grid; grid-template-columns: 1fr 1fr; gap: .12rem .4rem; margin: 0; padding: 0; list-style: none; }
.book-menu-panel li { min-width: 0; }
.book-menu-panel li a { display: grid; grid-template-columns: 1.7rem minmax(0, 1fr); align-items: start; gap: .42rem; padding: .48rem .42rem; border-radius: .45rem; color: var(--body-ink); font-size: .77rem; line-height: 1.4; text-decoration: none; }
.book-menu-panel li a:hover { background: var(--accent-soft); color: var(--accent-dark); }
.book-menu-panel li a[aria-current="page"] { background: var(--accent); color: white; }
.book-menu-number { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .7rem; font-weight: 750; }
.book-menu-panel li a[aria-current="page"] .book-menu-number { color: #fff; }
.contents-page { max-width: 1120px; }
.contents-heading { max-width: 52rem; margin: .8rem auto 1.4rem; }
.contents-heading h1 { margin: .25rem 0 .85rem; color: var(--ink); font: 600 clamp(2.2rem, 5vw, 3.8rem)/1.1 var(--serif); letter-spacing: -.035em; text-wrap: balance; }
.contents-heading > p:last-child { max-width: 43rem; color: var(--muted); font-size: 1.05rem; }
.contents-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin: 1.6rem 0 0; padding: 0; list-style: none; }
.contents-grid li { min-width: 0; }
.contents-card { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr) 1.3rem; align-items: center; gap: .8rem; height: 100%; min-height: 5.5rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: .72rem; background: var(--surface); color: var(--body-ink); text-decoration: none; transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.contents-card:hover { transform: translateY(-1px); border-color: #aac9bd; box-shadow: 0 8px 20px rgba(22, 48, 43, .06); color: var(--accent-dark); }
.contents-number { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); font: 650 .88rem/1 var(--serif); }
.contents-card-copy { display: flex; flex-direction: column; gap: .3rem; }
.contents-card-copy strong { color: var(--ink); font: 600 1rem/1.35 var(--serif); }
.contents-card-copy > span { color: var(--muted); font-size: .7rem; }
.contents-arrow { justify-self: end; color: var(--gold); }
.chapter-pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1rem; }
.pager-link { display: flex; flex-direction: column; gap: .22rem; max-width: 24rem; padding: .9rem 1.1rem; border: 1px solid var(--line); border-radius: .65rem; background: var(--surface); text-decoration: none; transition: border-color .15s ease, transform .15s ease; }
.pager-link:hover { border-color: #aac9bd; transform: translateY(-1px); }
.pager-next { margin-left: auto; text-align: right; }
.pager-previous { margin-right: auto; text-align: left; }
.pager-label { color: var(--muted); font-size: .71rem; letter-spacing: .06em; text-transform: uppercase; }
.pager-link strong { color: var(--accent-dark); font: 600 1rem/1.35 var(--serif); }
@media (max-width: 700px) {
  .book-navigation { gap: .35rem; }
  .contents-link, .book-menu summary { min-height: 2.1rem; gap: .25rem; padding: .32rem .52rem; font-size: .68rem; }
  .book-menu-panel ol { grid-template-columns: 1fr; }
  .book-menu-panel { right: -.4rem; width: min(24rem, calc(100vw - 1.2rem)); }
  .contents-grid { grid-template-columns: 1fr; gap: .5rem; margin-top: 1.1rem; }
  .contents-card { min-height: 4.8rem; padding: .72rem .8rem; }
  .contents-heading h1 { font-size: clamp(1.95rem, 8vw, 2.8rem); }
  .chapter-pager { margin-top: .7rem; }
  .pager-link { padding: .75rem .85rem; }
  .pager-link strong { font-size: .89rem; }
}


/* Small editorial polish: visible reading hierarchy without new assets or dependencies. */
.chapter-kicker { display: flex; align-items: center; gap: .7rem; }
.chapter-kicker::after { content: ""; width: 2.1rem; height: 1px; background: var(--gold); }
.contents-heading { padding-bottom: 1.15rem; border-bottom: 1px solid var(--line); }
.contents-card { border-left: 3px solid transparent; }
.contents-card:hover { border-left-color: var(--gold); }
@media (max-width: 480px) {
  html { scroll-padding-top: 7rem; }
  .header-inner { flex-wrap: wrap; gap: .45rem .8rem; padding: .55rem .85rem .65rem; }
  .brand { flex: 1 1 100%; min-width: 0; }
  .brand img { width: 34px; height: 34px; }
  .brand-name { font-size: .88rem; white-space: nowrap; }
  .book-navigation { flex: 1 1 100%; justify-content: flex-end; margin-left: 0; }
}
