/* ==========================================================
   発展教材 機械学習 — 確率から GPT まで 共通スタイルシート
   東京理科大学 先進工学部 マテリアル創成工学科
   ========================================================== */
:root {
  --text: #1a202c;
  --text-muted: #4a5568;
  --bg: #fdfdfc;
  --accent: #5b2a5e;          /* 見出し・リンクの基調色(茄子紺) */
  --accent-light: #f5eef5;
  --rule: #d5dbdb;

  --def-border: #5b2a5e;      /* 定義: 基調色 */
  --def-bg: #faf5fa;
  --thm-border: #7d3c98;      /* 定理: 紫 */
  --thm-bg: #f8f2fb;
  --derive-border: #1a5276;   /* 導出: 青 */
  --derive-bg: #eef4f9;
  --note-border: #b9770e;     /* 数学の道具: 琥珀 */
  --note-bg: #fdf8ee;
  --phys-border: #b03a2e;     /* 応用（材料科学・工学・身の回り）: 赤茶 */
  --phys-bg: #fdf3f1;
  --why-border: #117a8b;      /* なぜ?/直感: 藍 */
  --why-bg: #eef8fa;
  --warn-border: #a04000;     /* 注意・よくある誤解: 橙 */
  --warn-bg: #fdf2ec;
  --ex-border: #566573;       /* 例・演習: 灰 */
  --ex-bg: #f4f6f6;
  --code-bg: #2c3e50;
  --keyeq-bg: #fffbea;
  --keyeq-border: #f1c40f;
}

* { box-sizing: border-box; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", serif;
  line-height: 1.9;
  text-align: left;
}

/* ---------- ヘッダー・ナビゲーション ---------- */
header.site {
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1.2rem;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  position: sticky;
  top: 0;
  z-index: 10;
}
header.site a { color: #fff; text-decoration: none; }
header.site a:hover { text-decoration: underline; }
header.site .series { font-size: 0.9rem; opacity: 0.9; }

nav.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 2.5rem auto 1rem;
  max-width: 900px;
  padding: 0 1.2rem;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  font-size: 0.95rem;
}
nav.pager a {
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 0.5rem 0.9rem;
  background: #fff;
  max-width: 45%;
}
nav.pager a:hover { background: var(--accent-light); }
nav.pager .spacer { flex: 1; }

/* ---------- 本文レイアウト ---------- */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 1.2rem 4rem;
}

h1 {
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  font-size: 1.9rem;
  color: var(--accent);
  border-bottom: 3px solid var(--accent);
  padding-bottom: 0.4rem;
  margin: 1.8rem 0 0.6rem;
  line-height: 1.4;
}
h1 .chapter-no {
  display: block;
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: normal;
  letter-spacing: 0.08em;
}

h2 {
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  font-size: 1.45rem;
  color: var(--accent);
  border-left: 6px solid var(--accent);
  padding-left: 0.6rem;
  margin: 2.8rem 0 1rem;
  line-height: 1.45;
  scroll-margin-top: 4rem;
}

h3 {
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  font-size: 1.15rem;
  color: var(--text);
  margin: 2.2rem 0 0.8rem;
  scroll-margin-top: 4rem;
}

p { margin: 0.9rem 0; }

a { color: var(--accent); }

em.term { font-style: normal; font-weight: bold; }

ul, ol { padding-left: 1.5rem; }
li { margin: 0.3rem 0; }

/* 章の導入文 */
.lead {
  background: var(--accent-light);
  border-radius: 8px;
  padding: 1rem 1.3rem;
  margin: 1.4rem 0 2rem;
}
.lead p { margin: 0.5rem 0; }

/* この章で学ぶこと */
.goals {
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  font-size: 0.95rem;
}
.goals ul { margin: 0.4rem 0 0.2rem; padding-left: 1.4rem; }

/* 前提知識 */
.prereq {
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-top: 1px dashed var(--rule);
  margin-top: 0.8rem;
  padding-top: 0.6rem;
}

/* 章内目次 */
nav.chapter-toc {
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  font-size: 0.92rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: #fff;
  padding: 0.8rem 1.2rem;
  margin: 1.5rem 0 2rem;
}
nav.chapter-toc strong { color: var(--accent); display: block; margin-bottom: 0.3rem; }
nav.chapter-toc ol { margin: 0.2rem 0; padding-left: 1.3rem; }
nav.chapter-toc li { margin: 0.15rem 0; }
nav.chapter-toc a { text-decoration: none; }
nav.chapter-toc a:hover { text-decoration: underline; }

/* ---------- ボックス類 ---------- */
.box {
  border-left: 5px solid;
  border-radius: 0 8px 8px 0;
  padding: 0.9rem 1.2rem;
  margin: 1.6rem 0;
}
.box > .box-title {
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  font-weight: bold;
  font-size: 0.98rem;
  margin: 0 0 0.5rem;
}
.box p:last-child { margin-bottom: 0.2rem; }

.def    { border-color: var(--def-border);    background: var(--def-bg); }
.def    > .box-title { color: var(--def-border); }
.thm    { border-color: var(--thm-border);    background: var(--thm-bg); }
.thm    > .box-title { color: var(--thm-border); }
.derive { border-color: var(--derive-border); background: var(--derive-bg); }
.derive > .box-title { color: var(--derive-border); }
.note   { border-color: var(--note-border);   background: var(--note-bg); }
.note   > .box-title { color: var(--note-border); }
.phys   { border-color: var(--phys-border);   background: var(--phys-bg); }
.phys   > .box-title { color: var(--phys-border); }
.why    { border-color: var(--why-border);    background: var(--why-bg); }
.why    > .box-title { color: var(--why-border); }
.warn   { border-color: var(--warn-border);   background: var(--warn-bg); }
.warn   > .box-title { color: var(--warn-border); }
.ex     { border-color: var(--ex-border);     background: var(--ex-bg); }
.ex     > .box-title { color: var(--ex-border); }

/* 重要式(最重要結果)の強調 */
.keyeq {
  background: var(--keyeq-bg);
  border: 1.5px solid var(--keyeq-border);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  margin: 1.6rem 0;
  overflow-x: auto;
}

/* ---------- 数式まわり ---------- */
mjx-container[jax="CHTML"][display="true"] {
  margin: 1rem 0 !important;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0;
}

/* ---------- コード ---------- */
pre {
  background: var(--code-bg);
  color: #ecf0f1;
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  overflow-x: auto;
  font-family: "SFMono-Regular", Menlo, Consolas, "Courier New", monospace;
  font-size: 0.86rem;
  line-height: 1.6;
  margin: 1.2rem 0;
  text-align: left;
}
pre .cmt { color: #95a5a6; }
pre .prompt { color: #58d68d; }
code {
  font-family: "SFMono-Regular", Menlo, Consolas, "Courier New", monospace;
  font-size: 0.88em;
  background: #eef1f2;
  border-radius: 4px;
  padding: 0.05em 0.35em;
}
pre code { background: none; padding: 0; font-size: 1em; color: inherit; }

.codecap {
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: -0.8rem 0 1.2rem;
  text-align: left;
}

/* ---------- 表 ---------- */
table {
  border-collapse: collapse;
  margin: 1.4rem auto;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  font-size: 0.95rem;
}
caption {
  caption-side: top;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  text-align: left;
}
th, td {
  border: 1px solid var(--rule);
  padding: 0.45rem 0.9rem;
}
th { background: var(--accent-light); color: var(--accent); }
td { background: #fff; }
.tablewrap { overflow-x: auto; margin: 1.4rem 0; }
.tablewrap table { margin: 0 auto; }

/* ---------- 図 ---------- */
figure {
  margin: 1.8rem auto;
  text-align: center;
}
figure svg { max-width: 100%; height: auto; }
figcaption {
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  text-align: center;
}

/* ---------- 目次ページ ---------- */
.toc-part {
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  color: var(--accent);
  font-size: 1.2rem;
  margin: 2.2rem 0 0.6rem;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.25rem;
}
ol.toc { list-style: none; padding: 0; margin: 0.6rem 0; }
ol.toc li {
  margin: 0.55rem 0;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
}
ol.toc li a {
  display: block;
  text-decoration: none;
  padding: 0.7rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}
ol.toc li a:hover { background: var(--accent-light); }
ol.toc .ch-no {
  color: var(--accent);
  font-weight: bold;
  margin-right: 0.6rem;
}
ol.toc .ch-desc {
  display: block;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* ---------- 目次ページ:節まで辿れる目次(nav.book-toc) ---------- */
nav.book-toc {
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  text-align: left;
  line-height: 1.45;
  margin: 1.6rem 0 0;
}
nav.book-toc > h2 { margin: 2rem 0 0.4rem; }
nav.book-toc .bt-note {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0.3rem 0 0.6rem;
}
nav.book-toc .bt-part > h3 {
  font-size: 1rem;
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  margin: 1rem 0 0;
  padding-bottom: 0.1rem;
}
nav.book-toc ol.bt-chapters,
nav.book-toc ol.bt-secs,
nav.book-toc ul.bt-kw { list-style: none; margin: 0; padding: 0; }
nav.book-toc li { margin: 0; }
nav.book-toc sub, nav.book-toc sup { line-height: 0; }
/* mathwrap.js は数式だけを含むリンクの数式に .math-wide を付けてしまう（親の a の幅＝数式の幅のため）．
   目次の中では行内のまま置く */
nav.book-toc mjx-container.math-wide {
  display: inline-block !important;
  max-width: none;
  overflow: visible;
  margin: 0;
  padding: 0;
}
nav.book-toc ol.bt-chapters > li {
  padding: 0.3rem 0 0.35rem;
  border-bottom: 1px solid var(--rule);
}
nav.book-toc ol.bt-chapters > li:last-child { border-bottom: none; }
nav.book-toc a.bt-ch {
  display: inline-block;
  font-size: 0.93rem;
  font-weight: bold;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 0.05rem;
}
nav.book-toc .bt-no { margin-right: 0.5em; white-space: nowrap; }
nav.book-toc ol.bt-secs > li {
  display: grid;
  grid-template-columns: 31rem minmax(0, 1fr);
  column-gap: 1rem;
  align-items: baseline;
  padding: 0;
  font-size: 0.87rem;
}
nav.book-toc .bt-sec-link {
  display: grid;
  grid-template-columns: 3.3rem minmax(0, 1fr);
  align-items: baseline;
  color: var(--text);
  text-decoration: none;
}
nav.book-toc .bt-sec {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}
nav.book-toc .bt-sec-name { min-width: 0; overflow-wrap: anywhere; }
nav.book-toc ul.bt-kw {
  display: flex;
  flex-wrap: wrap;
  min-width: 0;
  font-size: 0.84rem;
}
nav.book-toc ul.bt-kw li { max-width: 100%; }
nav.book-toc ul.bt-kw li:not(:last-child)::after {
  content: "／";
  color: var(--text-muted);
}
nav.book-toc ul.bt-kw a { color: var(--accent); text-decoration: none; }
nav.book-toc a:hover { text-decoration: underline; }
nav.book-toc a.bt-sec-link:hover .bt-sec-name { color: var(--accent); }
nav.book-toc a.bt-ch:hover { background: var(--accent-light); }
/* 拡張点: 章の小見出しの右の札(.bt-badge)と，節名の後ろの小さな印(.bt-mark) */
nav.book-toc .bt-badges { margin-left: 0.4rem; white-space: nowrap; }
nav.book-toc .bt-badge {
  display: inline-block;
  margin-right: 0.3rem;
  padding: 0 0.45rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.75rem;
  line-height: 1.5;
  text-decoration: none;
  vertical-align: 0.05em;
}
nav.book-toc .bt-mark {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0 0.35rem;
  border: 1px solid var(--text-muted);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.7rem;
  line-height: 1.4;
  white-space: nowrap;
  vertical-align: 0.05em;
}
@media (max-width: 640px) {
  nav.book-toc ol.bt-chapters > li { padding: 0.55rem 0 0.6rem; }
  nav.book-toc a.bt-ch { display: block; font-size: 0.98rem; margin-bottom: 0.2rem; }
  nav.book-toc .bt-badges { display: block; margin: 0 0 0.2rem; }
  nav.book-toc ol.bt-secs > li {
    display: block;
    padding: 0.3rem 0;
    font-size: 0.93rem;
  }
  nav.book-toc .bt-sec-link { grid-template-columns: 3.6rem minmax(0, 1fr); }
  nav.book-toc ul.bt-kw {
    padding-left: 3.6rem;
    font-size: 0.88rem;
    line-height: 1.5;
    row-gap: 0.3rem;
    margin-top: 0.15rem;
  }
}
@media print {
  nav.book-toc ol.bt-chapters > li { break-inside: avoid; }
  nav.book-toc ol.bt-secs > li { break-inside: avoid; }
  nav.book-toc a, nav.book-toc ul.bt-kw a { color: var(--text); }
}
/* 目次の重要語の行き先(id の付いた囲み)を，h2・h3 と同じく固定ヘッダーの下に着地させる(nav.book-toc 以外の唯一の規則) */
.box[id] { scroll-margin-top: 4rem; }
/* ---------- nav.book-toc ここまで ---------- */

/* ---------- 脚注・参考 ---------- */
.refs {
  font-size: 0.92rem;
  color: var(--text-muted);
  border-top: 1px solid var(--rule);
  margin-top: 3rem;
  padding-top: 1rem;
}
.refs ol { padding-left: 1.4rem; }

/* ---------- 印刷 ---------- */
@media print {
  header.site, nav.pager, nav.chapter-toc { display: none; }
  body { background: #fff; }
  main { max-width: 100%; }
  .box { break-inside: avoid; }
  pre { background: #f4f6f6; color: #1a202c; border: 1px solid var(--rule); }
}

@media (max-width: 640px) {
  html { font-size: 15px; }
  h1 { font-size: 1.55rem; }
  h2 { font-size: 1.25rem; }
  body { text-align: left; }
  nav.pager { flex-direction: column; }
  nav.pager a { max-width: 100%; }
}

/* ---------- 数学教材用の追加 ---------- */
p.sol-link {
  text-align: right;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  font-size: 0.9rem;
  margin: 0.4rem 0 0.1rem;
}
p.sol-link a { text-decoration: none; }
p.sol-link a:hover { text-decoration: underline; }
p.back-link {
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  font-size: 0.9rem;
  margin: 0.2rem 0 1rem;
}

/* 本文幅より長い行内数式（assets/mathwrap.js が付ける） */
mjx-container.math-wide {
  display: block !important;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0.4rem 0;
  padding: 2px 0;
}

/* 狭い画面でページ全体が横にはみ出さないための調整 */
mjx-container[jax="CHTML"][display="true"] {
  min-width: 0 !important;   /* 式番号付きの式に MathJax が付ける最小幅を解除し，式の中だけで横スクロールさせる */
  max-width: 100%;
}
main mjx-container mjx-assistive-mml {
  width: 1px !important;     /* 読み上げ用の不可視 MathML がページ幅を押し広げないように */
  height: 1px !important;    /* （MathJax 自身の width:auto !important より詳細度を上げて上書き） */
}
p code, li code, td code {
  overflow-wrap: anywhere;   /* 行内の長いコード片を折り返す */
}

/* ==========================================================
   機械学習（AD 04）用の追加（2026-11-12）
   既存の規則は変えず，ここから下に足す．
   ========================================================== */
:root {
  --sim-border: #2f7d4f;      /* シミュレーター: 緑（他の box と区別．全周に細枠） */
  --sim-bg: #f1f8f3;
  --question-border: #5b2a5e;
}

/* 「この章で答える問い」：lead の先頭に置く囲み */
.lead .question {
  background: #fff;
  border: 2px solid var(--question-border);
  border-radius: 8px;
  padding: 0.7rem 1.1rem 0.6rem;
  margin: 0.2rem 0 1rem;
}
.lead .question > strong:first-child {
  display: block;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  color: var(--accent);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}
.lead .question ul, .lead .question ol { margin: 0.2rem 0 0.1rem; padding-left: 1.4rem; }
.lead .question li { margin: 0.25rem 0; font-weight: bold; }

/* 「入門ルートで読む節：…」の 1 行 */
.lead .route {
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  font-size: 0.9rem;
  border-top: 1px dashed var(--rule);
  margin: 0.8rem 0 0.2rem;
  padding-top: 0.6rem;
}
.lead .route strong { color: var(--accent); }

/* 節見出しの右に付く小さな札（〔基〕でない節＝詳しいルート） */
h2 .route-tag {
  display: inline-block;
  vertical-align: 0.2em;
  margin-left: 0.6rem;
  padding: 0.05rem 0.6rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: normal;
  line-height: 1.6;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
h2 .route-tag.adv { border-style: dashed; color: var(--text-muted); border-color: var(--text-muted); }

/* シミュレーターの囲み */
.box.sim {
  border: 1.5px solid var(--sim-border);
  border-left: 5px solid var(--sim-border);
  border-radius: 0 8px 8px 0;
  background: var(--sim-bg);
}
.box.sim > .box-title { color: var(--sim-border); }
.box.sim iframe.qsim-embed {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 240px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: #fafafa;
  margin: 0.8rem 0 0.3rem;
}
.box.sim .sim-links {
  text-align: right;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  font-size: 0.88rem;
  margin: 0.2rem 0 0.8rem;
}
.box.sim .sim-links a { text-decoration: none; }
.box.sim .sim-links a:hover { text-decoration: underline; }
ol.sim-steps, ol.sim-questions { margin: 0.3rem 0 0.8rem; padding-left: 1.6rem; }
ol.sim-steps li, ol.sim-questions li { margin: 0.35rem 0; }

/* 答えの例（折りたたみ） */
details.ans {
  margin: 0.35rem 0 0.5rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: #fff;
  padding: 0.25rem 0.8rem;
}
details.ans > summary {
  cursor: pointer;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  font-size: 0.86rem;
  color: var(--accent);
}
details.ans[open] > summary { margin-bottom: 0.2rem; }
details.ans > p { margin: 0.4rem 0; }

/* 狭い画面（スマートフォン，幅 390px 前後）：表・数式・iframe をはみ出させない */
main, .box, .lead, figure, .keyeq, .tablewrap { min-width: 0; }
.box, .lead { overflow-wrap: break-word; }
figure img { max-width: 100%; height: auto; }
@media (max-width: 480px) {
  main { padding: 0.8rem 0.8rem 3rem; }
  .lead { padding: 0.8rem 0.9rem; }
  .lead .question { padding: 0.6rem 0.8rem 0.5rem; }
  .box { padding: 0.75rem 0.85rem; }
  .keyeq { padding: 0.5rem 0.6rem; }
  th, td { padding: 0.35rem 0.55rem; }
  h2 .route-tag { margin-left: 0.3rem; }
  nav.chapter-toc { padding: 0.7rem 0.9rem; }
  .box.sim iframe.qsim-embed { margin-left: 0; margin-right: 0; }
}

/* 広い画面では，シミュレーターの囲みだけ本文（900px）より広げる．
   装置は幅 820px 以上で「図の横に操作欄」の 2 列になるので，操作と図を同時に見られる．
   囲みの中の文章は本文と同じ幅に保つ． */
@media (min-width: 1100px) {
  .box.sim {
    --sim-w: min(1140px, calc(100vw - 72px));
    width: var(--sim-w);
    margin-left: calc((100% - var(--sim-w)) / 2);
    box-sizing: border-box;
  }
  .box.sim > p, .box.sim > ol, .box.sim > ul, .box.sim > noscript { max-width: 850px; }
  .box.sim > .sim-links { max-width: none; }
}

@media print {
  .box.sim { width: auto; margin-left: 0; }
  .box.sim iframe.qsim-embed { display: none; }
  details.ans { border: none; }
}

/* 目次ページ（index.html）：章に対応するシミュレーターの札と，入門ルートの節の 1 行 */
ol.toc .ch-sim {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0 0.45rem;
  border: 1px solid var(--sim-border);
  border-radius: 999px;
  color: var(--sim-border);
  font-size: 0.72rem;
  vertical-align: 0.12em;
}
ol.toc .ch-route {
  display: block;
  font-size: 0.82rem;
  color: var(--accent);
  margin-top: 0.1rem;
}
