/*
 * <共通の見た目 site.css>
 * すべてのページで読み込む。節の順:
 *   1. 色と寸法の変数（明るい表示 / 暗い表示）
 *   2. 土台（body、見出し、リンク、表）
 *   3. サイト共通ヘッダー・パンくず・フッター
 *   4. 総合トップ（科目カード）
 *   5. 物理の目次（分野・章・単元カード）
 *   6. 解説ページ・原理ページの本文部品（導入、囲み、式、図、まとめ、確認問題、原理へのリンク）
 *   7. シミュレーション（simkit.js が作る要素）
 *   8. 図（インライン SVG の色の部品）
 *   9. 前後の単元ナビ
 *  10. 準備中ページ
 * </共通の見た目 site.css>
 */

/* ===== 1. 色と寸法の変数 ===== */
/* 2026-11 のデザイン改修で、ニワトコの配色に改めた。値の根拠は README.md */
/* <色の変数> 明るい表示。値の根拠は Workspace の contrast.py */
:root {
  --bg: #f7f4ec;            /* 花の生成り */
  --surface: #fffdf8;
  --surface-2: #efeadd;
  --fg: #2e1f33;            /* 実の紫黒 */
  --muted: #675d6b;
  --line: #e2dacb;
  --accent: #3f6b4e;        /* 葉の深い緑 */
  --accent-soft: #e3ece2;
  --accent-fg: #ffffff;
  --berry: #7a2e6b;         /* 実の紫（リンク、強調） */
  --berry-soft: #f4e7f0;
  --marker: rgba(212, 225, 87, .55);   /* Wasabi の蛍光ペン */
  --summary-dot: #d4e157;              /* まとめ（濃い札）の上の印 */
  --flower: #fffdf8;                   /* 導入の絵: ニワトコの花 */
  --ball: #2e1f33;                     /* 導入の絵: 物体の塗り */
  --life: #3b6b4a;  --life-soft: #e7efe4;
  --point: #2f5f96; --point-soft: #e6edf5;
  --caution: #a2431b; --caution-soft: #faeadf;
  --think: #7a2e6b; --think-soft: #f4e7f0;
  --deep: #4a3f50;  --deep-soft: #eee9f0;
  --basic: #2f6f73; --adv: #7a2e6b;
  --sim-bg: #fffdf8; --sim-fg: #2e1f33; --sim-muted: #675d6b; --sim-grid: #ece5d6; --sim-ground: #8a6d4b;
  --sim-c1: #2f68a8;  /* Cool Blue */
  --sim-c2: #c24a22;  /* Persimmon */
  --sim-c3: #2f7a4c;  /* Jade */
  --sim-c4: #8a6100;  /* Wasabi を文字に使える濃さまで落とした黄土 */
  --sim-c5: #853876;  /* Plum */
  --sim-c6: #17777e;
  --radius: 18px;
  --shadow: 0 1px 0 rgba(46, 31, 51, .04), 0 10px 30px -12px rgba(46, 31, 51, .18);
  --content: 760px;
  --wide: 1120px;
  --font: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
  color-scheme: light;
  --grain-opacity: .35;
}
/* </色の変数> */
/* <色の変数: 暗い表示> 背景は実の紫黒、文字は花の生成り */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1d1720; --surface: #272029; --surface-2: #322a35; --fg: #ede6d3; --muted: #b7abb9; --line: #3d3341;
    --accent: #9cc3a4; --accent-soft: #243028; --accent-fg: #1d1720;
    --berry: #e0b3d6; --berry-soft: #35233a; --marker: rgba(212, 225, 87, .26); --summary-dot: #3f6b4e; --flower: #ede6d3; --ball: #b7abb9;
    --life: #9cc3a4; --life-soft: #22302a; --point: #9dbee8; --point-soft: #1f2a3a;
    --caution: #f2a27e; --caution-soft: #3a2620; --think: #e0b3d6; --think-soft: #35233a;
    --deep: #d6cbd8; --deep-soft: #2c2430; --basic: #7fd0d4; --adv: #e0b3d6;
    --sim-bg: #221b25; --sim-fg: #ede6d3; --sim-muted: #b7abb9; --sim-grid: #352c38; --sim-ground: #b8956a;
    --sim-c1: #86b4ea; --sim-c2: #ff8f66; --sim-c3: #8fd19e; --sim-c4: #e5c352; --sim-c5: #dda8d2; --sim-c6: #6fd0d6;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 12px 30px -12px rgba(0, 0, 0, .55);
    --grain-opacity: .12;
  }
}
:root[data-theme="dark"] {
  --bg: #1d1720; --surface: #272029; --surface-2: #322a35; --fg: #ede6d3; --muted: #b7abb9; --line: #3d3341;
  --accent: #9cc3a4; --accent-soft: #243028; --accent-fg: #1d1720;
  --berry: #e0b3d6; --berry-soft: #35233a; --marker: rgba(212, 225, 87, .26); --summary-dot: #3f6b4e; --flower: #ede6d3; --ball: #b7abb9;
  --life: #9cc3a4; --life-soft: #22302a; --point: #9dbee8; --point-soft: #1f2a3a;
  --caution: #f2a27e; --caution-soft: #3a2620; --think: #e0b3d6; --think-soft: #35233a;
  --deep: #d6cbd8; --deep-soft: #2c2430; --basic: #7fd0d4; --adv: #e0b3d6;
  --sim-bg: #221b25; --sim-fg: #ede6d3; --sim-muted: #b7abb9; --sim-grid: #352c38; --sim-ground: #b8956a;
  --sim-c1: #86b4ea; --sim-c2: #ff8f66; --sim-c3: #8fd19e; --sim-c4: #e5c352; --sim-c5: #dda8d2; --sim-c6: #6fd0d6;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 12px 30px -12px rgba(0, 0, 0, .55);
  --grain-opacity: .12;
}
/* </色の変数: 暗い表示> */


/* ===== 2. 土台 ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font);
  font-size: 17px; line-height: 1.85; letter-spacing: .01em;
}
img, svg, canvas { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { line-height: 1.4; letter-spacing: .02em; }
h1 { font-size: clamp(1.6rem, 4.5vw, 2.2rem); margin: .2em 0 .4em; }
h2 { font-size: 1.45rem; margin: 2.4em 0 .8em; padding-bottom: .35em; border-bottom: 2px solid var(--line); scroll-margin-top: 16px; }
h3 { font-size: 1.15rem; margin: 1.8em 0 .6em; }
p { margin: .7em 0; }
strong { font-weight: 700; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }
.container { max-width: var(--wide); margin: 0 auto; padding: 0 16px; }
.content { max-width: var(--content); margin: 0 auto; padding: 0 16px 48px; }
.data-table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: .95em; background: var(--surface); }
.data-table th, .data-table td { border: 1px solid var(--line); padding: .5em .7em; text-align: left; vertical-align: top; }
.data-table th { background: var(--surface-2); }
.table-wrap { overflow-x: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ===== 3. サイト共通ヘッダー・パンくず・フッター ===== */
#site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header-inner { max-width: var(--wide); margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 12px; }
.site-brand { font-weight: 800; font-size: 1.1rem; color: var(--fg); text-decoration: none; letter-spacing: .04em; }
.site-brand::before { content: ""; display: inline-block; width: .9em; height: .9em; margin-right: .45em; border-radius: 50%; vertical-align: -.08em;
  background: conic-gradient(var(--sim-c1) 0 25%, var(--sim-c3) 0 50%, var(--sim-c4) 0 75%, var(--sim-c2) 0); }
.breadcrumb { max-width: var(--wide); margin: 0 auto; padding: 0 16px 10px; font-size: .85rem; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .2em .5em; margin: 0; padding: 0; }
.breadcrumb li + li::before { content: "›"; color: var(--muted); margin-right: .5em; }
.breadcrumb span[aria-current] { color: var(--muted); }
#site-footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 24px 16px 40px; text-align: center; color: var(--muted); font-size: .85rem; }
#site-footer p { margin: .2em 0; }

/* ===== 4. 総合トップ ===== */
.top-hero { padding: 56px 0 28px; }
.top-hero h1 { font-size: clamp(1.9rem, 6vw, 2.8rem); margin-bottom: .2em; }
.top-hero .lead { font-size: 1.1rem; color: var(--muted); max-width: 40em; }
.top-section-title { font-size: 1.2rem; border: 0; margin: 1.6em 0 .6em; padding: 0; }
.subject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.subject-card {
  display: flex; flex-direction: column; gap: 8px; padding: 22px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--fg); text-decoration: none; min-height: 190px;
  border-top: 6px solid var(--accent); transition: transform .15s ease, box-shadow .15s ease;
}
.subject-card:hover { transform: translateY(-2px); }
.subject-card.is-soon { border-top-color: var(--line); opacity: .8; }
.subject-title { font-size: 1.5rem; font-weight: 800; }
.subject-summary { color: var(--muted); font-size: .95rem; flex: 1; }
.subject-fields { display: flex; flex-wrap: wrap; gap: 6px; }
.subject-status { font-weight: 700; color: var(--accent); font-size: .95rem; }
.subject-card.is-soon .subject-status { color: var(--muted); }
.tag { display: inline-block; font-size: .78rem; padding: .1em .6em; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 1em 0; }
.how-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.how-item h3 { margin: 0 0 .3em; font-size: 1.02rem; }
.how-item p { margin: 0; color: var(--muted); font-size: .93rem; }

/* ===== 5. 物理の目次 ===== */
.subject-hero { padding: 36px 0 8px; }
.subject-hero .lead { color: var(--muted); max-width: 44em; }
.field-jump { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 0; background: var(--bg); border-bottom: 1px solid var(--line); }
.field-jump a { padding: .25em .9em; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--fg); font-weight: 600; font-size: .92rem; }
.field-section { padding-top: 12px; scroll-margin-top: 60px; }
.field-head h2 { margin-bottom: .2em; }
.field-summary { color: var(--muted); margin: 0; }
.field-progress { font-size: .85rem; color: var(--muted); margin: .2em 0 0; }
.chapter-title { font-size: 1.02rem; color: var(--muted); margin: 1.6em 0 .6em; }
.unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.unit-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.unit-card.is-soon { background: var(--surface-2); box-shadow: none; }
.unit-title { margin: .25em 0 .3em; font-size: 1.08rem; }
.unit-title a { color: var(--fg); text-decoration: none; }
.unit-title a:hover { color: var(--accent); }
.unit-learn { margin: 0 0 12px; padding-left: 1.2em; font-size: .9rem; color: var(--muted); line-height: 1.7; flex: 1; }
.unit-links { display: flex; flex-wrap: wrap; gap: 8px; }
.course { font-size: .72rem; font-weight: 700; padding: .1em .55em; border-radius: 4px; border: 1px solid currentColor; }
.course-basic { color: var(--basic); }
.course-adv { color: var(--adv); }
.btn { display: inline-block; padding: .38em .9em; border-radius: 8px; font-size: .9rem; font-weight: 700; text-decoration: none; border: 1px solid var(--accent); cursor: pointer; font-family: inherit; line-height: 1.5; }
.btn-primary { background: var(--accent); color: var(--accent-fg); }
.btn-ghost { background: transparent; color: var(--accent); }
.unit-card.is-soon .btn-primary { background: transparent; color: var(--muted); border-color: var(--line); }

/* ===== 6. 解説ページ・原理ページの本文部品 ===== */
/* <導入> */
.lesson-hero { padding: 28px 0 8px; }
.lesson-hero .unit-kicker { font-size: .85rem; color: var(--muted); font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lesson-hero .lead { font-size: 1.08rem; }
.principle-page .lesson-hero { border-bottom: 1px dashed var(--line); }
.badge-principle { display: inline-block; background: var(--deep); color: var(--bg); font-size: .75rem; font-weight: 700; padding: .1em .6em; border-radius: 4px; }
/* <この単元で学ぶこと> */
.learn-box { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--accent); border-radius: var(--radius); padding: 14px 20px; margin: 18px 0; }
.learn-box h2 { border: 0; margin: 0 0 .3em; padding: 0; font-size: 1.05rem; }
.learn-box ul { margin: 0; padding-left: 1.3em; }
/* <このページの内容> */
#page-toc { background: var(--surface-2); border-radius: var(--radius); padding: 12px 20px; margin: 18px 0; font-size: .93rem; }
.page-toc-title { font-weight: 700; margin: 0 0 .2em; }
#page-toc ol { margin: 0; padding-left: 1.4em; columns: 2 260px; }
/* <囲み> 身近な例 / ポイント / 注意 / 考えてみよう / 原理ページの「前提」 */
.callout { border-radius: var(--radius); padding: 14px 18px; margin: 1.2em 0; border: 1px solid transparent; }
.callout > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }
.callout-title { font-weight: 800; display: flex; align-items: center; gap: .45em; margin-bottom: .3em; }
.callout-title::before { font-size: 1.1em; }
.callout-life { background: var(--life-soft); border-color: color-mix(in srgb, var(--life) 30%, transparent); }
.callout-life .callout-title { color: var(--life); }
.callout-life .callout-title::before { content: "🏠"; }
.callout-point { background: var(--point-soft); border-color: color-mix(in srgb, var(--point) 30%, transparent); }
.callout-point .callout-title { color: var(--point); }
.callout-point .callout-title::before { content: "💡"; }
.callout-caution { background: var(--caution-soft); border-color: color-mix(in srgb, var(--caution) 30%, transparent); }
.callout-caution .callout-title { color: var(--caution); }
.callout-caution .callout-title::before { content: "⚠️"; }
.callout-think { background: var(--think-soft); border-color: color-mix(in srgb, var(--think) 30%, transparent); }
.callout-think .callout-title { color: var(--think); }
.callout-think .callout-title::before { content: "🤔"; }
.callout-deep { background: var(--deep-soft); border-color: var(--line); }
.callout-deep .callout-title { color: var(--deep); }
.callout-deep .callout-title::before { content: "📐"; }
/* <式の箱> 式と、その言葉での読み方を並べる */
.formula { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 18px; margin: 1.2em 0; overflow-x: auto; }
.formula .formula-name { font-size: .85rem; font-weight: 700; color: var(--muted); margin: 0; }
.formula .formula-words { font-size: .93rem; color: var(--muted); margin: .2em 0 0; }
.formula .katex-display { margin: .4em 0; }
/* <図> */
figure { margin: 1.4em 0; }
.figure { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-align: center; }
.figure svg { width: 100%; height: auto; max-height: 420px; }
figcaption { font-size: .88rem; color: var(--muted); margin-top: .6em; text-align: left; }
.fig-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
/* <手順の段> 原理ページの導出などで番号つきの段を並べる */
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps > li { counter-increment: step; position: relative; padding: 4px 0 4px 2.6em; margin: .6em 0; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: 4px; width: 1.8em; height: 1.8em; border-radius: 50%; background: var(--accent); color: var(--accent-fg); font-weight: 700; text-align: center; line-height: 1.8em; font-size: .9em; }
/* <まとめ> */
.summary { background: var(--surface); border: 2px solid var(--accent); border-radius: var(--radius); padding: 6px 22px 14px; margin: 2em 0; }
.summary h2 { border: 0; margin: .6em 0 .3em; padding: 0; }
.summary ul { padding-left: 1.3em; margin: 0; }
/* <確認問題> */
.quiz { margin: 1.2em 0; }
.quiz-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin: 12px 0; }
.quiz-q { margin: 0 0 .4em; font-weight: 600; }
.quiz-item details { margin-top: .4em; }
.quiz-item summary { cursor: pointer; color: var(--accent); font-weight: 700; }
.quiz-item .quiz-a { border-top: 1px dashed var(--line); margin-top: .5em; padding-top: .5em; }
/* <原理ページへのリンク> */
.principle-link { display: flex; gap: 16px; align-items: center; background: var(--deep-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 2em 0; text-decoration: none; color: var(--fg); }
.principle-link:hover { border-color: var(--accent); }
.principle-link .pl-icon { font-size: 2rem; line-height: 1; }
.principle-link .pl-title { font-weight: 800; display: block; }
.principle-link .pl-desc { color: var(--muted); font-size: .92rem; display: block; }
/* <発展の注記> 原理ページで「読み飛ばしてよい」部分 */
.aside-advanced { border-left: 4px solid var(--think); padding: 4px 0 4px 16px; margin: 1.2em 0; color: var(--fg); }
.aside-advanced::before { content: "発展（読み飛ばしてよい）"; display: block; font-size: .8rem; font-weight: 700; color: var(--think); }
.katex { font-size: 1.08em; }
.katex svg { max-width: none; }   /* \vec の矢印や \sqrt の根号は幅 0 の箱の中の SVG なので、上の max-width を外す */
/* 図の説明文の中の数式は、.figure svg の幅と高さの指定（図そのもの向け）を受けない。KaTeX が属性で与える大きさに戻す */
.figure .katex svg { width: revert; height: revert; max-height: none; min-width: 0; }
.katex-display { overflow-x: auto; overflow-y: hidden; padding: 2px 0; }

/* ===== 7. シミュレーション（simkit.js が作る要素） ===== */
.sim { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 1.6em 0; box-shadow: var(--shadow); }
.sim-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.sim-head .sim-label { font-size: .75rem; font-weight: 800; color: var(--accent-fg); background: var(--accent); padding: .1em .55em; border-radius: 4px; }
.sim-head .sim-title { font-weight: 800; font-size: 1.02rem; }
.sim-howto { font-size: .9rem; color: var(--muted); margin: 0 0 8px; }
.simkit canvas { display: block; width: 100%; height: auto; border-radius: 8px; background: var(--sim-bg); }
.sim-stage { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.sim-graphs { display: grid; gap: 8px; margin-top: 8px; }
.sim-graphs.is-multi { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.sim-graphs canvas { border: 1px solid var(--line); }
.sim-readouts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 0; font-size: .9rem; }
.sim-readout { display: flex; gap: 6px; align-items: baseline; }
.sim-readout dt { color: var(--muted); }
.sim-readout dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.sim-controls { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.sim-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.sim-btn, .sim-speed { font: inherit; font-size: .9rem; padding: .35em .9em; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--fg); cursor: pointer; }
.sim-btn.sim-play { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 700; min-width: 7.5em; }
.sim-btn.sim-play.is-running { background: var(--surface-2); color: var(--fg); border-color: var(--line); }
.sim-params { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 6px 20px; }
.sim-param { display: grid; grid-template-columns: 7.5em minmax(0, 1fr) 5.5em; align-items: center; gap: 8px; font-size: .9rem; }
.sim-param-checkbox { grid-template-columns: auto minmax(0, 1fr); }
.sim-param-select { grid-template-columns: 7.5em minmax(0, 1fr); }
/* 選択欄は、長い選択肢でも列の幅を超えない（隣の欄に食い込まない）。はみ出す文字は省略する */
.sim-param select { font: inherit; padding: .2em .4em; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); min-width: 0; width: 100%; max-width: 100%; text-overflow: ellipsis; }
.sim-param input[type="range"] { width: 100%; accent-color: var(--accent); }
.sim-param-value { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.sim-note { font-size: .85rem; color: var(--muted); margin: 8px 0 0; }
@media (max-width: 520px) {
  .sim { padding: 10px; }
  .sim-param { grid-template-columns: minmax(0, 1fr) 5em; }
  .sim-param .sim-param-label { grid-column: 1 / -1; }
  /* スマホ幅でも、チェックボックスはラベルと同じ行に、選択欄はラベルの下に全幅で置く */
  .sim-param-checkbox { grid-template-columns: auto minmax(0, 1fr); }
  .sim-param-checkbox .sim-param-label { grid-column: auto; }
  .sim-param-select { grid-template-columns: minmax(0, 1fr); }
}

/* ===== 8. 図（インライン SVG の色の部品） ===== */
/* 色は class で付ける（明暗の表示に追従させるため）。f- は塗り、s- は線 */
.diagram text { fill: var(--fg); font-family: var(--font); font-size: 14px; }
.diagram .t-muted { fill: var(--muted); }
.diagram .t-small { font-size: 12px; }
.diagram .t-bold { font-weight: 700; }
.diagram .f-fg { fill: var(--fg); } .diagram .s-fg { stroke: var(--fg); }
.diagram .f-muted { fill: var(--muted); } .diagram .s-muted { stroke: var(--muted); }
.diagram .f-bg { fill: var(--surface); } .diagram .f-soft { fill: var(--surface-2); }
.diagram .s-line { stroke: var(--line); }
.diagram .f-c1 { fill: var(--sim-c1); } .diagram .s-c1 { stroke: var(--sim-c1); }
.diagram .f-c2 { fill: var(--sim-c2); } .diagram .s-c2 { stroke: var(--sim-c2); }
.diagram .f-c3 { fill: var(--sim-c3); } .diagram .s-c3 { stroke: var(--sim-c3); }
.diagram .f-c4 { fill: var(--sim-c4); } .diagram .s-c4 { stroke: var(--sim-c4); }
.diagram .f-c5 { fill: var(--sim-c5); } .diagram .s-c5 { stroke: var(--sim-c5); }
.diagram .f-c6 { fill: var(--sim-c6); } .diagram .s-c6 { stroke: var(--sim-c6); }
.diagram .f-ground { fill: var(--sim-ground); } .diagram .s-ground { stroke: var(--sim-ground); }
.diagram .f-none { fill: none; }
.diagram .text-c1 { fill: var(--sim-c1); } .diagram .text-c2 { fill: var(--sim-c2); } .diagram .text-c3 { fill: var(--sim-c3); }
.diagram .text-c4 { fill: var(--sim-c4); } .diagram .text-c5 { fill: var(--sim-c5); } .diagram .text-c6 { fill: var(--sim-c6); }
/* <g> に付けた文字用の class を、中の text に効かせる。:where() で詳細度を .diagram text と同じにし、
   後に書くことで既定に勝たせる。text 自身に付けた class（.diagram .text-c1 など）のほうが詳細度が高いので、そちらが優先される */
.diagram :where(g.t-muted) text { fill: var(--muted); }
.diagram :where(g.t-small) text { font-size: 12px; }
.diagram :where(g.t-bold) text { font-weight: 700; }
.diagram :where(g.text-c1) text { fill: var(--sim-c1); } .diagram :where(g.text-c2) text { fill: var(--sim-c2); }
.diagram :where(g.text-c3) text { fill: var(--sim-c3); } .diagram :where(g.text-c4) text { fill: var(--sim-c4); }
.diagram :where(g.text-c5) text { fill: var(--sim-c5); } .diagram :where(g.text-c6) text { fill: var(--sim-c6); }

/* ===== 9. 前後の単元ナビ ===== */
#unit-pager { max-width: var(--content); margin: 24px auto 0; padding: 0 16px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.pager-link { display: flex; flex-direction: column; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--fg); min-height: 70px; }
.pager-link.is-empty { visibility: hidden; }
.pager-link:hover { border-color: var(--accent); }
.pager-label { font-size: .8rem; color: var(--muted); }
.pager-title { font-weight: 700; font-size: .95rem; }
.pager-index { text-align: center; }
.pager-next { text-align: right; }
.pager-back { grid-column: 1 / -1; }
@media (max-width: 600px) {
  #unit-pager { grid-template-columns: 1fr 1fr; }
  .pager-index { grid-column: 1 / -1; order: 3; }
}

/* ===== 10. 準備中ページ ===== */
.coming { text-align: center; padding: 72px 16px; max-width: 640px; margin: 0 auto; }
.coming-icon { font-size: 3.2rem; line-height: 1; }
.coming h1 { font-size: 1.6rem; }
.coming .coming-title { display: block; font-size: 1.15rem; color: var(--muted); margin-bottom: .3em; }
.coming-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.coming-actions .btn { font-size: 1rem; padding: .55em 1.3em; }

@media (max-width: 520px) {
  body { font-size: 16px; }
  h2 { font-size: 1.3rem; }
  /* 図（インライン SVG）は縮めすぎると文字が読めないので、最小の幅を持たせ、はみ出す分は図の枠の中で横に送る */
  .figure { overflow-x: auto; padding: 10px; }
  .figure svg { min-width: 460px; }
  .fig-row .figure svg { min-width: 300px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .subject-card { transition: none; }
}

/* ===== 11. デザイン改修（2026-11）: 上の 2〜10 節の見た目を上書きする ===== */
/* ===== 11.1 土台 ===== */
/* <紙の粒> 背景にごく薄いノイズを重ねる。文字の読みやすさを落とさない濃さに留める */
body { position: relative; font-size: 17.5px; line-height: 1.95; font-feature-settings: "palt" 0; }
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .3 0 0 0 .18 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body > * { position: relative; z-index: 1; }
/* </紙の粒> */
h1, h2, h3 { font-feature-settings: "palt" 1; letter-spacing: .04em; }
a { color: var(--berry); }
/* <強調のマーカー> 太字に蛍光ペンの下線。ノートの書き方に寄せる */
main strong { background: linear-gradient(transparent 58%, var(--marker) 58%, var(--marker) 92%, transparent 92%); padding: 0 .1em; }
/* </強調のマーカー> */

/* ===== 11.2 読み進み具合のバーとヘッダー ===== */
/* <読み進み具合のバー> site.js の initProgress() が作り、幅を変える */
.rd-progress { position: fixed; top: 0; left: 0; height: 4px; width: 0; z-index: 50; background: var(--accent); border-radius: 0 4px 4px 0; transition: width .1s linear; }
.rd-progress::after { content: ""; position: absolute; right: -4px; top: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--berry); }
/* </読み進み具合のバー> */
/* <ヘッダー> 白い帯をやめて背景になじませ、サイト名の印をニワトコの実の房にする */
#site-header { background: transparent; border-bottom: 0; }
.site-header-inner { padding-top: 18px; max-width: var(--content); }
.breadcrumb { max-width: var(--content); }
/* 総合トップと科目の目次は本文が広いので、ヘッダーも広い幅にそろえる */
body[data-kind="top"] .site-header-inner, body[data-kind="stage"] .site-header-inner, body[data-kind="subject"] .site-header-inner, body[data-kind="track"] .site-header-inner,
body[data-kind="stage"] .breadcrumb, body[data-kind="subject"] .breadcrumb, body[data-kind="track"] .breadcrumb { max-width: var(--wide); }
.site-brand { font-size: 1.02rem; letter-spacing: .08em; }
/* <ブランドのマーク> ブランドアイコン（assets/brand/icon-64.png。原本は icon.svg、書き出しは scripts/learning_portal/make-icons.mjs）。
   生成りの地を持つ正方形なので、角を丸めた札として置く（暗い表示でも札として見える） */
.site-brand::before {
  width: 1.5em; height: 1.5em; border-radius: .34em; vertical-align: -.42em; margin-right: .55em;
  background: url("../brand/icon-64.png") center / contain no-repeat;
  box-shadow: 0 0 0 1px var(--line);
}
/* </ブランドのマーク> */
.breadcrumb { font-size: .82rem; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--berry); text-decoration: underline; }
/* </ヘッダー> */

/* ===== 11.3 導入 ===== */
/* <導入> 広い画面では文と絵を左右に並べる。この画面の主役は「問い」 */
.rd-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(260px, .85fr); gap: 28px; align-items: start; padding: 40px 0 12px; }
.rd-hero .rd-hero-art { margin-top: 36px; }
.nw { display: inline-block; }
.rd-hero .unit-kicker { font-size: .82rem; color: var(--muted); font-weight: 700; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.rd-hero h1 { font-size: clamp(1.9rem, 4.6vw, 2.9rem); line-height: 1.25; margin: .25em 0 .2em; text-wrap: balance; word-break: auto-phrase; }
.rd-question { font-size: clamp(1.15rem, 3.2vw, 1.45rem); font-weight: 800; line-height: 1.6; margin: .6em 0 .5em; }
.rd-question em { font-style: normal; color: var(--berry); }
.course { border-radius: 999px; padding: .05em .7em; }
.rd-hero-art { margin: 0; }
.rd-hero-art svg { width: 100%; height: auto; display: block; }
/* 絵の色。SVG の class で付け、明暗の表示に従わせる */
.rd-art .a-line { stroke: var(--fg); fill: none; stroke-linecap: round; stroke-linejoin: round; }
.rd-art .a-dash { stroke: var(--muted); fill: none; stroke-dasharray: 2 9; stroke-linecap: round; }
.rd-art .a-ball { fill: var(--ball); }
.rd-art .a-shine { fill: var(--bg); opacity: .8; }
.rd-art .a-leaf { fill: var(--accent); }
.rd-art .a-leaf-line { stroke: var(--surface); fill: none; stroke-linecap: round; }
.rd-art .a-flower { fill: var(--flower); stroke: var(--line); }
.rd-art .a-berry { fill: var(--berry); }
.rd-art .a-berry-line { stroke: var(--berry); fill: none; stroke-linecap: round; stroke-linejoin: round; }
.rd-art .a-accent-line { stroke: var(--accent); fill: none; stroke-linecap: round; stroke-linejoin: round; }
.rd-art .a-ground { stroke: var(--sim-ground); fill: none; stroke-linecap: round; }
.rd-art .a-text { fill: var(--muted); font-family: var(--font); font-size: 13px; font-weight: 700; }
.rd-art .a-text-lg { fill: var(--berry); font-family: var(--font); font-size: 22px; font-weight: 800; }
/* </導入> */
/* <予想のボタン> 選ぶと答えの文が開く。JS がないときは答えの文を最初から出す */
.rd-predict { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; padding: 0; border: 0; }
.rd-predict legend { font-size: .85rem; color: var(--muted); font-weight: 700; margin-bottom: 6px; padding: 0; }
.rd-chip { font: inherit; font-size: .95rem; font-weight: 700; padding: .45em 1.1em; border-radius: 999px; border: 2px solid var(--fg); background: var(--surface); color: var(--fg); cursor: pointer; transition: transform .12s ease; }
.rd-chip:hover { transform: translateY(-1px); }
.rd-chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.rd-chip:focus-visible { outline: 3px solid var(--marker); outline-offset: 2px; }
.rd-reveal { margin: 14px 0 0; padding: 14px 18px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.rd-reveal[hidden] { display: none; }
.rd-reveal .rd-verdict { font-weight: 800; color: var(--accent); margin: 0 0 .2em; }
.rd-reveal .lead { margin: 0; font-size: 1rem; }
/* </予想のボタン> */

/* ===== 11.4 この単元で学ぶこと / このページの内容 ===== */
/* <この単元で学ぶこと> 箇条書きの印をニワトコの実にする */
.learn-box { border: 0; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); padding: 18px 24px; }
.learn-box h2 { font-size: .95rem; color: var(--accent); letter-spacing: .1em; margin: 0 0 .4em; padding: 0; }
.learn-box h2::after { display: none; }
.learn-box ul { list-style: none; padding: 0; }
.learn-box li { position: relative; padding-left: 1.5em; margin: .25em 0; }
.learn-box li::before { content: ""; position: absolute; left: .2em; top: .72em; width: .55em; height: .55em; border-radius: 50%; background: var(--berry); box-shadow: .38em -.3em 0 -.1em var(--berry); }
/* </この単元で学ぶこと> */
/* <このページの内容> 狭い画面では番号つきの札、広い画面では左に固定した目次（site.js の initScrollSpy() が今の節に印を付ける） */
#page-toc { background: transparent; border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 14px 20px; }
#page-toc ol { list-style: none; padding: 0; counter-reset: toc; columns: 2 240px; }
#page-toc li { counter-increment: toc; break-inside: avoid; }
#page-toc li a { display: flex; gap: .6em; color: var(--fg); text-decoration: none; padding: .15em 0; }
#page-toc li a::before { content: counter(toc, decimal-leading-zero); color: var(--accent); font-weight: 800; font-variant-numeric: tabular-nums; }
#page-toc li a:hover { color: var(--berry); }
#page-toc li a.is-current { color: var(--berry); font-weight: 800; }
@media (min-width: 1240px) {
  #page-toc {
    position: fixed; top: 96px; left: max(16px, calc(50% - var(--content) / 2 - 250px)); width: 210px;
    border: 0; padding: 0; margin: 0; font-size: .86rem; z-index: 5;
  }
  #page-toc ol { columns: auto; border-left: 2px solid var(--line); }
  #page-toc li a { padding: .3em 0 .3em 12px; margin-left: -2px; border-left: 2px solid transparent; }
  #page-toc li a.is-current { border-left-color: var(--berry); }
}
/* </このページの内容> */

/* ===== 11.5 見出し、囲み、式、図 ===== */
/* <節の見出し> 節番号と手描きの波線。波線は mask で描き、色は変数に従う */
main { counter-reset: sec; }
main > section:not(.summary):not(.quiz):not(.lesson-hero):not(.learn-box):not(.prereq-group) > h2 { counter-increment: sec; }
h2 { border-bottom: 0; padding-bottom: .5em; position: relative; font-size: clamp(1.35rem, 3.6vw, 1.7rem); margin-top: 3.2em; }
main > section:not(.summary):not(.quiz):not(.lesson-hero):not(.learn-box):not(.prereq-group) > h2::before {
  content: "SECTION " counter(sec, decimal-leading-zero); display: block; font-size: .72rem; font-weight: 800; letter-spacing: .22em; color: var(--accent); margin-bottom: .3em;
}
h2::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 120px; height: 10px; background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 10'%3E%3Cpath d='M2 6 C 14 1, 22 9, 34 5 S 56 1, 68 5 S 92 9, 104 4 S 116 3, 118 5' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 10'%3E%3Cpath d='M2 6 C 14 1, 22 9, 34 5 S 56 1, 68 5 S 92 9, 104 4 S 116 3, 118 5' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat;
}
/* </節の見出し> */
/* <囲み> 絵文字をやめ、種類の名前を札にする。左に太い線 */
.callout { border: 0; border-left: 5px solid currentColor; border-radius: 6px var(--radius) var(--radius) 6px; padding: 16px 20px; }
.callout > p:not(.callout-title) { color: var(--fg); }
.callout-life { color: var(--life); }
.callout-point { color: var(--point); }
.callout-caution { color: var(--caution); }
.callout-think { color: var(--think); }
.callout-deep { color: var(--deep); }
.callout-title { display: inline-flex; font-size: .78rem; letter-spacing: .12em; padding: .15em .8em; border-radius: 999px; background: var(--surface); margin-bottom: .5em; }
.callout-title::before { content: "" !important; width: .5em; height: .5em; border-radius: 50%; background: currentColor; }
/* </囲み> */
/* <式の箱> 式を主役にし、言葉での読み方を下に添える */
.formula { border: 0; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); padding: 14px 22px 16px; position: relative; }
.formula .formula-name { display: inline-block; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: .1em .8em; font-size: .8rem; }
.formula .katex-display { margin: .7em 0 .5em; }
.formula .katex { font-size: 1.22em; }
.formula .formula-words { border-top: 1.5px dashed var(--line); padding-top: .55em; }
/* </式の箱> */
/* <図> 枠線をやめて影で浮かせる */
.figure { border: 0; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
figcaption { font-size: .86rem; line-height: 1.75; }
/* </図> */

/* ===== 11.6 シミュレーション ===== */
/* <シミュレーション> 広い画面では本文より横に広げ、操作の部品を大きくする */
.sim { border: 0; border-radius: 22px; box-shadow: var(--shadow); padding: 18px; }
@media (min-width: 900px) {
  .sim { margin-left: calc(50% - min(470px, 50vw - 24px)); margin-right: calc(50% - min(470px, 50vw - 24px)); padding: 22px 26px; }
}
/* 左に目次を固定する幅では、左へは広げず右へだけ広げる（目次と重ねない） */
@media (min-width: 1240px) {
  .sim { margin-left: -12px; margin-right: -200px; }
}
.sim-head .sim-label { background: var(--berry); color: var(--surface); border-radius: 999px; padding: .1em .75em; letter-spacing: .08em; }
.sim-head .sim-title { font-size: 1.08rem; }
.sim-stage, .sim-graphs canvas { border-color: var(--line); border-radius: 12px; }
.sim-btn, .sim-speed { border-radius: 999px; padding: .45em 1.1em; background: var(--surface-2); border-color: transparent; }
.sim-btn.sim-play { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.sim-btn.sim-play.is-running { background: var(--surface); border-color: var(--accent); color: var(--accent); }
.sim-param input[type="range"] { accent-color: var(--berry); }
.sim-readouts { background: var(--surface-2); border-radius: 12px; padding: 8px 14px; }
/* </シミュレーション> */

/* ===== 11.7 まとめ、確認問題、原理ページへのリンク、前後ナビ、フッター ===== */
/* <まとめ> ページの終わりの主役。色を反転させた濃い札にする */
.summary { background: var(--fg); color: var(--bg); border: 0; border-radius: 24px; padding: 10px 28px 22px; }
.summary h2 { color: var(--bg); margin-top: .8em; }
.summary h2::after { background: var(--summary-dot); }
.summary strong { background: none; }
.summary ul { list-style: none; padding: 0; }
.summary li { position: relative; padding-left: 1.5em; margin: .5em 0; }
.summary li::before { content: ""; position: absolute; left: .2em; top: .75em; width: .55em; height: .55em; border-radius: 50%; background: var(--summary-dot); }
/* </まとめ> */
/* <確認問題> 問題の番号を大きく、答えのボタンを札にする */
.quiz-item { border: 0; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 22px; }
.quiz-item summary { display: inline-block; list-style: none; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: .2em 1em; font-size: .9rem; }
.quiz-item summary::-webkit-details-marker { display: none; }
.quiz-item details[open] summary { background: var(--accent); color: var(--accent-fg); }
.quiz-item .quiz-a { border-top: 1.5px dashed var(--line); }
/* </確認問題> */
/* <原理ページへのリンク> */
.principle-link { border: 0; border-radius: 22px; background: var(--berry-soft); padding: 22px 24px; transition: transform .15s ease; }
.principle-link:hover { transform: translateY(-2px); }
.principle-link .pl-icon { width: 46px; height: 46px; flex: none; border-radius: 50%; background: var(--berry); color: var(--surface); font-size: 1.2rem; display: grid; place-items: center; }
.principle-link .pl-title { color: var(--berry); }
/* </原理ページへのリンク> */
/* <前後ナビとフッター> */
.pager-link { border: 0; border-radius: var(--radius); box-shadow: var(--shadow); }
.pager-link:hover { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.pager-title { color: var(--fg); }
#site-footer { border-top: 0; }
#site-footer::before {
  content: ""; display: block; width: 64px; height: 18px; margin: 0 auto 14px;
  background:
    radial-gradient(circle, var(--berry) 0 4px, transparent 5px) 0 50% / 16px 18px repeat-x;
  opacity: .8;
}
/* </前後ナビとフッター> */

/* ===== 11.8 狭い画面と、動きを減らす設定 ===== */
@media (max-width: 760px) {
  .rd-hero { grid-template-columns: 1fr; gap: 8px; padding-top: 20px; }
  .rd-hero .rd-hero-art { max-width: 300px; margin: 8px auto 0; }
}
@media (max-width: 520px) {
  body { font-size: 16.5px; }
  .learn-box, .formula, .quiz-item { padding-left: 16px; padding-right: 16px; }
  .summary { padding: 6px 18px 16px; }
  .sim { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .rd-progress, .rd-chip, .principle-link { transition: none; }
}

/* ===== 11.9 総合トップ・物理の目次・準備中ページ ===== */
/* <ボタン> 角を丸くし、主のボタンは葉の緑、控えめなボタンは実の紫の文字にする */
.btn { border-radius: 999px; padding: .42em 1.05em; }
.btn-ghost { color: var(--berry); border-color: color-mix(in srgb, var(--berry) 45%, transparent); }
/* </ボタン> */
/* <総合トップ> 広い本文幅の導入。主役は問いの一文 */
.top-hero.rd-hero { padding-top: 48px; }
.top-hero .rd-question { font-size: clamp(1.25rem, 3.6vw, 1.7rem); }
.top-hero .lead { color: var(--fg); }
.top-section-title { padding-bottom: .5em; margin: 2.2em 0 1em; }
.subject-card { border: 0; border-radius: 22px; box-shadow: var(--shadow); background: var(--surface); padding: 24px; }
.subject-card:not(.is-soon) { background: var(--accent); color: var(--accent-fg); }
.subject-card:not(.is-soon) .subject-summary { color: var(--accent-fg); opacity: .9; }
.subject-card:not(.is-soon) .subject-status { color: var(--accent-fg); }
.subject-card:not(.is-soon) .tag { background: color-mix(in srgb, var(--accent-fg) 18%, transparent); color: var(--accent-fg); }
.subject-card.is-soon { background: transparent; box-shadow: none; border: 1.5px dashed var(--line); opacity: 1; }
.subject-card.is-soon .subject-title { color: var(--muted); }
.subject-title { font-size: 1.7rem; letter-spacing: .06em; }
.how-grid { gap: 16px; }
.how-item { border: 0; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.how-item h3 { color: var(--accent); }
.how-item p { color: var(--fg); }
/* </総合トップ> */
/* <物理の目次> 分野へのジャンプを札に、単元カードを影で浮かせる。準備中は点線の枠 */
.subject-hero.rd-hero { padding-top: 40px; }
.field-jump { background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); border-bottom: 0; }
.field-jump a { border: 1.5px solid var(--line); background: var(--surface); color: var(--fg); }
.field-jump a:hover { border-color: var(--accent); color: var(--accent); }
.field-progress { color: var(--accent); font-weight: 700; }
.chapter-title { color: var(--accent); letter-spacing: .08em; }
.unit-card { border: 0; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.unit-card.is-soon { background: transparent; border: 1.5px dashed var(--line); }
.unit-title a:hover { color: var(--berry); }
.unit-learn { color: var(--fg); }
.unit-learn li::marker { color: var(--berry); }
/* </物理の目次> */
/* <準備中ページ> 絵文字をやめ、芽を出したニワトコの絵にする */
.coming-art { width: 180px; margin: 0 auto 8px; }
.coming-art svg { width: 100%; height: auto; display: block; }
.coming h1 { font-size: clamp(1.4rem, 4.5vw, 1.9rem); }
.coming h2::after { display: none; }
/* </準備中ページ> */
@media (max-width: 760px) {
  .top-hero.rd-hero, .subject-hero.rd-hero { padding-top: 20px; }
}

/* ===== 12. 前提知識（「これを知っておくといい！」のボタンと前提知識ページ） ===== */
/* <これを知っておくといい！ボタン> site.js の renderPrereqButton() が導入の直後に置く */
.prereq-button { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 8px 0 18px; padding: 12px 20px; border-radius: 999px;
  background: var(--berry-soft); color: var(--fg); text-decoration: none; border: 1.5px solid color-mix(in srgb, var(--berry) 35%, transparent); }
.prereq-button:hover { border-color: var(--berry); }
.prereq-button-label { font-weight: 800; color: var(--berry); }
.prereq-button-label::before { content: ""; display: inline-block; width: .55em; height: .55em; margin-right: .5em; border-radius: 50%; background: var(--berry); box-shadow: .38em -.3em 0 -.1em var(--berry); vertical-align: .05em; }
.prereq-button-desc { font-size: .88rem; color: var(--muted); }
/* </これを知っておくといい！ボタン> */
/* <前提知識ページ> generate.mjs が作る。必須 / あると良い / 次に進む の 3 群 */
.badge-prereq { display: inline-block; background: var(--berry); color: var(--surface); font-size: .75rem; font-weight: 700; padding: .1em .7em; border-radius: 999px; }
.prereq-group h2 { margin-top: 2.4em; }
.prereq-note { color: var(--muted); margin: .2em 0 1em; }
.prereq-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.prereq-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 20px; }
.prereq-card.is-soon { background: transparent; box-shadow: none; border: 1.5px dashed var(--line); }
.prereq-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 0; font-size: .8rem; color: var(--muted); }
.prereq-badge { font-weight: 800; border-radius: 999px; padding: .05em .7em; font-size: .75rem; }
.prereq-required { background: var(--accent); color: var(--accent-fg); }
.prereq-recommended { background: var(--accent-soft); color: var(--accent); }
.prereq-title { margin: .3em 0 .2em; font-size: 1.12rem; }
.prereq-reason { margin: .2em 0 .5em; }
.prereq-mini { margin: .4em 0 .6em; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); font-size: .93rem; }
.prereq-mini-label { display: block; font-size: .75rem; font-weight: 800; color: var(--accent); letter-spacing: .1em; margin: 0 0 .2em; }
.prereq-actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* </前提知識ページ> */
/* <準備中ページのミニ解説> */
.coming-mini { text-align: left; max-width: 520px; margin: 18px auto 0; padding: 12px 18px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.coming-mini p { margin: .2em 0; }
.coming-mini[hidden] { display: none; }
/* </準備中ページのミニ解説> */
