/* 迷わない AI の選び方 — 生成り × 深い緑 × 金色。スマホで読むことを最優先にした作り。 */
:root {
  --paper: #fbf7ec;
  --kinari: #f3ecda;
  --card: #ffffff;
  --ink: #2a2823;
  --ink-soft: #5b574b;
  --green: #1e4a38;
  --green-deep: #143527;
  --green-tint: #e3ede3;
  --gold: #b58a3c;
  --gold-text: #86601c;
  --gold-light: #dcba70;
  --cream: #f6f0df;
  --line: #e0d6bd;
  --warn: #9a3f1b;
  --warn-tint: #f7e8de;
  --sans: "Inter", "Helvetica Neue", Arial, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "BIZ UDPGothic", Meiryo, "Yu Gothic Medium", "Noto Sans JP", sans-serif;
  --serif: "Georgia", "Hiragino Mincho ProN", "Yu Mincho", "BIZ UDPMincho", "Noto Serif JP", serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Hiragino Sans", "BIZ UDPGothic", monospace;
  --header-h: 52px;
  --side-w: 19rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.95;
  letter-spacing: 0.03em;
  line-break: strict;
  overflow-wrap: anywhere;
  word-break: normal;
  font-feature-settings: "palt" 1;
  text-autospace: normal;
  text-spacing-trim: normal;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--green); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--green-deep); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--green); color: #fff; padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
.wrap { width: 100%; max-width: 42rem; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }

/* ---------- ヘッダー ---------- */
.top {
  position: sticky; top: 0; z-index: 30; height: var(--header-h);
  display: flex; align-items: center; gap: 8px;
  padding: 0 max(8px, env(safe-area-inset-right)) 0 max(4px, env(safe-area-inset-left));
  background: rgba(251, 247, 236, 0.94);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.menu { width: 48px; height: 48px; border: 0; background: none; display: grid; place-content: center; gap: 5px; cursor: pointer; border-radius: 12px; }
.menu span { display: block; width: 22px; height: 2px; background: var(--green); border-radius: 2px; }
.brand { font-family: var(--serif); font-weight: 700; color: var(--green-deep); text-decoration: none; font-size: 0.95rem; letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.where { margin-left: auto; font-size: 0.8125rem; color: var(--gold-text); font-weight: 700; white-space: nowrap; }
.bar { position: absolute; left: 0; bottom: -1px; height: 3px; width: 100%; background: var(--gold); transform-origin: left; transform: scaleX(0); }

/* ---------- 目次ドロワー ---------- */
.drawer {
  position: fixed; z-index: 50; top: 0; bottom: 0; left: 0; width: min(88vw, 22rem);
  background: var(--paper); border-right: 1px solid var(--line);
  transform: translateX(-102%); visibility: hidden;
  transition: transform 0.25s ease, visibility 0s linear 0.25s;
  overflow-y: auto; overscroll-behavior: contain;
  padding-bottom: 32px;
}
.drawer.open { transform: none; visibility: visible; transition: transform 0.25s ease; box-shadow: 8px 0 32px rgba(20, 53, 39, 0.18); }
.drawer-head { position: sticky; top: 0; background: var(--paper); display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 18px; border-bottom: 1px solid var(--line); z-index: 1; }
.drawer-title { font-family: var(--serif); font-weight: 700; color: var(--green-deep); text-decoration: none; }
.drawer-close { width: 48px; height: 48px; border: 0; background: none; font-size: 1.8rem; color: var(--green); cursor: pointer; line-height: 1; }
.dgroup { margin: 22px 18px 6px; font-size: 0.78rem; letter-spacing: 0.16em; color: var(--gold-text); font-weight: 700; }
.dlist { list-style: none; margin: 0; padding: 0 8px; }
.dlist a, .dlist .pending { display: flex; gap: 10px; align-items: baseline; padding: 11px 10px; min-height: 44px; border-radius: 12px; text-decoration: none; color: var(--ink); line-height: 1.5; }
.dlist a:hover { background: var(--kinari); }
.dlist a.cur { background: var(--green-tint); color: var(--green-deep); font-weight: 700; }
.dn { flex: 0 0 4.2em; font-size: 0.78rem; color: var(--gold-text); font-weight: 700; letter-spacing: 0.04em; }
.dt { font-size: 0.95rem; }
.pending { color: var(--ink-soft) !important; }
.pending em { font-style: normal; margin-left: 8px; font-size: 0.72rem; border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(20, 30, 25, 0.45); }

/* ---------- ページの見出し ---------- */
.phero { background: var(--green-deep); color: var(--cream); padding: 44px 0 40px; position: relative; overflow: hidden; }
.phero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; border: 1px solid rgba(220, 186, 112, 0.35); box-shadow: 0 0 0 28px rgba(220, 186, 112, 0.06); pointer-events: none; }
.eyebrow { margin: 0 0 12px; font-size: 0.78rem; letter-spacing: 0.28em; color: var(--gold-light); font-weight: 700; font-family: var(--sans); }
.phero h1 { margin: 0; font-family: var(--serif); font-weight: 800; font-size: 1.75rem; line-height: 1.55; letter-spacing: 0.05em; text-wrap: balance; word-break: auto-phrase; position: relative; z-index: 1; }
.chips { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; position: relative; z-index: 1; }
.chips li { font-size: 0.8125rem; line-height: 1.4; padding: 5px 12px; border: 1px solid rgba(246, 240, 223, 0.35); border-radius: 999px; color: var(--cream); }

/* ---------- 本文 ---------- */
.prose { padding-top: 28px; padding-bottom: 24px; }
.prose p { margin: 0 0 1.35em; }
.prose strong { font-weight: 700; color: #1b1a16; }
.prose h2, .prose h3, .prose h4 { font-family: var(--serif); color: var(--green-deep); line-height: 1.55; letter-spacing: 0.04em; word-break: auto-phrase; text-wrap: balance; }
.sec { margin-top: 3rem; }
.sec:first-of-type { margin-top: 2rem; }
.prose h2 { font-size: 1.45rem; font-weight: 800; margin: 0 0 1.2rem; padding-bottom: 0.7rem; position: relative; }
.prose h2::after { content: ""; position: absolute; left: 0; bottom: 0; width: 3.2rem; height: 3px; background: var(--gold); border-radius: 2px; }
.prose h3 { font-size: 1.2rem; font-weight: 800; margin: 2.2rem 0 0.9rem; padding-left: 0.8rem; border-left: 4px solid var(--gold); }
.prose h4 { font-size: 1.05rem; font-weight: 800; margin: 1.8rem 0 0.7rem; }
.prose h3.ph, .prose h4.ph { color: var(--green); }
.prose h3, .prose h4, .prose h2 { scroll-margin-top: calc(var(--header-h) + 12px); }

.prose ul, .prose ol { margin: 0 0 1.4em; padding-left: 1.45em; }
.prose li { margin: 0.35em 0; padding-left: 0.15em; }
.prose li::marker { color: var(--gold-text); font-weight: 700; }
.prose li > ul, .prose li > ol { margin: 0.4em 0 0.2em; }
.prose ol > li::marker { font-variant-numeric: tabular-nums; }

.orn { border: 0; height: 1px; margin: 2.8rem auto; width: 100%; background: linear-gradient(90deg, transparent, var(--line) 20%, var(--line) 80%, transparent); position: relative; overflow: visible; }
.orn::after { content: "◆"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -52%); background: var(--paper); color: var(--gold); padding: 0 12px; font-size: 0.7rem; }

code { font-family: var(--mono); font-size: 0.88em; background: #efe7d1; padding: 0.08em 0.38em; border-radius: 6px; letter-spacing: 0; font-feature-settings: normal; }
a.url { word-break: break-all; }

/* 根拠ラベル */
.tag { display: inline-block; font-size: 0.74em; font-weight: 700; line-height: 1.5; padding: 0.04em 0.7em; border-radius: 999px; vertical-align: 0.08em; white-space: nowrap; letter-spacing: 0.04em; margin: 0 0.1em; font-feature-settings: normal; }
.tag-official { background: #dcebdc; color: #1c4a33; }
.tag-verified { background: #d8e9e5; color: #12504a; }
.tag-story { background: #f5e6c2; color: #774f10; }
.tag-guide { background: #ece4cf; color: #5a4c2c; }
.tag-ref { background: #e8e6df; color: #54514a; }
.tag-check { background: #f6dccf; color: #8d3716; }
.tag-unverified { background: #f1e0d6; color: #763a1f; }
.tag-long { white-space: normal; font-size: 0.8em; line-height: 1.9; border-radius: 8px; padding: 0.1em 0.6em; -webkit-box-decoration-break: clone; box-decoration-break: clone; font-weight: 500; }
.tag-plain { background: var(--kinari); color: var(--ink-soft); }

/* 引用(ふきだし) */
.callout { margin: 1.6rem 0; padding: 1rem 1.1rem 0.2rem; background: var(--kinari); border-left: 4px solid var(--gold); border-radius: 4px 14px 14px 4px; }
.callout > :last-child { margin-bottom: 1rem; }
.callout p, .callout ul, .callout ol { margin-bottom: 0.9em; }
.callout-warn { background: var(--warn-tint); border-left-color: var(--warn); }

/* この章でできるようになること / まとめ */
.sec-goals { background: var(--green-tint); border-radius: 18px; padding: 1.3rem 1.2rem 0.6rem; margin-top: 1.6rem; }
.sec-goals h2 { font-size: 1.1rem; padding-bottom: 0.6rem; margin-bottom: 0.8rem; }
.sec-goals ul { list-style: none; padding-left: 0; }
.sec-goals li { position: relative; padding-left: 1.7em; }
.sec-goals li::before { content: ""; position: absolute; left: 0.2em; top: 0.62em; width: 0.9em; height: 0.5em; border-left: 3px solid var(--green); border-bottom: 3px solid var(--green); transform: rotate(-45deg) translateY(-30%); }
.sec-summary { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--gold); border-radius: 18px; padding: 1.4rem 1.2rem 0.7rem; box-shadow: 0 6px 20px rgba(20, 53, 39, 0.06); }
.sec-summary h2 { font-size: 1.2rem; }

/* このページの流れ */
.pagetoc { margin: 0 0 1.6rem; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.pagetoc summary { cursor: pointer; padding: 12px 16px; min-height: 44px; font-weight: 700; font-size: 0.9rem; color: var(--green); list-style: none; display: flex; align-items: center; justify-content: space-between; }
.pagetoc summary::-webkit-details-marker { display: none; }
.pagetoc summary::after { content: "＋"; color: var(--gold-text); }
.pagetoc details[open] summary::after { content: "－"; }
.pagetoc ol { margin: 0; padding: 0 16px 12px 2.6em; font-size: 0.92rem; line-height: 1.6; }
.pagetoc li { margin: 0; }
.pagetoc a { display: block; padding: 7px 0; text-decoration: none; color: var(--ink); }
.pagetoc a:hover { color: var(--green); text-decoration: underline; }

/* 出典(たたむ) */
.sources { margin: 2rem 0 0; border-top: 1px solid var(--line); padding-top: 0.6rem; }
.sources summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; color: var(--ink-soft); font-size: 0.95rem; font-family: var(--sans); }
.srcbody { font-size: 0.88rem; line-height: 1.8; color: var(--ink-soft); }
.srcbody ul { padding-left: 1.2em; }

/* ---------- コピー用の枠 ---------- */
.codecard { margin: 1.5rem 0; border: 1px solid #c9d6c9; border-radius: 16px; background: var(--card); overflow: hidden; box-shadow: 0 4px 14px rgba(20, 53, 39, 0.07); }
.codehead { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--green); color: var(--cream); padding: 6px 8px 6px 16px; }
.codelabel { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em; }
.copy { min-width: 92px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(246, 240, 223, 0.55); background: transparent; color: var(--cream); font: inherit; font-size: 0.9rem; font-weight: 700; cursor: pointer; letter-spacing: 0.06em; }
.copy:hover { background: rgba(255, 255, 255, 0.12); }
.copy.done { background: var(--gold-light); color: #2a2000; border-color: var(--gold-light); }
.codecard pre { margin: 0; padding: 16px 16px 18px; white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal; font-family: var(--sans); font-size: 0.97rem; line-height: 1.85; letter-spacing: 0.02em; font-feature-settings: normal; color: #24231f; user-select: all; -webkit-user-select: all; }
.codecard code { background: none; padding: 0; border-radius: 0; font: inherit; letter-spacing: inherit; }

/* 図(横にスクロール) */
.diagram { margin: 1.5rem 0; border: 1px solid var(--line); border-radius: 14px; background: var(--card); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.diagram pre { margin: 0; padding: 14px 16px; font-family: var(--mono); font-size: 0.8125rem; line-height: 1.75; letter-spacing: 0; white-space: pre; font-feature-settings: normal; width: max-content; min-width: 100%; }
.diagram code { background: none; padding: 0; font: inherit; }

/* ---------- チェックリスト ---------- */
.checklist { list-style: none; padding-left: 0 !important; }
.checklist li { margin: 0.2em 0; padding-left: 0; }
.chk { display: flex; gap: 12px; align-items: flex-start; padding: 8px 8px 8px 4px; min-height: 44px; border-radius: 12px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.chk:hover { background: rgba(227, 237, 227, 0.6); }
.chk input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chk .box { flex: 0 0 26px; width: 26px; height: 26px; margin-top: 0.12em; border: 2px solid var(--green); border-radius: 8px; background: var(--card); position: relative; transition: background 0.15s; }
.chk .box::after { content: ""; position: absolute; left: 7px; top: 2px; width: 7px; height: 13px; border-right: 3px solid #fff; border-bottom: 3px solid #fff; transform: rotate(45deg) scale(0); transition: transform 0.15s; }
.chk input:checked + .box { background: var(--green); }
.chk input:checked + .box::after { transform: rotate(45deg) scale(1); }
.chk input:checked ~ .txt { color: var(--ink-soft); }
.chk input:focus-visible + .box { outline: 3px solid var(--gold); outline-offset: 2px; }
.checknote { position: sticky; top: calc(var(--header-h) + 6px); z-index: 5; display: inline-block; margin: 0 0 1.2rem; padding: 4px 14px; font-size: 0.82rem; line-height: 1.7; background: var(--card); border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 2px 8px rgba(20, 53, 39, 0.08); }
.checknote .cn-label { color: var(--gold-text); font-weight: 700; }
.checknote .cn-hint { color: var(--ink-soft); font-size: 0.78rem; }

/* ---------- 表 ---------- */
.tablewrap { margin: 1.5rem 0; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
table { border-collapse: collapse; width: 100%; font-size: 0.94rem; line-height: 1.75; font-feature-settings: normal; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); letter-spacing: 0.02em; }
thead th { background: var(--green-tint); color: var(--green-deep); font-weight: 700; font-size: 0.86rem; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) td { background: #fdfaf2; }
td:first-child { font-weight: 500; }
table.kv td:first-child { min-width: 6.5em; }
td p { margin: 0; }

@media (max-width: 640px) {
  .tablewrap:has(table.stack) { border: 0; background: none; overflow: visible; border-radius: 0; }
  table.stack, table.stack tbody { display: block; }
  table.stack thead { display: none; }
  table.stack tr { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 14px; margin: 0 0 12px; padding: 12px 16px 10px; box-shadow: 0 2px 8px rgba(20, 53, 39, 0.04); }
  table.stack tbody tr:nth-child(even) td { background: none; }
  table.stack td { display: block; padding: 5px 0; border: 0; font-size: 0.95rem; }
  table.stack td::before { content: attr(data-label); display: block; font-size: 0.72rem; line-height: 1.5; color: var(--gold-text); font-weight: 700; letter-spacing: 0.08em; }
  table.stack td:first-child { font-weight: 700; font-size: 1.02rem; color: var(--green-deep); padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px dashed var(--line); }
  table.stack td:first-child::before { display: none; }
  table.stack td:empty { display: none; }
  table.stack.numcol tr { position: relative; padding-left: 64px; min-height: 64px; }
  table.stack.numcol td:first-child { position: absolute; left: 14px; top: 12px; min-width: 38px; height: 30px; padding: 0 10px; margin: 0; border: 0; border-radius: 999px; background: var(--green); color: var(--cream); display: grid; place-content: center; font-size: 0.82rem; }
  table.stack.numcol td:first-child strong { color: inherit; }
  table.stack.numcol td:nth-child(2) { font-weight: 700; font-size: 1.02rem; color: var(--green-deep); padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px dashed var(--line); }
  table.stack.numcol td:nth-child(2)::before { display: none; }
}

/* ---------- 画像 ---------- */
figure { margin: 1.8rem 0; }
figure a { display: block; }
figure img { display: block; width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
figcaption { margin-top: 8px; font-size: 0.82rem; line-height: 1.7; color: var(--ink-soft); }

/* ---------- 前後のページ ---------- */
.pager { display: grid; gap: 12px; margin: 1.5rem 0 3rem; }
.pg { display: block; padding: 14px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); text-decoration: none; color: var(--ink); min-height: 64px; }
.pg:hover { border-color: var(--gold); }
.pg-dir { display: block; font-size: 0.78rem; color: var(--gold-text); font-weight: 700; letter-spacing: 0.1em; }
.pg-t { display: block; font-weight: 700; color: var(--green-deep); line-height: 1.6; }
.pg-next { background: var(--green-deep); border-color: var(--green-deep); }
.pg-next .pg-dir { color: var(--gold-light); }
.pg-next .pg-t { color: var(--cream); }

.foot { border-top: 1px solid var(--line); background: var(--kinari); padding: 28px max(20px, env(safe-area-inset-left)) calc(32px + env(safe-area-inset-bottom)); text-align: center; font-size: 0.82rem; line-height: 1.8; color: var(--ink-soft); }
.foot p { max-width: 36rem; margin: 0 auto 0.5em; }
.foot .by { font-family: var(--serif); color: var(--green); font-weight: 700; }

/* ---------- 表紙(index) ---------- */
.cover { background: radial-gradient(120% 80% at 85% 0%, #24604a 0%, var(--green-deep) 55%, #0e271c 100%); color: var(--cream); padding: 64px 0 56px; position: relative; overflow: hidden; }
.cover::before { content: ""; position: absolute; right: -90px; top: 40px; width: 300px; height: 300px; border-radius: 50%; border: 1px solid rgba(220, 186, 112, 0.4); box-shadow: 0 0 0 36px rgba(220, 186, 112, 0.05), 0 0 0 72px rgba(220, 186, 112, 0.03); pointer-events: none; }
.cover-in { position: relative; z-index: 1; }
.cover-eyebrow { margin: 0 0 20px; font-size: 0.78rem; letter-spacing: 0.4em; color: var(--gold-light); font-weight: 700; }
.cover-title span { display: inline-block; }
.cover-title { margin: 0; font-family: var(--serif); font-weight: 800; font-size: clamp(2rem, 9vw, 3rem); line-height: 1.4; letter-spacing: 0.06em; word-break: auto-phrase; text-wrap: balance; }
.cover-sub { margin: 18px 0 0; font-family: var(--serif); font-weight: 600; font-size: 1.05rem; line-height: 1.8; color: #ece4cc; word-break: auto-phrase; text-wrap: balance; }
.cover-rule { width: 56px; height: 3px; background: var(--gold); margin: 28px 0 22px; border-radius: 2px; }
.cover-by { margin: 0; font-family: var(--serif); font-weight: 800; font-size: 1.1rem; letter-spacing: 0.08em; }
.cover-tag { margin: 6px 0 0; font-size: 0.92rem; color: #dcd5bd; }
.cover-cta { display: grid; gap: 12px; margin-top: 34px; }
.btn { display: flex; align-items: center; justify-content: center; min-height: 54px; padding: 0 22px; border-radius: 999px; text-decoration: none; font-weight: 700; letter-spacing: 0.06em; text-align: center; line-height: 1.4; }
.btn-gold { background: var(--gold-light); color: #231a05; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); }
.btn-gold:hover { background: #e6c883; color: #231a05; }
.btn-ghost { border: 1px solid rgba(246, 240, 223, 0.5); color: var(--cream); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); color: var(--cream); }
.cover-date { margin: 26px 0 0; font-size: 0.8rem; color: #cfc8ae; }

.home { padding-top: 12px; padding-bottom: 32px; }
.hsec { margin-top: 2.6rem; }
.hsec h2 { font-family: var(--serif); font-size: 1.35rem; font-weight: 800; color: var(--green-deep); margin: 0 0 0.6rem; letter-spacing: 0.06em; }
.hlead { margin: 0 0 1rem; color: var(--ink-soft); font-size: 0.95rem; line-height: 1.8; }
.routes, .toc { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.route, .tc { display: flex; gap: 14px; align-items: center; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; text-decoration: none; color: var(--ink); min-height: 64px; }
.route:hover, a.tc:hover { border-color: var(--gold); box-shadow: 0 6px 18px rgba(20, 53, 39, 0.08); }
.route-k { flex: 0 0 38px; height: 38px; border-radius: 50%; background: var(--green); color: var(--cream); display: grid; place-content: center; font-family: var(--serif); font-weight: 800; }
.route-b { display: grid; line-height: 1.55; }
.route-b b { color: var(--green-deep); }
.route-b small { color: var(--ink-soft); font-size: 0.8rem; line-height: 1.6; }
.tc-n { flex: 0 0 4.4em; font-size: 0.8rem; font-weight: 700; color: var(--gold-text); letter-spacing: 0.04em; line-height: 1.5; }
.tc-b { flex: 1; display: grid; gap: 2px; line-height: 1.6; min-width: 0; }
.tc-t { font-weight: 700; color: var(--green-deep); }
.tc-d { font-size: 0.82rem; color: var(--ink-soft); line-height: 1.65; }
.tc-a { color: var(--gold-text); font-weight: 700; }
.tc-off { opacity: 0.65; border-style: dashed; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 0.92rem; line-height: 1.7; }
.legend .tag { margin-right: 0.6em; min-width: 4.6em; text-align: center; }

/* ---------- 広い画面 ---------- */
@media (min-width: 700px) {
  .cover-cta { grid-template-columns: auto auto; justify-content: start; }
  .pager { grid-template-columns: 1fr 1fr; }
  .pager .pg-next { grid-column: 2; }
  .pager .pg-prev:only-child { grid-column: 1; }
  .phero h1 { font-size: 2.1rem; }
}
@media (min-width: 1100px) {
  body { padding-left: var(--side-w); }
  .menu, .drawer-close, .scrim { display: none !important; }
  .drawer { visibility: visible; transform: none; width: var(--side-w); box-shadow: none; transition: none; }
  .top { padding-left: 24px; }
  .brand { display: none; }
  .prose { font-size: 1.0625rem; }
}

/* ---------- 動きを減らす ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .drawer, .chk .box, .chk .box::after { transition: none; }
}

/* ---------- 印刷 / PDF ---------- */
@media print {
  @page { size: A4; margin: 16mm 14mm; }
  body { padding-left: 0 !important; background: #fff; font-size: 10.5pt; line-height: 1.8; }
  .top, .drawer, .scrim, .pager, .copy, .skip, .checknote, .bar, .pagetoc { display: none !important; }
  .phero { background: none; color: var(--green-deep); padding: 0 0 8mm; border-bottom: 2px solid var(--gold); }
  .phero::after { display: none; }
  .eyebrow { color: var(--gold-text); }
  .phero h1 { color: var(--green-deep); font-size: 20pt; }
  .chips li { border-color: var(--line); color: var(--ink-soft); }
  .printpage { break-before: page; }
  .printpage:first-of-type { break-before: auto; }
  h2, h3, h4 { break-after: avoid; }
  .codecard, .callout, table.stack tr, figure, .sec-summary { break-inside: avoid; }
  .codecard { box-shadow: none; }
  .codehead { background: #eee; color: #222; }
  .sources > .srcbody { display: block; }
  .wrap { max-width: none; padding: 0; }
  .tablewrap { overflow: visible; }
  a { color: inherit; text-decoration: none; }
}

/* ---------- 印刷用ページの表紙・目次 ---------- */
.printcover { min-height: 100vh; display: grid; align-items: center; background: var(--green-deep); color: var(--cream); padding: 0 0; }
.printcover .wrap { padding-top: 80px; padding-bottom: 80px; }
.printcover h1 { font-family: var(--serif); font-weight: 800; font-size: 2.4rem; line-height: 1.45; margin: 0; letter-spacing: 0.06em; }
.pc-sub { font-family: var(--serif); font-size: 1.1rem; margin: 16px 0 0; color: #ece4cc; }
.pc-by { font-family: var(--serif); font-weight: 800; font-size: 1.1rem; margin: 0; letter-spacing: 0.08em; }
.pc-tag { margin: 6px 0 0; color: #dcd5bd; font-size: 0.95rem; }
.pc-date { margin: 40px 0 0; font-size: 0.82rem; color: #cfc8ae; }
.printtoc { padding: 48px 0; }
.printtoc h2 { font-family: var(--serif); color: var(--green-deep); font-size: 1.5rem; }
.printtoc ol { list-style: none; padding: 0; margin: 0; }
.printtoc li { padding: 8px 0; border-bottom: 1px solid var(--line); line-height: 1.6; }
.printtoc li span { display: inline-block; min-width: 5em; color: var(--gold-text); font-weight: 700; font-size: 0.85em; }
@media print {
  .printcover { -webkit-print-color-adjust: exact; print-color-adjust: exact; min-height: 0; height: 262mm; }
  .printcover .wrap { padding: 40mm 12mm; }
  .printcover h1 { font-size: 30pt; color: var(--cream); }
  .pc-sub, .pc-by, .pc-tag, .pc-date { color: var(--cream); }
  .printcover .cover-eyebrow { color: var(--gold-light); }
  .printcover .cover-rule { background: var(--gold-light); }
  .printtoc li { break-inside: avoid; }
}
