/*
 * v2/src/css/base.css — 見本（序章と第9章）
 * 配置：高校の日本史の資料集（図録）。本文は1段、右の余白に側注。
 *       史料は大きく載せ、図の番号・説明・所蔵と権利を必ず添える。
 *       色は白い紙と墨。赤は重要語句（赤シートでかくせる）と図の中の「次の一手」だけ。
 *       黄色は読み落としてほしくない一文のマーカー。金と銀は硬貨そのものにだけ使う。
 * 文字：本文と見出しは BIZ UDP明朝、図・注・操作は BIZ UDPゴシック（教材用の UD 書体）。
 */
:root {
  --paper: #fbf9f4;
  --card: #ffffff;
  --tint: #f4f0e6;
  --ink: #1f1d1a;
  --sub: #655f55;
  --rule: #ddd6c8;
  --red: #c9321b;
  --red-bg: #fdece7;
  /* 役割の色：統治する側は金茶、民衆は藍（硬貨と米の図の --au・--rice とは別） */
  --ruler: #8a5a00;
  --ruler-bg: #fbf0d0;
  --ruler-line: #dcc07a;
  --people: #24598c;
  --people-bg: #e5eef8;
  --people-line: #a4c0dd;
  --marker: #ffe766;
  --au: #c99520;
  --au-line: #7d5a00;
  --ag: #c6cacf;
  --ag-line: #6b7176;
  --empty: #dcdcdc;
  --rice: #c8ae6e;
  --rice-line: #7a6634;
  --bubble: #ffffff;
  --bubble-ink: #141414;
  --bubble-sub: #5c5c5c;
  /* 板書の黒板（明暗どちらでも同じ） */
  --board: #1f3a2e;
  --board-frame: #6b4f2e;
  --board-ink: #f2f1ea;
  --board-sub: #b9c9bd;
  --board-key: #ffd84d;

  --mincho: "BIZ UDPMincho", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", serif;
  --gothic: "BIZ UDPGothic", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "YuGothic", "Noto Sans JP", "Meiryo", sans-serif;
  --measure: 34em;
  --gutter-l: max(20px, env(safe-area-inset-left, 0px));
  --gutter-r: max(20px, env(safe-area-inset-right, 0px));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #171614;
    --card: #211f1c;
    --tint: #26231f;
    --ink: #ece8df;
    --sub: #aaa397;
    --rule: #3d3a34;
    --red: #ff7b66;
    --red-bg: #3a1f1a;
    --ruler: #e8b84f;
    --ruler-bg: #2f2714;
    --ruler-line: #6d5820;
    --people: #8fbdea;
    --people-bg: #18283a;
    --people-line: #36567a;
    --marker: #5f5317;
    --au: #e0a83a;
    --au-line: #f3cf80;
    --ag: #b0b6bc;
    --ag-line: #e2e6ea;
    --empty: #3a3a3a;
    --rice: #a38c57;
    --rice-line: #dcc58c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #171614;
  --card: #211f1c;
  --tint: #26231f;
  --ink: #ece8df;
  --sub: #aaa397;
  --rule: #3d3a34;
  --red: #ff7b66;
  --red-bg: #3a1f1a;
  --ruler: #e8b84f;
  --ruler-bg: #2f2714;
  --ruler-line: #6d5820;
  --people: #8fbdea;
  --people-bg: #18283a;
  --people-line: #36567a;
  --marker: #5f5317;
  --au: #e0a83a;
  --au-line: #f3cf80;
  --ag: #b0b6bc;
  --ag-line: #e2e6ea;
  --empty: #3a3a3a;
  --rice: #a38c57;
  --rice-line: #dcc58c;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 64px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mincho);
  font-size: 17px;
  line-height: 1.95;
  letter-spacing: 0.02em;
  line-break: strict;
  overflow-wrap: anywhere;
}
@media (min-width: 700px) { body { font-size: 18px; } }
img { display: block; max-width: 100%; height: auto; }
p { margin: 0 0 1.1em; }
h1, h2, h3 { font-weight: 700; line-height: 1.35; margin: 0; text-wrap: balance; }
b { font-weight: 700; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.wrap {
  max-width: 1120px;
  margin-inline: auto;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
}
.txt { max-width: var(--measure); min-width: 0; }
/* 本文と側注 */
.row { display: grid; }
.side {
  min-width: 0; max-width: 24em; align-self: start;
  margin: 0 0 30px; padding-top: 10px; border-top: 1px solid var(--ink);
  font-family: var(--gothic); font-size: 0.78rem; line-height: 1.75; color: var(--sub); letter-spacing: 0.02em;
}
.side p { margin: 0 0 0.9em; }
.side b { color: var(--ink); }
@media (min-width: 980px) {
  .row { grid-template-columns: minmax(0, var(--measure)) minmax(0, 1fr); column-gap: 56px; }
  .side { margin-top: 0.55em; }
}
/* 側注が本文の下に並ぶ幅では、薄い面（角丸）にして本文と区別する */
@media (max-width: 979.98px) {
  .side { padding: 10px 14px 4px; background: var(--tint); border-top: 0; border-radius: 8px; }
}
/* 柱（ページの上の小さな見出し） */
.run {
  display: flex; flex-wrap: wrap; gap: 2px 18px; margin: 0;
  padding-bottom: 10px; border-bottom: 1px solid var(--ink);
  font-family: var(--gothic); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em;
}
.run span + span { font-weight: 400; }
/* 重要語句（赤字）とマーカー */
.key { color: var(--red); font-weight: 700; }
mark {
  color: inherit; font-weight: 700;
  background: linear-gradient(transparent 60%, var(--marker) 60%);
  padding-inline: 1px;
}
.sheet-on .key:not(.is-open) {
  color: transparent; background: var(--red); cursor: pointer;
  -webkit-user-select: none; user-select: none;
}
/* ---------------------------------------------------------- 序章 */
.cover { padding-block: clamp(20px, 5vh, 64px) 64px; }
.cover h1 { font-size: clamp(2.2rem, 8.4vw, 4.4rem); line-height: 1.25; letter-spacing: 0.03em; margin: 0; }
/* 題・説明・ボタン（左）と、各時代の人物（右。狭い画面では題の下） */
.cover-hero { display: grid; gap: 16px; margin: 20px 0 40px; }
.cover-head { min-width: 0; display: grid; gap: 14px; }
.cover-desc { margin: 0; font-family: var(--gothic); font-size: 0.98rem; font-weight: 700; line-height: 1.7; color: var(--sub); }
.cover-acts { display: flex; flex-wrap: wrap; gap: 10px; margin: 2px 0 0; }
.cover-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 20px;
  font-family: var(--gothic); font-size: 0.95rem; font-weight: 700; text-decoration: none;
  color: var(--ink); background: var(--card); border: 1.5px solid var(--ink); border-radius: 8px;
}
.cover-btn-main { color: var(--card); background: var(--ink); }
.cover-btn-main::after, .cover-btn[href="#toc"]::after { content: "　→"; }
.cover-acts .resume-btn { color: var(--card); background: var(--red); border-radius: 8px; }
.cover-cast { display: flex; align-items: flex-end; justify-content: center; min-height: 0; }
.cover-cast img { flex: 0 1 auto; width: calc((100% + 120px) / 6); max-width: none; height: auto; margin: 0 -10px; }
/* 狭い画面では、人物を題のすぐ下に置く */
@media (max-width: 699.98px) {
  .cover-head { display: contents; }
  .cover h1 { order: 1; }
  .cover-cast { order: 2; }
  .cover-desc { order: 3; }
  .cover-acts { order: 4; }
}
@media (min-width: 700px) {
  .cover-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); align-items: end; gap: 24px; }
  .cover-cast { justify-content: flex-end; padding-inline: 10px; overflow: hidden; }
  /* 6人を列の幅に収める（少し重ねて並べる） */
  .cover-cast img { flex: 1 1 0; min-width: 0; width: auto; max-width: 140px; height: auto; margin: 0 -8px; }
}
.lead p { font-size: 1.04em; }
.cases { list-style: none; margin: 36px 0 40px; padding: 0; border-top: 2px solid var(--ink); max-width: 46em; }
.cases li { display: grid; gap: 2px 28px; padding-block: 22px 8px; border-bottom: 1px solid var(--rule); }
.case-body { min-width: 0; }
.yr { margin: 0 0 8px; font-family: var(--gothic); font-weight: 700; font-size: 2.3rem; line-height: 1; letter-spacing: 0.01em; }
.yr small { display: block; margin-top: 8px; font-size: 0.78rem; font-weight: 400; color: var(--sub); letter-spacing: 0.1em; }
.cases h2 { font-size: 1.22rem; margin: 0 0 8px; }
.cases p:not(.yr) { font-size: 0.96em; line-height: 1.9; }
@media (min-width: 700px) {
  .cases li { grid-template-columns: 8rem 1fr; }
}
@media (min-width: 900px) {
  .cases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; max-width: none; border-top: 0; }
  .cases li { display: block; padding: 18px 18px 8px; background: var(--card); border: 1px solid var(--rule); border-radius: 12px; }
  .cases .yr { font-size: 2rem; }
}
/* この授業の読み方 */
.howto { max-width: 46em; margin: 8px 0 0; padding: 14px 18px 4px; background: var(--tint); border-radius: 10px; }
.howto h2 { margin: 0 0 8px; font-family: var(--gothic); font-size: 0.9rem; letter-spacing: 0.12em; }
.howto p { font-size: 0.96em; line-height: 1.85; }
.toc { margin-top: 56px; max-width: 46em; }
.toc h2 { font-family: var(--gothic); font-size: 0.82rem; letter-spacing: 0.3em; margin-bottom: 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.toc li { border-bottom: 1px dotted var(--rule); color: var(--sub); }
.toc li, .toc li > a, .toc-dlg-ch {
  display: grid; grid-template-columns: 62px minmax(0, 1fr); grid-template-areas: "f n" "f t" "f e";
  column-gap: 12px; row-gap: 0; align-items: center; padding-block: 8px; line-height: 1.5; text-decoration: none;
}
.toc-faces { grid-area: f; }
/* 題の区切り（扉の題の改行の位置）。この中では折り返さず、区切りの間で折り返す */
.ttl-seg { display: inline-block; }
.toc-no { grid-area: n; }
.toc-ttl { grid-area: t; }
.toc-era { grid-area: e; }
@media (min-width: 700px) {
  .toc li, .toc li > a, .toc-dlg-ch { grid-template-columns: 62px 4.6em minmax(0, 1fr) auto; grid-template-areas: "f n t e"; }
}
.toc-faces { display: flex; gap: 2px; }
.toc-face { position: relative; flex: none; width: 30px; height: 30px; overflow: hidden; border-radius: 50%; background: var(--tint); }
.toc-face img { position: absolute; left: -10px; top: -5px; width: 50px; height: 75px; max-width: none; }
@media (min-width: 900px) {
  .toc { max-width: none; }
  .toc ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
}
.toc li.is-ready { display: block; padding: 0; color: var(--ink); }
.toc-no { font-family: var(--gothic); font-size: 0.82rem; font-weight: 700; }
.toc-ttl { font-size: 1rem; }
.toc-era { font-family: var(--gothic); font-size: 0.74rem; color: var(--sub); }
@media (min-width: 700px) { .toc-era { text-align: right; } }
.toc li.is-ready .toc-ttl { font-weight: 700; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.toc li.is-ready .toc-no { color: var(--red); }
.toc-note { font-family: var(--gothic); font-size: 0.78rem; color: var(--sub); margin: 12px 0 0; }
/* 目次の区切り（前近代・近現代・まとめ） */
.toc-grp { margin: 28px 0 8px; font-family: var(--gothic); font-size: 0.82rem; font-weight: 700; letter-spacing: 0.06em; color: var(--sub); }
.toc h2 + .toc-grp { margin-top: 6px; }
/* ---------------------------------------------------------- 上部バー（いまの章と節・その章を読んだ割合・目次）
 * 画面の上に固定する。幅960px未満では、下へ読み進めているあいだは上へ隠し、読んだ割合の線（3px）だけ残す。中身は common.js が作る。 */
body.has-topbar { padding-top: 48px; }
.topbar {
  position: fixed; z-index: 50; top: 0; left: 0; right: 0; height: 48px;
  font-family: var(--gothic); background: var(--card); border-bottom: 1px solid var(--rule);
  transition: transform 0.25s ease;
}
.topbar.is-hidden { transform: translateY(-45px); }
.topbar-in {
  display: flex; align-items: center; gap: 12px; height: 100%;
  padding: 0 max(12px, env(safe-area-inset-right, 0px)) 0 max(14px, env(safe-area-inset-left, 0px));
}
.topbar-where { flex: 1 1 auto; display: flex; align-items: center; gap: 10px; min-width: 0; margin: 0; font-size: 0.8rem; line-height: 1.3; white-space: nowrap; }
.topbar-ch { flex: none; font-weight: 700; color: var(--sub); }
.topbar-sec:empty { display: none; }
.topbar-sec { min-width: 0; overflow: hidden; text-overflow: ellipsis; padding: 2px 4px; border-radius: 4px; font-weight: 700; color: var(--ink); }
.topbar-sec b {
  display: inline-grid; place-items: center; min-width: 1.5em; height: 1.5em; margin-right: 0.4em; padding: 0 0.2em;
  font-size: 0.92em; color: var(--card); background: var(--ink); border-radius: 3px;
}
.topbar-where.is-new .topbar-sec { animation: bar-flash 1.6s ease-out; }
@keyframes bar-flash { 0%, 30% { background-color: var(--marker); } 100% { background-color: transparent; } }
/* 目次のボタン（☰）。左の端に置き、線3本の印に「目次」の字を添える */
.topbar-toc {
  flex: none; order: -1; position: relative; display: inline-flex; align-items: center; gap: 6px;
  min-width: 44px; min-height: 40px; padding: 6px 10px;
  font: inherit; font-size: 0.78rem; font-weight: 700; color: var(--ink); cursor: pointer;
  background: var(--card); border: 1.5px solid var(--ink); border-radius: 6px;
}
.topbar-burger { position: relative; display: block; width: 18px; height: 2px; background: currentColor; border-radius: 1px; }
.topbar-burger::before, .topbar-burger::after { content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: currentColor; border-radius: 1px; }
.topbar-burger::before { top: -6px; }
.topbar-burger::after { top: 6px; }
.topbar-toc::after { content: ""; position: absolute; inset: -3px; }
.topbar-prog { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; }
.topbar-prog i { display: block; height: 100%; background: var(--red); transform: scaleX(0); transform-origin: left; }
@media (max-width: 699.98px) { .topbar-ch { max-width: 42%; overflow: hidden; text-overflow: ellipsis; } }
.topbar-where:has(.topbar-sec:empty) .topbar-ch { max-width: none; }
/* 目次の窓（全章を3つに区切る。いまの章の下に、節へのリンク） */
.toc-dlg {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0;
  font-family: var(--gothic); color: var(--ink); background: var(--card); border: 1px solid var(--rule); border-radius: 12px;
}
.toc-dlg::backdrop { background: rgba(0, 0, 0, 0.5); }
.toc-dlg-in { padding: 12px 16px 16px; }
.toc-dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 8px; }
.toc-dlg-head h2 { font-size: 1rem; letter-spacing: 0.2em; }
.toc-dlg-close {
  min-height: 44px; padding: 6px 16px; font: inherit; font-size: 0.86rem; font-weight: 700; color: var(--ink); cursor: pointer;
  background: var(--card); border: 1.5px solid var(--ink); border-radius: 6px;
}
.toc-dlg-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.toc-dlg-grp { margin: 16px 0 4px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; color: var(--sub); }
.toc-dlg-grp:first-child { margin-top: 0; }
.toc-dlg-list > li { border-bottom: 1px solid var(--rule); }
.toc-dlg-ch { min-height: 44px; padding-inline: 6px; color: var(--ink); }
.toc-dlg-ch:hover { background: var(--tint); }
.toc-dlg-list .toc-ttl { font-family: var(--mincho); font-size: 0.98rem; line-height: 1.5; }
.toc-dlg-list .toc-no { color: var(--red); }
.toc-dlg-list .toc-era { color: var(--sub); }
.toc-dlg-list li.is-current { background: var(--tint); box-shadow: inset 4px 0 0 var(--red); }
.toc-dlg-list li.is-current .toc-ttl { font-weight: 700; }
.toc-dlg-secs { list-style: none; margin: 0; padding: 0 6px 8px 80px; }
.toc-dlg-secs a { display: flex; align-items: center; min-height: 40px; font-size: 0.86rem; font-weight: 700; color: var(--ink); text-underline-offset: 4px; }
.toc-read {
  display: inline-block; margin-left: 0.6em; padding: 0 6px; vertical-align: 0.1em;
  font-family: var(--gothic); font-size: 0.66rem; font-weight: 700; line-height: 1.6; text-decoration: none;
  color: var(--people); border: 1px solid var(--people); border-radius: 4px;
}
/* 章の最後の「次の章へ」 */
.next { margin-top: 56px; }
.next-link {
  display: grid; gap: 4px; max-width: 46em; padding: 18px 20px; color: var(--ink); text-decoration: none;
  background: var(--card); border: 1.5px solid var(--ink); border-radius: 12px;
}
.next-link:hover { background: var(--tint); }
.next-lbl { font-family: var(--gothic); font-size: 0.82rem; font-weight: 700; color: var(--red); }
.next-lbl::after { content: "　→"; }
.next-no { font-family: var(--gothic); font-size: 0.86rem; font-weight: 700; color: var(--sub); }
.next-ttl { font-size: 1.3rem; font-weight: 700; line-height: 1.45; }
.next-sub { margin: 10px 0 0; font-family: var(--gothic); font-size: 0.9rem; font-weight: 700; }
.next-sub a { display: inline-flex; align-items: center; min-height: 44px; text-underline-offset: 4px; }
/* 表紙の「続きから読む」 */
.resume { margin: -16px 0 32px; }
.resume-btn {
  display: inline-grid; gap: 2px; min-height: 44px; padding: 10px 18px; font-family: var(--gothic); text-decoration: none;
  color: var(--card); background: var(--ink); border-radius: 8px;
}
.resume-lbl { font-size: 0.92rem; font-weight: 700; }
.resume-lbl::after { content: "　→"; }
.resume-where { font-size: 0.76rem; opacity: 0.9; }
/* ---------------------------------------------------------- 章のあいだ（仮置き） */
.gap { padding-block: 30px; border-block: 1px dashed var(--rule); }
.gap p { margin: 0; font-family: var(--gothic); font-size: 0.78rem; color: var(--sub); text-align: center; letter-spacing: 0.2em; }
/* ---------------------------------------------------------- 章の扉 */
.chapter { padding: clamp(48px, 9vh, 90px) 0 96px; }
/* 題は1行に最大10字。幅375pxでも1行に収まる大きさにし、語の途中では折らない */
.opener h2 { font-size: clamp(2rem, 7.4vw, 4.1rem); line-height: 1.25; letter-spacing: 0.03em; margin: 26px 0 34px; word-break: auto-phrase; }
.opener .plate { margin-bottom: 40px; }
/* 図版 */
.plate { margin: 36px 0 44px; }
.plate img { width: 100%; }
.plate-narrow img { max-width: 620px; }
figcaption {
  margin-top: 10px; max-width: 48em;
  font-family: var(--gothic); font-size: 0.78rem; line-height: 1.75; color: var(--sub); letter-spacing: 0.02em;
}
.fig-no { color: var(--ink); margin-right: 0.9em; font-family: var(--gothic); }
.credit { display: block; margin-top: 2px; font-size: 0.92em; opacity: 0.9; }
/* 狂歌（縦書き） */
.kyoka { float: right; margin: 0.3em 0 1em 1.6em; padding-left: 1.2em; border-left: 1px solid var(--ink); }
.kyoka blockquote { margin: 0; }
.kyoka p {
  margin: 0; writing-mode: vertical-rl; text-orientation: mixed;
  font-size: 1.3rem; font-weight: 700; line-height: 1.9; letter-spacing: 0.14em;
}
/* 見出し（話の順番） */
.chapter h3 {
  clear: both; display: flex; gap: 0.6em; align-items: center; max-width: var(--measure);
  font-size: 1.5rem; margin: 64px 0 22px; padding-top: 14px; border-top: 2px solid var(--ink);
}
.h-no { flex: none; display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; padding: 0 0.2em; font-family: var(--gothic); font-size: 0.78em; color: var(--card); background: var(--ink); border-radius: 4px; }
/* ---------------------------------------------------------- 手を動かす図（共通） */
.work {
  margin: 36px 0 44px; padding-block: 16px 20px;
  border-top: 3px solid var(--ink); border-bottom: 1px solid var(--ink);
  font-family: var(--gothic); line-height: 1.6; letter-spacing: 0.02em;
}
.work-head { margin: 0 0 4px; font-weight: 700; font-size: 0.95rem; }
.log { margin: 0 0 18px; min-height: 3.4em; font-family: var(--mincho); font-size: 1.05rem; line-height: 1.75; }
.work-note { margin: 16px 0 0; font-size: 0.74rem; color: var(--sub); }
.tables { display: grid; gap: 26px; }
.tables > * { min-width: 0; }
@media (min-width: 840px) {
  .tables { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 52px; align-items: start; }
}
.lbl, .mint-ctl label { display: block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; color: var(--sub); margin: 0; }
.count { margin: 2px 0 10px; font-size: 0.9rem; line-height: 1.1; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.count b { font-size: 2.5rem; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.acts { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 22px; }
.act {
  font: inherit; font-size: 0.98rem; font-weight: 700; line-height: 1.4; letter-spacing: 0.04em;
  min-height: 52px; padding: 12px 20px; border-radius: 2px; cursor: pointer;
  color: var(--paper); background: var(--ink); border: 1.5px solid var(--ink);
  flex: 1 1 260px; -webkit-tap-highlight-color: transparent;
}
.act:active { transform: translateY(1px); }
.act-2 { color: var(--ink); background: transparent; flex: 0 1 auto; }
.textbtn { font: inherit; font-size: 0.86rem; font-weight: 700; color: var(--ink); background: none; border: 0; padding: 12px 4px; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
/* ---------------------------------------------------------- 手を動かす図：改鋳 */
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; margin: 8px 0 0; background: transparent; cursor: pointer; display: block; }
input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: var(--ink); }
input[type="range"]::-moz-range-track { height: 2px; background: var(--ink); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 32px; margin-top: -15px; border-radius: 50%; background: var(--au); border: 1.5px solid var(--au-line); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 30px; border-radius: 50%; background: var(--au); border: 1.5px solid var(--au-line); }
.range-ends { display: flex; justify-content: space-between; gap: 12px; font-size: 0.74rem; color: var(--sub); line-height: 1.4; }
.reads { margin: 22px 0 0; border-top: 1px solid var(--ink); }
.reads > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-block: 8px; border-bottom: 1px solid var(--rule); min-height: 54px; }
.reads dt { font-size: 0.86rem; min-width: 0; }
.reads dt small { font-size: 0.72rem; color: var(--sub); }
.reads dd { margin: 0; font-size: 0.86rem; white-space: nowrap; }
.reads dd b { font-size: 1.8rem; font-variant-numeric: tabular-nums; margin-right: 3px; }
.acts-quiet { gap: 18px; margin-top: 8px; }
/* ---------------------------------------------------------- 赤シートのボタン（側注の中） */
.side-btn-wrap { margin-bottom: 0.6em !important; }
.sheet-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-weight: 700; font-size: 0.82rem; color: var(--ink);
  background: var(--card); border: 1px solid var(--ink); border-radius: 6px;
  padding: 7px 12px; cursor: pointer;
}
.sheet-btn i { display: block; width: 18px; height: 12px; background: var(--red); opacity: 0.85; }
.sheet-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
/* ---------------------------------------------------------- 板書 */
.board {
  margin-top: 64px; max-width: 46em; padding: 22px 24px 12px; color: var(--board-ink);
  background: var(--board); border-radius: 10px; box-shadow: inset 0 0 0 6px var(--board-frame);
}
.board h3 { display: block; max-width: none; margin: 0 0 14px; padding: 0; border: 0; font-family: var(--gothic); font-size: 0.86rem; letter-spacing: 0.2em; color: var(--board-ink); }
.board ol { margin: 0; padding-left: 1.4em; }
.board li { margin-bottom: 0.9em; line-height: 1.85; }
.board li::marker { font-family: var(--gothic); font-weight: 700; color: var(--board-sub); }
.board .to { margin: 0 0.45em; color: var(--board-sub); font-family: var(--gothic); }
.board .key { color: var(--board-key); }
.board .term:hover, .board .term.is-active { background: rgba(255, 255, 255, 0.16); }
.board .term ruby rt, .board ruby.term rt { color: var(--board-sub); }
/* ---------------------------------------------------------- 全体図（章の頭に置く1枚の図）
 * ボタンで節を選ぶと、その節で見る所だけを濃くし、ほかを薄くする。
 * 各節の側注には、同じ図を小さく写し、その節の所だけを濃くして置く（.map-mini、common.js が作る）。 */
.map { margin: 32px 0 48px; max-width: 46em; padding-top: 14px; border-top: 3px solid var(--ink); font-family: var(--gothic); }
.map-steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.map-step {
  font: inherit; font-size: 0.8rem; font-weight: 700; line-height: 1.3;
  min-height: 38px; padding: 7px 11px; cursor: pointer;
  color: var(--ink); background: var(--card); border: 1px solid var(--ink); border-radius: 6px;
}
.map-step[aria-pressed="true"] { color: var(--card); background: var(--ink); box-shadow: 0 3px 0 var(--red); }
.map svg, .map-mini svg { display: block; width: 100%; height: auto; }
.map svg { max-width: 560px; }
.map svg g[data-step], .map-mini svg g[data-step] { transition: opacity 0.35s ease; }
.map[data-on] svg g[data-step], .map-mini svg g[data-step] { opacity: 0.16; }
.map[data-on="1"] svg g[data-step~="1"], .map[data-on="2"] svg g[data-step~="2"], .map[data-on="3"] svg g[data-step~="3"],
.map-mini[data-step="1"] svg g[data-step~="1"], .map-mini[data-step="2"] svg g[data-step~="2"], .map-mini[data-step="3"] svg g[data-step~="3"] { opacity: 1; }
.map-box { fill: var(--paper); stroke: var(--ink); stroke-width: 1.2; }
.map-box-key { stroke-width: 2.2; }
.map-hard { fill: var(--marker); }
.map-name { font-family: var(--gothic); font-size: 13px; font-weight: 700; fill: var(--ink); }
.map-lbl { font-family: var(--gothic); font-size: 12px; font-weight: 700; fill: var(--ink); }
.map-sub { font-family: var(--gothic); font-size: 10.5px; fill: var(--sub); }
.map-line { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.map-red { stroke: var(--red); }
.map-rice { stroke: var(--rice-line); stroke-width: 2.4; }
.map-au { stroke: var(--au-line); }
.map-dash { stroke-dasharray: 4 3; }
.map-redtx { fill: var(--red); }
.map-ricetx { fill: var(--rice-line); }
.map-x { fill: none; stroke: var(--red); stroke-width: 2.4; }
.map-head-ink { fill: var(--ink); }
.map-head-red { fill: var(--red); }
.map-head-rice { fill: var(--rice-line); }
/* 幅480px未満では、図の SVG を画面の幅いっぱいに広げる（文字が小さくなりすぎないように。文字の大きさは common.js の setupSvgText が整える） */
@media (max-width: 479.98px) {
  main figure:not(.map-mini) > svg {
    width: calc(100% + var(--gutter-l) + var(--gutter-r)); max-width: none;
    margin-inline: calc(-1 * var(--gutter-l)) calc(-1 * var(--gutter-r));
  }
}
.map-mini { margin: 0 0 18px; padding-top: 8px; border-top: 1px solid var(--ink); }
.map-mini svg { max-width: 260px; }
.map-mini figcaption { margin-top: 4px; font-size: 0.72rem; }
/* ---------------------------------------------------------- 舞台（画面に固定した漫画の2人）
 * 統治する側と民衆の2人を、画面の同じ位置に出し続ける。本文の .cue を読み進めると、
 * 吹き出しのせりふ・表情（ふつう・うれしい・困った）・メーターが変わる。章が変わると、その時代の服の2人に替わる。
 * 狭い画面では下に、広い画面では右に置く。中身は common.js が .stage-cast と .cue から作る。 */
.cue { display: block; height: 0; overflow: hidden; }
/* せりふと本文を結ぶ：いまのせりふの場面（合図から次の合図までの本文）の左に細い線を引く。
 * せりふが替わった瞬間に、その場面の最初の段落を一度だけ、薄い蛍光ペンの色で光らせる（1.2秒）。人物を隠しているあいだは出さない。 */
.cue-scene { position: relative; }
.cue-scene::before {
  content: ""; position: absolute; top: 0.35em; bottom: 0.35em; left: -12px; width: 2px;
  background: var(--ruler-line); transform: scaleY(0); transform-origin: top; transition: transform 0.4s ease;
  pointer-events: none;
}
body.has-stage .cue-scene.is-cued::before { transform: scaleY(1); }
body.has-stage .is-flash { animation: cue-flash 1.2s ease-out; }
@keyframes cue-flash { 0%, 25% { background-color: color-mix(in srgb, var(--marker) 50%, transparent); } 100% { background-color: transparent; } }
/* 1人ぶんは、.stage-fig（絵）・.stage-meta（名前とメーター）・.stage-say（吹き出し）の3つ。並べ方は grid-template-areas で決める。
 * 幅960px未満：画面の下に低い欄。顔だけを丸く切り出し、上の段が統治する側（左に顔）、下の段が民衆（右に顔）。700px以上は2人を横に並べる。
 * 幅960px以上：右の列。1人ぶんを「吹き出し（下向きの三角で絵を指す）」「絵と、名前・説明・メーター」の順に並べる。 */
.stage {
  position: fixed; z-index: 45; left: 0; right: 0; top: 48px;
  display: grid; grid-template-columns: 50px minmax(0, 1fr) 50px;
  grid-template-areas: "rf rm rm" "rf rs rs" "pm pm pf" "ps ps pf";
  column-gap: 8px; row-gap: 2px; align-items: center;
  padding: 6px max(8px, calc((100% - 720px) / 2)) 6px;
  font-family: var(--gothic);
  background: var(--tint); border-bottom: 1px solid var(--rule);
  transform: translateY(calc(-100% - 60px)); visibility: hidden;
  transition: transform 0.35s ease, top 0.25s ease, visibility 0s linear 0.35s;
  pointer-events: none;
}
/* 上部バーが隠れているあいだは、人物欄を画面の上（読んだ割合の線の下）に詰める */
body.bar-hidden .stage { top: 3px; }
/* 隠れているあいだは visibility も消して、キーボードで見えないボタンに移らないようにする */
.stage.is-on { transform: none; visibility: visible; transition: transform 0.35s ease, top 0.25s ease; }
.stage > * { pointer-events: auto; }
.stage > .stage-scene { display: none; }
.stage-ruler { grid-area: rf; }
.stage-people { grid-area: pf; }
.stage-meta-ruler { grid-area: rm; justify-self: start; max-width: calc(100% - 82px); }
.stage-meta-people { grid-area: pm; justify-self: end; }
.stage-say-ruler { grid-area: rs; }
.stage-say-people { grid-area: ps; }
/* 絵（狭い画面では、絵の上のほうを拡大して顔だけを丸く見せる） */
.stage-fig { position: relative; }
.stage-img {
  position: relative; width: 50px; height: 50px; overflow: hidden; border-radius: 50%;
  background: var(--card); box-shadow: inset 0 0 0 2px var(--ruler-line);
}
.stage-people .stage-img { box-shadow: inset 0 0 0 2px var(--people-line); }
/* 絵を幅84px・高さ126pxにして、高さの6%〜47%（頭から口まで）を見せる。笠や烏帽子の人物でも口が切れない */
.stage-img img {
  position: absolute; left: -16px; top: -8px; width: 84px; height: 126px; max-width: none;
  transition: opacity 0.3s ease;
}
.stage-img img.is-out { opacity: 0; }
.stage-img img.is-missing { visibility: hidden; }
.stage-fig.is-speaking .stage-img { animation: stage-hop 0.45s ease; }
@keyframes stage-hop { 0%, 100% { transform: none; } 40% { transform: translateY(-4px); } }
/* 名前とメーター（吹き出しのすぐ上に1行で。民衆は右に寄せる） */
.stage-meta { display: flex; align-items: center; gap: 2px 8px; min-width: 0; font-size: 0.7rem; line-height: 1.3; }
.stage-who { margin: 0; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--sub); }
.stage-who b { font-size: 0.72rem; }
.stage-meta-ruler .stage-who b { color: var(--ruler); }
.stage-meta-people .stage-who b { color: var(--people); }
.stage-note { display: none; }
.stage-meter { flex: none; display: flex; align-items: center; gap: 4px; }
.stage-meter small { order: -1; font-size: 0.6rem; font-weight: 700; color: var(--sub); white-space: nowrap; }
/* いまの段階の言葉（狭い画面では出さない）と、変わったときの「4 → 2　足りない」（約3秒） */
.stage-level { display: none; }
.stage-change { display: none; font-weight: 700; white-space: nowrap; }
.stage-meta.is-changing .stage-change { display: inline; }
.stage-meta-ruler .stage-change { color: var(--ruler); }
.stage-meta-people .stage-change { color: var(--people); }
/* 狭い画面では、変わった表示のあいだだけ名前を隠して、1行に収める */
@media (max-width: 699.98px) { .stage-meta.is-changing .stage-who { display: none; } }
.stage-cells i.is-blink { animation: cell-blink 0.5s ease-in-out 3; }
@keyframes cell-blink { 50% { opacity: 0.15; } }
.stage-cells { display: flex; gap: 2px; }
.stage-cells i { display: block; width: 8px; height: 7px; background: var(--empty); transition: background-color 0.4s ease; }
.stage-money .stage-cells i.on { background: var(--au); }
.stage-life .stage-cells i.on { background: var(--people); }
/* 吹き出し（漫画と同じく白地。暗い配色でも白のまま）。枠は立場の色。
 * しっぽは、枠の色の三角と白の三角を重ねて作る。白の三角が本体の線を覆うので、つなぎ目が出ない。 */
.stage-say {
  position: relative; margin: 0 0 0 10px; padding: 3px 10px;
  font-family: var(--gothic); font-size: 0.8rem; font-weight: 700; line-height: 1.4;
  color: var(--bubble-ink); background: var(--bubble); border: 1.5px solid var(--ruler); border-radius: 12px;
}
.stage-say-people { margin: 0 10px 0 0; border-color: var(--people); }
/* 幅960px未満では、吹き出しの高さを2行分にそろえて、せりふが替わっても人物欄の高さを変えない（せりふが替わる位置をずらさない） */
@media (max-width: 959.98px) { .stage-say { min-height: calc(2.8em + 9px); } }
.stage-say::before, .stage-say::after { content: ""; position: absolute; top: 50%; width: 0; height: 0; border-style: solid; }
.stage-say-ruler::before { left: -10px; margin-top: -7px; border-width: 7px 10px 7px 0; border-color: transparent var(--ruler) transparent transparent; }
.stage-say-ruler::after { left: -7px; margin-top: -5px; border-width: 5px 8px 5px 0; border-color: transparent var(--bubble) transparent transparent; }
.stage-say-people::before { right: -10px; margin-top: -7px; border-width: 7px 0 7px 10px; border-color: transparent transparent transparent var(--people); }
.stage-say-people::after { right: -7px; margin-top: -5px; border-width: 5px 0 5px 8px; border-color: transparent transparent transparent var(--bubble); }
/* この場面で話さない側：吹き出しを出さない（欄の高さは変えない） */
.stage-say.is-empty { visibility: hidden; }
/* 章の最初（最初の合図の前）：吹き出しではなく、その人物の紹介を細い字で出す */
.stage-say.is-intro { font-weight: 400; font-size: 0.74rem; color: var(--sub); background: none; border-color: transparent; }
.stage-say.is-intro::before, .stage-say.is-intro::after, .stage-say.is-summary::before, .stage-say.is-summary::after { display: none; }
/* 3択の反応：「もしも」は破線の枠、史実の答えは「史実」の印 */
.stage-say.is-if { border-style: dashed; }
.stage-tag {
  display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 4px; vertical-align: 0.08em;
  font-size: 0.72em; font-weight: 700; line-height: 1.6; color: var(--bubble); background: var(--bubble-sub);
}
.stage-say.is-fact .stage-tag { background: #c9321b; }
/* 章の終わり（年表から先）：その章のメーターの動きを、小さな棒で並べる */
.stage-say.is-summary {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 2px 10px;
  font-weight: 700; font-size: 0.72rem; color: var(--ink); background: none; border-color: transparent;
}
.stage-sum-ttl { flex: 1 0 100%; color: var(--sub); }
.stage-sum-bars { display: flex; align-items: flex-end; gap: 3px; height: 22px; }
/* 棒は役割の色の薄い色、最後の1本だけ濃い色 */
.stage-sum-bars i { display: block; width: 9px; height: calc(var(--v) * 20%); border-radius: 1px; }
.stage-say-ruler .stage-sum-bars i { background: var(--ruler-line); }
.stage-say-people .stage-sum-bars i { background: var(--people-line); }
.stage-say-ruler .stage-sum-bars i.is-last { background: var(--ruler); }
.stage-say-people .stage-sum-bars i.is-last { background: var(--people); }
/* 狭い画面では、民衆の紹介とまとめを、民衆の顔のある右にそろえる */
@media (max-width: 959.98px) {
  .stage-say-people.is-intro { text-align: right; }
  .stage-say-people.is-summary { justify-content: flex-end; text-align: right; }
}
.stage-sum-last { color: var(--ink); }
.stage-say.is-new { animation: stage-pop 0.35s ease; }
@keyframes stage-pop { 0% { transform: scale(0.94); opacity: 0.2; } 100% { transform: none; opacity: 1; } }
/* 人物を隠す・表示するボタン（何が起きるかを言葉で書く。押せる所は44px角以上） */
.stage-close, .stage-open {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 6px 12px;
  font: inherit; font-size: 0.8rem; font-weight: 700; color: var(--ink); cursor: pointer;
  background: var(--card); border: 1.5px solid var(--ink); border-radius: 6px;
}
.stage-close { grid-area: rm; justify-self: end; position: relative; min-height: 22px; padding: 1px 8px; font-size: 0.68rem; border-width: 1px; }
.stage-close::after { content: ""; position: absolute; inset: -11px -4px; }
.stage-open { position: fixed; z-index: 40; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); display: none; }
.stage-open.is-on { display: inline-flex; }
/* 見出しへ移ったとき、上部バーと人物欄の下に見出しが来るようにする */
@media (max-width: 959.98px) { html { scroll-padding-top: calc(64px + var(--stage-h, 150px)); } }
@media (min-width: 700px) and (max-width: 959.98px) {
  .stage {
    grid-template-columns: 50px minmax(0, 1fr) minmax(0, 1fr) 50px; grid-template-areas: "rf rm pm pf" "rf rs ps pf";
    column-gap: 10px; padding-top: 8px;
  }
  .stage-meta-ruler { max-width: none; }
  .stage-meta-people { justify-self: start; max-width: calc(100% - 96px); }
  .stage-close { grid-area: pm; }
}
/* 幅960px以上：右の列。上部バーの下から画面の下まで。本文はその分だけ左に寄せ、残りの幅の中央に置く */
@media (min-width: 960px) {
  .stage {
    top: 48px; left: auto; right: 0; bottom: 0; width: 300px; padding: 14px 14px 12px;
    grid-template-columns: 116px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto minmax(0, 1fr) auto;
    grid-template-areas: "rs rs" "rf rm" "ps ps" "pf pm" "cl cl";
    column-gap: 12px; row-gap: 10px; align-items: start;
    border-top: 0; border-left: 1px solid var(--rule);
    transform: translateX(110%);
  }
  .stage-fig { align-self: stretch; min-height: 0; }
  .stage-img { width: 100%; height: 100%; min-height: 90px; max-height: 225px; overflow: visible; border-radius: 0; background: none; box-shadow: none; }
  .stage-people .stage-img { box-shadow: none; }
  .stage-img img { left: 0; top: 0; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; }
  .stage-meta, .stage-meta-ruler, .stage-meta-people {
    align-self: end; justify-self: stretch; max-width: none; flex-direction: column; align-items: flex-start; gap: 8px; font-size: 0.78rem;
  }
  .stage-who { white-space: normal; overflow: visible; line-height: 1.45; }
  .stage-who b { display: block; font-size: 0.92rem; }
  .stage-note { display: block; font-size: 0.72rem; }
  .stage-meter { flex-direction: column; align-items: flex-start; gap: 3px; }
  .stage-meter small { order: 0; font-size: 0.7rem; }
  .stage-level { display: block; font-size: 0.74rem; font-weight: 700; color: var(--ink); }
  .stage-meta.is-changing .stage-level { display: none; }
  .stage-meta.is-changing .stage-change { display: block; font-size: 0.74rem; }
  .stage-say.is-summary { font-size: 0.8rem; }
  .stage-sum-bars { height: 48px; gap: 4px; }
  .stage-sum-bars i { width: 14px; }
  .stage-cells i { width: 14px; height: 9px; }
  .stage-say, .stage-say-people { margin: 0 0 10px; padding: 7px 12px; font-size: 0.92rem; line-height: 1.5; border-width: 2px; border-radius: 14px; }
  .stage-say::before, .stage-say::after { top: auto; margin: 0; }
  .stage-say-ruler::before, .stage-say-people::before { right: auto; left: 46px; bottom: -13px; border-width: 13px 9px 0 9px; border-color: var(--ruler) transparent transparent transparent; }
  .stage-say-people::before { border-top-color: var(--people); }
  .stage-say-ruler::after, .stage-say-people::after { right: auto; left: 48.5px; bottom: -9.5px; border-width: 10px 6.5px 0 6.5px; border-color: var(--bubble) transparent transparent transparent; }
  .stage-close { grid-area: cl; justify-self: end; min-height: 40px; padding: 6px 12px; font-size: 0.8rem; border-width: 1.5px; }
  .stage-close::after { content: none; }
  .stage-open { right: 16px; bottom: 16px; }
  body.bar-hidden .stage { top: 48px; }
  body.stage-col main .chapter.has-cast { padding-right: 300px; }
  /* 本文の列が狭くなるので、側注は本文の下に置き、本文の幅のまとまりを中央に置く */
  body.stage-col main .chapter.has-cast .wrap { max-width: calc(var(--measure) + 40px); }
  body.stage-col main .chapter.has-cast .row { grid-template-columns: minmax(0, 1fr); }
  body.stage-col main .chapter.has-cast .side { margin-top: 0; padding: 10px 14px 4px; background: var(--tint); border-top: 0; border-radius: 8px; }
}
@media (min-width: 960px) and (max-height: 760px) { .stage-note { display: none; } }
@media (min-width: 1280px) {
  .stage { width: 360px; padding: 16px 16px 14px; grid-template-columns: 140px minmax(0, 1fr); }
  body.stage-col main .chapter.has-cast { padding-right: 360px; }
  body.stage-col main .chapter.has-cast .wrap { max-width: 1040px; }
  body.stage-col main .chapter.has-cast .row { grid-template-columns: minmax(0, var(--measure)) minmax(0, 1fr); }
  body.stage-col main .chapter.has-cast .side { max-width: none; margin-top: 0.55em; padding: 10px 0 0; background: none; border-top: 1px solid var(--ink); border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .stage, .stage-img img, .stage-cells i { transition: none; }
  .stage-fig.is-speaking .stage-img, .stage-say.is-new, .stage-cells i.is-blink { animation: none; }
  .cue-scene::before { transition: none; }
  body.has-stage .is-flash { animation: none; }
}
/* ---------------------------------------------------------- あなたならどうする？（3択）
 * どの章も同じ操作にそろえる。3つの答えは、どの幅でも縦に並べる。選ぶと、3つすべての結果と「実際の歴史では」が出る。
 * 全体は立場の色の薄い面（統治する側・民衆）、答えは白いカード。答えた後は、1つの答えを「ボタン・印・結果・理由」のまとまりにする。
 * 史実の答えは赤い枠と「＝ 史実の答え」の見出しでいちばん目立たせ、選んだ答えには「あなたの答え」と「史実と同じ・違う」を出す。
 * 史実と違う答えには理由（.choice-why）を出す。中身の動きは common.js。 */
.choice {
  max-width: 46em; margin: 36px 0 44px; padding: 16px 14px 18px;
  border-top: 4px solid var(--ink); border-radius: 0 0 12px 12px; background: var(--tint); font-family: var(--gothic);
}
.choice-head { margin: 0 0 8px; font-size: 0.95rem; font-weight: 700; }
.choice-who { margin: 0 0 2px; font-size: 0.82rem; color: var(--sub); }
.choice-who b { color: var(--ink); }
.choice-q { margin: 0 0 14px; font-family: var(--mincho); font-size: 1.05rem; line-height: 1.85; }
.choice-opts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.choice-opt {
  display: flex; gap: 12px; align-items: flex-start; width: 100%; min-height: 52px; padding: 12px 14px;
  font: inherit; font-size: 0.95rem; font-weight: 700; line-height: 1.55; text-align: left;
  color: var(--ink); background: var(--card); border: 1.5px solid var(--rule); border-radius: 10px; cursor: pointer;
}
.choice-opt:hover { border-color: var(--ink); }
.choice-mark {
  flex: none; display: inline-grid; place-items: center; width: 1.8em; height: 1.8em; margin-top: 0.02em;
  border: 1.5px solid currentColor; border-radius: 6px; font-size: 0.88em;
}
/* 答えた後：1つの答えを1枚のカードにまとめる */
.choice.is-done .choice-item { padding: 0 0 12px; background: var(--card); border: 1.5px solid var(--rule); border-radius: 10px; }
.choice.is-done .choice-opt { cursor: default; border: 0; border-radius: 10px 10px 0 0; }
.choice.is-done .choice-opt:hover { border-color: transparent; }
.choice.is-done .choice-item.is-picked { border: 2px solid var(--ink); }
.choice.is-done .choice-item.is-real { border: 2.5px solid var(--red); }
.choice-fact {
  margin: 10px 12px 0; display: inline-block; padding: 2px 10px; border-radius: 4px;
  font-size: 0.8rem; font-weight: 800; color: var(--card); background: var(--red);
}
.choice-tags { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; margin: 2px 12px 0 calc(12px + 2.6em); }
.choice-tag { padding: 1px 8px; font-size: 0.74rem; font-weight: 700; border: 1px solid currentColor; border-radius: 4px; }
.choice-tag.is-you { color: var(--card); background: var(--ink); border-color: var(--ink); }
.choice-tag.is-real { color: var(--red); }
.choice-tag.is-diff { color: var(--sub); border-style: dashed; }
.choice-res { margin: 8px 12px 0; font-family: var(--mincho); font-size: 0.95rem; line-height: 1.75; color: var(--ink); }
.choice-real { margin: 16px 0 0; padding: 10px 14px; background: var(--red-bg); border-left: 4px solid var(--red); border-radius: 0 8px 8px 0; }
.choice-real p { margin: 0 0 0.4em; font-family: var(--mincho); font-size: 1rem; line-height: 1.8; }
.choice-real .choice-real-head { font-family: var(--gothic); font-size: 0.85rem; font-weight: 700; color: var(--red); letter-spacing: 0.08em; }
.choice-again { margin: 12px 0 0; }
.choice-again .choice-reset {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 18px;
  color: var(--ink); background: var(--card); border: 1.5px solid var(--ink); border-radius: 8px; text-decoration: none;
}
/* ---------------------------------------------------------- この節のポイント（要点を3つの流れで先に見せる）
 * 各節の頭に置く。原因から結果へ、左から右（狭い画面では上から下）に読む。最後の箱が結論。 */
.point { max-width: 46em; margin: 0 0 28px; padding: 12px 14px 14px; background: var(--tint); border-radius: 10px; font-family: var(--gothic); }
.point-head { margin: 0 0 10px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; color: var(--red); }
.point-chain { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.point-chain li { position: relative; padding: 8px 10px; background: var(--card); border: 1px solid var(--rule); border-radius: 6px; font-size: 0.92rem; font-weight: 700; line-height: 1.5; }
.point-chain li:last-child { background: var(--marker); border-color: var(--marker); }
/* 「前は」「きっかけ」「その後」の見出し（どうだったものが、何で、どう変わったか） */
.point-lbl { display: block; margin: 0 0 2px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; color: var(--sub); }
.point-chain li:last-child .point-lbl { color: var(--ink); }
.point-chain li + li::before {
  content: "↓"; position: absolute; top: -20px; left: 50%; transform: translateX(-50%);
  font-size: 0.95rem; font-weight: 700; color: var(--sub);
}
@media (min-width: 700px) {
  .point-chain { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 28px; }
  .point-chain li + li::before { content: "→"; top: 50%; left: -21px; transform: translateY(-50%); }
}
/* ---------------------------------------------------------- 3択を問いごとに見分けやすくする
 * 立場（統治する側・民衆）で色を変え、その章の人物が吹き出しで問いかける。選んだあとは、答えごとに人物の表情を出す。 */
.choice-role { display: inline-block; margin-left: 0.6em; padding: 1px 8px; border-radius: 4px; font-size: 0.72rem; font-weight: 700; color: var(--card); }
.choice-ruler { border-top-color: var(--ruler); background: var(--ruler-bg); }
.choice-ruler .choice-role { background: var(--ruler); }
.choice-people { border-top-color: var(--people); background: var(--people-bg); }
.choice-people .choice-role { background: var(--people); }
.choice-scene { display: grid; grid-template-columns: 84px minmax(0, 1fr); column-gap: 18px; align-items: end; margin: 8px 0 16px; }
.choice-face { width: 84px; height: 112px; object-fit: cover; object-position: 50% 4%; }
.choice-bubble {
  position: relative; padding: 12px 15px; border-radius: 16px;
  color: var(--bubble-ink); background: var(--bubble); border: 2px solid var(--bubble-ink);
}
.choice-bubble::before, .choice-bubble::after { content: ""; position: absolute; bottom: 22px; width: 0; height: 0; border-style: solid; }
.choice-bubble::before { left: -15px; border-width: 9px 15px 9px 0; border-color: transparent var(--bubble-ink) transparent transparent; }
.choice-bubble::after { left: -11px; bottom: 24px; border-width: 7px 12px 7px 0; border-color: transparent var(--bubble) transparent transparent; }
.choice-bubble .choice-q { margin: 0; color: var(--bubble-ink); font-size: 1rem; }
.choice-ruler .choice-mark { color: var(--card); background: var(--ruler); border-color: var(--ruler); }
.choice-people .choice-mark { color: var(--card); background: var(--people); border-color: var(--people); }
/* 史実と同じか違うか（選んだ答えの下）。記号・文・枠の線の種類で示し、色だけに頼らない */
.choice-verdict {
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; align-items: center;
  margin: 8px 12px 0; padding: 8px 12px; border: 2px solid currentColor; border-radius: 8px; font-family: var(--gothic);
}
.choice-verdict:focus { outline: none; }
.choice-verdict:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.choice-verdict.is-same { color: var(--red); background: var(--red-bg); }
.choice-verdict.is-diff { color: var(--ink); border-style: dashed; }
.choice-verdict-icon { grid-row: span 2; font-size: 1.9rem; font-weight: 800; line-height: 1; }
.choice-verdict-main { font-size: 0.98rem; font-weight: 800; line-height: 1.4; }
.choice-verdict-sub { font-size: 0.8rem; font-weight: 700; line-height: 1.5; color: var(--sub); }
/* 史実と違う理由（史実と違う答えにだけ出る）：薄い面と左の線 */
.choice-why {
  margin: 10px 12px 0; padding: 8px 12px; background: var(--tint); border-left: 3px solid var(--sub); border-radius: 0 6px 6px 0;
  font-family: var(--mincho); font-size: 0.92rem; line-height: 1.75; color: var(--ink);
}
.choice-why-head { display: block; margin: 0 0 2px; font-family: var(--gothic); font-size: 0.75rem; font-weight: 700; color: var(--sub); }
.choice-res-face { float: left; width: 44px; height: 58px; margin: 0 10px 2px 0; object-fit: cover; object-position: 50% 4%; }
.choice-res::after { content: ""; display: block; clear: both; }
/* 狭い画面では、3択の面を画面の端まで広げ、答えの文の幅を取る */
@media (max-width: 699.98px) {
  .choice { margin-inline: calc(-1 * var(--gutter-l)) calc(-1 * var(--gutter-r)); padding-inline: 10px; border-radius: 0; }
}
@media (min-width: 700px) {
  .choice { padding: 18px 20px 20px; }
  .choice-scene { grid-template-columns: 104px minmax(0, 1fr); }
  .choice-face { width: 104px; height: 138px; }
}
/* ---------------------------------------------------------- 比べ表（○と×で、条件がそろうかを見せる）
 * 行が比べるもの、列が条件。○と×は記号と短い言葉で書き、色だけに頼らない。最後の列が結論で、結論の行（.matrix-key）は蛍光ペンの色。 */
.matrix { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
.matrix-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.matrix-table th, .matrix-table td { padding: 10px 6px; border-bottom: 1px solid var(--rule); text-align: center; vertical-align: middle; line-height: 1.35; }
.matrix-table thead th { font-size: 0.74rem; font-weight: 700; color: var(--sub); border-bottom: 2px solid var(--ink); vertical-align: bottom; word-break: keep-all; }
.matrix-table thead th:first-child { width: 18%; }
/* 狭い画面：見出しの1行（最長7字）が、フォントが変わっても列に収まるように、字を小さくし字間を詰める */
@media (max-width: 699.98px) { .matrix-table thead th { padding-inline: 2px; font-size: 0.66rem; letter-spacing: 0; } }
.matrix-table thead th:first-child, .matrix-table tbody th { text-align: left; padding-left: 0; }
.matrix-table tbody th { font-size: 0.95rem; font-weight: 800; color: var(--ink); }
.matrix-table td { font-size: 1.55rem; font-weight: 800; color: var(--ink); }
.matrix-table th small, .matrix-table td small { display: block; margin-top: 3px; font-size: 0.68rem; font-weight: 700; line-height: 1.4; color: var(--sub); }
.matrix-table td.matrix-no { color: var(--sub); }
.matrix-table thead th:last-child, .matrix-table td:last-child { border-left: 2px solid var(--ink); }
.matrix-table thead th:last-child { color: var(--ink); }
.matrix-key th, .matrix-key td { background: var(--marker); }
/* ---------------------------------------------------------- 数字で見る（大きな数字と、その意味を並べる）
 * 本文に数字を並べるかわりに使う。結論になる数字の欄（.stats-key）は赤。 */
.stats { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
.stats-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; border-top: 2px solid var(--ink); }
.stats-list li { padding: 12px 0 14px; border-bottom: 1px solid var(--rule); }
.stats-num { margin: 0; font-size: 1.75rem; font-weight: 800; line-height: 1.1; color: var(--ink); }
.stats-num small { margin-left: 3px; font-size: 0.5em; font-weight: 700; }
.stats-lbl { margin: 5px 0 0; font-size: 0.84rem; font-weight: 700; line-height: 1.45; color: var(--ink); }
.stats-note { margin: 2px 0 0; font-size: 0.72rem; line-height: 1.5; color: var(--sub); }
.stats-key .stats-num { color: var(--red); }
@media (min-width: 700px) {
  .stats-list { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 22px; }
  .stats-num { font-size: 2rem; }
}
/* ---------------------------------------------------------- 上と下の年表（権力のお金と、民衆の暮らしを同じ年表に並べる）
 * 幅が狭いときは1列にして、各行の頭に「幕府」「民衆」などの名札を出す。
 * 幅があるときは、まん中に年の柱を立て、左に権力、右に民衆を置く。お金は金色、食べ物は米の色の線で分ける。 */
.lanes { margin: 40px 0 48px; max-width: 58em; }
.lanes-cols { display: none; }
.lanes-list {
  list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink);
  font-family: var(--gothic); font-size: 0.86rem; line-height: 1.7; letter-spacing: 0.02em;
}
.lanes-list li {
  display: grid; grid-template-columns: 5.4em minmax(0, 1fr); column-gap: 12px;
  padding: 10px 0; border-top: 1px solid var(--rule);
}
.lanes-list li:first-child { border-top: 0; }
.lanes-y { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lanes-list p { margin: 0; padding-left: 10px; border-left: 3px solid var(--ruler); }
.lanes-down p { border-left-color: var(--people); }
.lanes-who { font-weight: 700; margin-right: 0.6em; color: var(--ruler); }
.lanes-down .lanes-who { color: var(--people); }
.lanes-list b { font-weight: 700; }
.lanes-down.is-hard p { background: linear-gradient(90deg, var(--marker), transparent 85%); }
@media (min-width: 760px) {
  .lanes-cols {
    display: grid; grid-template-columns: minmax(0, 1fr) 7em minmax(0, 1fr);
    padding-bottom: 8px; font-family: var(--gothic); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em;
  }
  .lanes-cols p { margin: 0; }
  .lanes-cols p:first-child { text-align: right; padding-right: 16px; color: var(--ruler); }
  .lanes-cols p:last-child { grid-column: 3; padding-left: 16px; color: var(--people); }
  .lanes-list { position: relative; }
  .lanes-list::before {
    content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: var(--ink);
  }
  .lanes-list li { grid-template-columns: minmax(0, 1fr) 7em minmax(0, 1fr); column-gap: 0; border-top: 0; padding: 7px 0; }
  .lanes-y {
    grid-column: 2; grid-row: 1; justify-self: center; align-self: start; position: relative;
    padding: 0 0.5em; background: var(--paper); text-align: center;
  }
  .lanes-up p { grid-column: 1; grid-row: 1; padding: 0 12px 0 0; border-left: 0; border-right: 3px solid var(--ruler); text-align: right; }
  .lanes-down p { grid-column: 3; grid-row: 1; padding: 0 0 0 12px; }
  .lanes-who {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
}
.foot { padding-block: 40px 60px; }
.foot p { margin: 0; font-family: var(--gothic); font-size: 0.76rem; color: var(--sub); max-width: 46em; }
.foot p + p { margin-top: 10px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------- 用語（点線・ふりがな・説明のカード・章末の一覧） */
.term {
  cursor: pointer;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.28em;
  text-decoration-color: currentColor;
  border-radius: 1px;
  -webkit-tap-highlight-color: transparent;
}
.term:hover, .term.is-active { background: var(--marker); }
.term:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.term ruby rt, ruby.term rt {
  font-family: var(--gothic); font-weight: 400; font-size: 0.5em; letter-spacing: 0.04em; color: var(--sub);
}
.sheet-on .key.term:not(.is-open) { text-decoration-color: transparent; }
.sheet-on .key:not(.is-open) rt { visibility: hidden; }

.term-card {
  position: relative; max-width: var(--measure);
  margin: -0.3em 0 1.3em; padding: 10px 76px 12px 14px;
  border: 1px solid var(--rule); border-radius: 10px; background: var(--card);
  font-family: var(--gothic); font-size: 0.86rem; line-height: 1.75; letter-spacing: 0.02em; color: var(--ink);
  animation: term-card-in 0.16s ease-out;
}
li > .term-card, dd > .term-card, td > .term-card { margin: 8px 0 4px; }
.term-card p { margin: 0; }
.term-card-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-bottom: 4px !important; }
.term-card-lbl { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.2em; color: var(--sub); border: 1px solid var(--rule); border-radius: 4px; padding: 0 6px; line-height: 1.6; }
.term-card-word { font-family: var(--mincho); font-size: 1.05rem; }
.term-card-yomi { font-size: 0.78rem; color: var(--sub); }
.term-card-def { color: var(--ink); }
.term-card-close {
  position: absolute; top: 6px; right: 6px;
  font: inherit; font-size: 0.78rem; font-weight: 700; color: var(--ink);
  background: none; border: 0; padding: 6px 8px; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}
@keyframes term-card-in { from { opacity: 0; transform: translateY(-4px); } }

.term-index { max-width: 46em; margin-top: 28px; padding: 0 14px; background: var(--card); border: 1px solid var(--rule); border-radius: 10px; font-family: var(--gothic); }
.term-index summary { min-height: 44px; padding: 12px 0; cursor: pointer; font-size: 0.9rem; font-weight: 700; letter-spacing: 0.06em; }
.term-index dl { margin: 0 0 8px; }
.term-index dl > div { display: grid; gap: 2px 18px; padding: 9px 0; border-top: 1px solid var(--rule); }
.term-index dt { font-family: var(--mincho); font-weight: 700; font-size: 0.98rem; }
.term-index dt span { display: block; font-family: var(--gothic); font-weight: 400; font-size: 0.72rem; color: var(--sub); }
.term-index dd { margin: 0; font-size: 0.84rem; line-height: 1.75; color: var(--sub); }
@media (min-width: 700px) {
  .term-index dl > div { grid-template-columns: 10em minmax(0, 1fr); }
}


/* 第1章 旧石器・縄文（ch00）：黒曜石の手渡し、食べ物の持ち、縄文の1年、2つの家の蓄え */

/* ---------------------------------------------------------- 図：黒曜石の手渡し */
.ch00-relay { margin: 10px 0 36px; max-width: var(--measure); }
.ch00-relay ol { list-style: none; margin: 0; padding: 12px 0 14px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-block: 1px solid var(--ink); }
.ch00-relay li { position: relative; display: grid; align-content: start; justify-items: start; gap: 8px; padding: 0 6px 0 14px; }
.ch00-relay li:first-child { padding-left: 0; }
.ch00-relay li + li::before { content: "→"; position: absolute; left: -2px; top: 1.9em; font-family: var(--gothic); font-size: 0.8rem; line-height: 1; color: var(--sub); }
.ch00-relay-lbl { margin: 0; font-family: var(--gothic); font-weight: 700; font-size: 0.72rem; line-height: 1.35; min-height: 2.7em; }
.ch00-stones { display: grid; grid-template-columns: repeat(2, 12px); gap: 5px; padding: 2px; }
.ch00-stones i { display: block; width: 12px; height: 12px; background: var(--ink); transform: rotate(45deg) skew(12deg, 12deg); }
.ch00-stones i.ch00-small { width: 8px; height: 8px; margin: 2px; }
@media (min-width: 700px) {
  .ch00-relay-lbl { font-size: 0.82rem; min-height: 0; }
  .ch00-relay li + li::before { top: 2.3em; }
  .ch00-stones { grid-template-columns: repeat(4, 14px); gap: 6px; }
  .ch00-stones i { width: 14px; height: 14px; }
  .ch00-stones i.ch00-small { width: 9px; height: 9px; }
}

/* ---------------------------------------------------------- 図：食べ物の持ち */
.ch00-keep { margin: 10px 0 36px; max-width: var(--measure); font-family: var(--gothic); }
.ch00-keep-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.ch00-keep-row:first-child { border-top: 1px solid var(--ink); }
.ch00-keep-lbl { margin: 0; font-weight: 700; font-size: 0.86rem; line-height: 1.4; }
.ch00-keep-bar { height: 12px; background: transparent; box-shadow: inset 0 -1px 0 var(--rule); }
.ch00-keep-bar i { display: block; height: 100%; width: calc(var(--v) * 1%); min-width: 6px; background: var(--ink); }
.ch00-keep-rice .ch00-keep-bar i { background: var(--rice); box-shadow: inset 0 0 0 1px var(--rice-line); }
.ch00-keep-note { margin: 0; font-size: 0.74rem; line-height: 1.4; color: var(--sub); }
@media (min-width: 700px) {
  .ch00-keep-row { grid-template-columns: 9.5em minmax(0, 1fr); column-gap: 14px; align-items: center; }
  .ch00-keep-note { grid-column: 2; }
}

/* ---------------------------------------------------------- 図：縄文の1年と貯蔵穴の中身
 * 季節ごとに、とった食べ物・貯蔵穴の中身（--v は 0〜100）・その季節のようすを並べる。
 * 穴は上が開いた断面の形。いちばん困る時期は赤、中身が傷んで空に戻る時期は破線。狭い画面では季節を縦に並べる。 */
.ch00-year { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
.ch00-year-key { margin: 0 0 8px; font-size: 0.74rem; font-weight: 700; line-height: 1.5; color: var(--sub); }
.ch00-year-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.ch00-year-list li { display: grid; grid-template-columns: minmax(0, 1fr) 64px; column-gap: 14px; row-gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.ch00-year-when { grid-column: 1; margin: 0; font-size: 0.95rem; font-weight: 800; line-height: 1.4; }
.ch00-year-food { grid-column: 1; margin: 0; font-size: 0.84rem; line-height: 1.55; }
.ch00-year-note { grid-column: 1; margin: 0; font-size: 0.76rem; font-weight: 700; line-height: 1.5; color: var(--sub); }
.ch00-year-pit {
  grid-column: 2; grid-row: 1 / span 3; align-self: center; position: relative; height: 56px; margin: 0;
  border: 2px solid var(--ink); border-top: 0; border-radius: 0 0 12px 12px; overflow: hidden;
}
.ch00-year-pit i { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--v) * 1%); background: var(--rice); }
.ch00-year-hard .ch00-year-when, .ch00-year-hard .ch00-year-note { color: var(--red); }
.ch00-year-hard .ch00-year-pit { border-color: var(--red); }
.ch00-year-rot .ch00-year-pit { border-style: dashed; }
.ch00-year-loop { margin: 8px 0 0; font-size: 0.8rem; font-weight: 700; line-height: 1.5; }
@media (min-width: 700px) {
  .ch00-year-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 22px; padding-top: 10px; }
  .ch00-year-list li { position: relative; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 5em 64px auto; row-gap: 6px; padding: 0 0 10px; border-bottom: 0; }
  .ch00-year-when, .ch00-year-food, .ch00-year-note, .ch00-year-pit { grid-column: 1; grid-row: auto; }
  .ch00-year-pit { height: 64px; }
  .ch00-year-list li + li::before { content: "→"; position: absolute; left: -17px; top: 0.1em; font-size: 0.9rem; font-weight: 700; color: var(--sub); }
}

/* ---------------------------------------------------------- 図：2つの家がためた食べ物の量（木の実ともみ）
 * 実線はたくさんとれた家、破線は少ししかとれなかった家。右の赤い括弧が、3年目の差。 */
.ch00-gap { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
.ch00-gap-key { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 10px; font-size: 0.76rem; font-weight: 700; line-height: 1.5; }
.ch00-gap-key span { display: inline-flex; align-items: center; gap: 6px; }
.ch00-gap-key span::before { content: ""; width: 26px; height: 0; border-top: 3px solid var(--ink); }
.ch00-gap-key .ch00-gap-kb::before { border-top: 2px dashed var(--ink); }
.ch00-gap-panels { display: grid; gap: 22px; }
.ch00-gap-panel { padding-top: 8px; border-top: 2px solid var(--ink); }
.ch00-gap-ttl { margin: 0 0 2px; font-size: 0.9rem; font-weight: 800; line-height: 1.4; }
.ch00-gap-axes { margin: 0 0 4px; font-size: 0.7rem; line-height: 1.4; color: var(--sub); }
.ch00-gap-panel svg { display: block; width: 100%; max-width: 420px; height: auto; }
.ch00-gap-line { fill: none; stroke: var(--sub); stroke-width: 1; }
.ch00-gap-season { fill: none; stroke: var(--rule); stroke-width: 1; stroke-dasharray: 3 3; }
.ch00-gap-a { fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linejoin: round; }
.ch00-gap-b { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-dasharray: 5 4; stroke-linejoin: round; }
.ch00-gap-txt { font-family: var(--gothic); font-size: 10.5px; fill: var(--sub); }
.ch00-gap-diff { fill: none; stroke: var(--red); stroke-width: 1.8; }
.ch00-gap-difftx { font-family: var(--gothic); font-size: 12px; font-weight: 700; fill: var(--red); }
.ch00-gap-out { margin: 6px 0 0; padding: 6px 8px; font-size: 0.84rem; font-weight: 700; line-height: 1.5; border-left: 3px solid var(--ink); }
.ch00-gap-rice .ch00-gap-out { border-left-color: var(--red); background: var(--marker); }
@media (min-width: 700px) {
  .ch00-gap-panels { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 26px; }
}


/* 第2章 弥生・古墳（ch01）：米の行き先、2つのムラの倉、倭の身分 */
/* 書き出しの引用：ふりがなを縦書きに合わせる */
#ch01 .kyoka rt { font-size: 0.42em; font-weight: 400; letter-spacing: 0; }

/* ---------------------------------------------------------- 図：ムラでとれた米の行き先
 * 帯の長さ（--v は 0〜100）は、実りの良い年にとれた米を100としたイメージ。
 * 凶作の年の赤い破線が足りない分で、その右端は、実りの良い年の「食べる分＋種もみ」の右端とそろう。 */
.ch01-rice { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
.ch01-rice-key { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 10px; font-size: 0.76rem; font-weight: 700; line-height: 1.5; }
.ch01-rice-key span { display: inline-flex; align-items: center; gap: 6px; }
.ch01-rice-key span::before { content: ""; box-sizing: border-box; width: 18px; height: 12px; }
.ch01-rice-k1::before { background: var(--rice); }
.ch01-rice-k2::before { background: var(--rice-line); }
.ch01-rice-k3::before { background: var(--marker); border: 1px solid var(--rice-line); }
.ch01-rice-k4::before { border: 2px dashed var(--red); }
.ch01-rice-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.ch01-rice-row { display: grid; row-gap: 5px; padding: 10px 0 12px; border-bottom: 1px solid var(--rule); }
.ch01-rice-when { margin: 0; font-size: 0.95rem; font-weight: 800; line-height: 1.4; }
.ch01-rice-row + .ch01-rice-row .ch01-rice-when::before { content: "↓ "; color: var(--sub); }
.ch01-rice-bar { display: flex; height: 20px; margin: 0; }
.ch01-rice-bar i { display: block; box-sizing: border-box; flex: 0 0 calc(var(--v) * 1%); }
.ch01-rice-eat { background: var(--rice); }
.ch01-rice-seed { background: var(--rice-line); }
.ch01-rice-left { background: var(--marker); border: 1px solid var(--rice-line); }
.ch01-rice-short { border: 2px dashed var(--red); }
.ch01-rice-note { margin: 0; font-size: 0.8rem; font-weight: 700; line-height: 1.5; color: var(--sub); }
.ch01-rice-store { padding-left: 12px; background: var(--tint); box-shadow: inset 4px 0 0 var(--rice); }
.ch01-rice-bad .ch01-rice-when, .ch01-rice-bad .ch01-rice-note { color: var(--red); }

/* ---------------------------------------------------------- 図：2つのムラの倉の米（イメージ）
 * 実線は水を引きやすいムラ、破線は引きにくいムラ。赤い帯が凶作の年で、白抜きの赤い丸が、倉が空になった所。 */
.ch01-gap { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
.ch01-gap-key { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 4px; padding-top: 8px; border-top: 2px solid var(--ink); font-size: 0.76rem; font-weight: 700; line-height: 1.5; }
.ch01-gap-key span { display: inline-flex; align-items: center; gap: 6px; }
.ch01-gap-key span::before { content: ""; width: 26px; height: 0; border-top: 3px solid var(--ink); }
.ch01-gap-key .ch01-gap-kb::before { border-top: 2px dashed var(--ink); }
.ch01-gap-axes { margin: 0 0 4px; font-size: 0.7rem; line-height: 1.4; color: var(--sub); }
.ch01-gap svg { display: block; width: 100%; max-width: 480px; height: auto; }
.ch01-gap-band { fill: var(--red-bg); }
.ch01-gap-line { fill: none; stroke: var(--sub); stroke-width: 1; }
.ch01-gap-a { fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linejoin: round; }
.ch01-gap-b { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-dasharray: 5 4; stroke-linejoin: round; }
.ch01-gap-dot { fill: var(--ink); }
.ch01-gap-empty { fill: var(--card); stroke: var(--red); stroke-width: 2; }
.ch01-gap-txt { font-family: var(--gothic); font-size: 10.5px; fill: var(--sub); }
.ch01-gap-strong { font-size: 11px; font-weight: 700; fill: var(--ink); }
.ch01-gap-redtx, .ch01-gap-badtx { font-family: var(--gothic); font-size: 10.5px; font-weight: 700; fill: var(--red); }

/* ---------------------------------------------------------- 図：「魏志倭人伝」に書かれた倭の身分
 * 上から身分の高い順。王は統治する側の色、下戸は民衆の色、いちばん下の人々は赤い線。 */
.ch01-rank { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
.ch01-rank-end { margin: 0; font-size: 0.74rem; font-weight: 700; line-height: 1.5; color: var(--sub); }
.ch01-rank-end:first-child::before { content: "↑ "; }
.ch01-rank-list + .ch01-rank-end::before { content: "↓ "; }
.ch01-rank-list { list-style: none; margin: 4px 0; padding: 0; border-top: 2px solid var(--ink); }
.ch01-rank-list li { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); column-gap: 12px; align-items: baseline; padding: 10px 8px; border-bottom: 1px solid var(--rule); }
.ch01-rank-name { margin: 0; font-size: 1rem; font-weight: 800; line-height: 1.35; }
.ch01-rank-name small { display: block; margin-top: 2px; font-size: 0.68rem; font-weight: 700; color: var(--sub); }
.ch01-rank-note { margin: 0; font-size: 0.84rem; line-height: 1.55; }
.ch01-rank-top { background: var(--ruler-bg); }
.ch01-rank-top .ch01-rank-name { color: var(--ruler); }
.ch01-rank-people { background: var(--people-bg); }
.ch01-rank-people .ch01-rank-name { color: var(--people); }
.ch01-rank-low { box-shadow: inset 4px 0 0 var(--red); }
.ch01-rank-low .ch01-rank-name { color: var(--red); }
@media (max-width: 699.98px) {
  .ch01-rank-list li { grid-template-columns: 5.5em minmax(0, 1fr); }
}


/* 第3章 飛鳥・奈良：歌のふりがな、負担の表、戸籍の家族、男子の1年、五保の肩代わり */
#ch02 .kyoka rt { font-size: 0.42em; font-weight: 400; letter-spacing: 0; }

/* ---------------------------------------------------------- 図：正丁の負担 */
.ch02-duty { margin: 10px 0 40px; max-width: 46em; }
.ch02-duty table { width: 100%; border-collapse: collapse; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); font-family: var(--gothic); font-size: 0.86rem; line-height: 1.6; }
.ch02-duty th, .ch02-duty td { padding: 9px 10px 9px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.ch02-duty thead th { font-size: 0.74rem; font-weight: 700; color: var(--sub); letter-spacing: 0.08em; border-bottom: 1px solid var(--ink); }
.ch02-duty tbody th { width: 3.6em; font-size: 1rem; white-space: nowrap; }
.ch02-duty td:last-child { width: 4.6em; padding-right: 0; color: var(--sub); white-space: nowrap; }
.ch02-duty tbody tr:last-child th, .ch02-duty tbody tr:last-child td { border-bottom: 0; }

/* ---------------------------------------------------------- 図：戸籍に載った家族と、口分田・調・庸
 * 1行が家族の1人。口分田の棒（--v は男子の2段を100）と、調・庸がかかるか。6歳未満は口分田が無い。 */
.ch02-koseki { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
.ch02-koseki-cols, .ch02-koseki-list li { display: grid; grid-template-columns: 6.4em minmax(0, 1fr) 4.2em; column-gap: 12px; }
.ch02-koseki-cols { margin: 0; padding: 0 0 6px; font-size: 0.7rem; font-weight: 700; line-height: 1.4; color: var(--sub); border-bottom: 2px solid var(--ink); }
.ch02-koseki-cols span:last-child, .ch02-koseki-cho { text-align: center; }
.ch02-koseki-list { list-style: none; margin: 0; padding: 0; }
.ch02-koseki-list li { align-items: center; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.ch02-koseki-who { margin: 0; font-size: 0.86rem; line-height: 1.35; }
.ch02-koseki-who b { display: block; font-weight: 800; }
.ch02-koseki-who small { font-size: 0.72rem; color: var(--sub); }
.ch02-koseki-den { margin: 0; display: grid; gap: 3px; font-size: 0.74rem; font-weight: 700; line-height: 1.4; color: var(--sub); }
.ch02-koseki-den i { display: block; height: 14px; width: calc(var(--v) * 1%); background: var(--rice); box-shadow: inset 0 0 0 1px var(--rice-line); }
.ch02-koseki-none .ch02-koseki-den span { padding: 3px 0; border-top: 1px dashed var(--rule); }
.ch02-koseki-cho { margin: 0; font-size: 0.8rem; font-weight: 700; line-height: 1.3; color: var(--sub); }
.ch02-koseki-on { padding: 4px 0; color: var(--ruler); background: var(--ruler-bg); border: 1.5px solid var(--ruler); border-radius: 4px; }
.ch02-koseki-sum { display: grid; gap: 4px; margin: 10px 0 0; padding: 8px 10px; font-size: 0.82rem; font-weight: 700; line-height: 1.5; background: var(--tint); border-left: 3px solid var(--ink); }
@media (min-width: 700px) {
  .ch02-koseki-cols, .ch02-koseki-list li { grid-template-columns: 9em minmax(0, 1fr) 6em; column-gap: 18px; }
  .ch02-koseki-den { grid-template-columns: minmax(0, 1fr) 7.5em; align-items: center; column-gap: 10px; }
  .ch02-koseki-none .ch02-koseki-den span { grid-column: 1 / -1; }
  .ch02-koseki-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
}

/* ---------------------------------------------------------- 図：成年の男子の1年のうち、国のために取られる日
 * 棒の全体が1年（365日）。--v は日数。運脚は斜線で雑徭と見分ける。防人の年は全部が取られる。 */
.ch02-days { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
.ch02-days-key { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 10px; font-size: 0.74rem; font-weight: 700; line-height: 1.5; }
.ch02-days-key span { display: inline-flex; align-items: center; gap: 6px; }
.ch02-days-key span::before { content: ""; width: 16px; height: 12px; }
.ch02-days-k1::before { background: var(--ruler); }
.ch02-days-k2::before { background: var(--people-bg); box-shadow: inset 0 0 0 1px var(--people-line); }
.ch02-days-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.ch02-days-list li { padding: 10px 0 12px; border-bottom: 1px solid var(--rule); }
.ch02-days-ttl { margin: 0 0 6px; font-size: 0.9rem; font-weight: 800; line-height: 1.4; }
.ch02-days-bar { display: flex; height: 20px; margin: 0; background: var(--people-bg); box-shadow: inset 0 0 0 1px var(--people-line); }
.ch02-days-bar i { display: block; height: 100%; width: calc(var(--v) / 365 * 100%); background: var(--ruler); }
.ch02-days-bar i + i { border-left: 2px solid var(--paper); }
.ch02-days-bar .ch02-days-un { background: repeating-linear-gradient(135deg, var(--ruler) 0 4px, var(--ruler-bg) 4px 7px); }
.ch02-days-note { margin: 5px 0 0; font-size: 0.76rem; font-weight: 700; line-height: 1.5; color: var(--sub); }
.ch02-days-hard .ch02-days-ttl, .ch02-days-hard .ch02-days-note { color: var(--red); }

/* ---------------------------------------------------------- 図：五保の肩代わり
 * 1つの枠が1軒。棒の高さが、その家が納める負担（--v は、もとの負担を100）。
 * 下の色がもとの負担、上の赤が逃げた家から上乗せされた分。逃げた家は破線の枠。幅があるときは3つの段を横に並べる。 */
.ch02-goho { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
.ch02-goho-key { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 10px; font-size: 0.74rem; font-weight: 700; line-height: 1.5; }
.ch02-goho-key span { display: inline-flex; align-items: center; gap: 6px; }
.ch02-goho-key span::before { content: ""; width: 12px; height: 12px; }
.ch02-goho-k1::before { background: var(--people); }
.ch02-goho-k2::before { background: var(--red); }
.ch02-goho-steps { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.ch02-goho-steps > li { position: relative; padding: 10px 0 12px; border-bottom: 1px solid var(--rule); }
.ch02-goho-ttl { margin: 0 0 6px; font-size: 0.9rem; font-weight: 800; line-height: 1.4; }
.ch02-goho-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: 76px; gap: 6px; align-items: end; margin: 0; max-width: 22em; }
.ch02-goho-row span { position: relative; display: block; height: calc(var(--v) * 0.6%); background: var(--red); }
.ch02-goho-row span i { position: absolute; left: 0; right: 0; bottom: 0; height: calc(100% * 100 / var(--v)); background: var(--people); }
.ch02-goho-row .ch02-goho-gone { display: flex; align-items: center; justify-content: center; height: 60%; background: transparent; border: 1.5px dashed var(--sub); font-size: 0.68rem; font-weight: 700; color: var(--sub); writing-mode: vertical-rl; }
.ch02-goho-hard .ch02-goho-ttl { color: var(--red); }
@media (min-width: 700px) {
  .ch02-goho-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 28px; padding-top: 10px; }
  .ch02-goho-steps > li { padding: 0 0 10px; border-bottom: 0; }
  .ch02-goho-steps > li + li::before { content: "→"; position: absolute; left: -20px; top: 60%; font-size: 0.95rem; font-weight: 700; color: var(--sub); }
}

/* ---------------------------------------------------------- 比べ表（図9）：法の名前を、言葉の切れ目（wbr）でだけ折り返す */
#ch02 .matrix-table tbody th { word-break: keep-all; }


/* 第4章 平安：受領の取り分、寄進のしくみ、寄進で細る税、支払いに使われた物 */
/* ---------------------------------------------------------- 図：寄進のしくみ */
#ch03 .ch03-kishin { margin: 10px 0 40px; max-width: var(--measure); }
#ch03 .ch03-kishin svg { display: block; width: 100%; max-width: 470px; height: auto; overflow: visible; }
#ch03 .ch03-kishin rect { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
#ch03 .ch03-kishin text { fill: var(--ink); font-family: var(--gothic); font-size: 11.5px; }
#ch03 .ch03-kishin .ch03-k-name { font-size: 14px; font-weight: 700; }
#ch03 .ch03-kishin .ch03-k-sub { fill: var(--sub); font-size: 11px; }
#ch03 .ch03-kishin .ch03-k-line { fill: none; stroke: var(--ink); stroke-width: 1.5; marker-end: url(#ch03-ah); }
#ch03 .ch03-kishin .ch03-k-stop { fill: none; stroke: var(--sub); stroke-width: 1.5; stroke-dasharray: 4 3; }
#ch03 .ch03-kishin .ch03-k-x { fill: none; stroke: var(--red); stroke-width: 2.5; }
#ch03 .ch03-kishin .ch03-k-no { fill: var(--red); font-weight: 700; }
#ch03 .ch03-ah { fill: var(--ink); }

/* ---------------------------------------------------------- 図：農民がとった米や絹の行き先（受領の取り立て方で比べる）
 * 棒の全体が農民の収穫。左から、朝廷に納める決まった額・受領の取り分・農民の手元に残る分（--v は割合）。 */
.ch03-take { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
.ch03-take-key { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 10px; font-size: 0.74rem; font-weight: 700; line-height: 1.5; }
.ch03-take-key span { display: inline-flex; align-items: center; gap: 6px; }
.ch03-take-key span::before { content: ""; width: 14px; height: 12px; }
.ch03-take-k1::before { background: var(--ruler-line); }
.ch03-take-k2::before { background: var(--ruler); }
.ch03-take-k3::before { background: var(--people-bg); box-shadow: inset 0 0 0 1px var(--people-line); }
.ch03-take-row { padding: 10px 0 12px; border-bottom: 1px solid var(--rule); }
.ch03-take-row:first-of-type { border-top: 2px solid var(--ink); }
.ch03-take-ttl { margin: 0 0 6px; font-size: 0.9rem; font-weight: 800; line-height: 1.4; }
.ch03-take-bar { display: flex; height: 22px; margin: 0; }
.ch03-take-bar i { display: block; height: 100%; width: calc(var(--v) * 1%); }
.ch03-take-bar i + i { border-left: 2px solid var(--paper); }
.ch03-take-court { background: var(--ruler-line); }
.ch03-take-zuryo { background: var(--ruler); }
.ch03-take-farm { background: var(--people-bg); box-shadow: inset 0 0 0 1px var(--people-line); }
.ch03-take-note { margin: 5px 0 0; font-size: 0.78rem; font-weight: 700; line-height: 1.5; color: var(--sub); }
.ch03-take-hard .ch03-take-note { color: var(--red); }

/* ---------------------------------------------------------- 図：寄進が進むと、朝廷に入る税が細る
 * 1つの四角が1枚の田。塗った四角は国に税を納める田、破線の四角は寄進された田。右の棒が朝廷に入る税（--v）。 */
.ch03-shrink { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
.ch03-shrink-key { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 10px; font-size: 0.74rem; font-weight: 700; line-height: 1.5; }
.ch03-shrink-key span { display: inline-flex; align-items: center; gap: 6px; }
.ch03-shrink-key span::before { content: ""; flex: none; width: 12px; height: 12px; box-sizing: border-box; }
.ch03-shrink-k1::before { background: var(--rice); border: 1px solid var(--rice-line); }
.ch03-shrink-k2::before { border: 1.5px dashed var(--ruler); background: var(--ruler-bg); }
.ch03-shrink-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.ch03-shrink-list li { display: grid; gap: 6px; padding: 10px 0 12px; border-bottom: 1px solid var(--rule); }
.ch03-shrink-ttl { margin: 0; font-size: 0.9rem; font-weight: 800; line-height: 1.4; }
.ch03-shrink-fields { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; max-width: 20em; margin: 0; }
.ch03-shrink-fields i { display: block; aspect-ratio: 1; box-sizing: border-box; background: var(--rice); border: 1px solid var(--rice-line); }
.ch03-shrink-fields .ch03-shrink-sho { background: var(--ruler-bg); border: 1.5px dashed var(--ruler); }
.ch03-shrink-tax { display: grid; grid-template-columns: 6.6em minmax(0, 1fr); align-items: center; column-gap: 8px; margin: 0; font-size: 0.74rem; font-weight: 700; line-height: 1.4; color: var(--sub); }
.ch03-shrink-bar { display: block; height: 14px; width: calc(var(--v) * 1%); background: var(--rice-line); }
.ch03-shrink-hard .ch03-shrink-ttl, .ch03-shrink-hard .ch03-shrink-tax { color: var(--red); }
@media (min-width: 700px) {
  .ch03-shrink-list li { grid-template-columns: 8.5em minmax(0, 20em) minmax(0, 1fr); align-items: center; column-gap: 18px; }
}

/* ---------------------------------------------------------- 図：支払いに使われた物の移り変わり
 * 時代を左から右（狭い画面では上から下）に並べる。銭は金色、米・絹・布は米の色の印で見分ける。 */
.ch03-coin { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
.ch03-coin-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.ch03-coin-list li { position: relative; display: grid; gap: 4px; align-content: start; padding: 10px 0 12px; border-bottom: 1px solid var(--rule); }
.ch03-coin-when { margin: 0; font-size: 0.95rem; font-weight: 800; line-height: 1.4; }
.ch03-coin-what { margin: 0; font-size: 0.84rem; line-height: 1.55; }
.ch03-coin-pay { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 2px 0 0; font-size: 0.78rem; font-weight: 700; line-height: 1.5; }
.ch03-coin-pay span { display: inline-flex; align-items: baseline; gap: 6px; }
.ch03-coin-pay span::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; transform: translateY(1px); }
.ch03-coin-zeni::before { background: var(--au); box-shadow: inset 0 0 0 1px var(--au-line); }
.ch03-coin-mono::before { background: var(--rice); box-shadow: inset 0 0 0 1px var(--rice-line); }
.ch03-coin-gap .ch03-coin-when { color: var(--sub); }
.ch03-coin-key .ch03-coin-pay { padding: 4px 6px; background: var(--marker); }
@media (min-width: 700px) {
  .ch03-coin-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 26px; padding-top: 10px; }
  .ch03-coin-list li { padding: 0 0 10px; border-bottom: 0; }
  .ch03-coin-list li + li::before { content: "→"; position: absolute; left: -19px; top: 0.1em; font-size: 0.9rem; font-weight: 700; color: var(--sub); }
}


/* 第4章 鎌倉：御恩と奉公、恩賞の土地を配る、分割相続と質入れ */
/* ---------------------------------------------------------- 図：御恩と奉公 */
#ch04 .ch04-goon { margin: 10px 0 40px; max-width: var(--measure); }
#ch04 .ch04-goon svg { display: block; width: 100%; max-width: 470px; height: auto; overflow: visible; }
#ch04 .ch04-goon rect { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
#ch04 .ch04-goon text { fill: var(--ink); font-family: var(--gothic); font-size: 11.5px; }
#ch04 .ch04-goon .ch04-g-name { font-size: 14px; font-weight: 700; }
#ch04 .ch04-goon .ch04-g-big { font-size: 16px; font-weight: 700; }
#ch04 .ch04-goon .ch04-g-sub { fill: var(--sub); font-size: 11px; }
#ch04 .ch04-goon .ch04-g-line { fill: none; stroke: var(--ink); stroke-width: 2; marker-end: url(#ch04-ah); }
#ch04 .ch04-goon .ch04-g-red { stroke: var(--red); marker-end: url(#ch04-ah-red); }
#ch04 .ch04-goon text.ch04-g-redtx { fill: var(--red); }
#ch04 .ch04-ah { fill: var(--ink); }
#ch04 .ch04-ah-red { fill: var(--red); }

/* ---------------------------------------------------------- 手を動かす図1：恩賞を配る */
#ch04 .ch04-phase { margin: 0 0 14px; font-size: 1.05rem; font-weight: 700; letter-spacing: 0.04em; }
#ch04 .ch04-pool { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; max-width: 330px; }
#ch04 .ch04-pool i { display: block; aspect-ratio: 1; background: var(--rice); box-shadow: inset 0 0 0 1px var(--rice-line); transition: background-color 0.2s, box-shadow 0.2s; }
#ch04 .ch04-pool i.out { background: transparent; box-shadow: inset 0 0 0 1px var(--empty); }
#ch04 .ch04-poolbox.is-empty .count b { color: var(--red); }
#ch04 .ch04-roll { list-style: none; margin: 6px 0 0; padding: 0; border-top: 1px solid var(--ink); }
#ch04 .ch04-roll li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding-block: 10px; border-bottom: 1px solid var(--rule); }
#ch04 .ch04-deed { margin: 0; font-size: 0.9rem; font-weight: 700; line-height: 1.5; }
#ch04 .ch04-state { margin: 0; font-size: 0.78rem; color: var(--sub); text-align: right; white-space: nowrap; }
#ch04 .ch04-roll li.is-ok .ch04-state { color: var(--ink); font-weight: 700; }
#ch04 .ch04-roll li.is-ng .ch04-state { color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
#ch04 .ch04-slots { display: flex; gap: 4px; align-items: center; }
#ch04 .ch04-slots i { display: block; width: 20px; height: 20px; box-shadow: inset 0 0 0 1px var(--sub); transition: background-color 0.2s; }
#ch04 .ch04-slots i.on { background: var(--rice); box-shadow: inset 0 0 0 1px var(--rice-line); }
#ch04 .ch04-give { display: flex; gap: 6px; }
#ch04 .ch04-pm {
  font: inherit; font-size: 0.84rem; font-weight: 700; min-width: 58px; min-height: 44px; padding: 6px 10px;
  color: var(--ink); background: transparent; border: 1.5px solid var(--ink); border-radius: 2px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#ch04 .ch04-pm[aria-disabled="true"] { color: var(--empty); border-color: var(--empty); cursor: default; }

/* ---------------------------------------------------------- 手を動かす図2：田を継がせる */
#ch04 .ch04-field { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 3px; max-width: 430px; }
#ch04 .ch04-field i {
  display: grid; place-items: center; aspect-ratio: 1; font-style: normal; font-size: 0.8rem; font-weight: 700; line-height: 1;
  background: var(--rice); box-shadow: inset 0 0 0 1px var(--rice-line);
  transition: background-color 0.4s, box-shadow 0.4s;
}
#ch04 .ch04-field i.is-sib { background: transparent; box-shadow: inset 0 0 0 1px var(--empty); }
#ch04 .ch04-field i.is-pawn { background: transparent; box-shadow: inset 0 0 0 2px var(--ink); }
#ch04 .ch04-field i.is-pawn::after { content: "質"; }
#ch04 .ch04-legend { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 0.74rem; color: var(--sub); }
#ch04 .ch04-legend li { display: flex; align-items: center; gap: 6px; }
#ch04 .ch04-legend i { display: block; width: 14px; height: 14px; flex: none; background: var(--rice); box-shadow: inset 0 0 0 1px var(--rice-line); }
#ch04 .ch04-legend i.is-sib { background: transparent; box-shadow: inset 0 0 0 1px var(--empty); }
#ch04 .ch04-legend i.is-pawn { background: transparent; box-shadow: inset 0 0 0 2px var(--ink); }
#ch04 .ch04-gen { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; border-top: 1px solid var(--ink); }
#ch04 .ch04-gen li { display: grid; padding-top: 8px; color: var(--empty); transition: color 0.3s; }
#ch04 .ch04-gen li.on { color: var(--ink); }
#ch04 .ch04-gen b { font-size: 1.7rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
#ch04 .ch04-gen span { font-size: 0.72rem; }
#ch04 .ch04-gen li.on span { color: var(--sub); }
#ch04 .ch04-house .reads { margin-top: 0; }
#ch04 .ch04-house .reads dd b.is-minus { color: var(--red); }

/* ---------------------------------------------------------- 図：分割相続で、1人が継ぐ田が細る
 * 3×3の田のうち、その人が継いだ田（米の色）と、きょうだいが継いだ田（枠だけ）。いちばん細る孫の代は赤。
 * 狭い画面では代を縦に並べ、田を右に置く。幅700px以上では代を横に並べる。 */
.ch04-split { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
.ch04-split-key { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 8px; font-size: 0.74rem; font-weight: 700; line-height: 1.5; color: var(--sub); }
.ch04-split-key span { display: inline-flex; align-items: center; gap: 6px; }
.ch04-split-key span::before { content: ""; width: 14px; height: 14px; flex: none; background: var(--rice); box-shadow: inset 0 0 0 1px var(--rice-line); }
.ch04-split-key .ch04-split-ksib::before { background: transparent; box-shadow: inset 0 0 0 1px var(--sub); opacity: 0.45; }
.ch04-split-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.ch04-split-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 14px; row-gap: 2px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.ch04-split-gen { grid-column: 1; margin: 0; font-size: 0.95rem; font-weight: 800; line-height: 1.4; }
.ch04-split-note { grid-column: 1; margin: 0; font-size: 0.8rem; font-weight: 700; line-height: 1.5; color: var(--sub); }
.ch04-split-field { grid-column: 2; grid-row: 1 / span 2; display: grid; grid-template-columns: repeat(3, 16px); gap: 3px; margin: 0; }
.ch04-split-field i { display: block; width: 16px; height: 16px; background: var(--rice); box-shadow: inset 0 0 0 1px var(--rice-line); }
.ch04-split-field i.is-sib { background: transparent; box-shadow: inset 0 0 0 1px var(--sub); opacity: 0.45; }
.ch04-split-hard .ch04-split-gen, .ch04-split-hard .ch04-split-note { color: var(--red); }
.ch04-split-cost { margin: 10px 0 0; padding: 6px 8px; font-size: 0.84rem; font-weight: 700; line-height: 1.5; border-left: 3px solid var(--red); background: var(--marker); }
@media (min-width: 700px) {
  .ch04-split-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 28px; padding-top: 10px; }
  .ch04-split-list li { position: relative; grid-template-columns: minmax(0, 1fr); align-items: start; row-gap: 8px; padding: 0 0 10px; border-bottom: 0; }
  .ch04-split-gen, .ch04-split-note, .ch04-split-field { grid-column: 1; grid-row: auto; }
  .ch04-split-field { grid-template-columns: repeat(3, 22px); gap: 4px; }
  .ch04-split-field i { width: 22px; height: 22px; }
  .ch04-split-list li + li::before { content: "→"; position: absolute; left: -20px; top: 0.1em; font-size: 0.9rem; font-weight: 700; color: var(--sub); }
}

/* ---------------------------------------------------------- 図：銭が広まる前と後
 * 行が比べること、左の列が前、右の列が後（薄い地）。狭い画面でも3列のまま、文を折り返す。 */
.ch04-shift { margin: 12px 0 40px; max-width: 46em; }
.ch04-shift table { width: 100%; border-collapse: collapse; table-layout: fixed; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); font-family: var(--gothic); font-size: 0.84rem; line-height: 1.6; }
.ch04-shift th, .ch04-shift td { padding: 9px 8px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.ch04-shift thead th, .ch04-shift thead td { font-size: 0.88rem; font-weight: 800; line-height: 1.4; border-bottom: 1px solid var(--ink); }
.ch04-shift thead td { width: 6em; }
.ch04-shift thead small { display: block; margin-top: 2px; font-size: 0.7rem; font-weight: 700; color: var(--sub); }
.ch04-shift thead th.ch04-shift-after { color: var(--red); }
.ch04-shift tbody th { padding-left: 0; font-size: 0.88rem; font-weight: 800; }
.ch04-shift .ch04-shift-after { background: var(--tint); }
.ch04-shift tbody tr:last-child th, .ch04-shift tbody tr:last-child td { border-bottom: 0; }


/* 第6章 室町：借り方の比べ、借金がふくらむ、分一銭のしくみ */
/* 題：2行目が9字あるので、幅375pxでも2行に収まる大きさにする */
#ch05 .opener h2 { font-size: clamp(2rem, 7.4vw, 4.1rem); }

/* ---------------------------------------------------------- 図：米を借りるときと、銭を借りるとき
 * 行が比べること、左の列が前、右の列が後（薄い地）。狭い画面でも3列のまま、文を折り返す。 */
.ch05-shift { margin: 12px 0 40px; max-width: 46em; }
.ch05-shift table { width: 100%; border-collapse: collapse; table-layout: fixed; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); font-family: var(--gothic); font-size: 0.84rem; line-height: 1.6; }
.ch05-shift th, .ch05-shift td { padding: 9px 8px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.ch05-shift thead th, .ch05-shift thead td { font-size: 0.88rem; font-weight: 800; line-height: 1.4; border-bottom: 1px solid var(--ink); }
.ch05-shift thead td { width: 6em; }
.ch05-shift thead small { display: block; margin-top: 2px; font-size: 0.7rem; font-weight: 700; color: var(--sub); }
.ch05-shift thead th.ch05-shift-after { color: var(--red); }
.ch05-shift tbody th { padding-left: 0; font-size: 0.88rem; font-weight: 800; }
.ch05-shift .ch05-shift-after { background: var(--tint); }
.ch05-shift tbody tr:last-child th, .ch05-shift tbody tr:last-child td { border-bottom: 0; }

/* ---------------------------------------------------------- 図：返せない借金がふくらむ
 * 棒の長さは銭の額（170文で幅いっぱい）。借りた100文は金色、ついた利子は赤。--i は利子の文の数。 */
.ch05-debt { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
.ch05-debt-key { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 8px; font-size: 0.74rem; font-weight: 700; line-height: 1.5; color: var(--sub); }
.ch05-debt-key span { display: inline-flex; align-items: center; gap: 6px; }
.ch05-debt-key span::before { content: ""; width: 14px; height: 14px; flex: none; background: var(--au); box-shadow: inset 0 0 0 1px var(--au-line); }
.ch05-debt-key .ch05-debt-kint::before { background: var(--red); box-shadow: none; }
.ch05-debt-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.ch05-debt-list li { display: grid; grid-template-columns: 4.6em minmax(0, 1fr) 3.4em; column-gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.ch05-debt-when { margin: 0; font-size: 0.82rem; font-weight: 700; line-height: 1.4; }
.ch05-debt-bar { display: flex; height: 16px; margin: 0; }
.ch05-debt-base { display: block; flex: none; width: calc(100 / 170 * 100%); height: 100%; background: var(--au); box-shadow: inset 0 0 0 1px var(--au-line); }
.ch05-debt-int { display: block; flex: none; width: calc(var(--i) / 170 * 100%); height: 100%; background: var(--red); }
.ch05-debt-sum { margin: 0; font-size: 0.9rem; font-weight: 800; line-height: 1.3; text-align: right; font-variant-numeric: tabular-nums; }
.ch05-debt-last .ch05-debt-when, .ch05-debt-last .ch05-debt-sum { color: var(--red); }
.ch05-debt-note { margin: 8px 0 0; font-size: 0.76rem; font-weight: 700; line-height: 1.5; color: var(--sub); }

/* ---------------------------------------------------------- 図：分一銭のしくみ
 * 左が借りた側（民衆の色）、右が貸した側（お金の色）。下の帯が、どちらからも銭を受け取る幕府（統治する側の色）。 */
.ch05-buichi { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
.ch05-buichi-case { margin: 0 0 8px; font-size: 0.78rem; font-weight: 700; line-height: 1.5; color: var(--sub); }
.ch05-buichi-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ch05-buichi-col { display: grid; align-content: start; gap: 6px; padding: 10px 12px 12px; background: var(--people-bg); border-top: 3px solid var(--people); }
.ch05-buichi-col + .ch05-buichi-col { background: var(--tint); border-top-color: var(--au); }
.ch05-buichi-col p { margin: 0; }
.ch05-buichi-who { font-size: 0.95rem; font-weight: 800; line-height: 1.4; }
.ch05-buichi-who small { display: block; font-size: 0.7rem; font-weight: 700; color: var(--sub); }
.ch05-buichi-pay { font-size: 0.84rem; font-weight: 700; line-height: 1.4; }
.ch05-buichi-pay b { margin: 0 2px; font-size: 1.4rem; font-weight: 800; color: var(--red); }
.ch05-buichi-get { font-size: 0.84rem; font-weight: 700; line-height: 1.5; }
.ch05-buichi-when { font-size: 0.72rem; line-height: 1.4; color: var(--sub); }
.ch05-buichi-out { margin: 10px 0 0; padding: 6px 8px; font-size: 0.84rem; font-weight: 700; line-height: 1.5; background: var(--ruler-bg); border-left: 3px solid var(--ruler); }


/* 第7章 戦国・安土桃山：南蛮貿易の銀の流れ、石高の出し方、検地の前と後、15石の分け方、兵農分離の3つの決まり */
/* ---------------------------------------------------------- 図4：銀の流れ */
#ch06 .ch06-flow { margin: 10px 0 40px; max-width: var(--measure); }
#ch06 .ch06-flow svg { display: block; width: 100%; max-width: 520px; height: auto; overflow: visible; }
#ch06 .ch06-node rect { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
#ch06 .ch06-flow text { fill: var(--ink); font-family: var(--gothic); }
#ch06 .ch06-f-name { font-size: 14px; font-weight: 700; }
#ch06 .ch06-flow .ch06-f-sm { font-size: 10.5px; fill: var(--sub); }
#ch06 .ch06-f-lbl { font-size: 14px; font-weight: 700; }
#ch06 .ch06-flow .ch06-f-on { fill: var(--red); }
#ch06 .ch06-arw { fill: none; stroke: var(--ink); stroke-width: 2; marker-end: url(#ch06-ah); }
#ch06 .ch06-arw-on { stroke: var(--red); stroke-width: 3; marker-end: url(#ch06-ah-on); }
#ch06 .ch06-ah { fill: var(--ink); }
#ch06 .ch06-ah-on { fill: var(--red); }
#ch06 .ch06-ban { fill: none; stroke: var(--sub); stroke-width: 1.5; stroke-dasharray: 3 5; }

/* ---------------------------------------------------------- 図5：石高の出し方
 * 上の段は「広さ × 1反あたりの量 ＝ 石高」の式。答えの欄だけ蛍光ペンの色。
 * 中の段は等級ごとの1反あたりの量（--v は斗の数。上田15を100%とする）。下の段は、田から日本中までの足し算。 */
#ch06 .ch06-koku { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
#ch06 .ch06-koku-calc { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); column-gap: 6px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule); }
#ch06 .ch06-koku-term { min-width: 0; padding: 10px 6px 12px; }
#ch06 .ch06-koku-term:first-child { padding-left: 0; }
#ch06 .ch06-koku-ans { background: var(--marker); }
#ch06 .ch06-koku-lbl { margin: 0; min-height: 2.9em; font-size: 0.7rem; font-weight: 700; line-height: 1.45; color: var(--sub); }
#ch06 .ch06-koku-ans .ch06-koku-lbl { color: var(--ink); }
#ch06 .ch06-koku-num { margin: 2px 0 0; font-size: 1.3rem; font-weight: 800; line-height: 1.15; white-space: nowrap; }
#ch06 .ch06-koku-num small { margin: 0 1px; font-size: 0.6em; font-weight: 700; }
#ch06 .ch06-koku-note { margin: 4px 0 0; font-size: 0.68rem; line-height: 1.45; color: var(--sub); }
#ch06 .ch06-koku-op { margin: 0; padding-top: calc(10px + 2.9 * 0.7rem); font-size: 1.15rem; font-weight: 800; line-height: 1.3; color: var(--sub); }
#ch06 .ch06-koku-grade, #ch06 .ch06-koku-sum { padding: 12px 0 14px; border-bottom: 1px solid var(--rule); }
#ch06 .ch06-koku-sub { margin: 0 0 8px; font-size: 0.78rem; font-weight: 700; line-height: 1.5; }
#ch06 .ch06-koku-grade ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
#ch06 .ch06-koku-grade li { display: grid; grid-template-columns: 2.6em minmax(0, 1fr) 4.4em; align-items: center; column-gap: 10px; font-size: 0.82rem; line-height: 1.4; }
#ch06 .ch06-koku-grade li span { font-weight: 700; }
#ch06 .ch06-koku-grade li i { display: block; height: 12px; width: calc(var(--v) / 15 * 100%); background: var(--rice); box-shadow: inset 0 0 0 1px var(--rice-line); }
#ch06 .ch06-koku-grade li b { font-weight: 700; text-align: right; }
#ch06 .ch06-koku-sum ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; row-gap: 8px; }
#ch06 .ch06-koku-sum li { position: relative; padding: 4px 10px; border: 1px solid var(--ink); font-size: 0.86rem; font-weight: 800; line-height: 1.4; }
#ch06 .ch06-koku-sum li + li { margin-left: 24px; }
#ch06 .ch06-koku-sum li + li::before { content: "→"; position: absolute; left: -19px; top: 50%; transform: translateY(-50%); font-size: 0.8rem; color: var(--sub); }
#ch06 .ch06-koku-sum li:last-child { background: var(--rice); border-color: var(--rice-line); }
#ch06 .ch06-koku-one { margin: 10px 0 0; font-size: 0.74rem; line-height: 1.5; color: var(--sub); }
@media (min-width: 700px) {
  #ch06 .ch06-koku-calc { column-gap: 14px; }
  #ch06 .ch06-koku-term { padding-inline: 10px; }
  #ch06 .ch06-koku-lbl { min-height: 0; font-size: 0.76rem; }
  #ch06 .ch06-koku-num { font-size: 1.75rem; }
  #ch06 .ch06-koku-op { padding-top: calc(10px + 1.45 * 0.76rem); font-size: 1.4rem; line-height: 1.6; }
  #ch06 .ch06-koku-note { font-size: 0.72rem; }
}

/* ---------------------------------------------------------- 図7：検地の前と後
 * 左の列が検地の前、右の太線から先が検地の後。いちばん下の行（国ごとの年貢）が結論で、蛍光ペンの色。 */
#ch06 .ch06-ba { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
#ch06 .ch06-ba-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
#ch06 .ch06-ba-table th, #ch06 .ch06-ba-table td { padding: 9px 6px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; font-size: 0.78rem; line-height: 1.5; }
#ch06 .ch06-ba-table thead th { font-size: 0.86rem; font-weight: 800; line-height: 1.35; border-bottom: 2px solid var(--ink); vertical-align: bottom; }
#ch06 .ch06-ba-table thead th small { display: block; margin-top: 2px; font-size: 0.66rem; font-weight: 400; color: var(--sub); }
#ch06 .ch06-ba-table thead th:first-child { width: 24%; padding-left: 0; font-size: 0.68rem; font-weight: 700; color: var(--sub); }
#ch06 .ch06-ba-table tbody th { padding-left: 0; font-size: 0.72rem; font-weight: 700; color: var(--sub); }
#ch06 .ch06-ba-table td { color: var(--sub); }
#ch06 .ch06-ba-table td:last-child { color: var(--ink); font-weight: 700; }
#ch06 .ch06-ba-table thead th:last-child, #ch06 .ch06-ba-table td:last-child { padding-left: 10px; border-left: 2px solid var(--ink); }
#ch06 .ch06-ba-key th, #ch06 .ch06-ba-key td { background: var(--marker); }
#ch06 .ch06-ba-key th { padding-left: 6px; color: var(--ink); }
#ch06 .ch06-ba-key td { color: var(--ink); font-weight: 700; }
@media (min-width: 700px) {
  #ch06 .ch06-ba-table th, #ch06 .ch06-ba-table td { padding: 10px 10px; font-size: 0.86rem; }
  #ch06 .ch06-ba-table thead th { font-size: 0.95rem; }
  #ch06 .ch06-ba-table thead th:first-child { width: 20%; font-size: 0.74rem; }
  #ch06 .ch06-ba-table tbody th { font-size: 0.8rem; }
  #ch06 .ch06-ba-table thead th:last-child, #ch06 .ch06-ba-table td:last-child { padding-left: 14px; }
}

/* ---------------------------------------------------------- 図8：石高15石の分け方（二公一民）
 * 1マスが1石。下の線と文字で、領主へ行く分（統治する側の色）と百姓の手元に残る分（民衆の色）に分ける。 */
#ch06 .ch06-share { margin: 12px 0 40px; max-width: var(--measure); font-family: var(--gothic); }
#ch06 .ch06-share-ttl { margin: 0 0 8px; font-size: 0.84rem; font-weight: 800; line-height: 1.45; }
#ch06 .ch06-share-grid { display: grid; grid-template-columns: repeat(15, minmax(0, 1fr)); column-gap: 3px; }
#ch06 .ch06-share-grid i { display: block; aspect-ratio: 1; background: var(--rice); box-shadow: inset 0 0 0 1px var(--rice-line); }
#ch06 .ch06-share-grid i.ch06-share-own { box-shadow: inset 0 0 0 2px var(--people); }
#ch06 .ch06-share-k1, #ch06 .ch06-share-k2 { grid-row: 2; margin: 8px 0 0; padding-top: 6px; font-size: 0.78rem; font-weight: 700; line-height: 1.45; }
#ch06 .ch06-share-k1 { grid-column: 1 / 11; border-top: 3px solid var(--ruler); color: var(--ruler); }
#ch06 .ch06-share-k2 { grid-column: 11 / 16; border-top: 3px solid var(--people); color: var(--people); }
#ch06 .ch06-share-grid b { display: block; font-size: 1.3rem; font-weight: 800; line-height: 1.2; }
#ch06 .ch06-share-grid small { display: block; font-size: 0.7rem; font-weight: 700; color: var(--sub); }
@media (min-width: 700px) {
  #ch06 .ch06-share-grid { column-gap: 5px; }
  #ch06 .ch06-share-k1, #ch06 .ch06-share-k2 { font-size: 0.86rem; }
  #ch06 .ch06-share-grid b { font-size: 1.6rem; }
}

/* ---------------------------------------------------------- 図9：兵農分離の3つの決まり
 * 3つの決まりを並べ（狭い画面では縦に積む）、それぞれの下に百姓ができなくなったことを民衆の色で書く。
 * 3つが重なった結果（兵農分離）は、下の蛍光ペンの帯。 */
#ch06 .ch06-bunri { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
#ch06 .ch06-bunri-list { list-style: none; margin: 0; padding: 0; display: grid; border-top: 2px solid var(--ink); }
#ch06 .ch06-bunri-list li { display: grid; align-content: start; row-gap: 4px; padding: 10px 0 12px; border-bottom: 1px solid var(--rule); }
#ch06 .ch06-bunri-name { margin: 0; font-size: 1rem; font-weight: 800; line-height: 1.4; }
#ch06 .ch06-bunri-name small { margin-left: 0.6em; font-size: 0.72rem; font-weight: 700; color: var(--sub); }
#ch06 .ch06-bunri-do { margin: 0; font-size: 0.82rem; line-height: 1.55; }
#ch06 .ch06-bunri-out { margin: 2px 0 0; padding-left: 10px; border-left: 3px solid var(--people); font-size: 0.8rem; font-weight: 700; line-height: 1.55; color: var(--people); }
#ch06 .ch06-bunri-res { position: relative; margin: 26px 0 0; padding: 10px 12px; background: var(--marker); font-size: 0.86rem; font-weight: 700; line-height: 1.55; }
#ch06 .ch06-bunri-res::before { content: "↓"; position: absolute; left: 50%; top: -22px; transform: translateX(-50%); font-size: 0.9rem; font-weight: 700; line-height: 1; color: var(--sub); }
#ch06 .ch06-bunri-res b { display: block; font-size: 1.05rem; font-weight: 800; }
@media (min-width: 700px) {
  #ch06 .ch06-bunri-list { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 22px; border-top: 0; }
  #ch06 .ch06-bunri-list li { grid-template-rows: auto 1fr auto; padding-top: 10px; border-top: 2px solid var(--ink); border-bottom: 0; }
  #ch06 .ch06-bunri-res { font-size: 0.92rem; }
}

/* 題：2行目が9字あるので、幅375pxでも2行に収まる大きさにする */
#ch06 .opener h2 { font-size: clamp(2rem, 7.4vw, 4.1rem); }


/* 第8章 江戸前期：三貨のつりあい、寛永の飢饉、田畑の行方、幕府の金銀の出入り、改鋳の図 */
/* 書き出しの引用は3行あるので、少し小さく組む */
#ch07 .kyoka p { font-size: 1.12rem; }
/* ---------------------------------------------------------- 図：三貨 */
.ch07-sanka { margin: 10px 0 40px; max-width: var(--measure); }
.ch07-sanka-row { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr); align-items: center; gap: 10px; padding-block: 12px; border-bottom: 1px solid var(--rule); }
.ch07-sanka-row:first-child { border-top: 1px solid var(--ink); }
.ch07-sanka-lbl { margin: 0; font-family: var(--gothic); font-weight: 700; font-size: 1.15rem; line-height: 1.3; }
.ch07-sanka-lbl small { display: block; font-size: 0.68rem; font-weight: 400; color: var(--sub); }
.ch07-sanka-body { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; min-width: 0; font-family: var(--gothic); }
.ch07-sanka-body > b { color: var(--sub); font-weight: 400; }
.ch07-sanka-num { font-weight: 700; font-size: 0.9rem; }
.ch07-koban { display: block; flex: none; width: 22px; height: 36px; border-radius: 50%; background: var(--au); box-shadow: inset 0 0 0 1px var(--au-line); }
.ch07-bu { display: flex; gap: 4px; flex: none; }
.ch07-bu i { display: block; width: 11px; height: 18px; border-radius: 1px; background: var(--au); box-shadow: inset 0 0 0 1px var(--au-line); }
.ch07-chogin { display: flex; align-items: center; gap: 5px; flex: none; }
.ch07-chogin i { display: block; width: 12px; height: 12px; border-radius: 50%; background: var(--ag); box-shadow: inset 0 0 0 1px var(--ag-line); }
.ch07-chogin i:first-child { width: 58px; height: 19px; border-radius: 50% / 60%; }
.ch07-zeni { display: grid; gap: 3px; flex: none; }
.ch07-zeni i { display: block; width: 92px; height: 9px; border-radius: 2px; background-color: var(--rice); background-image: repeating-linear-gradient(90deg, var(--rice-line) 0 1px, transparent 1px 4px); box-shadow: inset 0 0 0 1px var(--rice-line); }

/* ---------------------------------------------------------- 図：寛永の飢饉が広がった理由
 * 上に2つの原因（天候と、統治する側の色の「領主のふるまい」）を並べ、赤の矢印で、民衆の色の「百姓の暮らし」へつなぐ。 */
.ch07-kikin { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
.ch07-kikin-causes { display: grid; gap: 12px; }
.ch07-kikin-box { padding: 10px 12px 12px; background: var(--card); border: 1px solid var(--rule); border-top: 3px solid var(--ink); }
.ch07-kikin-ruler { background: var(--ruler-bg); border-color: var(--ruler-line); border-top-color: var(--ruler); }
.ch07-kikin-people { background: var(--people-bg); border-color: var(--people-line); border-top-color: var(--people); }
.ch07-kikin-lbl { margin: 0 0 6px; font-size: 0.9rem; font-weight: 800; line-height: 1.4; }
.ch07-kikin-ruler .ch07-kikin-lbl { color: var(--ruler); }
.ch07-kikin-people .ch07-kikin-lbl { color: var(--people); }
.ch07-kikin-box ul { margin: 0; padding: 0 0 0 1.1em; font-size: 0.82rem; line-height: 1.55; }
.ch07-kikin-box li + li { margin-top: 4px; }
.ch07-kikin-box li b { margin-right: 0.5em; font-weight: 800; }
.ch07-kikin-note { margin: 8px 0 0; padding-top: 6px; border-top: 1px dashed var(--ruler-line); font-size: 0.74rem; line-height: 1.5; color: var(--sub); }
.ch07-kikin-join { position: relative; margin: 6px 0; padding: 22px 0 18px; text-align: center; font-size: 0.8rem; font-weight: 700; line-height: 1.4; color: var(--red); }
.ch07-kikin-join::before, .ch07-kikin-join::after { content: ""; position: absolute; left: 50%; width: 2px; height: 14px; background: var(--red); transform: translateX(-50%); }
.ch07-kikin-join::before { top: 2px; }
.ch07-kikin-join::after { bottom: 0; height: 0; width: 0; background: none; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 10px solid var(--red); }
.ch07-kikin-num { margin: 10px 0 0; font-size: 1.5rem; font-weight: 800; line-height: 1.2; color: var(--red); }
.ch07-kikin-num small { display: block; margin-top: 2px; font-size: 0.48em; font-weight: 700; color: var(--sub); }
@media (min-width: 700px) {
  .ch07-kikin-causes { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
  .ch07-kikin-box ul { font-size: 0.86rem; }
}

/* ---------------------------------------------------------- 図：田畑永代売買の禁止令の前と後
 * 年貢に困った百姓の田畑がたどる道を、上から下へ矢印でつなぐ。赤は百姓が田畑を失う所、破線は禁じられた道。 */
.ch07-denpata { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
.ch07-denpata-cols { display: grid; gap: 22px; }
.ch07-denpata-col { padding-top: 8px; border-top: 2px solid var(--ink); }
.ch07-denpata-head { margin: 0 0 10px; font-size: 0.95rem; font-weight: 800; line-height: 1.4; }
.ch07-denpata-head small { margin-left: 0.6em; font-size: 0.72rem; font-weight: 700; color: var(--sub); }
.ch07-denpata ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.ch07-denpata li { position: relative; padding: 7px 10px; background: var(--card); border: 1px solid var(--rule); font-size: 0.82rem; font-weight: 700; line-height: 1.5; }
.ch07-denpata li + li::before { content: "↓"; position: absolute; left: 14px; top: -19px; font-size: 0.82rem; line-height: 1.2; color: var(--sub); }
.ch07-denpata .ch07-denpata-bad { color: var(--red); background: var(--red-bg); border-color: var(--red); }
.ch07-denpata .ch07-denpata-no { color: var(--sub); background: transparent; border-style: dashed; border-color: var(--sub); }
.ch07-denpata .ch07-denpata-fork { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0; background: transparent; border: 0; }
.ch07-denpata-fork span { padding: 7px 10px; background: var(--card); border: 1px solid var(--rule); }
.ch07-denpata-fork span + span { border-left: 0; }
.ch07-denpata-fork span.ch07-denpata-bad { border: 1px solid var(--red); }
@media (min-width: 700px) {
  .ch07-denpata-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 26px; }
  .ch07-denpata li, .ch07-denpata-fork span { font-size: 0.86rem; }
}

/* ---------------------------------------------------------- 図：幕府の金銀の出入り
 * 左が入ってくるもの、右が出ていくもの。悪くなった所は赤で、小さな札に変化を書く。下の帯が結果。 */
.ch07-kura { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
.ch07-kura-cols { display: grid; gap: 18px; }
.ch07-kura-col { padding-top: 8px; border-top: 2px solid var(--ink); }
.ch07-kura-head { margin: 0 0 4px; font-size: 0.95rem; font-weight: 800; line-height: 1.4; }
.ch07-kura-head::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; background: var(--au); box-shadow: inset 0 0 0 1px var(--au-line); vertical-align: 0; }
.ch07-kura-col ul { list-style: none; margin: 0; padding: 0; }
.ch07-kura-col li { padding: 8px 0 9px; border-bottom: 1px solid var(--rule); font-size: 0.8rem; line-height: 1.55; color: var(--sub); }
.ch07-kura-col li b { display: block; font-size: 0.9rem; font-weight: 800; line-height: 1.45; color: var(--ink); }
.ch07-kura-bad b { color: var(--red); }
.ch07-kura-tag { display: inline-block; margin-left: 6px; padding: 0 5px; font-size: 0.7rem; font-weight: 700; line-height: 1.5; color: var(--red); border: 1px solid var(--red); vertical-align: 1px; }
.ch07-kura-res { margin: 14px 0 0; padding: 9px 12px; background: var(--red-bg); border-left: 4px solid var(--red); font-size: 0.92rem; font-weight: 800; line-height: 1.5; }
@media (min-width: 700px) {
  .ch07-kura-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 26px; }
  .ch07-kura-col li { font-size: 0.84rem; }
}

/* ---------------------------------------------------------- 図：改鋳 */
.ch07-kaichu { margin: 10px 0 40px; max-width: var(--measure); font-family: var(--gothic); }
.ch07-kaichu-col { padding-block: 14px; border-bottom: 1px solid var(--rule); }
.ch07-kaichu-col:first-child { border-top: 1px solid var(--ink); }
.ch07-kaichu-lbl { margin: 0 0 6px; font-weight: 700; font-size: 0.95rem; }
.ch07-kaichu-lbl small { margin-left: 0.8em; font-size: 0.72rem; font-weight: 400; color: var(--sub); }
.ch07-kaichu-bar { font-size: 0.82rem; font-weight: 700; }
.ch07-kaichu-bar::before { content: ""; display: block; height: 20px; margin-bottom: 3px; background: linear-gradient(90deg, var(--au) calc(var(--v) * 1%), var(--ag) 0); box-shadow: inset 0 0 0 1px var(--ink); }
.ch07-kaichu-coins { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 12px; }
.ch07-kaichu-coins i { display: block; flex: none; width: 15px; height: 24px; border-radius: 50%; background: var(--au); box-shadow: inset 0 0 0 1px var(--au-line); }
.ch07-kaichu-coins i.ch07-deme { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--red); margin-inline: 3px; }
.ch07-kaichu-num { margin: 6px 0 0; font-weight: 700; font-size: 0.9rem; }
.ch07-kaichu-num small { margin-left: 0.8em; font-size: 0.74rem; font-weight: 400; color: var(--sub); }

@media (min-width: 700px) {
  .ch07-koban { width: 26px; height: 42px; }
  .ch07-bu i { width: 13px; height: 21px; }
}


/* 第9章 江戸中期・後期：旗本の家計の棒、米の値段と困る人、天明の飢饉の数字 */
.ch08-kakei { font-family: var(--gothic); }
.ch08-kakei-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 10px; margin-top: 10px; }
.ch08-kakei-row > span { grid-column: 1 / -1; font-size: 0.8rem; line-height: 1.5; }
.ch08-kakei-row > em { grid-column: 1 / -1; font-style: normal; font-weight: 700; font-size: 0.78rem; color: var(--red); }
.ch08-bar { display: block; height: 16px; width: calc(var(--v) * 1%); min-width: 2px; transition: width 0.6s ease; }
.ch08-bar-in { background: var(--rice); box-shadow: inset 0 0 0 1px var(--rice-line); }
.ch08-bar-out { background: var(--ink); }
.ch08-kakei-fig { margin: 10px 0 40px; max-width: var(--measure); }
.ch08-kakei-set { padding-block: 12px 14px; border-bottom: 1px solid var(--rule); }
.ch08-kakei-set:first-child { border-top: 1px solid var(--ink); }
.ch08-kakei-ttl { margin: 0; font-weight: 700; font-size: 0.95rem; }

/* ---------------------------------------------------------- 図：米の値段と困る人
 * 上の軸は米の値段（左が安い、右が高い）。左の面は統治する側の色、右の面は民衆の色。
 * 面の下の赤い行が、行き着く先。狭い画面では面を縦に積む。 */
.ch08-swing { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
.ch08-swing-axis { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 0.78rem; font-weight: 700; line-height: 1.4; }
.ch08-swing-axis span:first-child { color: var(--ruler); }
.ch08-swing-axis span:first-child::before { content: "← "; }
.ch08-swing-axis span:last-child { color: var(--people); }
.ch08-swing-axis span:last-child::after { content: " →"; }
.ch08-swing-axis span:nth-child(2) {
  flex: 1; text-align: center; color: var(--sub);
  background: linear-gradient(var(--rule), var(--rule)) center / 100% 1px no-repeat;
}
.ch08-swing-panels { display: grid; gap: 14px; }
.ch08-swing-panel { padding: 12px 14px 14px; border-top: 3px solid var(--ink); border-radius: 0 0 10px 10px; }
.ch08-swing-ruler { background: var(--ruler-bg); border-top-color: var(--ruler); }
.ch08-swing-people { background: var(--people-bg); border-top-color: var(--people); }
.ch08-swing-ttl { margin: 0 0 4px; font-size: 1rem; font-weight: 800; line-height: 1.4; }
.ch08-swing-ruler .ch08-swing-ttl { color: var(--ruler); }
.ch08-swing-people .ch08-swing-ttl { color: var(--people); }
.ch08-swing-why { margin: 0 0 10px; font-size: 0.78rem; line-height: 1.55; color: var(--sub); }
.ch08-swing-who { margin: 0; font-size: 1.05rem; font-weight: 800; line-height: 1.4; }
.ch08-swing-who span { display: inline-block; margin-right: 8px; padding: 1px 6px; font-size: 0.7rem; color: var(--card); background: var(--ink); border-radius: 3px; vertical-align: 2px; }
.ch08-swing-how { margin: 4px 0 10px; font-size: 0.84rem; line-height: 1.6; }
.ch08-swing-end { margin: 0; padding-top: 8px; border-top: 1px solid var(--rule); font-size: 0.86rem; font-weight: 800; line-height: 1.5; color: var(--red); }
.ch08-swing-end::before { content: "→ "; }
@media (min-width: 700px) {
  .ch08-swing-panels { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
}

/* ---------------------------------------------------------- 図：天明の飢饉を数字で（共通の .stats を2列のまま使う） */
@media (min-width: 700px) {
  .ch08-stats .stats-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* 第10章 幕末：金銀の比、両替の一往復、小判の山、改鋳、改鋳の前とあと、生糸の流れ */
/* ---------------------------------------------------------- 図：金と銀の比 */
.ratio { margin: 10px 0 40px; max-width: var(--measure); }
.ratio-row { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); align-items: center; gap: 8px; }
.ratio-row + .ratio-row { margin-top: 14px; }
.ratio-lbl { margin: 0; font-family: var(--gothic); font-weight: 700; font-size: 0.92rem; }
.ratio-coins { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; min-width: 0; font-family: var(--gothic); }
.ratio-coins b { color: var(--sub); font-weight: 400; }
.ratio-coins .ag { display: flex; gap: 3px; }
.ratio-coins i { display: block; flex: none; width: 13px; height: 13px; border-radius: 50%; background: var(--ag); box-shadow: inset 0 0 0 1px var(--ag-line); }
.ratio-coins i.au { width: 15px; height: 24px; background: var(--au); box-shadow: inset 0 0 0 1px var(--au-line); }
.ratio-num { font-weight: 700; font-size: 0.9rem; margin-left: 4px; }
@media (min-width: 700px) {
  .ratio-coins i { width: 18px; height: 18px; }
  .ratio-coins i.au { width: 20px; height: 32px; }
  .ratio-coins .ag { gap: 4px; }
}
/* 両替の一往復の図 */
.loop { display: block; width: 100%; max-width: 520px; height: auto; margin-bottom: 18px; overflow: visible; }
.node rect { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; transition: fill 0.2s; }
.node text { fill: var(--ink); font-family: var(--gothic); }
.node .n-place { font-size: 11.5px; fill: var(--sub); }
.n-kind { font-size: 14px; font-weight: 700; }
.n-count { font-weight: 700; font-size: 21px; }
.node.is-now rect { fill: var(--ink); }
.node.is-now text, .node.is-now .n-place { fill: var(--paper); }
.arw path { fill: none; stroke: var(--rule); stroke-width: 2.5; marker-end: url(#ch09-ah); transition: stroke 0.2s; }
.arw text { fill: var(--sub); font-family: var(--gothic); }
.arw-big { font-weight: 700; font-size: 17px; }
.arw-sm { font-size: 11px; }
.ah { fill: var(--rule); }
.ah-on { fill: var(--red); }
.arw.is-next path { stroke: var(--red); marker-end: url(#ch09-ah-on); }
.arw.is-next text { fill: var(--red); }
/* 手元の貨幣 */
.coins { --w: 30px; --g: 6px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: var(--g); min-height: 112px; margin-top: 8px; }
.coins i { display: block; flex: none; width: var(--w); height: var(--w); border-radius: 50%; background: var(--ag); box-shadow: inset 0 0 0 1px var(--ag-line); animation: pop 0.28s ease-out backwards; }
.coins.big.dollar i { box-shadow: inset 0 0 0 1px var(--ag-line), inset 0 0 0 4px var(--ag), inset 0 0 0 5px var(--ag-line); }
.coins.ichibu i { height: calc(var(--w) * 1.5); border-radius: 2px; }
.coins.big.ichibu i { box-shadow: inset 0 0 0 1px var(--ag-line), inset 0 0 0 3px var(--ag), inset 0 0 0 4px var(--ag-line); }
.coins.koban i { height: calc(var(--w) * 1.6); background-color: var(--au); box-shadow: inset 0 0 0 1px var(--au-line); }
.coins.big.koban i { background-image: repeating-linear-gradient(0deg, transparent 0 3px, rgba(60, 40, 0, 0.22) 3px 4px); }
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(0.6); } }
/* 小判の山：33列×11段＝363枚 */
.vault-grid { display: grid; grid-template-columns: repeat(33, minmax(0, 1fr)); gap: 2px; max-width: 400px; }
.vault-grid i { display: block; aspect-ratio: 5 / 8; border-radius: 50%; background: var(--au); box-shadow: inset 0 0 0 1px var(--au-line); transition: background-color 0.25s, box-shadow 0.25s; }
.vault-grid i.out { background: transparent; box-shadow: inset 0 0 0 1px var(--empty); }
/* 往復の記録 */
.ledger { list-style: none; margin: 22px 0 0; padding: 12px 0 0; border-top: 1px solid var(--rule); display: grid; grid-template-columns: repeat(6, auto); justify-content: space-between; gap: 4px; }
.ledger li { display: grid; color: var(--empty); transition: color 0.3s; }
.ledger li.on { color: var(--ink); }
.ledger li.on:last-child { color: var(--red); }
.ledger b { font-size: clamp(1.05rem, 5vw, 1.8rem); font-variant-numeric: tabular-nums; line-height: 1.15; }
.ledger span { font-size: 0.68rem; }
.ledger li.on span { color: var(--sub); }
.mint-top { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 22px; align-items: center; }
.koban-stage { position: relative; width: 88px; height: 164px; }
.koban-ghost { position: absolute; inset: 0; border: 1.5px dashed var(--sub); border-radius: 50% / 27%; }
.koban-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  border-radius: 50% / 27%; transform: scale(var(--s, 1)); transform-origin: center;
  transition: transform 0.12s linear;
}
.mint-ctl .count { margin-bottom: 0; }
/* 米俵 */
.bales { display: flex; gap: 3px; }
.bales i { display: block; width: 12px; height: 19px; border-radius: 5px / 4px; background: var(--rice); box-shadow: inset 0 5px 0 -4px var(--rice-line), inset 0 -5px 0 -4px var(--rice-line); transition: background-color 0.2s; }
.bales i.out { background: transparent; box-shadow: inset 0 0 0 1px var(--empty); }

/* ---------------------------------------------------------- 図：外国の商人の両替の一往復
 * 1〜4の手順を、手元の貨幣の絵と枚数で並べる。丸い銀はメキシコドル、四角い銀は一分銀、金の楕円は小判。
 * 最後の段（上海）は赤。狭い画面では手順を縦に、広い画面では横に並べる。 */
.ch09-swap { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
.ch09-swap-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.ch09-swap-list li { display: grid; grid-template-columns: minmax(0, 1fr) 118px; column-gap: 12px; row-gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.ch09-swap-step { grid-column: 1; margin: 0; font-size: 0.86rem; font-weight: 800; line-height: 1.4; }
.ch09-swap-step span { display: inline-grid; place-items: center; width: 1.5em; height: 1.5em; margin-right: 6px; font-size: 0.76rem; color: var(--card); background: var(--ink); border-radius: 50%; }
.ch09-swap-coins { grid-column: 2; grid-row: 1 / span 3; align-self: center; display: flex; flex-wrap: wrap; align-items: center; gap: 3px; margin: 0; }
.ch09-swap-num { grid-column: 1; margin: 0; font-size: 0.84rem; line-height: 1.4; }
.ch09-swap-num b { font-size: 1.3rem; font-weight: 800; }
.ch09-swap-note { grid-column: 1; margin: 0; font-size: 0.74rem; line-height: 1.5; color: var(--sub); }
.ch09-swap-end .ch09-swap-step span { background: var(--red); }
.ch09-swap-end .ch09-swap-num b, .ch09-swap-end .ch09-swap-note { color: var(--red); font-weight: 700; }
.ch09-swap-end .ch09-swap-num b { font-weight: 800; }
.ch09-dollar { display: block; flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--ag); box-shadow: inset 0 0 0 1px var(--ag-line); }
.ch09-ichibu { display: block; flex: none; width: 9px; height: 14px; border-radius: 1px; background: var(--ag); box-shadow: inset 0 0 0 1px var(--ag-line); }
.ch09-koban { display: block; flex: none; width: 14px; height: 22px; border-radius: 50%; background: var(--au); box-shadow: inset 0 0 0 1px var(--au-line); }
.ch09-swap-loop { margin: 8px 0 0; font-size: 0.8rem; font-weight: 700; line-height: 1.5; color: var(--red); }
@media (min-width: 700px) {
  .ch09-swap-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 24px; padding-top: 10px; }
  .ch09-swap-list li { position: relative; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 52px auto auto; align-content: start; row-gap: 6px; padding: 0 0 10px; border-bottom: 0; }
  .ch09-swap-step, .ch09-swap-num, .ch09-swap-note, .ch09-swap-coins { grid-column: 1; grid-row: auto; }
  .ch09-swap-coins { align-self: end; align-content: flex-end; }
  .ch09-swap-list li + li::before { content: "→"; position: absolute; left: -18px; top: 0.1em; font-size: 0.9rem; font-weight: 700; color: var(--sub); }
}

/* ---------------------------------------------------------- 図：万延の改鋳の前とあと
 * 同じ項目で前とあとを並べる。金の量は小判の色の棒（イメージ）。最後の行が結論で、蛍光ペンの色。 */
.ch09-mint { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
.ch09-mint-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.ch09-mint-table th, .ch09-mint-table td { padding: 9px 6px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: middle; font-size: 0.86rem; line-height: 1.45; }
.ch09-mint-table thead th { font-size: 0.82rem; font-weight: 800; border-bottom: 2px solid var(--ink); vertical-align: bottom; }
.ch09-mint-table thead th:first-child { width: 34%; }
.ch09-mint-table tbody th { padding-left: 0; font-size: 0.78rem; font-weight: 700; color: var(--sub); }
.ch09-mint-table td { font-weight: 700; }
.ch09-mint-table th small, .ch09-mint-table td small { display: block; margin-top: 2px; font-size: 0.7rem; font-weight: 700; color: var(--sub); }
.ch09-mint-table thead th:last-child, .ch09-mint-table td:last-child { padding-left: 10px; border-left: 2px solid var(--ink); }
.ch09-mint-bar { display: block; height: 12px; width: calc(var(--v) * 1%); min-width: 6px; margin: 2px 0 4px; background: var(--au); box-shadow: inset 0 0 0 1px var(--au-line); }
.ch09-mint-key th, .ch09-mint-key td { background: var(--marker); }
.ch09-mint-key th { padding-left: 6px; color: var(--ink); }

/* ---------------------------------------------------------- 図：生糸の流れ（開港の前とあと）
 * 上が開港の前、下があと。行き先（横浜）は赤い枠。狭い画面では縦に積み、広い画面では横に流す。 */
.ch09-silk { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
.ch09-silk-set { padding: 10px 0 12px; border-top: 2px solid var(--ink); }
.ch09-silk-set + .ch09-silk-set { margin-top: 8px; }
.ch09-silk-ttl { margin: 0 0 10px; font-size: 0.95rem; font-weight: 800; line-height: 1.4; }
.ch09-silk-ttl small { margin-left: 8px; font-size: 0.72rem; font-weight: 700; color: var(--sub); }
.ch09-silk-flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.ch09-silk-flow li { position: relative; padding: 8px 10px; background: var(--card); border: 1px solid var(--rule); border-radius: 6px; }
.ch09-silk-flow b { display: block; font-size: 0.92rem; font-weight: 800; line-height: 1.4; }
.ch09-silk-flow span { display: block; font-size: 0.76rem; line-height: 1.5; color: var(--sub); }
.ch09-silk-flow li + li::before { content: "↓"; position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 0.95rem; font-weight: 700; color: var(--sub); }
.ch09-silk-to { border: 2px solid var(--red); }
.ch09-silk-to b { color: var(--red); }
.ch09-silk-lost { margin: 10px 0 0; padding: 6px 10px; font-size: 0.84rem; font-weight: 700; line-height: 1.5; color: var(--red); background: var(--red-bg); border-left: 3px solid var(--red); }
@media (min-width: 700px) {
  .ch09-silk-flow { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 28px; }
  .ch09-silk-flow li + li::before { content: "→"; top: 50%; left: -21px; transform: translateY(-50%); }
}


/* 第11章 1860・70年代：年貢と地租の表、米の値段と売る米の量 */
/* ---------------------------------------------------------- 図：年貢と地租 */
#ch10 .ch10-cmp { margin: 8px 0 40px; max-width: 46em; }
#ch10 .ch10-cmp table {
  width: 100%; table-layout: fixed; border-collapse: collapse; border-top: 2px solid var(--ink);
  font-family: var(--gothic); font-size: 0.88rem; line-height: 1.6; letter-spacing: 0.02em;
}
#ch10 .ch10-cmp th, #ch10 .ch10-cmp td { padding: 10px 12px 10px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
#ch10 .ch10-cmp thead th, #ch10 .ch10-cmp thead td { border-bottom: 1px solid var(--ink); }
#ch10 .ch10-cmp thead td { width: 6em; }
#ch10 .ch10-cmp tbody th { font-size: 0.78rem; font-weight: 400; color: var(--sub); }
#ch10 .ch10-cmp tbody td:last-child { font-weight: 700; }
#ch10 .ch10-cmp small { display: block; font-size: 0.78rem; font-weight: 400; color: var(--sub); }

/* ---------------------------------------------------------- 図：米の値段と、同じ地租を払うのに売る米の量（イメージ図）
 * 上の段は米の値段、下の段は同じ額の地租を払うのに売る米の量。色を付けた帯は、米が高く売れた1878〜80年。 */
.ch10-wave { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
.ch10-wave svg { display: block; width: 100%; max-width: 560px; height: auto; padding-top: 8px; border-top: 2px solid var(--ink); }
.ch10-wave-band { fill: var(--tint); }
.ch10-wave-axis { fill: none; stroke: var(--sub); stroke-width: 1; }
.ch10-wave-rice { fill: none; stroke: var(--rice-line); stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.ch10-wave-sell { fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.ch10-wave-dot { fill: var(--red); }
.ch10-wave-ttl { font-family: var(--gothic); font-size: 12px; font-weight: 700; fill: var(--ink); }
.ch10-wave-txt { font-family: var(--gothic); font-size: 10.5px; fill: var(--sub); }
.ch10-wave-red { font-family: var(--gothic); font-size: 11px; font-weight: 700; fill: var(--red); }


/* 第12章 1880年代：お札の量と米の値段（扉）、小作人になるまでの流れ */
/* ---------------------------------------------------------- 図1（扉）：お札の量と米の値段（イメージ図）
 * 上の段はお札の量、下の段は米の値段。色を付けた帯は、お札を減らした1881〜85年。 */
.ch11-wave svg { display: block; width: 100%; max-width: 620px; height: auto; padding-top: 8px; border-top: 2px solid var(--ink); font-family: var(--gothic); }
.ch11-wave-band { fill: var(--tint); }
.ch11-wave-axis { fill: none; stroke: var(--sub); stroke-width: 1; }
.ch11-wave-bill { fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.ch11-wave-rice { fill: none; stroke: var(--rice-line); stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.ch11-wave-dot { fill: var(--red); }
.ch11-wave-ttl { font-family: var(--gothic); font-size: 12px; font-weight: 700; fill: var(--ink); }
.ch11-wave-num { font-family: var(--gothic); font-size: 11px; font-weight: 700; fill: var(--ink); }
.ch11-wave-txt { font-family: var(--gothic); font-size: 10.5px; fill: var(--sub); }
.ch11-wave-red { font-family: var(--gothic); font-size: 11px; font-weight: 700; fill: var(--red); }
.ch11-wave-band-txt { font-family: var(--gothic); font-size: 10.5px; font-weight: 700; fill: var(--ink); }

/* ---------------------------------------------------------- 図：田畑を持つ農民が小作人になるまで
 * 上から下へ1段ずつ進む。最後の段（小作人）は赤い線で区切る。 */
.ch11-fall { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
.ch11-fall-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); counter-reset: ch11-fall; }
.ch11-fall-list li { position: relative; padding: 10px 0 10px 2.2em; border-bottom: 1px solid var(--rule); counter-increment: ch11-fall; }
.ch11-fall-list li::before {
  content: counter(ch11-fall); position: absolute; left: 0; top: 10px;
  width: 1.5em; height: 1.5em; border-radius: 50%; background: var(--ink); color: var(--card);
  font-size: 0.78rem; font-weight: 700; line-height: 1.5em; text-align: center;
}
.ch11-fall-step { margin: 0; font-size: 0.95rem; font-weight: 800; line-height: 1.45; }
.ch11-fall-note { margin: 2px 0 0; font-size: 0.8rem; line-height: 1.55; color: var(--sub); }
.ch11-fall-end { border-bottom: 2px solid var(--red); }
.ch11-fall-end::before { background: var(--red); }
.ch11-fall-end .ch11-fall-step { color: var(--red); }
@media (min-width: 700px) {
  .ch11-fall-list li { display: grid; grid-template-columns: 14em minmax(0, 1fr); column-gap: 16px; align-items: baseline; }
  .ch11-fall-note { margin: 0; }
}


/* 第13章（ch12）1890・1900年代：女工の1日、戦費と賠償金、景気の上がり下がり */

/* ---------------------------------------------------------- 図：女工の1日（24時間のうち働いた時間）
 * 帯の全体が24時間。色の付いた所が働いた時間（--v は 0〜100）。目盛りは6時間ごと。いまの法律の決まりは破線の枠で並べる。 */
#ch12 .ch12-day { margin: 10px 0 40px; max-width: var(--measure); font-family: var(--gothic); }
#ch12 .ch12-day-key { margin: 0 0 8px; font-size: 0.74rem; font-weight: 700; line-height: 1.5; color: var(--sub); }
#ch12 .ch12-day-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; row-gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
#ch12 .ch12-day-row:first-of-type { border-top: 2px solid var(--ink); }
#ch12 .ch12-day-lbl { grid-column: 1; margin: 0; font-size: 0.86rem; font-weight: 700; line-height: 1.4; }
#ch12 .ch12-day-note { grid-column: 2; grid-row: 1; margin: 0; font-size: 0.95rem; font-weight: 800; line-height: 1.4; text-align: right; }
#ch12 .ch12-day-bar {
  grid-column: 1 / -1; position: relative; height: 18px; border: 1.5px solid var(--ink);
  background-image: linear-gradient(90deg, transparent calc(25% - 1px), var(--rule) calc(25% - 1px), var(--rule) 25%, transparent 25%, transparent calc(50% - 1px), var(--rule) calc(50% - 1px), var(--rule) 50%, transparent 50%, transparent calc(75% - 1px), var(--rule) calc(75% - 1px), var(--rule) 75%, transparent 75%);
}
#ch12 .ch12-day-bar i { display: block; height: 100%; width: calc(var(--v) * 1%); background: var(--people); }
#ch12 .ch12-day-hard .ch12-day-bar i { background: var(--red); }
#ch12 .ch12-day-hard .ch12-day-note { color: var(--red); }
#ch12 .ch12-day-now .ch12-day-bar { border-style: dashed; border-color: var(--sub); }
#ch12 .ch12-day-now .ch12-day-bar i { background: var(--empty); }
#ch12 .ch12-day-now .ch12-day-lbl, #ch12 .ch12-day-now .ch12-day-note { color: var(--sub); font-weight: 700; }
@media (min-width: 700px) {
  #ch12 .ch12-day-row { grid-template-columns: 10em minmax(0, 1fr) 6.5em; align-items: center; column-gap: 14px; }
  #ch12 .ch12-day-bar { grid-column: 2; grid-row: 1; }
  #ch12 .ch12-day-note { grid-column: 3; }
}

/* ---------------------------------------------------------- 図：日清戦争と日露戦争の戦費と賠償金（四角1つが1億円） */
#ch12 .ch12-war { margin: 8px 0 40px; max-width: 46em; font-family: var(--gothic); letter-spacing: 0.02em; }
#ch12 .ch12-war-row { padding: 14px 0 12px; border-top: 1px solid var(--rule); }
#ch12 .ch12-war-row:first-child { border-top: 2px solid var(--ink); }
#ch12 .ch12-war-ttl { margin: 0 0 8px; font-weight: 700; font-size: 0.95rem; line-height: 1.5; }
#ch12 .ch12-war-ttl small { margin-left: 0.8em; font-size: 0.76rem; font-weight: 400; color: var(--sub); }
#ch12 .ch12-war dl { margin: 0; }
#ch12 .ch12-war dl > div { display: grid; grid-template-columns: 3.6em minmax(0, 1fr); align-items: center; gap: 8px; min-height: 34px; }
#ch12 .ch12-war dt { font-size: 0.8rem; color: var(--sub); }
#ch12 .ch12-war dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 0.86rem; }
#ch12 .ch12-oku { display: flex; flex-wrap: wrap; gap: 2px; }
#ch12 .ch12-oku i { display: block; flex: none; width: 12px; height: 12px; background: var(--ink); }
#ch12 .ch12-oku-in i { background: var(--au); box-shadow: inset 0 0 0 1px var(--au-line); }
#ch12 .ch12-oku i.ch12-part { width: 2px; }
#ch12 .ch12-zero { font-size: 1.5rem; line-height: 1.2; color: var(--red); }
#ch12 .ch12-war figcaption { margin-top: 2px; padding-top: 10px; border-top: 1px solid var(--ink); }
@media (min-width: 700px) {
  #ch12 .ch12-oku i { width: 18px; height: 18px; }
  #ch12 .ch12-oku i.ch12-part { width: 2px; }
  #ch12 .ch12-oku { gap: 4px; }
}

/* ---------------------------------------------------------- 図：1890〜1909年の景気（イメージ図）
 * 太い線が景気。点線より上がよい時期、下が悪い時期。色の帯が戦争の期間。恐慌は赤、好景気は墨で添える。 */
#ch12 .ch12-wave { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
#ch12 .ch12-wave svg { display: block; width: 100%; max-width: 560px; height: auto; }
#ch12 .ch12-wave-war { fill: var(--tint); }
#ch12 .ch12-wave-wartx { font-size: 10.5px; font-weight: 700; fill: var(--sub); }
#ch12 .ch12-wave-txt { font-size: 10.5px; fill: var(--sub); }
#ch12 .ch12-wave-mid { fill: none; stroke: var(--rule); stroke-width: 1; stroke-dasharray: 4 4; }
#ch12 .ch12-wave-axis { fill: none; stroke: var(--ink); stroke-width: 1; }
#ch12 .ch12-wave-line { fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
#ch12 .ch12-wave-hard { font-size: 11px; font-weight: 700; fill: var(--red); }
#ch12 .ch12-wave-good { font-size: 11px; font-weight: 700; fill: var(--ink); }


/* 第14章（ch13）1910年代：景気の上がり下がり、米1升の値段 */

/* ---------------------------------------------------------- 図：1907〜1920年の景気（イメージ図）
 * 太い線が景気。点線より上がよい時期、下が悪い時期。色の帯が第一次世界大戦の期間。赤い点が米騒動。 */
#ch13 .ch13-wave { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
#ch13 .ch13-wave svg { display: block; width: 100%; max-width: 560px; height: auto; }
#ch13 .ch13-wave-war { fill: var(--tint); }
#ch13 .ch13-wave-wartx { font-size: 10.5px; font-weight: 700; fill: var(--sub); }
#ch13 .ch13-wave-txt { font-size: 10.5px; fill: var(--sub); }
#ch13 .ch13-wave-mid { fill: none; stroke: var(--rule); stroke-width: 1; stroke-dasharray: 4 4; }
#ch13 .ch13-wave-axis { fill: none; stroke: var(--ink); stroke-width: 1; }
#ch13 .ch13-wave-line { fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
#ch13 .ch13-wave-dot { fill: var(--red); }
#ch13 .ch13-wave-hard { font-size: 11px; font-weight: 700; fill: var(--red); }
#ch13 .ch13-wave-good { font-size: 11px; font-weight: 700; fill: var(--ink); }

/* ---------------------------------------------------------- 図：米1升の値段（すべての棒を同じ目盛りでそろえる。--v は 0〜100）
 * 上の組は春と8月、下の組は神戸の8月の1週間。値上がりした後の棒は赤。 */
#ch13 .ch13-rice { margin: 10px 0 40px; max-width: var(--measure); font-family: var(--gothic); }
#ch13 .ch13-rice-key { margin: 0; padding-bottom: 6px; font-size: 0.8rem; font-weight: 700; line-height: 1.5; border-bottom: 2px solid var(--ink); }
#ch13 .ch13-rice-sub { margin-top: 18px; }
#ch13 .ch13-rice-row { display: grid; grid-template-columns: 4.2em minmax(0, 1fr) 5.4em; align-items: center; column-gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
#ch13 .ch13-rice-lbl { margin: 0; font-size: 0.84rem; font-weight: 700; line-height: 1.4; }
#ch13 .ch13-rice-bar { height: 16px; }
#ch13 .ch13-rice-bar i { display: block; height: 100%; width: calc(var(--v) * 1%); background: var(--rice); box-shadow: inset 0 0 0 1px var(--rice-line); }
#ch13 .ch13-rice-num { margin: 0; font-size: 0.95rem; font-weight: 800; line-height: 1.4; text-align: right; }
#ch13 .ch13-rice-hard .ch13-rice-bar i { background: var(--red); box-shadow: none; }
#ch13 .ch13-rice-hard .ch13-rice-num { color: var(--red); }
#ch13 .ch13-rice figcaption { margin-top: 10px; }


/* 第15章 1920年代（ch14）：景気の上がり下がり、取り付けの仕組み、二百円札 */

/* ---------------------------------------------------------- 図：1914〜1929年の景気の上がり下がり（イメージ）
 * 太い線が景気。赤い点が恐慌の谷。1929年の先は破線で次の章へつなぐ。 */
.ch14-wave { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
.ch14-wave svg { display: block; width: 100%; max-width: 420px; height: auto; overflow: visible; }
.ch14-wave-axis { fill: none; stroke: var(--sub); stroke-width: 1; }
.ch14-wave-line { fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.ch14-wave-next { fill: none; stroke: var(--sub); stroke-width: 2; stroke-dasharray: 5 4; }
.ch14-wave-head { fill: var(--sub); }
.ch14-wave-dot { fill: var(--red); }
.ch14-wave-txt { font-family: var(--gothic); font-size: 10.5px; fill: var(--sub); }
.ch14-wave-key { font-family: var(--gothic); font-size: 11.5px; font-weight: 700; fill: var(--ink); }
.ch14-wave-red { font-family: var(--gothic); font-size: 11px; font-weight: 700; fill: var(--red); }

/* ---------------------------------------------------------- 図：取り付けの仕組み（イメージ）
 * 上の帯は銀行が預かったお金の置き場所（左の黄色が金庫）。下の棒は下ろしに来た額で、点線が金庫にあるお金の額。
 * 狭い画面では2つの日を縦に、広い画面では横に並べる。 */
.ch14-run { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
.ch14-run-panels { display: grid; gap: 22px; }
.ch14-run-panel { padding-top: 8px; border-top: 2px solid var(--ink); }
.ch14-run-ttl { margin: 0 0 10px; font-size: 0.9rem; font-weight: 800; line-height: 1.4; }
.ch14-run-row { display: grid; grid-template-columns: 6.6em minmax(0, 1fr); column-gap: 10px; align-items: center; margin: 0 0 10px; }
.ch14-run-lbl { margin: 0; font-size: 0.74rem; font-weight: 700; line-height: 1.35; color: var(--sub); }
.ch14-run-bank { display: flex; height: 28px; border: 1px solid var(--ink); }
.ch14-run-safe {
  flex: 0 0 calc(var(--v) * 1%); display: flex; align-items: center; justify-content: center;
  background: var(--marker); border-right: 1px solid var(--ink); font-size: 0.68rem; font-weight: 700; color: var(--ink);
}
.ch14-run-lent {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: center; padding-left: 8px;
  background: var(--tint); font-size: 0.7rem; color: var(--sub); white-space: nowrap; overflow: hidden;
}
.ch14-run-ask { position: relative; height: 16px; box-shadow: inset 0 -1px 0 var(--rule); }
.ch14-run-ask i { display: block; height: 100%; width: calc(var(--v) * 1%); background: var(--ink); }
.ch14-run-ask::after { content: ""; position: absolute; top: -6px; bottom: -6px; left: calc(var(--safe) * 1%); border-left: 2px dashed var(--au-line); }
.ch14-run-hard .ch14-run-ttl { color: var(--red); }
.ch14-run-hard .ch14-run-ask i { background: var(--red); }
.ch14-run-out { margin: 4px 0 0; font-size: 0.78rem; font-weight: 700; line-height: 1.5; }
.ch14-run-hard .ch14-run-out { color: var(--red); }
@media (min-width: 700px) {
  .ch14-run-panels { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
}

/* ---------------------------------------------------------- 図版：二百円札の表と裏 */
.ch14-pair { display: grid; gap: 8px; max-width: 620px; }
.ch14-pair img { border: 1px solid var(--rule); }


/* 第16章 1930年代（ch15）：景気と国債の残高、生糸と米の値段、井上財政と高橋財政、国債の日銀引き受け */

/* ---------------------------------------------------------- 図：1929〜1939年の景気と国債の残高（イメージ）
 * 黒い太線が景気、赤い破線が国債の残高。薄く塗った帯が高橋財政の時期。 */
.ch15-wave { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
.ch15-wave-key { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 8px; font-size: 0.76rem; font-weight: 700; line-height: 1.5; }
.ch15-wave-key span { display: inline-flex; align-items: center; gap: 6px; }
.ch15-wave-key span::before { content: ""; width: 26px; height: 0; border-top: 3px solid var(--ink); }
.ch15-wave-key .ch15-wave-k2 { color: var(--red); }
.ch15-wave-key .ch15-wave-k2::before { border-top: 2px dashed var(--red); }
.ch15-wave svg { display: block; width: 100%; max-width: 420px; height: auto; overflow: visible; }
.ch15-wave-band { fill: var(--tint); }
.ch15-wave-axis { fill: none; stroke: var(--sub); stroke-width: 1; }
.ch15-wave-mark { fill: none; stroke: var(--rule); stroke-width: 1; stroke-dasharray: 3 3; }
.ch15-wave-line { fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.ch15-wave-debt { fill: none; stroke: var(--red); stroke-width: 2; stroke-dasharray: 6 4; stroke-linecap: round; }
.ch15-wave-dot { fill: var(--red); }
.ch15-wave-txt { font-family: var(--gothic); font-size: 10.5px; fill: var(--sub); }
.ch15-wave-era { font-family: var(--gothic); font-size: 11px; font-weight: 700; fill: var(--ink); }
.ch15-wave-red { font-family: var(--gothic); font-size: 10.5px; font-weight: 700; fill: var(--red); }

/* ---------------------------------------------------------- 図：生糸と米の値段（1929年＝100）
 * 年ごとの棒。半分近くまで下がった年は赤。狭い画面では2つの品を縦に、広い画面では横に並べる。 */
.ch15-fall { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
.ch15-fall-key { margin: 0 0 8px; font-size: 0.74rem; font-weight: 700; line-height: 1.5; color: var(--sub); }
.ch15-fall-grps { display: grid; gap: 18px; }
.ch15-fall-grp { padding-top: 8px; border-top: 2px solid var(--ink); }
.ch15-fall-ttl { margin: 0 0 6px; font-size: 0.95rem; font-weight: 800; line-height: 1.4; }
.ch15-fall-bars { list-style: none; margin: 0; padding: 0; }
.ch15-fall-bars li { display: grid; grid-template-columns: 4.2em minmax(0, 1fr) 2.6em; column-gap: 10px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--rule); }
.ch15-fall-y { font-size: 0.76rem; font-weight: 700; color: var(--sub); }
.ch15-fall-bar { display: block; height: 16px; }
.ch15-fall-bar i { display: block; height: 100%; width: calc(var(--v) * 1%); background: var(--ink); }
.ch15-fall-rice .ch15-fall-bar i { background: var(--rice); box-shadow: inset 0 0 0 1px var(--rice-line); }
.ch15-fall-bars li.ch15-fall-low .ch15-fall-bar i { background: var(--red); box-shadow: none; }
.ch15-fall-bars b { font-size: 1rem; font-weight: 800; text-align: right; color: var(--ink); }
.ch15-fall-bars li.ch15-fall-low b { color: var(--red); }
@media (min-width: 700px) {
  .ch15-fall-grps { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
}

/* ---------------------------------------------------------- 図：井上財政と高橋財政 */
.ch15-cmp { margin: 8px 0 40px; max-width: 46em; }
.ch15-cmp table {
  width: 100%; table-layout: fixed; border-collapse: collapse; border-top: 2px solid var(--ink);
  font-family: var(--gothic); font-size: 0.88rem; line-height: 1.6; letter-spacing: 0.02em;
}
.ch15-cmp th, .ch15-cmp td { padding: 10px 12px 10px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.ch15-cmp thead th, .ch15-cmp thead td { border-bottom: 1px solid var(--ink); }
.ch15-cmp thead td { width: 6em; }
.ch15-cmp tbody th { font-size: 0.78rem; font-weight: 400; color: var(--sub); }
.ch15-cmp tbody td { font-weight: 700; }
.ch15-cmp small { display: block; font-size: 0.76rem; font-weight: 400; color: var(--sub); }

/* ---------------------------------------------------------- 図：日本銀行が国債を引き受けるしくみ */
.ch15-flowfig { margin: 8px 0 40px; max-width: 46em; }
.ch15-flow { display: block; width: 100%; max-width: 520px; height: auto; overflow: visible; }
.ch15-node rect { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.ch15-node text { fill: var(--ink); font-family: var(--gothic); }
.ch15-n-ttl { font-size: 15px; font-weight: 700; }
.ch15-node .ch15-n-sub { font-size: 11.5px; fill: var(--sub); }
.ch15-arw path { fill: none; stroke: var(--ink); stroke-width: 2; marker-end: url(#ch15-ah); }
.ch15-arw text { fill: var(--sub); font-family: var(--gothic); font-size: 11.5px; }
.ch15-ah { fill: var(--ink); }
.ch15-ah-on { fill: var(--red); }
.ch15-arw-on path { stroke: var(--red); stroke-width: 3; marker-end: url(#ch15-ah-on); }
.ch15-arw-on text { fill: var(--red); font-weight: 700; }


/* 第17章 1940年代（ch16）：物の値段の動き、小作地の割合 */

/* ---------------------------------------------------------- 図：1945〜49年の物の値段の動き（イメージ図）
 * 赤い線が物の値段。縦の破線は、預金封鎖・復興金融金庫・ドッジ・ラインの時期。薄い縦線は各年の1月。 */
.ch16-price { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
.ch16-price-axes { margin: 0 0 4px; font-size: 0.72rem; line-height: 1.5; color: var(--sub); }
.ch16-price svg { display: block; width: 100%; max-width: 420px; height: auto; }
.ch16-price-ax { fill: none; stroke: var(--sub); stroke-width: 1; }
.ch16-price-grid { fill: none; stroke: var(--rule); stroke-width: 1; }
.ch16-price-ev { fill: none; stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 3; }
.ch16-price-line { fill: none; stroke: var(--red); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.ch16-price-lbl { font-family: var(--gothic); font-size: 12px; font-weight: 700; fill: var(--ink); }
.ch16-price-txt { font-family: var(--gothic); font-size: 10.5px; fill: var(--sub); }

/* ---------------------------------------------------------- 図：田畑のうち小作地が占める割合 */
.ch16-tenancy { margin: 10px 0 40px; max-width: var(--measure); }
.ch16-tenancy-row { display: grid; grid-template-columns: 3.6em minmax(0, 1fr) 3.6em; align-items: center; gap: 10px; font-family: var(--gothic); }
.ch16-tenancy-row + .ch16-tenancy-row { margin-top: 12px; }
.ch16-tenancy-lbl { margin: 0; font-weight: 700; font-size: 0.86rem; }
.ch16-tenancy-num { margin: 0; font-weight: 700; font-size: 0.95rem; text-align: right; }
.ch16-tenancy-bar { height: 30px; background: var(--rice); border: 1.5px solid var(--ink); }
.ch16-tenancy-bar i { display: block; height: 100%; width: var(--pct); background: var(--ink); }


/* 第18章 1950年代（ch17）：ドッジ・ラインの仕組み、景気の山と谷、成長が続く仕組み */

/* ---------------------------------------------------------- 図：ドッジ・ラインで不況になった仕組み
 * 上の3段が国のしたこと、下の2つがその結果（左はよくなったこと、右は困ったこと）。 */
.ch17-dodge { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
.ch17-dodge-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; border-top: 2px solid var(--ink); padding-top: 12px; }
.ch17-dodge-steps li { position: relative; padding: 8px 10px; background: var(--ruler-bg); border: 1px solid var(--ruler-line); border-radius: 6px; }
.ch17-dodge-steps li + li::before { content: "↓"; position: absolute; left: 50%; top: -20px; transform: translateX(-50%); font-size: 0.9rem; font-weight: 700; line-height: 1; color: var(--sub); }
.ch17-dodge-when { margin: 0 0 2px; font-size: 0.72rem; font-weight: 700; color: var(--ruler); }
.ch17-dodge-do { margin: 0; font-size: 0.88rem; font-weight: 700; line-height: 1.5; }
.ch17-dodge-out { position: relative; display: grid; gap: 10px; margin-top: 28px; }
.ch17-dodge-out::before { content: "↓"; position: absolute; left: 50%; top: -24px; transform: translateX(-50%); font-size: 0.9rem; font-weight: 700; line-height: 1; color: var(--sub); }
.ch17-dodge-out p { margin: 0; padding: 8px 10px; font-size: 0.86rem; line-height: 1.55; border-left: 4px solid var(--ink); background: var(--card); }
.ch17-dodge-out b { display: block; margin-bottom: 2px; font-size: 0.74rem; color: var(--sub); }
.ch17-dodge-out p.ch17-dodge-bad { border-left-color: var(--red); background: var(--red-bg); }
.ch17-dodge-out .ch17-dodge-bad b { color: var(--red); }
@media (min-width: 700px) {
  .ch17-dodge-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 28px; }
  .ch17-dodge-steps li + li::before { content: "→"; left: -20px; top: 50%; transform: translateY(-50%); }
  .ch17-dodge-out { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
}

/* ---------------------------------------------------------- 図：1949〜61年の景気の山と谷（イメージ図）
 * 線は景気のよしあしのイメージ。下の帯は、黒が好景気、赤が不況。1960年からの破線は次の章。 */
.ch17-wave { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
.ch17-wave-axes { margin: 0 0 4px; font-size: 0.72rem; line-height: 1.5; color: var(--sub); }
.ch17-wave svg { display: block; width: 100%; max-width: 420px; height: auto; }
.ch17-wave-ax { fill: none; stroke: var(--sub); stroke-width: 1; }
.ch17-wave-grid { fill: none; stroke: var(--rule); stroke-width: 1; }
.ch17-wave-line { fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.ch17-wave-next { stroke-dasharray: 5 4; stroke: var(--sub); }
.ch17-wave-good { fill: none; stroke: var(--ink); stroke-width: 4; }
.ch17-wave-bad { fill: none; stroke: var(--red); stroke-width: 4; }
.ch17-wave-txt { font-family: var(--gothic); font-size: 10.5px; fill: var(--sub); }
.ch17-wave-lbl { font-family: var(--gothic); font-size: 10.5px; font-weight: 700; fill: var(--ink); }
.ch17-wave-redtx { fill: var(--red); }

/* ---------------------------------------------------------- 図：成長が続く仕組み（イメージ図）
 * 会社と家庭のあいだを、機械・給料・買い物が回る。家庭の段は民衆の色、国の行は統治する側の色。 */
.ch17-cycle { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
.ch17-cycle-list { list-style: none; margin: 0; padding: 12px 0 0; display: grid; gap: 22px; border-top: 2px solid var(--ink); counter-reset: ch17-cycle; }
.ch17-cycle-list li { position: relative; padding: 8px 10px; background: var(--card); border: 1px solid var(--rule); border-radius: 6px; counter-increment: ch17-cycle; }
.ch17-cycle-list li + li::before { content: "↓"; position: absolute; left: 50%; top: -20px; transform: translateX(-50%); font-size: 0.9rem; font-weight: 700; line-height: 1; color: var(--sub); }
.ch17-cycle-list li.ch17-cycle-home { background: var(--people-bg); border-color: var(--people-line); }
.ch17-cycle-who { margin: 0 0 2px; font-size: 0.72rem; font-weight: 700; color: var(--sub); }
.ch17-cycle-who::before { content: counter(ch17-cycle) "　"; color: var(--ink); }
.ch17-cycle-home .ch17-cycle-who { color: var(--people); }
.ch17-cycle-do { margin: 0; font-size: 0.86rem; font-weight: 700; line-height: 1.5; }
.ch17-cycle-loop { margin: 8px 0 0; font-size: 0.8rem; font-weight: 700; line-height: 1.5; }
.ch17-cycle-gov { margin: 10px 0 0; padding: 8px 10px; font-size: 0.86rem; line-height: 1.55; background: var(--ruler-bg); border-left: 4px solid var(--ruler); }
.ch17-cycle-gov b { margin-right: 0.6em; color: var(--ruler); }
@media (min-width: 700px) {
  .ch17-cycle-list { grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 26px; }
  .ch17-cycle-list li + li::before { content: "→"; left: -19px; top: 50%; transform: translateY(-50%); }
}


/* 第19章 1960年代（ch18）：年度ごとの棒（成長率・国債依存度）、1960年代のお金の回り方 */

/* ---------------------------------------------------------- 図：年度ごとの棒
 * --v は棒の値（%）。図ごとに 1% あたりの高さ（--px）を変える。赤い棒は不況の1965年度。 */
.ch18-bars { margin: 10px 0 40px; max-width: 34em; font-family: var(--gothic); }
#ch18 .opener .ch18-bars { margin: 0 0 8px; }
.ch18-bars-growth { --px: 10px; }
.ch18-bars-debt { --px: 7px; max-width: 26em; }
.ch18-bars-key { margin: 0 0 8px; font-size: 0.76rem; font-weight: 700; line-height: 1.5; color: var(--sub); }
.ch18-bars-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); align-items: end; line-height: 1.3; }
.ch18-bars-debt .ch18-bars-list { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.ch18-bars-list li { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.ch18-bars-list b { margin-bottom: 3px; font-size: 0.7rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.ch18-bars-list i { display: block; width: calc(100% - 6px); max-width: 30px; height: calc(var(--v) * var(--px)); background: var(--ink); }
.ch18-bars-list span { align-self: stretch; padding-top: 6px; border-top: 1.5px solid var(--ink); font-size: 0.64rem; text-align: center; color: var(--sub); font-variant-numeric: tabular-nums; }
.ch18-bars-hard b { color: var(--red); }
.ch18-bars-hard i { background: var(--red); }
@media (min-width: 700px) {
  .ch18-bars-list b { font-size: 0.8rem; }
  .ch18-bars-list span { font-size: 0.74rem; }
}

/* ---------------------------------------------------------- 図：1960年代のお金の回り方
 * 家計（民衆の色）→ 会社 → 国（統治する側の色）と進み、最後の行で最初に戻る。狭い画面では縦に並べる。 */
.ch18-cycle { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
.ch18-cycle-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.ch18-cycle-list li { position: relative; padding: 8px 12px 10px; background: var(--card); border: 1px solid var(--rule); border-radius: 6px; }
.ch18-cycle-list li + li::before {
  content: "↓"; position: absolute; left: 50%; top: -20px; transform: translateX(-50%);
  font-size: 0.9rem; font-weight: 700; line-height: 1; color: var(--sub);
}
.ch18-cycle-who { display: block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; color: var(--sub); }
.ch18-cycle-list p { margin: 2px 0 0; font-size: 0.9rem; font-weight: 700; line-height: 1.5; color: var(--ink); }
.ch18-cycle-list .ch18-cycle-people { background: var(--people-bg); border-color: var(--people-line); }
.ch18-cycle-people .ch18-cycle-who { color: var(--people); }
.ch18-cycle-list .ch18-cycle-ruler { background: var(--ruler-bg); border-color: var(--ruler-line); }
.ch18-cycle-ruler .ch18-cycle-who { color: var(--ruler); }
.ch18-cycle-loop { margin: 10px 0 0; font-size: 0.82rem; font-weight: 700; line-height: 1.5; color: var(--ink); }
@media (min-width: 700px) {
  .ch18-cycle-list { grid-template-columns: repeat(5, minmax(0, 1fr)); column-gap: 24px; }
  .ch18-cycle-list li + li::before { content: "→"; left: -19px; top: 50%; transform: translateY(-50%); }
}


/* 第20章 1970年代（ch19）：国債依存度の棒（扉）、経済成長率と物価の上がり方（上にも下にも伸びる棒） */

/* ---------------------------------------------------------- 図：国債依存度の棒（扉の図）
 * --v は棒の値（%）。1% あたりの高さは --px。赤い棒（.ch19-bars-red）は、赤字国債も出した1975年度から。
 * 10本を同じ幅で並べ、狭い画面でも横にはみ出さない。 */
.ch19-bars { --px: 5px; margin: 10px 0 40px; max-width: 34em; font-family: var(--gothic); }
#ch19 .opener .ch19-bars { margin: 0 0 8px; }
.ch19-bars-key { margin: 0 0 8px; font-size: 0.76rem; font-weight: 700; line-height: 1.5; color: var(--sub); }
.ch19-bars-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); align-items: end; line-height: 1.3; }
.ch19-bars-list li { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.ch19-bars-list b { margin-bottom: 3px; font-size: 0.7rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink); }
.ch19-bars-list i { display: block; width: calc(100% - 6px); max-width: 30px; height: calc(var(--v) * var(--px)); background: var(--ink); }
.ch19-bars-list span { align-self: stretch; padding-top: 6px; border-top: 1.5px solid var(--ink); font-size: 0.64rem; text-align: center; color: var(--sub); font-variant-numeric: tabular-nums; }
.ch19-bars-list .ch19-bars-red b { color: var(--red); }
.ch19-bars-list .ch19-bars-red i { background: var(--red); }
@media (min-width: 700px) {
  .ch19-bars-list b { font-size: 0.8rem; }
  .ch19-bars-list span { font-size: 0.74rem; }
}

/* ---------------------------------------------------------- 図：経済成長率と物価の上がり方
 * 2段（成長率、物価）を、同じ縮尺（1% あたり --px）で上下に並べる。--v は値の大きさ（%）。
 * 0% の線が各段の中ほどにあり、プラスの棒（.ch19-swing-up）は線の上へ、マイナスの棒（.ch19-swing-down）は線の下へ伸びる。
 * --top は、その段でいちばん大きいプラスの値（上側の高さを全部の年で揃えるために使う）。
 * 1974年（.ch19-swing-hard）は赤。 */
.ch19-swing { --px: 6px; margin: 12px 0 40px; max-width: 34em; font-family: var(--gothic); }
.ch19-swing-row + .ch19-swing-row { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--rule); }
.ch19-swing-gdp { --top: 9.1; }
.ch19-swing-cpi { --top: 23.2; }
.ch19-swing-ttl { margin: 0 0 8px; font-size: 0.76rem; font-weight: 700; line-height: 1.5; color: var(--sub); }
.ch19-swing-bars { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); line-height: 1.3; }
.ch19-swing-bars li { display: flex; flex-direction: column; align-items: stretch; min-width: 0; }
.ch19-swing-up { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: calc(var(--top) * var(--px) + 22px); border-bottom: 1.5px solid var(--ink); }
.ch19-swing-down { display: flex; flex-direction: column; align-items: center; }
.ch19-swing-gdp .ch19-swing-down { min-height: 26px; }
.ch19-swing-bars b { font-size: 0.7rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink); }
.ch19-swing-up b { margin-bottom: 3px; }
.ch19-swing-down b { margin-top: 3px; }
.ch19-swing-bars i { display: block; width: calc(100% - 6px); max-width: 30px; height: calc(var(--v) * var(--px)); min-height: 3px; background: var(--ink); }
.ch19-swing-y { padding-top: 6px; font-size: 0.64rem; text-align: center; color: var(--sub); font-variant-numeric: tabular-nums; }
.ch19-swing-bars .ch19-swing-hard b { color: var(--red); }
.ch19-swing-bars .ch19-swing-hard i { background: var(--red); }
.ch19-swing-bars .ch19-swing-hard .ch19-swing-y { font-weight: 800; color: var(--red); }
@media (min-width: 700px) {
  .ch19-swing-bars b { font-size: 0.8rem; }
  .ch19-swing-up { height: calc(var(--top) * var(--px) + 24px); }
  .ch19-swing-gdp .ch19-swing-down { min-height: 28px; }
  .ch19-swing-y { font-size: 0.74rem; }
}


/* 第21章（ch20）1980年代：円高で減る輸出の手取り、公定歩合の動き、土地を担保に借りて土地を買うくり返し */

/* ---------------------------------------------------------- 図：円高で減る輸出の手取り
 * アメリカで1万ドルの自動車を売ったときの、円に直した手取りを横棒で並べる。--v は、プラザ合意の前（約240万円）を100とした割合。
 * 棒の外側（空の枠）が、円高で減った分。減ったあとの棒（.ch20-yen-down）は、会社が困った所なので赤。 */
#ch20 .ch20-yen { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
#ch20 .ch20-yen-key { margin: 0 0 8px; font-size: 0.78rem; font-weight: 700; line-height: 1.5; color: var(--sub); }
#ch20 .ch20-yen-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 6px; align-items: end; padding: 10px 0; border-bottom: 1px solid var(--rule); }
#ch20 .ch20-yen-key + .ch20-yen-row { border-top: 2px solid var(--ink); }
#ch20 .ch20-yen-lbl { grid-column: 1; grid-row: 1; margin: 0; font-size: 0.9rem; font-weight: 800; line-height: 1.4; }
#ch20 .ch20-yen-lbl small { display: block; margin-top: 2px; font-size: 0.74rem; font-weight: 400; color: var(--sub); }
#ch20 .ch20-yen-num { grid-column: 2; grid-row: 1; margin: 0; font-size: 1rem; font-weight: 800; line-height: 1.4; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
#ch20 .ch20-yen-bar { grid-column: 1 / -1; grid-row: 2; height: 20px; background: var(--tint); box-shadow: inset 0 0 0 1.5px var(--rule); }
#ch20 .ch20-yen-bar i { display: block; height: 100%; width: calc(var(--v) * 1%); background: var(--ink); }
#ch20 .ch20-yen-down .ch20-yen-bar i { background: var(--red); }
#ch20 .ch20-yen-down .ch20-yen-num { color: var(--red); }
#ch20 .ch20-yen-out { margin: 12px 0 0; padding: 8px 10px; font-size: 0.9rem; font-weight: 800; line-height: 1.5; border-left: 3px solid var(--red); background: var(--red-bg); }
@media (min-width: 700px) {
  #ch20 .ch20-yen-row { grid-template-columns: 11em minmax(0, 1fr) 7em; align-items: center; column-gap: 14px; }
  #ch20 .ch20-yen-bar { grid-column: 2; grid-row: 1; }
  #ch20 .ch20-yen-num { grid-column: 3; grid-row: 1; }
}

/* ---------------------------------------------------------- 図：公定歩合の動き（1983〜90年）
 * 黒い線が公定歩合。色の付いた帯が、2.5%だった時期（1987年2月〜89年5月）。縦の破線がプラザ合意（1985年9月）。
 * 2.5%の数字は赤、ほかの数字は墨。 */
#ch20 .ch20-rate { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
#ch20 .ch20-rate svg { display: block; width: 100%; max-width: 560px; height: auto; overflow: visible; }
#ch20 .ch20-rate-band { fill: var(--ruler-bg); }
#ch20 .ch20-rate-base { fill: none; stroke: var(--ink); stroke-width: 1.5; }
#ch20 .ch20-rate-plaza { fill: none; stroke: var(--sub); stroke-width: 1.2; stroke-dasharray: 4 3; }
#ch20 .ch20-rate-line { fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linejoin: round; }
#ch20 .ch20-rate-txt { fill: var(--sub); font-size: 10.5px; }
#ch20 .ch20-rate-num { fill: var(--ink); font-size: 12px; font-weight: 700; }
#ch20 .ch20-rate-num.ch20-rate-low { fill: var(--red); }

/* ---------------------------------------------------------- 図：土地を担保に借りて土地を買うくり返し（イメージ図）
 * 上から下へ矢印でつなぎ、4つめのあとに「1に戻る」を添える。幅700px以上では4つを横に並べ、
 * 4つめから1つめへ戻る赤い線（.ch20-loop-back の上）を引いて、くり返しの輪にする。 */
#ch20 .ch20-loop { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
#ch20 .ch20-loop-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
#ch20 .ch20-loop-list li {
  position: relative; display: grid; grid-template-columns: 1.8em minmax(0, 1fr); column-gap: 10px; align-items: start;
  padding: 9px 12px 10px; font-size: 0.9rem; font-weight: 700; line-height: 1.5;
  background: var(--card); border: 1px solid var(--rule); border-left: 4px solid var(--ink); border-radius: 4px;
}
#ch20 .ch20-loop-list li + li::before {
  content: "↓"; position: absolute; left: 50%; top: -20px; transform: translateX(-50%);
  font-size: 0.9rem; font-weight: 700; line-height: 1; color: var(--sub);
}
#ch20 .ch20-loop-list b { display: grid; place-items: center; width: 1.8em; height: 1.8em; font-size: 0.82rem; font-weight: 700; line-height: 1; color: var(--card); background: var(--ink); border-radius: 50%; }
#ch20 .ch20-loop-back { position: relative; margin: 12px 0 0; padding: 8px 10px; font-size: 0.9rem; font-weight: 800; line-height: 1.5; color: var(--red); border-left: 3px solid var(--red); background: var(--red-bg); }
@media (min-width: 700px) {
  #ch20 .ch20-loop-list { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 26px; }
  #ch20 .ch20-loop-list li { grid-template-columns: minmax(0, 1fr); row-gap: 8px; }
  #ch20 .ch20-loop-list li + li::before { content: "→"; left: -19px; top: 50%; transform: translateY(-50%); }
  #ch20 .ch20-loop-back { margin-top: 30px; }
  /* 4つめの下から出て、1つめの下へ戻る線。左右の位置は、4つの列の真ん中（列の間は26px×3）に合わせる */
  #ch20 .ch20-loop-back::before {
    content: ""; position: absolute; top: -30px; left: calc((100% - 78px) / 8); right: calc((100% - 78px) / 8); height: 22px;
    border: 2px solid var(--red); border-top: 0; border-radius: 0 0 10px 10px;
  }
  #ch20 .ch20-loop-back::after {
    content: ""; position: absolute; top: -30px; left: calc((100% - 78px) / 8 - 5px);
    border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 9px solid var(--red);
  }
}


/* 第23章（ch22）2000年代：平均の給料と景気の拡大、デフレが続く仕組み、派遣社員の数、金融危機が届くまでの流れ */

/* ---------------------------------------------------------- 図：平均の給料と景気の拡大（扉の図）
 * 色の付いた帯が景気の拡大の期間。折れ線が平均の給料で、最後の点（2009年）だけ赤。 */
#ch22 .ch22-pay { margin: 0 0 40px; max-width: 46em; font-family: var(--gothic); }
#ch22 .ch22-pay svg { display: block; width: 100%; max-width: 560px; height: auto; overflow: visible; }
#ch22 .ch22-pay-band { fill: var(--tint); }
#ch22 .ch22-pay-grid { fill: none; stroke: var(--rule); stroke-width: 1; }
#ch22 .ch22-pay-axis { fill: none; stroke: var(--ink); stroke-width: 1.5; }
#ch22 .ch22-pay-line { fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linejoin: round; }
#ch22 .ch22-pay-dot { fill: var(--ink); }
#ch22 .ch22-pay-low { fill: var(--red); }
#ch22 .ch22-pay-txt { fill: var(--sub); font-size: 10.5px; }
#ch22 .ch22-pay-bandtx { fill: var(--ink); font-size: 12px; font-weight: 700; }
#ch22 .ch22-pay-num { fill: var(--ink); font-size: 12px; font-weight: 700; }
#ch22 .ch22-pay-lowtx { fill: var(--red); }

/* ---------------------------------------------------------- 図：流れ（デフレが続く仕組み・金融危機が届くまで）
 * 上から下へ矢印でつなぐ。最後の段（.ch22-flow-hard）は暮らしが困る所なので赤。
 * .ch22-flow-loop は、幅700px以上で4つを横に並べ、最後に「最初に戻る」を添える。 */
#ch22 .ch22-flow { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
#ch22 .ch22-flow-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
#ch22 .ch22-flow-list li { position: relative; padding: 9px 12px 10px; background: var(--card); border: 1px solid var(--rule); border-left: 4px solid var(--ink); border-radius: 4px; }
#ch22 .ch22-flow-list li + li::before {
  content: "↓"; position: absolute; left: 50%; top: -20px; transform: translateX(-50%);
  font-size: 0.9rem; font-weight: 700; line-height: 1; color: var(--sub);
}
#ch22 .ch22-flow-head { margin: 0; font-size: 0.92rem; font-weight: 800; line-height: 1.45; }
#ch22 .ch22-flow-note { margin: 2px 0 0; font-size: 0.76rem; line-height: 1.5; color: var(--sub); }
#ch22 .ch22-flow-list li.ch22-flow-hard { border-left-color: var(--red); background: var(--red-bg); }
#ch22 .ch22-flow-hard .ch22-flow-head { color: var(--red); }
#ch22 .ch22-flow-back { margin: 10px 0 0; font-size: 0.8rem; font-weight: 700; line-height: 1.5; }
@media (min-width: 700px) {
  #ch22 .ch22-flow-loop .ch22-flow-list { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 26px; }
  #ch22 .ch22-flow-loop .ch22-flow-list li + li::before { content: "→"; left: -19px; top: 50%; transform: translateY(-50%); }
}

/* ---------------------------------------------------------- 図：派遣社員の数（棒）
 * 高さは --v（万人）。いちばん多い2008年は黒、金融危機のあとの2010年は赤の線で囲む。 */
#ch22 .ch22-haken { margin: 10px 0 40px; max-width: var(--measure); font-family: var(--gothic); }
#ch22 .ch22-haken-bars {
  list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  column-gap: 6px; align-items: end; max-width: 32em; line-height: 1.4;
}
#ch22 .ch22-haken-bars li { display: flex; flex-direction: column; min-width: 0; }
#ch22 .ch22-haken-bars b { margin-bottom: 4px; font-size: 1rem; font-variant-numeric: tabular-nums; }
#ch22 .ch22-haken-bars i { display: block; height: calc(var(--v) * 1.3px); background: var(--sub); }
#ch22 .ch22-haken-bars li.ch22-haken-top i { background: var(--ink); }
#ch22 .ch22-haken-bars li.ch22-haken-down i { background: transparent; box-shadow: inset 0 0 0 2px var(--red); }
#ch22 .ch22-haken-bars li.ch22-haken-down b { color: var(--red); }
#ch22 .ch22-haken-bars span { padding-top: 8px; border-top: 1.5px solid var(--ink); font-size: 0.74rem; color: var(--sub); }


/* 第24章（ch23）2010年代：税収と国債で借りたお金（扉）、消費税の税率の階段 */

/* ---------------------------------------------------------- 図：税収と国債で新しく借りたお金（2009〜2019年度、扉の図）
 * 黒い線が税収、赤みの棒が国債で新しく借りたお金。色の付いた帯が景気の拡大の期間。
 * 線の点と数字は、2009年度・2018年度・2019年度だけ。棒の上の赤い数字は、国債の2009年度と2019年度。
 * 下の「消費税8%」「消費税10%」は、税率が上がった年（ruler 色）。SVG の文字は viewBox 換算で10.5px以上。 */
.ch23-tax { margin: 0 0 40px; max-width: 46em; font-family: var(--gothic); }
.ch23-tax-key { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 8px; font-size: 0.76rem; font-weight: 700; line-height: 1.5; }
.ch23-tax-key span { display: inline-flex; align-items: center; gap: 6px; }
.ch23-tax-key span::before { content: ""; flex: none; }
.ch23-tax-kline::before { width: 26px; height: 0; border-top: 3px solid var(--ink); }
.ch23-tax-kbar::before { width: 16px; height: 10px; background: var(--red); opacity: 0.55; }
.ch23-tax-kband::before { width: 16px; height: 10px; background: var(--tint); box-shadow: inset 0 0 0 1px var(--rule); }
.ch23-tax svg { display: block; width: 100%; max-width: 560px; height: auto; overflow: visible; }
.ch23-tax-band { fill: var(--tint); }
.ch23-tax-grid { fill: none; stroke: var(--rule); stroke-width: 1; }
.ch23-tax-axis { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.ch23-tax-bar { fill: var(--red); fill-opacity: 0.55; }
.ch23-tax-line { fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.ch23-tax-dot { fill: var(--ink); stroke: var(--paper); stroke-width: 1.5; }
.ch23-tax-txt { fill: var(--sub); font-size: 10.5px; }
.ch23-tax-bandtx { fill: var(--ink); font-size: 12px; font-weight: 700; }
.ch23-tax-num { fill: var(--ink); font-size: 12px; font-weight: 700; }
.ch23-tax-subnum { fill: var(--red); }
.ch23-tax-mark { fill: var(--ruler); font-size: 10.5px; font-weight: 700; }

/* ---------------------------------------------------------- 図：消費税の税率の階段（3%・5%・8%・10%）
 * 高さは --v（税率の%）。2010年代に上がった8%と10%（.ch23-vat-now）は黒い棒、それより前は薄い灰色の棒。 */
.ch23-vat { margin: 10px 0 40px; max-width: var(--measure); font-family: var(--gothic); }
.ch23-vat-bars {
  list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 10px; align-items: end; max-width: 26em; line-height: 1.4;
}
.ch23-vat-bars li { display: flex; flex-direction: column; min-width: 0; }
.ch23-vat-bars b { margin-bottom: 4px; font-size: 1rem; font-variant-numeric: tabular-nums; }
.ch23-vat-bars i { display: block; height: calc(var(--v) * 13px); background: var(--empty); box-shadow: inset 0 0 0 1px var(--sub); }
.ch23-vat-bars li.ch23-vat-now i { background: var(--ink); box-shadow: none; }
.ch23-vat-bars li.ch23-vat-now b { font-size: 1.2rem; font-weight: 800; }
.ch23-vat-bars span { padding-top: 8px; border-top: 1.5px solid var(--ink); font-size: 0.74rem; color: var(--sub); }

/* ---------------------------------------------------------- 図：3つの税の並べ方（何にかかるか／景気が悪くなると／収入に占める税の割合）
 * ○×の採点にせず、税ごとに3つの見方を短い文で並べる。消費税の行（.ch23-cmp-key）は、この章の主題なので蛍光ペンの色。 */
.ch23-cmp { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
.ch23-cmp-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.ch23-cmp-list > li { padding: 12px 8px 14px; border-bottom: 1px solid var(--rule); }
.ch23-cmp-list > li.ch23-cmp-key { background: var(--marker); }
.ch23-cmp-name { margin: 0 0 8px; font-size: 1.05rem; font-weight: 800; color: var(--ink); }
.ch23-cmp-rows { margin: 0; display: grid; gap: 6px; }
.ch23-cmp-rows > div { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); column-gap: 10px; align-items: baseline; }
.ch23-cmp-rows dt { margin: 0; font-size: 0.74rem; font-weight: 700; line-height: 1.5; color: var(--sub); }
.ch23-cmp-rows dd { margin: 0; font-size: 0.88rem; font-weight: 700; line-height: 1.55; color: var(--ink); }
@media (max-width: 699.98px) { .ch23-cmp-rows > div { grid-template-columns: minmax(0, 1fr); row-gap: 1px; } }


/* 第25章（ch24）2020年代：税収と国債の帯、給料と物価の上がり方、国の家計簿 */

/* ---------------------------------------------------------- 図：税収と新しく借りたお金（扉）
 * 年度ごとに、税収（黄土色）と国債（赤）を横棒で並べる。--v は兆円で、108.6兆円が幅の約65%。
 * 予算の年度（.ch24-debt-plan）は、決算と区別するために破線の枠にする。 */
.ch24-debt { margin: 0 0 40px; max-width: var(--measure); font-family: var(--gothic); }
.ch24-debt-key { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 8px; font-size: 0.76rem; font-weight: 700; line-height: 1.5; }
.ch24-debt-key span { display: inline-flex; align-items: center; gap: 6px; }
.ch24-debt-key span::before { content: ""; width: 16px; height: 10px; }
.ch24-debt-kt::before { background: var(--rice); box-shadow: inset 0 0 0 1px var(--rice-line); }
.ch24-debt-kb::before { background: var(--red); }
.ch24-debt-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.ch24-debt-list li { display: grid; grid-template-columns: 4.6em minmax(0, 1fr); column-gap: 10px; row-gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.ch24-debt-y { grid-column: 1; grid-row: 1 / span 2; align-self: center; margin: 0; font-size: 0.8rem; font-weight: 800; line-height: 1.3; }
.ch24-debt-y small { display: block; font-size: 0.7rem; font-weight: 400; color: var(--sub); }
.ch24-debt-bar { grid-column: 2; display: flex; align-items: center; gap: 6px; margin: 0; min-width: 0; font-size: 0.74rem; line-height: 1.2; }
.ch24-debt-bar i { display: block; flex: none; height: 11px; width: calc(var(--v) * 0.6%); }
.ch24-debt-bar b { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ch24-debt-t i { background: var(--rice); box-shadow: inset 0 0 0 1px var(--rice-line); }
.ch24-debt-b i { background: var(--red); }
.ch24-debt-b b { color: var(--red); }
.ch24-debt-hot .ch24-debt-y { color: var(--red); }
.ch24-debt-hot .ch24-debt-b i { height: 14px; }
.ch24-debt-hot .ch24-debt-b b { font-size: 0.9rem; font-weight: 800; }
.ch24-debt-plan .ch24-debt-bar i { background: transparent; box-shadow: none; border: 1.5px dashed var(--rice-line); }
.ch24-debt-plan .ch24-debt-b i { border-color: var(--red); }
@media (min-width: 700px) {
  .ch24-debt-list li { grid-template-columns: 5.6em minmax(0, 1fr); }
  .ch24-debt-bar { font-size: 0.8rem; }
  .ch24-debt-bar i { height: 13px; }
}

/* ---------------------------------------------------------- 図：給料と物の値段の上がり方
 * 年ごとに、給料（民衆の青）と物価（赤）の前年比を横棒で並べる。縦の線が0%で、棒を描く範囲の左から24%の位置。
 * 1ポイントが範囲の幅の20%（−1.2%〜+3.8%が範囲いっぱい）。--v は前年比（%）で、マイナスは左へ伸ばす。 */
.ch24-wage { margin: 12px 0 40px; max-width: var(--measure); font-family: var(--gothic); }
.ch24-wage-key { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 8px; font-size: 0.74rem; font-weight: 700; line-height: 1.5; }
.ch24-wage-key span { display: inline-flex; align-items: center; gap: 6px; }
.ch24-wage-key span::before { content: ""; width: 16px; height: 10px; }
.ch24-wage-kp::before { background: var(--people); }
.ch24-wage-kc::before { background: var(--red); }
.ch24-wage-k0 { font-weight: 400; color: var(--sub); }
.ch24-wage-key .ch24-wage-k0::before { width: 0; height: 14px; border-left: 1.5px solid var(--ink); }
.ch24-wage-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.ch24-wage-list li { display: grid; grid-template-columns: 3.6em minmax(0, 1fr); column-gap: 8px; row-gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.ch24-wage-y { grid-column: 1; grid-row: 1 / span 3; align-self: center; margin: 0; font-size: 0.8rem; font-weight: 800; line-height: 1.3; }
.ch24-wage-row { grid-column: 2; display: grid; grid-template-columns: 2.4em minmax(0, 1fr) 3.4em; column-gap: 6px; align-items: center; margin: 0; font-size: 0.74rem; line-height: 1.3; }
.ch24-wage-k { color: var(--sub); }
.ch24-wage-track { position: relative; height: 12px; }
.ch24-wage-track::before { content: ""; position: absolute; left: 24%; top: -3px; bottom: -3px; border-left: 1.5px solid var(--ink); }
.ch24-wage-track i {
  position: absolute; top: 1px; bottom: 1px;
  left: calc(24% + min(0%, var(--v) * 20%));
  width: calc(max(var(--v), var(--v) * -1) * 20%);
}
.ch24-wage-pay i { background: var(--people); }
.ch24-wage-price i { background: var(--red); }
.ch24-wage-n { font-weight: 700; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ch24-wage-real { grid-column: 2; margin: 2px 0 0; font-size: 0.76rem; font-weight: 800; line-height: 1.4; }
.ch24-wage-minus { color: var(--red); }
@media (min-width: 700px) {
  .ch24-wage-list li { grid-template-columns: 4.4em minmax(0, 1fr) 8.5em; }
  .ch24-wage-real { grid-column: 3; grid-row: 1 / span 2; align-self: center; margin: 0; padding-left: 10px; text-align: right; }
  .ch24-wage-row { font-size: 0.78rem; }
}

/* ---------------------------------------------------------- 図：国の家計簿（2025年度の当初予算）
 * 出ていくお金と入ってくるお金を、それぞれ1本の帯に積む。--v は万円で、帯の中の割合になる。
 * 借金に関わる2つ（国債費と、新しく出す国債）は赤。下の一覧の四角の色が、帯の色と対応する。 */
.ch24-kakei { margin: 12px 0 40px; max-width: 46em; font-family: var(--gothic); }
.ch24-kakei-blocks { display: grid; gap: 24px; }
.ch24-kakei-ttl { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; margin: 0 0 6px; font-size: 0.9rem; font-weight: 800; line-height: 1.4; }
.ch24-kakei-ttl span { font-size: 1.05rem; }
.ch24-kakei-bar { display: flex; height: 26px; margin: 0 0 8px; border: 1.5px solid var(--ink); background: var(--card); }
.ch24-kakei-bar i { display: block; flex: var(--v) 1 0; min-width: 0; }
.ch24-kakei-bar i + i { border-left: 2px solid var(--card); }
.ch24-kakei-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.ch24-kakei-list li { display: grid; grid-template-columns: 12px 5.4em minmax(0, 1fr); column-gap: 8px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--rule); font-size: 0.8rem; line-height: 1.45; }
.ch24-kakei-list li::before { content: ""; align-self: center; width: 12px; height: 12px; }
.ch24-kakei-list b { font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ch24-kakei-bar .ch24-kakei-ss, .ch24-kakei-list .ch24-kakei-ss::before { background: var(--people); }
.ch24-kakei-bar .ch24-kakei-sd, .ch24-kakei-list .ch24-kakei-sd::before { background: var(--red); }
.ch24-kakei-bar .ch24-kakei-sl, .ch24-kakei-list .ch24-kakei-sl::before { background: var(--ruler); }
.ch24-kakei-bar .ch24-kakei-so, .ch24-kakei-list .ch24-kakei-so::before { background: var(--ag); }
.ch24-kakei-bar .ch24-kakei-it, .ch24-kakei-list .ch24-kakei-it::before { background: var(--rice); }
.ch24-kakei-bar .ch24-kakei-io, .ch24-kakei-list .ch24-kakei-io::before { background: var(--ag); }
.ch24-kakei-bar .ch24-kakei-ib, .ch24-kakei-list .ch24-kakei-ib::before { background: var(--red); }
.ch24-kakei-list .ch24-kakei-sd b, .ch24-kakei-list .ch24-kakei-ib b { color: var(--red); }
.ch24-kakei-loan { margin: 14px 0 0; padding: 8px 10px; font-size: 0.84rem; font-weight: 700; line-height: 1.5; border-left: 3px solid var(--red); background: var(--red-bg); }
@media (min-width: 700px) {
  .ch24-kakei-blocks { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
}


/* 終章：2000年分の手とお腹の表、ニュースの問い */

#final .final-ctl { display: grid; gap: 6px 14px; margin: 6px 0 14px; }
#final .final-ctl .lbl { margin-top: 6px; }
@media (min-width: 760px) {
  #final .final-ctl { grid-template-columns: auto minmax(0, 1fr); align-items: center; }
  #final .final-ctl .lbl { margin-top: 0; }
}
#final .final-seg { display: flex; flex-wrap: wrap; gap: 6px; }
#final .final-opt {
  font: inherit; font-size: 0.84rem; font-weight: 700; line-height: 1.3;
  min-height: 40px; padding: 8px 12px; cursor: pointer;
  color: var(--ink); background: var(--card); border: 1px solid var(--ink); border-radius: 6px;
}
#final .final-opt[aria-pressed="true"] { color: var(--card); background: var(--ink); box-shadow: 0 3px 0 var(--red); }

/* 25行あるので、表は枠の中で縦にも動かし、見出しの行を枠の上に止める */
#final .final-scroll { overflow: auto; max-height: min(72vh, 720px); margin-top: 4px; background: var(--card); border: 1px solid var(--rule); border-radius: 10px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
#final .final-table {
  width: 100%; min-width: 820px; border-collapse: collapse;
  font-family: var(--gothic); font-size: 0.8rem; line-height: 1.5;
}
#final .final-table th,
#final .final-table td { padding: 9px 8px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
#final .final-table thead th { position: sticky; top: 0; z-index: 2; background: var(--card); border-bottom: 0; box-shadow: inset 0 -2px 0 var(--ink); white-space: nowrap; font-size: 0.8rem; }
#final .final-table thead small { font-weight: 400; color: var(--sub); }
#final .final-table tbody th { white-space: nowrap; font-weight: 700; }
#final .final-table tbody th a { display: block; font-size: 0.72rem; font-weight: 400; color: var(--sub); text-decoration: none; }
#final .final-table tbody th a:hover { text-decoration: underline; }
#final .final-table tbody tr { background: var(--card); }
#final .final-table tbody tr.final-moving { position: relative; z-index: 1; }

/* 民衆のお腹（5段） */
#final .final-belly { white-space: nowrap; }
#final .final-belly > span:first-child { display: block; font-weight: 700; }
#final .final-bowls { display: flex; gap: 2px; margin-top: 4px; }
#final .final-bowls i { display: block; width: 10px; height: 8px; background: var(--people); }
#final .final-bowls i.final-off { background: transparent; box-shadow: inset 0 0 0 1px var(--empty); }
#final .final-belly-low > span:first-child { color: var(--red); }

/* 手に印を付ける */
#final .final-table[data-hand="take"] td[data-col="take"]:not(:empty),
#final .final-table[data-hand="cut"] td[data-col="cut"]:not(:empty),
#final .final-table[data-hand="print"] td[data-col="print"]:not(:empty),
#final .final-table[data-hand="default"] td[data-col="default"]:not(:empty),
#final .final-table[data-hand="abroad"] td[data-col="abroad"]:not(:empty) {
  background: var(--marker); color: var(--ink); font-weight: 700;
}
#final .final-table[data-hand="take"] th[data-col="take"],
#final .final-table[data-hand="cut"] th[data-col="cut"],
#final .final-table[data-hand="print"] th[data-col="print"],
#final .final-table[data-hand="default"] th[data-col="default"],
#final .final-table[data-hand="abroad"] th[data-col="abroad"] { color: var(--red); }

/* ニュースの問い */
#final .final-qs { max-width: var(--measure); margin: 8px 0 0; border-top: 1px solid var(--ink); }
#final .final-q { border-bottom: 1px solid var(--rule); }
#final .final-q summary {
  display: flex; gap: 0.7em; padding: 14px 0; cursor: pointer; list-style: none;
  font-weight: 700; line-height: 1.6;
}
#final .final-q summary::-webkit-details-marker { display: none; }
#final .final-q summary::before { content: "問"; flex: none; font-family: var(--gothic); color: var(--red); }
#final .final-q[open] summary { padding-bottom: 6px; }
#final .final-q p { margin: 0 0 16px 1.7em; font-family: var(--gothic); font-size: 0.86rem; line-height: 1.8; color: var(--sub); }

#final .final-sources { margin-top: 48px; }
#final .final-sources p:not(.lbl) { font-family: var(--gothic); font-size: 0.8rem; line-height: 1.8; color: var(--sub); }
