/* PEDAL QUEST 徹底攻略ガイド
   色は設計トークン4つ（紺 #132A35／生成り #FFFDF7／黄 #F6C928／赤 #B3261E）と、その混色だけ。
   書体: 見出し M PLUS 1（700-900）／案内役の台詞と札 DotGothic16／数字 Space Mono／本文は端末の日本語書体。 */

@font-face { font-family: 'DotGothic16'; font-style: normal; font-weight: 400; font-display: swap; src: url('./fonts/dotgothic16-subset.woff2') format('woff2'); }
@font-face { font-family: 'M PLUS 1'; font-style: normal; font-weight: 700 900; font-display: swap; src: url('./fonts/mplus1-vf-subset.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('../assets/fonts/inter-400-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2122, U+2212; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('../assets/fonts/inter-700-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2122, U+2212; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 900; font-display: swap; src: url('../assets/fonts/inter-900-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2122, U+2212; }
@font-face { font-family: 'Space Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('../assets/fonts/spacemono-400-latin.woff2') format('woff2'); unicode-range: U+0000-00FF; }
@font-face { font-family: 'Space Mono'; font-style: normal; font-weight: 700; font-display: swap; src: url('../assets/fonts/spacemono-700-latin.woff2') format('woff2'); unicode-range: U+0000-00FF; }

:root {
  --navy: #132A35;
  --cream: #FFFDF7;
  --yellow: #F6C928;
  --red: #B3261E;

  --bg: var(--cream);
  --bg-2: #F3F2ED;
  --bg-3: #E7E8E4;
  --ink: var(--navy);
  --ink-2: #4E5F65;
  --ink-3: #7D898C;
  --line: #DCDDDA;
  --line-strong: var(--navy);
  --panel: var(--navy);
  --panel-2: #2F434C;
  --on-panel: var(--cream);
  --yellow-soft: #FDF2CA;
  --red-soft: #F7E8E1;
  --red-ink: var(--red);
  --dot: rgba(19, 42, 53, .075);
  --shadow: 0 1px 0 rgba(19, 42, 53, .08), 0 8px 24px -12px rgba(19, 42, 53, .22);

  --font-body: 'Inter', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic UI', 'Yu Gothic', Meiryo, system-ui, sans-serif;
  --font-head: 'M PLUS 1', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic', sans-serif;
  --font-dot: 'DotGothic16', 'M PLUS 1', 'Hiragino Sans', sans-serif;
  --font-mono: 'Space Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --top-h: 60px;
  --side-w: 288px;
  --toc-w: 220px;
  --radius: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F2129; --bg-2: #132A35; --bg-3: #1B3540; --ink: var(--cream); --ink-2: #CBCECC; --ink-3: #93A0A3;
    --line: #2C434D; --line-strong: #CBCECC; --panel: #0B1A20; --panel-2: #1B3540; --yellow-soft: #3A3A22; --red-soft: #3A2423; --red-ink: #E2857B;
    --dot: rgba(255, 253, 247, .05); --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 10px 28px -14px rgba(0, 0, 0, .7); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F2129; --bg-2: #132A35; --bg-3: #1B3540; --ink: var(--cream); --ink-2: #CBCECC; --ink-3: #93A0A3;
  --line: #2C434D; --line-strong: #CBCECC; --panel: #0B1A20; --panel-2: #1B3540; --yellow-soft: #3A3A22; --red-soft: #3A2423; --red-ink: #E2857B;
  --dot: rgba(255, 253, 247, .05); --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 10px 28px -14px rgba(0, 0, 0, .7); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + 16px); }
body {
  margin: 0; min-height: 100vh; color: var(--ink); background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.3px);
  background-size: 22px 22px;
  font: 400 16px/1.85 var(--font-body); letter-spacing: .02em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--yellow); color: var(--navy); padding: 8px 14px; border-radius: 8px; font-weight: 700; }
.skip:focus { left: 12px; }

/* ── 上の帯 ─────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 60; height: var(--top-h);
  display: flex; align-items: center; gap: 10px; padding: 0 16px;
  background: var(--navy); color: var(--cream);
  border-bottom: 3px solid var(--yellow);
}
.top-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; min-width: 0; }
.top-wordmark { width: auto; height: 17px; display: block; }
.top-sub { font: 400 14px/1 var(--font-dot); color: var(--navy); background: var(--yellow); padding: 4px 8px 3px; border-radius: 5px; margin-left: 4px; white-space: nowrap; }
.top-search {
  margin-left: auto; display: flex; align-items: center; gap: 8px; height: 38px; min-width: 38px; padding: 0 12px;
  background: #2F434C; color: var(--cream); border: 1.5px solid rgba(255, 253, 247, .18); border-radius: 999px; cursor: pointer; font: 700 14px/1 var(--font-body);
}
.top-search:hover { border-color: var(--yellow); }
.top-search kbd { font: 700 11px/1 var(--font-mono); border: 1px solid rgba(255, 253, 247, .35); border-radius: 5px; padding: 3px 6px; opacity: .8; }
.top-search-ico { width: 16px; height: 16px; border: 2.5px solid currentColor; border-radius: 50%; position: relative; flex: none; }
.top-search-ico::after { content: ''; position: absolute; width: 7px; height: 2.5px; background: currentColor; right: -6px; bottom: -3px; transform: rotate(45deg); border-radius: 2px; }
.top-theme { width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid rgba(255, 253, 247, .18); background: #2F434C; cursor: pointer; display: grid; place-items: center; }
.top-theme span { width: 16px; height: 16px; border-radius: 50%; background: var(--yellow); box-shadow: inset -5px -3px 0 0 #2F434C; transition: box-shadow .3s; }
:root[data-theme="dark"] .top-theme span { box-shadow: inset 0 0 0 0 #2F434C; }
:root[data-theme="dark"] .hero, :root[data-theme="dark"] .home-hero { border-color: #2C434D; }
.top-app { display: inline-flex; align-items: center; height: 38px; padding: 0 14px; border-radius: 999px; background: var(--yellow); color: var(--navy); font: 800 14px/1 var(--font-head); text-decoration: none; white-space: nowrap; }
.top-app:hover { background: var(--cream); }
.top-menu { display: none; width: 40px; height: 40px; border: 0; background: transparent; cursor: pointer; padding: 0; }
.top-menu span, .top-menu span::before, .top-menu span::after { display: block; width: 22px; height: 2.5px; background: var(--cream); border-radius: 2px; position: relative; margin: auto; transition: transform .2s; }
.top-menu span::before, .top-menu span::after { content: ''; position: absolute; left: 0; }
.top-menu span::before { top: -7px; } .top-menu span::after { top: 7px; }
.top-menu[aria-expanded="true"] span { background: transparent; }
.top-menu[aria-expanded="true"] span::before { transform: translateY(7px) rotate(45deg); }
.top-menu[aria-expanded="true"] span::after { transform: translateY(-7px) rotate(-45deg); }

/* ── 3列の骨組み ───────────────────────── */
.layout { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr) var(--toc-w); align-items: start; max-width: 1480px; margin: 0 auto; }
.layout--home { grid-template-columns: var(--side-w) minmax(0, 1fr); }
.main { padding: 28px clamp(16px, 4vw, 48px) 64px; min-width: 0; }
.chapter { max-width: 800px; margin: 0 auto; }

/* ── 左の目次 ─────────────────────────── */
.side {
  position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto; overscroll-behavior: contain;
  padding: 18px 14px 40px; border-right: 1.5px solid var(--line); background: color-mix(in srgb, var(--bg-2) 82%, transparent);
  backdrop-filter: blur(6px); scrollbar-width: thin;
}
.side-home { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; text-decoration: none; font: 800 15px/1.2 var(--font-head); }
.side-home:hover { background: var(--bg-3); }
.side-home.is-active { background: var(--navy); color: var(--cream); }
.side-part { margin: 18px 10px 6px; font: 400 13px/1 var(--font-dot); color: var(--ink-3); letter-spacing: .12em; }
.side-part::before { content: '\25B6'; font-size: 9px; margin-right: 6px; color: var(--yellow); vertical-align: 2px; }
.side-list, .side-sub { list-style: none; margin: 0; padding: 0; }
.side-item > a { position: relative; display: grid; grid-template-columns: 32px 24px 1fr auto; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 12px; text-decoration: none; }
.side-item > a:hover { background: var(--bg-3); }
.side-item img { width: 32px; height: 32px; object-fit: contain; }
.side-no { font: 700 12px/1 var(--font-mono); color: var(--ink-3); }
.side-title { font: 700 14.5px/1.35 var(--font-head); }
.side-item.is-active > a { background: var(--navy); color: var(--cream); box-shadow: inset 4px 0 0 var(--yellow); }
.side-item.is-active .side-no { color: var(--yellow); }
.side-read { display: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--red-ink); color: var(--red-ink); font: 400 12px/20px var(--font-dot); text-align: center; transform: rotate(-12deg); }
[data-read] .side-read { display: block; }
.side-sub { margin: 4px 0 8px 52px; border-left: 2px dotted var(--line); }
.side-sub a { display: block; padding: 4px 10px; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); text-decoration: none; border-radius: 0 8px 8px 0; }
.side-sub a:hover, .side-sub a.is-current { color: var(--ink); background: var(--yellow-soft); }

/* ── 右の目次 ─────────────────────────── */
.toc { position: sticky; top: calc(var(--top-h) + 24px); max-height: calc(100vh - var(--top-h) - 48px); overflow-y: auto; padding: 8px 16px 24px 4px; font-size: 13.5px; }
.toc-title { margin: 0 0 10px; font: 400 13px/1 var(--font-dot); letter-spacing: .1em; color: var(--ink-3); }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc a { display: block; padding: 5px 0 5px 12px; margin-left: -2px; border-left: 2px solid transparent; line-height: 1.45; color: var(--ink-2); text-decoration: none; }
.toc .toc-l3 a { padding-left: 24px; font-size: 12.5px; }
.toc a:hover { color: var(--ink); }
.toc a.is-current { color: var(--ink); border-left-color: var(--yellow); font-weight: 700; }
.toc-mobile { display: none; }

/* ── 章の扉 ───────────────────────────── */
.hero {
  position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 18px;
  padding: 30px clamp(20px, 4vw, 40px); border-radius: 22px; color: var(--cream);
  background:
    radial-gradient(circle at 88% 22%, rgba(246, 201, 40, .22), transparent 38%),
    repeating-radial-gradient(circle at 92% 118%, transparent 0 26px, rgba(255, 253, 247, .07) 26px 27.5px),
    var(--navy);
  border: 3px solid var(--navy); box-shadow: 0 6px 0 var(--yellow), var(--shadow);
}
.hero::after { content: ''; position: absolute; inset: 8px; border: 1.5px solid rgba(255, 253, 247, .16); border-radius: 15px; pointer-events: none; }
.hero-no { margin: 0 0 6px; font: 700 13px/1 var(--font-mono); letter-spacing: .28em; color: var(--yellow); }
.hero h1 { margin: 0; font: 900 clamp(28px, 4.6vw, 42px)/1.2 var(--font-head); letter-spacing: .02em; }
.hero-lead { margin: 12px 0 0; color: rgba(255, 253, 247, .86); font-size: 15.5px; line-height: 1.75; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.hero-meta span { font: 400 13px/1 var(--font-dot); padding: 6px 10px 5px; border-radius: 6px; background: rgba(255, 253, 247, .1); border: 1px solid rgba(255, 253, 247, .2); }
.hero-ico { width: clamp(88px, 16vw, 150px); height: auto; filter: drop-shadow(0 8px 0 rgba(0, 0, 0, .25)); animation: float 5s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px) rotate(-2deg); } }

/* ── 本文 ─────────────────────────────── */
.prose { margin-top: 8px; }
.prose > p, .prose li { max-width: 40em; }
.prose h2 {
  position: relative; margin: 56px 0 18px; padding: 0 0 12px; font: 800 clamp(22px, 3vw, 27px)/1.4 var(--font-head);
  border-bottom: 3px solid var(--line-strong);
}
.prose h2::after { content: ''; position: absolute; left: 0; bottom: -3px; width: 72px; height: 3px; background: var(--yellow); }
.prose h3 { margin: 34px 0 10px; font: 800 19px/1.5 var(--font-head); display: flex; align-items: center; gap: 10px; }
.prose h3::before { content: ''; width: 10px; height: 10px; background: var(--red); border-radius: 2px; transform: rotate(45deg); flex: none; }
.anchor { position: absolute; left: -1.1em; opacity: 0; text-decoration: none; color: var(--ink-3); font-weight: 400; }
.prose h3 .anchor { left: -1.6em; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .anchor:focus { opacity: 1; }
.prose h3 { position: relative; }
.prose p { margin: 12px 0; }
.prose ul { padding-left: 1.3em; }
.prose ul li { margin: 6px 0; }
.prose ul li::marker { color: var(--red); }
.prose strong { background: linear-gradient(transparent 62%, var(--yellow-soft) 62%); font-weight: 700; }
.prose a:not([class]) { color: var(--ink); text-decoration-color: var(--yellow); text-decoration-thickness: 3px; text-underline-offset: 3px; }
.prose a:not([class]):hover { background: var(--yellow-soft); }
.prose code { font: 400 .9em var(--font-mono); background: var(--bg-3); padding: 1px 6px; border-radius: 5px; }
.lead-box { font-size: 17px; }

/* 画面のボタン名 */
.ui {
  display: inline-block; padding: 0 .55em; margin: 0 .12em; border: 1.5px solid var(--line-strong); border-radius: 8px;
  background: var(--bg); box-shadow: 0 2px 0 var(--line-strong); font-weight: 700; font-size: .93em; line-height: 1.6; text-indent: 0;
}
.ico { display: inline-flex; vertical-align: -3px; margin: 0 .15em; }
.ico svg { display: block; }

/* プラン・端末 */
.plan { display: inline-block; font: 700 11px/1 var(--font-mono); letter-spacing: .06em; padding: 4px 7px 3px; border-radius: 6px; vertical-align: 2px; margin: 0 .2em; border: 1.5px solid var(--navy); }
.plan--free { background: var(--bg); color: var(--ink); border-color: var(--line-strong); }
.plan--lite { background: var(--yellow); color: var(--navy); }
.plan--premium { background: var(--red); color: var(--cream); border-color: var(--red); }
.plan--team { background: var(--navy); color: var(--yellow); }
.os { display: inline-flex; gap: 4px; vertical-align: 2px; margin: 0 .2em; }
.os-tag { font: 700 10.5px/1 var(--font-mono); padding: 4px 6px 3px; border-radius: 5px; border: 1.5px solid var(--line); color: var(--ink-2); }

/* ── 手順（道のりの点線つき） ─────────────── */
.steps { list-style: none; counter-reset: step; margin: 18px 0 22px; padding: 0; }
.steps > li { position: relative; counter-increment: step; padding: 2px 0 18px 52px; min-height: 40px; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 36px; height: 36px; display: grid; place-items: center;
  background: var(--navy); color: var(--yellow); border: 2px solid var(--navy); border-radius: 10px; font: 700 16px/1 var(--font-mono);
  box-shadow: 0 3px 0 var(--yellow);
}
:root[data-theme="dark"] .steps > li::before { border-color: var(--yellow); }
.steps > li:not(:last-child)::after { content: ''; position: absolute; left: 17px; top: 42px; bottom: 4px; border-left: 2.5px dashed var(--line); }
.steps > li > p:first-child { margin-top: 4px; }

/* ── 画面写真 ─────────────────────────── */
.row { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 28px; align-items: start; margin: 20px 0 28px; }
.row > .shot { margin: 0; position: sticky; top: calc(var(--top-h) + 20px); }
.row-text > :first-child { margin-top: 0; }
.shot { margin: 24px auto; text-align: center; }
.shot-frame { position: relative; display: inline-block; line-height: 0; cursor: zoom-in; }
.shot--phone .shot-frame { max-width: 270px; padding: 7px; background: var(--navy); border-radius: 30px; box-shadow: 0 0 0 2px rgba(255, 253, 247, .1) inset, 0 12px 30px -14px rgba(19, 42, 53, .6); }
.shot--phone .shot-frame img { border-radius: 23px; }
.shot--wide .shot-frame { padding: 6px; background: var(--navy); border-radius: 16px; box-shadow: var(--shadow); }
.shot--wide .shot-frame img { border-radius: 11px; }
.shot--plain .shot-frame { border-radius: 14px; overflow: hidden; border: 1.5px solid var(--line); }
.shot figcaption { margin: 10px auto 0; max-width: 300px; font-size: 13.5px; line-height: 1.6; color: var(--ink-2); }
.shot--wide figcaption { max-width: 560px; }
.mark { position: absolute; border: 3px solid var(--yellow); border-radius: 10px; box-shadow: 0 0 0 2px var(--navy), 0 0 0 9999px rgba(19, 42, 53, 0); pointer-events: none; animation: mark 2.4s ease-in-out infinite; }
.mark b { position: absolute; left: -11px; top: -11px; width: 22px; height: 22px; display: grid; place-items: center; background: var(--red); color: var(--cream); border: 2px solid var(--cream); border-radius: 50%; font: 700 12px/1 var(--font-mono); }
@keyframes mark { 50% { box-shadow: 0 0 0 2px var(--navy), 0 0 0 7px rgba(246, 201, 40, .35); } }
.shot-missing { width: 260px; aspect-ratio: 390 / 844; display: grid; place-items: center; border: 2px dashed var(--red); border-radius: 26px; color: var(--red-ink); font: 700 12px var(--font-mono); }

/* ── 案内役：会話の窓（章の入口） ─────────── */
.dlg { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 14px; align-items: end; margin: 26px 0 8px; }
.dlg-portrait { position: relative; width: 116px; height: 116px; border-radius: 18px; background: var(--bg-2); border: 3px solid var(--navy); box-shadow: 0 4px 0 var(--navy); overflow: hidden; }
.dlg-portrait::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, transparent 0 7px, var(--dot) 7px 8px); }
.dlg-portrait img { position: relative; width: 100%; height: 100%; object-fit: contain; object-position: center bottom; transform: scale(1.12) translateY(6px); transition: opacity .15s; }
.dlg.is-pixel .dlg-portrait img, .say.is-pixel .say-face img, .cast-item.is-pixel img { image-rendering: pixelated; }
.dlg-box {
  position: relative; min-height: 116px; padding: 22px 22px 18px; border-radius: 12px; color: var(--cream); background: var(--navy);
  border: 3px solid var(--cream); outline: 3px solid var(--navy); box-shadow: 0 7px 0 3px rgba(19, 42, 53, .22);
}
:root[data-theme="dark"] .dlg-box { outline-color: var(--yellow); }
.dlg-name { position: absolute; top: -17px; left: 16px; margin: 0; padding: 5px 12px 4px; font: 400 15px/1 var(--font-dot); letter-spacing: .08em; border: 3px solid var(--navy); border-radius: 7px; background: var(--yellow); color: var(--navy); }
.dlg--doctor .dlg-name { background: var(--red); color: var(--cream); }
.dlg--zen .dlg-name { background: var(--cream); color: var(--navy); }
.dlg-lines { font: 400 16.5px/1.95 var(--font-dot); letter-spacing: .04em; }
.dlg-line { margin: 0; }
.dlg-line + .dlg-line { margin-top: 6px; }
.dlg.is-playing .dlg-line { display: none; }
.dlg.is-playing .dlg-line.is-shown { display: block; }
.dlg-next { position: absolute; right: 12px; bottom: 8px; display: flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--yellow); font: 400 13px/1 var(--font-dot); cursor: pointer; padding: 6px; }
.dlg-caret { width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 9px solid var(--yellow); animation: caret 1s steps(2) infinite; }
@keyframes caret { 50% { transform: translateY(3px); opacity: .4; } }
.dlg-line .cursor { display: inline-block; width: .55em; height: 1em; background: var(--yellow); vertical-align: -2px; margin-left: 2px; animation: blink .8s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ── 案内役：本文中のひとこと ─────────────── */
.say { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: start; margin: 22px 0; }
.say-face { position: relative; width: 64px; height: 64px; border-radius: 50%; background: var(--bg-2); border: 3px solid var(--yellow); overflow: hidden; }
.say-face img { position: absolute; width: 168%; max-width: none; height: auto; left: -34%; top: -6%; }
.say--zen .say-face img { width: 150%; left: -25%; top: -4%; }
.say--doctor .say-face { border-color: var(--red); }
.say--zen .say-face { border-color: var(--navy); }
:root[data-theme="dark"] .say--zen .say-face { border-color: var(--cream); }
.say-bubble { position: relative; padding: 12px 16px; border-radius: 4px 16px 16px 16px; background: var(--bg-2); border: 1.5px solid var(--line); }
.say-bubble::before { content: ''; position: absolute; left: -9px; top: 12px; width: 14px; height: 14px; background: var(--bg-2); border-left: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line); transform: rotate(45deg); }
.say-name { margin: 0 0 2px; font: 400 13px/1.4 var(--font-dot); letter-spacing: .08em; color: var(--ink-3); }
.say-name::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 2px; background: var(--yellow); vertical-align: 1px; }
.say--doctor .say-name::before { background: var(--red); }
.say--zen .say-name::before { background: var(--navy); }
:root[data-theme="dark"] .say--zen .say-name::before { background: var(--cream); }
.say-text > p { margin: 0; }
.say-text > p + p { margin-top: 6px; }

/* ── 囲み ─────────────────────────────── */
.callout { margin: 22px 0; padding: 14px 18px; border-radius: 14px; border: 1.5px solid var(--line); border-left-width: 6px; background: var(--bg-2); }
.callout--note { border-left-color: var(--navy); }
:root[data-theme="dark"] .callout--note { border-left-color: var(--cream); }
.callout--warn { border-color: var(--red); background: var(--red-soft); }
.callout--tip { border-color: var(--yellow); background: var(--yellow-soft); }
.callout-label { display: flex; align-items: center; gap: 4px; margin: 0 0 4px; font: 800 14px/1.4 var(--font-head); }
.callout--warn .callout-label { color: var(--red-ink); }
.callout-body > :first-child { margin-top: 0; } .callout-body > :last-child { margin-bottom: 0; }
.callout-body ul { margin: 6px 0; }

.more { margin: 18px 0; border: 1.5px dashed var(--line); border-radius: 14px; background: color-mix(in srgb, var(--bg-2) 60%, transparent); }
.more > summary { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; font: 700 15px/1.5 var(--font-head); list-style: none; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary::after { content: '+'; margin-left: auto; font: 700 18px/1 var(--font-mono); color: var(--ink-3); }
.more[open] > summary::after { content: '\2212'; }
.more-i { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--ink); font: italic 700 13px/1 Georgia, serif; flex: none; }
.more-body { padding: 0 18px 14px; }
.more-body > :first-child { margin-top: 0; }

.faq { margin: 10px 0; border: 1.5px solid var(--line); border-radius: 14px; background: var(--bg); box-shadow: 0 3px 0 var(--line); }
.faq > summary { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; cursor: pointer; list-style: none; font: 700 16px/1.6 var(--font-head); }
.faq > summary::-webkit-details-marker { display: none; }
.faq-q { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: var(--navy); color: var(--yellow); font: 700 13px/1 var(--font-mono); margin-top: 1px; }
:root[data-theme="dark"] .faq-q { background: var(--yellow); color: var(--navy); }
.faq[open] { border-color: var(--line-strong); }
.faq-a { padding: 0 18px 14px 54px; }
.faq-a > :first-child { margin-top: 0; }

.terms { margin: 16px 0; display: grid; gap: 10px; }
.term { padding: 14px 18px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--bg); }
.term dt { font: 800 17px/1.5 var(--font-head); }
.term dt small { margin-left: 10px; font: 400 12.5px var(--font-dot); color: var(--ink-3); }
.term dd { margin: 4px 0 0; color: var(--ink-2); }
.term:target { border-color: var(--yellow); box-shadow: 0 0 0 3px var(--yellow-soft); }

.table-wrap { overflow-x: auto; margin: 18px 0; border: 1.5px solid var(--line); border-radius: 14px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.6; }
.prose th, .prose td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--bg-2); font: 800 13.5px/1.5 var(--font-head); white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }

/* ── 札（入口のカード） ───────────────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 14px; margin: 18px 0 26px; }
.card { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; padding: 14px; border: 2px solid var(--line-strong); border-radius: 16px; background: var(--bg); box-shadow: 0 4px 0 var(--line-strong); text-decoration: none; transition: transform .12s, box-shadow .12s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--line-strong); }
.card:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line-strong); }
.card-ico { width: 56px; height: 56px; object-fit: contain; }
.card-title { display: block; font: 800 16px/1.4 var(--font-head); }
.card-desc { display: block; margin-top: 2px; font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }

/* ── 前後の章 ─────────────────────────── */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 64px 0 0; padding-top: 24px; border-top: 3px double var(--line); }
.pager a { display: block; padding: 14px 18px; border: 2px solid var(--line-strong); border-radius: 14px; text-decoration: none; background: var(--bg); box-shadow: 0 4px 0 var(--line-strong); }
.pager a:hover { background: var(--yellow-soft); }
.pager small { display: block; font: 400 12.5px/1.4 var(--font-dot); color: var(--ink-3); }
.pager b { display: block; font: 800 16px/1.4 var(--font-head); }
.pager-prev small::before { content: '\25C0  '; font-size: 9px; }
.pager-next { text-align: right; }
.pager-next small::after { content: '  \25B6'; font-size: 9px; }

/* ── 表紙 ─────────────────────────────── */
.home-hero {
  position: relative; overflow: hidden; margin: 0 0 30px; padding: clamp(28px, 5vw, 56px) clamp(20px, 4vw, 48px) 0; border-radius: 26px; color: var(--cream);
  background:
    radial-gradient(1.5px 1.5px at 12% 22%, rgba(255, 253, 247, .8), transparent),
    radial-gradient(1.5px 1.5px at 32% 12%, rgba(255, 253, 247, .6), transparent),
    radial-gradient(2px 2px at 58% 26%, rgba(246, 201, 40, .9), transparent),
    radial-gradient(1.5px 1.5px at 76% 10%, rgba(255, 253, 247, .7), transparent),
    radial-gradient(1.5px 1.5px at 90% 34%, rgba(255, 253, 247, .5), transparent),
    radial-gradient(circle at 80% -10%, rgba(246, 201, 40, .2), transparent 42%),
    repeating-radial-gradient(ellipse at 50% 150%, transparent 0 30px, rgba(255, 253, 247, .06) 30px 31.5px),
    var(--navy);
  border: 3px solid var(--navy); box-shadow: 0 7px 0 var(--yellow), var(--shadow);
}
.home-eyebrow { margin: 0; font: 700 13px/1 var(--font-mono); letter-spacing: .3em; color: var(--yellow); }
.home-title { margin: 18px 0 0; line-height: 0; }
.home-title img { display: block; width: min(620px, 100%); height: auto; }
.home-title-sub { display: inline-block; margin: 14px 0 0; padding: 7px 14px 6px; font: 400 clamp(19px, 3vw, 28px)/1.1 var(--font-dot); color: var(--navy); background: var(--yellow); border-radius: 8px; box-shadow: 4px 4px 0 rgba(0, 0, 0, .3); }
.home-lead { max-width: 34em; margin: 18px 0 0; color: rgba(255, 253, 247, .86); font-size: 15.5px; }
.home-search { display: flex; align-items: center; gap: 10px; width: min(560px, 100%); margin: 22px 0 0; padding: 0 16px; height: 52px; border-radius: 14px; border: 3px solid var(--cream); background: var(--cream); color: var(--navy); font: 700 15px/1 var(--font-body); cursor: pointer; text-align: left; box-shadow: 0 5px 0 rgba(0, 0, 0, .35); }
.home-search span:nth-child(2) { flex: 1; color: var(--ink-3); font-weight: 400; }
.home-search kbd { font: 700 12px/1 var(--font-mono); border: 1.5px solid #DCDDDA; border-radius: 6px; padding: 4px 7px; color: #7D898C; }
.home-cast { display: flex; justify-content: flex-end; align-items: flex-end; gap: clamp(4px, 2vw, 20px); margin: 22px -8px 0 0; height: clamp(120px, 20vw, 190px); }
.home-cast img { height: 100%; width: auto; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .25)); }
.home-cast img.is-pixel { image-rendering: pixelated; height: 62%; }
.home-ground { height: 16px; margin: 0 calc(-1 * clamp(20px, 4vw, 48px)); background: repeating-linear-gradient(90deg, var(--yellow) 0 18px, transparent 18px 30px), var(--panel-2); background-size: 30px 4px, auto; background-repeat: repeat-x; background-position: 0 6px, 0 0; }

.home-section { margin: 40px 0 0; }
.home-section > h2 { display: flex; align-items: baseline; gap: 12px; margin: 0 0 14px; font: 800 clamp(21px, 3vw, 26px)/1.4 var(--font-head); }
.home-section > h2 small { font: 700 12px/1 var(--font-mono); letter-spacing: .24em; color: var(--red-ink); }

.cast { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cast-item { margin: 0; display: grid; grid-template-columns: 76px 1fr; align-items: center; gap: 12px; padding: 12px; border: 2px solid var(--line-strong); border-radius: 16px; background: var(--bg); box-shadow: 0 4px 0 var(--line-strong); }
.cast-item img { width: 76px; height: 76px; object-fit: contain; border-radius: 12px; background: var(--bg-2); }
.cast-item figcaption b { display: block; font: 400 17px/1.3 var(--font-dot); }
.cast-item figcaption span { display: block; font-size: 13.5px; color: var(--ink-2); }

.quests { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.quest { position: relative; display: grid; grid-template-rows: auto auto 1fr; gap: 6px; padding: 16px 16px 18px; border: 2px solid var(--line-strong); border-radius: 18px; background: var(--bg); box-shadow: 0 5px 0 var(--line-strong); text-decoration: none; transition: transform .12s, box-shadow .12s; }
.quest:hover { transform: translateY(-3px); box-shadow: 0 8px 0 var(--line-strong); }
.quest img { width: 64px; height: 64px; object-fit: contain; }
.quest-no { position: absolute; right: 14px; top: 12px; font: 700 13px/1 var(--font-mono); color: var(--ink-3); }
.quest-title { font: 800 17px/1.4 var(--font-head); }
.quest-lead { font-size: 13.5px; line-height: 1.6; color: var(--ink-2); }
.quest-read { display: none; position: absolute; right: 12px; bottom: 12px; width: 34px; height: 34px; border-radius: 50%; border: 2.5px solid var(--red-ink); color: var(--red-ink); font: 400 15px/29px var(--font-dot); text-align: center; transform: rotate(-14deg); background: color-mix(in srgb, var(--bg) 70%, transparent); }
[data-read] .quest-read { display: block; }
.progress { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; font: 400 14px/1 var(--font-dot); color: var(--ink-2); }
.progress-bar { flex: 1; max-width: 260px; height: 12px; border: 2px solid var(--line-strong); border-radius: 4px; background: var(--bg); overflow: hidden; }
.progress-bar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--yellow) 0 8px, #E5B91F 8px 10px); transition: width .6s; }

/* ── 下の帯 ───────────────────────────── */
.foot { margin-top: 40px; background: var(--navy); color: var(--cream); border-top: 3px solid var(--yellow); }
.foot-inner { max-width: 1100px; margin: 0 auto; padding: 32px 20px 40px; display: grid; gap: 12px; }
.foot-brand { margin: 0; }
.foot-brand img { width: auto; height: 18px; display: block; }
.foot-meta { margin: 0; font-size: 13px; color: rgba(255, 253, 247, .7); }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; }
.foot-links a { text-decoration: none; color: var(--cream); opacity: .9; }
.foot-links a:hover { color: var(--yellow); }
.foot-copy { margin: 0; font: 400 12px var(--font-mono); opacity: .6; }

/* ── 検索 ─────────────────────────────── */
.search { position: fixed; inset: 0; z-index: 90; display: grid; align-items: start; justify-items: center; padding: 10vh 16px 16px; background: rgba(11, 26, 32, .62); backdrop-filter: blur(3px); }
.search[hidden] { display: none; }
.search-panel { width: min(640px, 100%); max-height: 76vh; display: flex; flex-direction: column; border-radius: 18px; background: var(--bg); border: 3px solid var(--navy); box-shadow: 0 8px 0 var(--yellow), 0 30px 60px -20px rgba(0, 0, 0, .6); overflow: hidden; }
.search-bar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 2px solid var(--line); color: var(--ink); }
.search-bar input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: 400 17px/1.4 var(--font-body); outline: none; padding: 6px 0; }
.search-close { border: 1.5px solid var(--line); background: var(--bg-2); color: var(--ink); border-radius: 8px; padding: 6px 10px; font: 700 13px/1 var(--font-body); cursor: pointer; }
.search-results { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.search-results li a { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; }
.search-results li a:hover, .search-results li a.is-active { background: var(--yellow-soft); }
.search-results small { display: block; font: 400 12px/1.4 var(--font-dot); color: var(--ink-3); }
.search-results b { display: block; font: 800 15.5px/1.45 var(--font-head); }
.search-results span { display: block; font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.search-results mark { background: var(--yellow); color: var(--navy); border-radius: 3px; padding: 0 1px; }
.search-empty { padding: 16px; color: var(--ink-2); font-size: 14px; }

/* ── 拡大 ─────────────────────────────── */
.zoom { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 56px 16px 16px; background: rgba(11, 26, 32, .88); cursor: zoom-out; }
.zoom[hidden] { display: none; }
.zoom img { max-height: calc(100vh - 80px); width: auto; border-radius: 22px; border: 6px solid var(--navy); box-shadow: 0 0 0 2px rgba(255, 253, 247, .2); }
.zoom-close { position: absolute; top: 14px; right: 14px; border: 2px solid var(--cream); background: var(--navy); color: var(--cream); border-radius: 10px; padding: 8px 14px; font: 700 14px/1 var(--font-body); cursor: pointer; }

/* ── 幅ごとの並び ─────────────────────── */
@media (max-width: 1279px) {
  .layout { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .toc { display: none; }
  .toc-mobile { display: block; margin: 18px 0 0; border: 1.5px solid var(--line); border-radius: 14px; background: var(--bg); }
  .toc-mobile summary { padding: 12px 16px; cursor: pointer; font: 400 14px/1.4 var(--font-dot); }
  .toc-mobile ol { margin: 0; padding: 0 16px 12px 36px; font-size: 14px; }
  .toc-mobile li { margin: 4px 0; }
  .toc-mobile .toc-l3 { margin-left: 14px; font-size: 13px; list-style: circle; }
  .toc-mobile a { text-decoration: none; }
}
@media (max-width: 1023px) {
  .layout, .layout--home { grid-template-columns: minmax(0, 1fr); }
  .top-menu { display: block; margin-left: -6px; }
  .side {
    position: fixed; z-index: 70; top: var(--top-h); left: 0; bottom: 0; height: auto; width: min(86vw, 320px);
    transform: translateX(-102%); transition: transform .22s ease; background: var(--bg); box-shadow: 0 0 0 9999px rgba(11, 26, 32, 0);
  }
  .side.is-open { transform: none; box-shadow: 20px 0 40px -20px rgba(0, 0, 0, .5), 0 0 0 9999px rgba(11, 26, 32, .45); }
  .row { grid-template-columns: minmax(0, 1fr); }
  .row > .shot { position: static; }
  .cast { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .top { gap: 6px; padding: 0 10px; }
  .top-wordmark { height: 13px; }
  .top-sub, .top-search-label, .top-search kbd { display: none; }
  .top-search { padding: 0; justify-content: center; width: 38px; }
  .top-app { padding: 0 11px; font-size: 13px; }
  .hero { grid-template-columns: minmax(0, 1fr); padding: 24px 20px; }
  .hero-ico { position: absolute; right: 12px; top: 12px; width: 64px; opacity: .9; }
  .hero-no, .hero h1 { padding-right: 64px; }
  .dlg { grid-template-columns: 76px minmax(0, 1fr); gap: 10px; }
  .dlg-portrait { width: 76px; height: 76px; border-radius: 14px; }
  .dlg-box { padding: 20px 14px 30px; min-height: 96px; }
  .dlg-lines { font-size: 15px; }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .faq-a { padding-left: 18px; }
  .shot--phone .shot-frame { max-width: 250px; }
}
@media (max-width: 360px) {
  .top-wordmark { height: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .top, .side, .toc, .toc-mobile, .pager, .foot, .search, .zoom, .dlg-next { display: none !important; }
  .layout { display: block; }
  body { background: #fff; }
}

/* ════════════════════════════════════════════════════════════
   紙の攻略本（2026-10-21）
   机の上に開いた本。章は「扉＋見出しごとの1ページ」に分かれ、つづけて読むか、めくって読む。
   ページは暗い表示でも紙の色のまま（暗くなるのは机）。
   ════════════════════════════════════════════════════════════ */
:root {
  --paper: #FFFDF7;
  --paper-edge: #EFE9D8;
  --paper-ink: #132A35;
  --paper-ink-2: #4E5F65;
  --paper-line: #D9D3C2;
  --desk: #E7E4DA;
}
:root[data-theme="dark"] { --desk: #0B1A20; }

.page-chapter { background-color: var(--desk); background-image: radial-gradient(var(--dot) 1px, transparent 1.3px); }
.page-chapter .chapter { max-width: 860px; }

/* ── ページ ── */
.book { display: grid; gap: 34px; counter-reset: none; }
.page {
  position: relative; padding: 46px clamp(18px, 5vw, 56px) 54px; color: var(--paper-ink);
  background:
    radial-gradient(120% 90% at 0% 50%, rgba(19, 42, 53, .07), transparent 22%),
    repeating-linear-gradient(0deg, rgba(19, 42, 53, .012) 0 1px, transparent 1px 3px),
    var(--paper);
  border-radius: 3px 8px 8px 3px;
  box-shadow:
    0 1px 0 var(--paper-edge), 2px 3px 0 -1px var(--paper), 2px 3px 0 0 var(--paper-line),
    4px 6px 0 -1px var(--paper), 4px 6px 0 0 var(--paper-line),
    0 18px 40px -22px rgba(11, 26, 32, .55);
  color-scheme: light;
  --bg: var(--paper); --bg-2: #F5F1E6; --bg-3: #ECE6D6; --ink: var(--paper-ink); --ink-2: var(--paper-ink-2); --ink-3: #7D898C;
  --line: var(--paper-line); --line-strong: var(--navy); --yellow-soft: #FBEFC4; --red-soft: #F6E3DA; --red-ink: var(--red);
}
.page::before { /* 綴じ目 */
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 14px; border-radius: 3px 0 0 3px;
  background: linear-gradient(90deg, rgba(19, 42, 53, .16), transparent);
}
.page-run { position: absolute; left: clamp(18px, 5vw, 56px); right: clamp(18px, 5vw, 56px); top: 16px; margin: 0; display: flex; justify-content: space-between; gap: 12px;
  font: 400 11.5px/1 var(--font-dot); letter-spacing: .12em; color: var(--paper-ink-2); border-bottom: 1px solid var(--paper-line); padding-bottom: 7px; }
.page-run span:last-child { text-align: right; }
.page-no { position: absolute; left: 0; right: 0; bottom: 14px; margin: 0; text-align: center; font: 700 12px/1 var(--font-mono); color: var(--paper-ink-2); letter-spacing: .1em; }
.page-no::before { content: '\2500\2500  '; } .page-no::after { content: '  \2500\2500'; }
.page-body { margin: 0; }
.page-body > :first-child { margin-top: 0; }

/* 扉 */
.page--open .hero { margin: 0 0 6px; }
.chapter-toc { margin: 22px 0 6px; padding: 14px 18px; border: 2px solid var(--navy); border-radius: 4px; background:
  radial-gradient(rgba(19, 42, 53, .09) 1px, transparent 1.2px) 0 0 / 6px 6px, var(--paper); }
.chapter-toc-title { margin: 0 0 6px; font: 400 14px/1 var(--font-dot); letter-spacing: .14em; }
.chapter-toc ol { margin: 0; padding: 0; list-style: none; columns: 2 220px; column-gap: 26px; }
.chapter-toc li { break-inside: avoid; margin: 3px 0; font-size: 14px; line-height: 1.5; }
.chapter-toc .toc-l2 a::before { content: '\25A0  '; color: var(--red); font-size: 10px; }
.chapter-toc .toc-l3 { padding-left: 1.3em; font-size: 13px; }
.chapter-toc a { text-decoration: none; }
.chapter-toc a:hover { background: var(--yellow-soft); }

/* 見出し＝黒ベタ帯に白抜き（攻略本の見出し） */
.page .prose h2 {
  margin: 0 0 20px; padding: 10px 14px 9px 46px; border: 0; color: var(--cream); background: var(--navy);
  font: 900 clamp(19px, 2.6vw, 24px)/1.35 var(--font-head); border-radius: 2px; box-shadow: 4px 4px 0 var(--yellow);
}
.page .prose h2::after { content: ''; position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px; background: var(--yellow); bottom: auto; border-radius: 2px; transform: rotate(45deg); }
.page .prose h2 .anchor { color: rgba(255, 253, 247, .6); left: auto; right: 10px; }
.page .prose h3 { margin-top: 30px; padding-bottom: 5px; border-bottom: 2px dotted var(--navy); }
.page .prose h3::before { width: 12px; height: 12px; border-radius: 0; transform: none; background: var(--navy); }

/* 囲み＝枠線の箱と網点 */
.page .callout { border-radius: 4px; border-width: 2px; border-left-width: 2px; position: relative; padding-top: 22px; }
.page .callout-label { position: absolute; top: -13px; left: 12px; margin: 0; padding: 3px 10px; background: var(--navy); color: var(--cream); font: 400 13px/1.2 var(--font-dot); border-radius: 2px; }
.page .callout--tip { background: radial-gradient(rgba(246, 201, 40, .35) 1px, transparent 1.3px) 0 0 / 5px 5px, var(--paper); }
.page .callout--tip .callout-label { background: var(--yellow); color: var(--navy); }
.page .callout--warn { background: var(--paper); }
.page .callout--warn .callout-label { background: var(--red); }
.page .callout .ico { display: none; }
.page .more, .page .faq, .page .term, .page .table-wrap { border-radius: 4px; }
.page .prose th { background: var(--navy); color: var(--cream); }
.page .prose tr:nth-child(even) td { background: #F7F3E8; }
.page .table-wrap { border: 2px solid var(--navy); }
.page .steps > li::before { border-radius: 50%; }
.page .say-bubble { background: #FFFFFF; border: 2px solid var(--navy); border-radius: 14px; }
.page .say-bubble::before { background: #FFFFFF; border-left: 2px solid var(--navy); border-bottom: 2px solid var(--navy); }
.page .dlg { margin-top: 24px; }

/* 読み方の切り替え */
.book-bar { display: flex; justify-content: flex-end; margin: 0 0 14px; }
.book-mode { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 2px solid var(--navy); border-radius: 999px; background: var(--paper); color: var(--navy); font: 400 14px/1 var(--font-dot); cursor: pointer; box-shadow: 0 3px 0 var(--navy); }
.book-mode:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--navy); }
.book-mode-ico { width: 18px; height: 14px; border: 2px solid currentColor; border-radius: 2px; position: relative; }
.book-mode-ico::after { content: ''; position: absolute; left: 50%; top: -2px; bottom: -2px; border-left: 2px solid currentColor; }
.book-mode[aria-pressed="true"] { background: var(--navy); color: var(--yellow); }

/* ── めくって読む ── */
.is-flip .book { position: relative; display: block; perspective: 2200px; }
.is-flip .page { display: none; height: calc(100vh - var(--top-h) - 150px); min-height: 460px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.is-flip .page.is-current { display: block; }
.is-flip .pager { display: none; }
.book-nav { position: sticky; bottom: 12px; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px auto 0; max-width: 520px; padding: 6px; border-radius: 999px; background: var(--navy); box-shadow: 0 10px 28px -12px rgba(0, 0, 0, .6); }
.book-nav[hidden] { display: none; }
.book-nav button { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--yellow); color: var(--navy); font: 400 15px/1 var(--font-dot); cursor: pointer; }
.book-nav button:disabled { opacity: .35; cursor: default; }
.book-prev span, .book-next span { width: 0; height: 0; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.book-prev span { border-right: 9px solid currentColor; }
.book-next span { border-left: 9px solid currentColor; }
.book-count { color: var(--cream); font: 700 13px/1 var(--font-mono); letter-spacing: .08em; }

/* めくる動き（前へ進む＝右のページが左へ倒れる） */
.page.flip-out-next { display: block; position: absolute; inset: 0; z-index: 3; transform-origin: left center; animation: flipNext .55s cubic-bezier(.45, .05, .35, 1) forwards; overflow: hidden; }
.page.flip-out-prev { display: block; position: absolute; inset: 0; z-index: 3; transform-origin: right center; animation: flipPrev .55s cubic-bezier(.45, .05, .35, 1) forwards; overflow: hidden; }
@keyframes flipNext { 0% { transform: rotateY(0); } 60% { box-shadow: -30px 0 40px rgba(0, 0, 0, .25); } 100% { transform: rotateY(-100deg); opacity: .2; } }
@keyframes flipPrev { 0% { transform: rotateY(0); } 100% { transform: rotateY(100deg); opacity: .2; } }

/* 見開き（広い画面）：2ページを左右に並べる */
@media (min-width: 1280px) {
  .is-flip .chapter { max-width: 1260px; }
  .is-flip.has-spread .layout { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .is-flip.has-spread .toc { display: none; }
  .is-flip.has-spread .book { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
  .is-flip.has-spread .page.is-current { display: flex; }
  .is-flip.has-spread .page.is-left { border-radius: 8px 3px 3px 8px; }
  .is-flip.has-spread .page.is-left::before { left: auto; right: 0; border-radius: 0 3px 3px 0; background: linear-gradient(270deg, rgba(19, 42, 53, .18), transparent); }
}

/* 表紙＝本の表紙 */
.page-home .home-hero { border-radius: 6px 14px 14px 6px; box-shadow: inset 14px 0 0 rgba(0, 0, 0, .18), inset 16px 0 0 rgba(255, 253, 247, .12), 0 7px 0 var(--yellow), 0 24px 40px -20px rgba(0, 0, 0, .6); }
.home-edition { margin: 14px 0 0; font: 400 12.5px/1.5 var(--font-dot); color: rgba(255, 253, 247, .72); letter-spacing: .08em; }

@media (max-width: 640px) {
  .page { padding: 42px 16px 50px; }
  .page-run span:first-child { display: none; }
  .is-flip .page { height: calc(100vh - var(--top-h) - 128px); }
  .book-nav button { padding: 0 14px; }
}
@media print {
  .book-bar, .book-nav { display: none !important; }
  .page { box-shadow: none; break-after: page; }
}

/* ページ自身の幅で組む（見開きの半分の幅でも、手順と写真を縦に積む） */
.page { container-type: inline-size; }
@container (max-width: 640px) {
  .page .row { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .page .row > .shot { position: static; }
  .page .hero { grid-template-columns: minmax(0, 1fr); padding: 26px 22px; }
  .page .hero-ico { position: absolute; right: 14px; top: 14px; width: 72px; }
  .page .hero-no, .page .hero h1 { padding-right: 76px; }
  .page .hero h1 { font-size: 30px; }
  .page .chapter-toc ol { columns: 1; }
  .page .dlg { grid-template-columns: 84px minmax(0, 1fr); }
  .page .dlg-portrait { width: 84px; height: 84px; }
}
.is-flip .page { padding-bottom: 92px; }
.is-flip .page-no { bottom: 70px; }

/* ── 見た目の検査（2026-10-21）の指摘を直す ── */
/* 1. 印の光が画面全体を染めない（影の数と形を両端で揃える） */
.mark { box-shadow: 0 0 0 2px var(--navy), 0 0 0 0 rgba(246, 201, 40, 0); }
@keyframes mark { 50% { box-shadow: 0 0 0 2px var(--navy), 0 0 0 7px rgba(246, 201, 40, .35); } }
.shot-frame { isolation: isolate; }

/* 2・3. めくって読む：本文だけが中で動き、ページ番号は下端に固定。続きがある時は「つづく」 */
.page-more { display: none; }
.page-cont { margin: 0 0 14px; font: 400 13px/1.4 var(--font-dot); color: var(--paper-ink-2); letter-spacing: .08em; }
.page-cont::before { content: '\25A0  '; color: var(--red); font-size: 10px; }
.is-flip .page { display: none; flex-direction: column; overflow: hidden; padding-bottom: 46px; }
.is-flip .page.is-current, .is-flip .page.flip-out-next, .is-flip .page.flip-out-prev { display: flex; }
.is-flip .page-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding-right: 4px; }
.is-flip .page.has-more .page-body { -webkit-mask-image: linear-gradient(#000 calc(100% - 34px), transparent); mask-image: linear-gradient(#000 calc(100% - 34px), transparent); }
.is-flip .page.has-more .page-more { display: block; position: absolute; right: clamp(18px, 5vw, 56px); bottom: 14px; margin: 0; font: 400 12px/1 var(--font-dot); color: var(--red); letter-spacing: .1em; }
.is-flip .page.has-more .page-more::after { content: ' \25BC'; font-size: 9px; }
.is-flip .page-no { bottom: 14px; }
@media (max-width: 640px) { .is-flip .page { padding-bottom: 96px; } .is-flip .page-no, .is-flip .page.has-more .page-more { bottom: 74px; } }

/* 4. 章の目次は1段（小見出しが親から離れない） */
.chapter-toc ol { columns: 1; }

/* 5. 選んでいる章のアイコンと「済」 */
.side-item.is-active img { background: var(--cream); border-radius: 8px; padding: 2px; }
.side-item.is-active .side-read { border-color: var(--yellow); color: var(--yellow); }

/* 6・7. 会話の窓（狭い所では顔を上に寄せる・後ろに余白） */
.dlg { align-items: start; }
.page .dlg { margin-bottom: 22px; }
@container (max-width: 480px) {
  .page .dlg { grid-template-columns: minmax(0, 1fr); margin-top: 46px; }
  .page .dlg-portrait { position: absolute; z-index: 2; width: 66px; height: 66px; right: 12px; margin-top: -48px; }
  .page .dlg-box { padding-right: 18px; }
}
.dlg { position: relative; }

/* 8・9. 表紙も机の上の本。中の見出しは黒ベタ帯 */
.page-home { background-color: var(--desk); background-image: radial-gradient(var(--dot) 1px, transparent 1.3px); }
.page--home { margin-top: 26px; padding-top: 50px; }
.page--home .page-body { margin: 0; }
.page--home .home-section:first-child { margin-top: 0; }
.page--home .home-section > h2 { position: relative; padding: 10px 14px 9px 46px; color: var(--cream); background: var(--navy); font-size: clamp(19px, 2.6vw, 24px); border-radius: 2px; box-shadow: 4px 4px 0 var(--yellow); }
.page--home .home-section > h2::before { content: ''; position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px; background: var(--yellow); border-radius: 2px; transform: rotate(45deg); }
.page--home .home-section > h2 small { order: 2; margin-left: auto; color: var(--yellow); font-size: 11px; }
.page--home .home-section > h2 .anchor { display: none; }
.page--home .dlg { margin: 0 0 8px; }

/* 10. やりたいことの札は3列（9枚がそろう） */
@media (min-width: 1024px) { .page--home .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* 11. スマホの章の一覧は2列・説明は2行まで */
@media (max-width: 640px) {
  .quests { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .quest { padding: 12px; }
  .quest img { width: 44px; height: 44px; }
  .quest-title { font-size: 15px; }
  .quest-lead { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12.5px; }
  .card-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .home-search span:nth-child(2) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* 12. 案内役の名前 */
.cast-item figcaption b { font: 800 17px/1.3 var(--font-head); }

/* 13. 用語の参照リンクは語の途中で折らない */
.term dd a { display: inline-block; white-space: nowrap; }

/* 15. 左の目次の下端 */
.side { padding-bottom: 64px; }

/* 暗い表示：操作の帯と切り替えに縁 */
:root[data-theme="dark"] .book-nav { box-shadow: 0 0 0 2px var(--yellow), 0 10px 28px -12px rgba(0, 0, 0, .6); }
:root[data-theme="dark"] .book-mode { box-shadow: 0 0 0 2px var(--yellow); }
