/* データモデルの道具箱(合体版)。外部フォント・外部通信なし。 */
:root {
  --paper: #F3F4EF; --band: #E9ECE6; --panel: #FAFBF8; --ink: #1F2A2E; --muted: #66746F;
  --rule: #CBD3CD; --rule2: #DDE3DC; --accent: #245C8C; --accent-soft: #DEE8F1; --now: #C2452F; --ok: #3F7B57; --ok-soft: #E1EEE5; --warn-soft: #F5E4E0; --code: #EAEEE8;
  --card: #7A5A3A; --tape: #8A6A2F; --chain: #2F5F8F; --hier: #6F7A2A; --rel: #6A3F8F; --dict: #3F7B57; --event: #B0662A;
  --deep: #183C37; --deep2: #20483E; --deep3: #14332E; --deep-ink: #EAF1DF; --deep-mute: #B1C5B8; --deep-line: #709886; --lime: #D5E79C; --gold: #DECC9A;
  --serif: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  --sans: "Yu Gothic UI", "Hiragino Sans", "Noto Sans JP", Meiryo, system-ui, sans-serif;
  --mono: Consolas, "Courier New", "Noto Sans Mono", monospace;
  --topH: 150px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #141A1C; --band: #1A2124; --panel: #1B2226; --ink: #E4E9E6; --muted: #98A4A2;
    --rule: #2E393C; --rule2: #263033; --accent: #86B6DF; --accent-soft: #1E2F3E; --now: #E5705A; --ok: #7FC397; --ok-soft: #1F2E25; --warn-soft: #3A2622; --code: #232C30;
    --card: #C9A27C; --tape: #D2AC6A; --chain: #7FB0E0; --hier: #C2CF6A; --rel: #B893E0; --dict: #7FC397; --event: #E0A070;
  }
}
:root[data-theme="dark"] {
  --paper: #141A1C; --band: #1A2124; --panel: #1B2226; --ink: #E4E9E6; --muted: #98A4A2;
  --rule: #2E393C; --rule2: #263033; --accent: #86B6DF; --accent-soft: #1E2F3E; --now: #E5705A; --ok: #7FC397; --ok-soft: #1F2E25; --warn-soft: #3A2622; --code: #232C30;
  --card: #C9A27C; --tape: #D2AC6A; --chain: #7FB0E0; --hier: #C2CF6A; --rel: #B893E0; --dict: #7FC397; --event: #E0A070;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 14.5px; line-height: 1.75; font-feature-settings: "palt"; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
a { touch-action: manipulation; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.3; margin: 0; text-wrap: balance; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
p { margin: 0 0 .7em; }
a { color: var(--accent); text-underline-offset: 3px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--event); outline-offset: 3px; }
.skip { position: fixed; top: -100px; left: 16px; z-index: 50; background: var(--accent); color: var(--paper); padding: .4rem .8rem; border-radius: 4px; }
.skip:focus { top: 12px; }

/* ── 動き ── */
@keyframes arrive { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: none; } }
@keyframes flash { from { box-shadow: inset 0 0 0 3px var(--ok); } to { box-shadow: inset 0 0 0 0 transparent; } }
@keyframes flashbad { from { box-shadow: inset 0 0 0 3px var(--now); } to { box-shadow: inset 0 0 0 0 transparent; } }
@keyframes blink { 0%, 100% { opacity: .15; } 50% { opacity: .95; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes seek { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-14deg); } }
@keyframes flow { to { stroke-dashoffset: -24; } }
@keyframes draw { from { stroke-dashoffset: 400; } to { stroke-dashoffset: 0; } }
@keyframes cardfly { 0% { transform: translate(0, 0); opacity: 0; } 12% { opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)); opacity: 1; } }
@keyframes printline { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(213, 231, 156, .55); } 50% { box-shadow: 0 0 0 7px rgba(213, 231, 156, 0); } }
@keyframes swap { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.arrive { animation: arrive .35s ease-out both; }
.vis .lamp { animation: blink 1.6s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -.23s); }
.vis .reel { animation: spin 3s linear infinite; transform-box: fill-box; transform-origin: 50% 50%; animation-delay: calc(var(--i, 0) * -1.1s); }
.vis .spin { animation: spin 1.4s linear infinite; }
.vis .spin.slow { animation-duration: 6s; }
.vis .seek { animation: seek 2.4s ease-in-out infinite; }
.vis .cardfly { animation: cardfly 1.1s cubic-bezier(.4, 0, .6, 1) both; animation-delay: calc(var(--i, 0) * .16s); }
.vis .printline { fill: var(--ink); transform-box: fill-box; transform-origin: left center; animation: printline .5s ease-out both; animation-delay: calc(var(--i, 0) * .25s); }
.vis .match.draw { stroke-dasharray: 400; animation: draw .9s ease-out both; animation-delay: calc(var(--i, 0) * .08s); }
html.reduced-motion *, html.reduced-motion *::before, html.reduced-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ── 上部: 年 ── */
.top { position: sticky; top: 0; z-index: 30; background: var(--paper); border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .1rem 1.2rem; align-items: center; padding: .3rem 1.2rem .3rem; }
.brand { display: flex; align-items: center; gap: .6rem; }
.brand .mark { width: 30px; height: 30px; flex: none; border-radius: 7px; display: block; }
.brand .brandtext { display: grid; }
.brand h1 { font-size: 1.05rem; letter-spacing: .02em; white-space: nowrap; line-height: 1.2; }
.brand .eyebrow { display: none; }
.brand .tagline { font-size: .66rem; color: var(--muted); line-height: 1.3; }
.eyebrow { font-family: var(--mono); font-size: .64rem; letter-spacing: .14em; color: var(--muted); }
/* 時代の札は「年表の帯」: 一本の線の上に点と名前と年。データ辞書(並走する仕組み)は点線の点(2026-09-14 ユーザー選定) */
.tools { display: flex; gap: 0; flex-wrap: nowrap; min-width: 0; align-items: stretch; position: relative; padding: 0 .4rem; width: max-content; max-width: 100%; align-self: center; }
.tools::before { content: ''; position: absolute; left: .9rem; right: .9rem; top: calc(1.025rem + .08rem + 4.5px); height: 2px; background: var(--rule); }
.tools .tsep { display: none; }
.tool { --h: var(--muted); display: grid; justify-items: center; gap: .08rem; position: relative; border: 0; background: transparent; padding: 0 .55rem; cursor: pointer; font-family: var(--sans); white-space: nowrap; }
.tool .n { order: 1; font-weight: 700; font-size: .82rem; color: var(--ink); line-height: 1.35; padding: 0 .45rem; border-radius: 4px; transition: color .2s, background .2s; }
.tool::after { content: ''; order: 2; width: 11px; height: 11px; border-radius: 50%; background: var(--paper); border: 2.2px solid var(--h); box-sizing: border-box; transition: background .2s; }
.tool .y { order: 3; font-family: var(--mono); font-size: .66rem; color: var(--h); }
.tool:hover .n { color: var(--h); }
.tool.on::after { background: var(--h); } .tool.on .n { background: var(--h); color: var(--paper); } /* 選んだ時代は名前の地も塗る(2026-09-14 ユーザー指示) */
.tool.off { opacity: .5; cursor: default; }
.tool.aside { margin-left: 1rem; } .tool.aside::after { border-style: dashed; }
/* 飛んだ直後の「← 年表へ戻る」の札 */
.backchip { position: fixed; left: 16px; bottom: 18px; z-index: 40; }
.backchip .btn { box-shadow: 0 5px 20px rgba(0, 0, 0, .2); font-size: .88rem; padding: .35rem 1rem; }

/* ── 図(app-figs.js) ── */
.fig { max-width: 100%; height: auto; display: block; }
.fig .fb { fill: var(--paper); stroke: var(--ink); stroke-width: 1.2; } .fig .fb.hot { fill: var(--accent-soft); stroke: var(--accent); }
.fig .fbh { fill: var(--band); stroke: var(--muted); stroke-width: .8; } .fig .fbr { fill: var(--paper); stroke: var(--rule); stroke-width: .6; } .fig .fbr.hot { fill: var(--accent-soft); }
.fig .fcard { fill: #F7EFD9; stroke: #B79A5C; stroke-width: 1; } .fig .freel { fill: var(--paper); stroke: var(--ink); stroke-width: 1.2; } .fig .freel.hot { fill: var(--accent-soft); stroke: var(--accent); }
.fig .fdot { fill: var(--rule); } .fig .fdot.on { fill: var(--accent); }
.fig .ft { font-family: var(--sans); font-size: 12px; fill: var(--ink); } .fig .fts { font-family: var(--sans); font-size: 10px; fill: var(--muted); } .fig .fth { font-family: var(--sans); font-size: 11px; fill: var(--muted); } .fig .fth.hot { fill: var(--now); }
.fig .fta { font-family: var(--mono); font-size: 10px; fill: var(--accent); } .fig .ftc { font-family: var(--sans); font-size: 9px; fill: var(--muted); } .fig .ftv { font-family: var(--mono); font-size: 10px; fill: var(--ink); } .fig .fts.hot { fill: var(--now); }
.fig .cur { stroke: var(--accent); stroke-width: 2.2; fill: var(--accent-soft); } .fig .faint { opacity: .5; } .fig .link { cursor: pointer; } .fig .link:hover .fb { stroke: var(--accent); }
.fig .fnote { fill: var(--panel); stroke: var(--rule); stroke-width: 1; } .fig .fer { fill: var(--paper); stroke: var(--ink); stroke-width: 1.2; }
.cmpwrap { overflow-x: auto; margin: .6rem 0 1rem; } .cmp { border-collapse: collapse; width: 100%; min-width: 860px; font-size: .8rem; background: var(--paper); }
.cmp th, .cmp td { border: 1px solid var(--rule); padding: .35rem .5rem; vertical-align: top; text-align: left; } .cmp thead th { background: var(--panel); font-weight: 700; white-space: nowrap; } .cmp thead th .y { font-family: var(--mono); color: var(--muted); font-weight: 400; margin-right: .3em; }
.cmp tbody th { font-weight: 600; width: 10em; background: var(--panel); } .cmp th.cur, .cmp td.cur { background: var(--accent-soft); } .cmp td b { display: block; font-family: var(--mono); font-size: .86rem; font-weight: 600; } .cmp td small { display: block; color: var(--muted); font-size: .7rem; line-height: 1.45; margin-top: .1rem; }
.cmp td.link { cursor: pointer; } .cmp td.link:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
.reflist { list-style: none; padding: 0; margin: .3rem 0 1rem; } .reflist li { padding: .3rem 0; border-bottom: 1px solid var(--rule); font-size: .84rem; line-height: 1.6; } .reflist .k { font-family: var(--mono); color: var(--accent); margin-right: .5em; } .reflist .use { color: var(--muted); font-size: .72rem; margin-left: .5em; } .reflist .from { color: var(--muted); font-size: .72rem; margin-left: .4em; white-space: nowrap; }
.lineage { margin: .3rem 0 .4rem; } .lineage svg { width: 100%; max-width: 980px; height: auto; display: block; } .lineage .lgd { list-style: none; margin: .2rem 0 .6rem; padding: 0; display: flex; flex-wrap: wrap; gap: .15rem 1.2rem; font-size: .78rem; color: var(--muted); } .lineage .lgd .no { font-family: var(--mono); color: var(--accent); margin-right: .3em; }
.fig .fa { stroke: var(--ink); stroke-width: 1.2; fill: none; } .fig .fa.hot { stroke: var(--accent); stroke-width: 1.6; } .fig .fa.dash { stroke-dasharray: 5 4; stroke: var(--now); } .fig .fah { fill: var(--ink); }
figure.fig { margin: .6rem 0 1rem; padding: .6rem .8rem; background: var(--panel); border: 1px solid var(--rule); border-radius: 5px; overflow-x: auto; } figure.fig figcaption { font-size: .78rem; color: var(--muted); margin-top: .4rem; line-height: 1.6; }
.modelessay { margin-top: 1.4rem; border-top: 2px solid var(--rule); padding-top: .8rem; }
/* ── 辞書の表 ── */
.dictbox { overflow-x: auto; } .dictbox table { border-collapse: collapse; font-size: .78rem; width: 100%; } .dictbox th { text-align: left; font-weight: 400; color: var(--muted); font-size: .68rem; padding: .2rem .5rem; border-bottom: 1px solid var(--rule); } .dictbox td { padding: .25rem .5rem; border-bottom: 1px solid var(--rule2); vertical-align: top; } .dictbox td.k { font-weight: 700; white-space: nowrap; }
/* ── 本体のタブ ── */
.maintabs { display: grid; grid-template-columns: minmax(0, 62em); justify-content: center; padding: 0 1.4rem; border-bottom: 1px solid var(--rule); background: var(--paper); position: sticky; top: var(--topH); z-index: 29; }
.maintabs .tabrow { display: flex; flex-wrap: wrap; gap: 0; margin-left: -.9rem; min-width: 0; } /* タブの先頭を本文の左端に揃える(タブの余白 .9rem 分だけ左へ) */ /* タブもヘッダの下に留まる(2026-09-14 ユーザー指示) */
[data-loc], .bench, .stage, .story { scroll-margin-top: calc(var(--topH) + 3rem); }
.maintab { border: 0; border-bottom: 3px solid transparent; background: transparent; padding: .45rem .9rem .35rem; font-size: .95rem; font-weight: 700; color: var(--muted); cursor: pointer; font-family: var(--sans); display: inline-flex; align-items: baseline; gap: .3rem; line-height: 1.3; }
.maintab .cnt { font-family: var(--mono); font-size: .7rem; font-weight: 400; color: var(--accent); }
.maintab:hover { color: var(--ink); } .maintab.on { color: var(--ink); border-bottom-color: var(--accent); }
[hidden] { display: none !important; }
/* ── 時代の姿 ── */
.stage { padding: 1rem 1.4rem 1.2rem; border-bottom: 1px solid var(--rule); background: var(--band); }
.stage.swap > * { animation: swap .4s ease-out both; }
.stage .sh { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1.2rem; margin-bottom: .5rem; }
.stage .sh h2 { font-size: 1.5rem; }
.stage .sh .sum { font-size: .92rem; color: var(--ink); max-width: 62em; line-height: 1.7; }
.stabs { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--rule); margin: .4rem 0 .8rem; }
.stab { border: 0; border-bottom: 2px solid transparent; background: transparent; padding: .3rem .8rem; font-size: .88rem; cursor: pointer; color: var(--muted); }
.stab.on { color: var(--ink); border-bottom-color: var(--ink); font-weight: 700; }
.stage .sh { margin-bottom: .2rem; }
.stage .sh .range { font-size: .78rem; color: var(--muted); flex-basis: 100%; } .stage .sh .range .mono { color: var(--accent); margin-right: .4em; }
.sbody { display: grid; grid-template-columns: minmax(0, 1fr); gap: .8rem; align-items: start; }
.sbody .visbox .vis { width: 100%; max-width: 100%; height: auto; margin: 0 auto; }
.sbody .text { max-width: 70em; }
.sbody .visbox { background: var(--panel); border: 1px solid var(--rule); border-radius: 5px; padding: .6rem; display: grid; gap: .5rem; }
.sbody .visbox .cap { font-size: .78rem; color: var(--muted); line-height: 1.5; }
.sbody .text { font-size: .92rem; line-height: 1.8; }
.sbody .text h4 { font-size: 1.05rem; margin: 0 0 .3rem; }
.sbody .text p { margin: 0 0 .6rem; }
.daylist { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.daylist li { display: grid; grid-template-columns: 4.5em 1fr; gap: .6rem; font-size: .9rem; }
.daylist .t { font-family: var(--mono); color: var(--accent); font-size: .82rem; }
.numlist { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; font-size: .9rem; }
.numlist li { border-left: 2px solid var(--rule); padding-left: .6rem; }
ruby rt { font-size: .55em; color: var(--muted); font-weight: 400; letter-spacing: 0; }
.deep { margin-top: .9rem; border-top: 1px dashed var(--rule); padding-top: .3rem; }
.deeph { font-family: var(--sans); font-weight: 700; font-size: .92rem; color: var(--accent); margin: .2rem 0 .3rem; }
.deep summary { cursor: pointer; font-weight: 700; font-size: .92rem; color: var(--accent); padding: .35rem 0; list-style: none; }
.deep summary::before { content: '▸ '; } .deep[open] summary::before { content: '▾ '; }
.deep summary::-webkit-details-marker { display: none; }
.deep .exbody { margin-top: .3rem; border-top: 0; padding-top: 0; }
.taskhead { margin-bottom: .9rem; }
.artlink, .gotab { border: 0; background: transparent; color: var(--accent); font-size: .74rem; font-family: var(--sans); letter-spacing: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 0; }
.playrow { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; margin: .3rem 0 .2rem; }
.btn.play { font-size: .92rem; padding: .3rem 1.1rem; }
.exbody { margin-top: .8rem; border-top: 1px dashed var(--rule); padding-top: .6rem; }
.exbody h4 { font-size: 1rem; margin: .6rem 0 .2rem; break-after: avoid; }
.exbody p { font-size: .9rem; line-height: 1.8; margin: 0 0 .5rem; }
.srcs { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .5rem; column-span: all; }
.src { font-family: var(--mono); font-size: .66rem; background: var(--code); border-radius: 3px; padding: 0 .35em; color: var(--muted); }
.src.gen { border: 1px solid var(--rule); background: transparent; }
.gensrc { font-size: .74rem; color: var(--muted); margin-top: .4rem; column-span: all; line-height: 1.6; }
.code { font-family: var(--mono); font-size: .78rem; line-height: 1.55; background: var(--code); border-radius: 4px; padding: .6rem .8rem; white-space: pre; overflow-x: auto; margin: 0; }
.code .c { color: var(--muted); }

/* ── 一週間 ── */
.cases { display: block; min-width: 0; }
.days { display: flex; flex-wrap: wrap; gap: .3rem; padding: .8rem 1.4rem 0; }
.day { border: 1px solid var(--rule); background: var(--panel); border-radius: 4px; padding: .3rem .7rem; text-align: left; cursor: pointer; display: grid; min-width: 9.5em; max-width: 15em; transition: border-color .2s; }
.day .dk { font-family: var(--mono); font-size: .62rem; letter-spacing: .06em; color: var(--muted); display: flex; gap: .4rem; }
.day.done .dk .st { color: var(--ok); }
.day .dt { font-size: .8rem; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.day.locked { opacity: .5; cursor: default; }
.day:hover { background: var(--band); }
.weekhint { padding: .3rem 1.4rem 0; font-size: .78rem; color: var(--muted); flex-basis: 100%; }
.bench { padding: .9rem 1.4rem 3rem; min-width: 0; }
.bench:focus { outline: none; }
.caller { display: flex; gap: .6rem; align-items: baseline; font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; color: var(--muted); }
.caller .dayb { color: var(--paper); background: var(--ink); padding: 0 .5em; border-radius: 3px; }
.bench h2 { font-size: 1.3rem; margin: .1rem 0 .2rem; }
.bench .sub { color: var(--muted); font-size: .86rem; margin-bottom: .9rem; }
.card { background: var(--panel); border: 1px solid var(--rule); border-radius: 5px; padding: .9rem 1rem 1rem; margin-bottom: 1rem; }
.card h3 { font-family: var(--sans); font-weight: 700; font-size: .8rem; letter-spacing: .06em; color: var(--muted); margin: 0 0 .5rem; }
.row { display: flex; flex-wrap: wrap; gap: .5rem .8rem; align-items: center; margin: .4rem 0; }
.btn { border: 1px solid var(--accent); color: var(--accent); background: transparent; border-radius: 4px; padding: .2rem .8rem; font-size: .84rem; cursor: pointer; white-space: nowrap; }
.btn.solid { background: var(--accent); color: var(--paper); } .btn.on { background: var(--ink); color: var(--paper); border-color: var(--ink); } .btn.ghost { border-color: var(--rule); color: var(--muted); } .btn.warn { border-color: var(--now); color: var(--now); } .btn.warn.solid { background: var(--now); color: var(--paper); } .btn[disabled] { opacity: .45; cursor: default; }
.btn.lime { background: var(--lime); border-color: var(--lime); color: #173D32; } .btn.deep { background: transparent; color: var(--deep-ink); border-color: var(--deep-line); }
select.sel { border: 1px solid var(--rule); border-radius: 4px; padding: .1rem .4rem; background: var(--panel); font-family: var(--mono); font-size: .82rem; } select.sel.bad { border-color: var(--now); }
label.chk { display: inline-flex; gap: .35rem; align-items: center; font-size: .88rem; }
.msg { border-radius: 4px; padding: .6rem .8rem; margin-top: .6rem; font-size: .88rem; line-height: 1.6; background: var(--band); animation: arrive .3s ease-out both; }
.msg.ok { background: var(--ok-soft); border-left: 3px solid var(--ok); } .msg.warn { background: var(--warn-soft); border-left: 3px solid var(--now); }
.msg b { font-weight: 700; } .msg .k { display: block; font-family: var(--mono); font-size: .64rem; letter-spacing: .1em; color: var(--muted); margin-bottom: .1rem; }
.prog { font-family: var(--mono); font-size: .8rem; line-height: 1.6; background: var(--code); border-radius: 4px; padding: .5rem .7rem; margin: .4rem 0; white-space: pre-wrap; overflow-x: auto; }
.prog .cur { color: var(--now); } .prog .cmt { color: var(--muted); } .prog .dim { color: var(--muted); }
.steps { font-family: var(--mono); font-size: .74rem; color: var(--muted); }
.passes { display: grid; gap: .35rem; margin: .3rem 0 .5rem; }
.pass { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; font-size: .88rem; }
.pass .no { font-family: var(--mono); font-size: .72rem; color: var(--muted); width: 3.4em; } .pass .aim { color: var(--muted); font-size: .8rem; }
.decision { border: 1px solid var(--accent); border-radius: 5px; padding: 1rem 1.1rem; background: var(--accent-soft); margin-bottom: 1rem; }
.decision h3 { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; margin: 0 0 .4rem; color: var(--ink); }
.decision p { font-size: .92rem; } .decision .reveal { margin-top: .7rem; border-top: 1px dashed var(--rule); padding-top: .6rem; font-size: .9rem; }
.decision .vis { margin: .5rem 0; }
.machines { display: grid; gap: .5rem; }
.mstep { display: grid; grid-template-columns: 2.2em 1fr auto; gap: .6rem; align-items: center; border: 1px solid var(--rule2); border-radius: 4px; padding: .45rem .7rem; background: var(--paper); transition: border-color .3s; }
.mstep .no { font-family: var(--mono); font-size: .72rem; color: var(--muted); }
.mstep .what { font-size: .88rem; } .mstep .what small { display: block; color: var(--muted); font-size: .76rem; }
.mstep.done { border-color: var(--ok); } .mstep .res { font-family: var(--mono); font-size: .74rem; color: var(--ok); text-align: right; }
.mstep.run { border-color: var(--accent); }
.mstep .anim { grid-column: 1 / -1; border: 0; background: transparent; }
.reel { border: 1px solid var(--rule); border-radius: 4px; background: var(--paper); padding: .5rem .6rem; font-size: .78rem; margin-top: .6rem; transition: border-color .2s; }
.reel.on { border-color: var(--tape); box-shadow: inset 0 0 0 1px var(--tape); }
.reel h4 { margin: 0 0 .3rem; font-family: var(--mono); font-size: .7rem; letter-spacing: .06em; color: var(--tape); display: flex; justify-content: space-between; }
.reel table { border-collapse: collapse; width: 100%; font-family: var(--mono); font-size: .7rem; }
.reel td, .reel th { border-bottom: 1px solid var(--rule2); padding: .05rem .25rem; text-align: left; white-space: nowrap; }
.reel th { color: var(--muted); font-weight: 500; }
.reel tr.read td { background: var(--accent-soft); } .reel tr.hit td { background: var(--ok-soft); font-weight: 700; } .reel tr.stale td { color: var(--now); }
.reel td.copy { color: var(--muted); }
.reel.broken { border-color: var(--now); border-style: dashed; } .reel .brk { color: var(--now); font-size: .72rem; margin-top: .3rem; }
.reel .vis { margin: .3rem 0; border: 0; background: transparent; }
.tbls { display: flex; flex-wrap: wrap; gap: .7rem; align-items: flex-start; }
.tbl { border-collapse: collapse; font-size: .78rem; background: var(--paper); }
.tbl caption { text-align: left; font-weight: 700; font-size: .74rem; padding-bottom: .1rem; display: flex; gap: .5rem; align-items: baseline; }
.tbl caption .n { font-family: var(--mono); font-size: .64rem; color: var(--muted); font-weight: 400; }
.tbl th, .tbl td { border: 1px solid var(--rule); padding: .05rem .45rem; font-family: var(--mono); }
.tbl th { font-weight: 500; color: var(--muted); background: var(--band); font-family: var(--sans); }
.tbl tr.hl td { background: var(--accent-soft); } .tbl.new caption { color: var(--chain); }
.tbl tr.arrive { animation: arrive .35s ease-out both; animation-delay: calc(var(--i, 0) * .07s); }
.tbl tr.extra td { background: var(--warn-soft); color: var(--now); animation: flashbad 1s ease-out both; } .tbl tr.extra td:first-child::before { content: '+ '; font-weight: 700; }
.tbl td.changed { background: var(--ok-soft); font-weight: 700; animation: flash .8s ease-out both; } .tbl td.stale { background: var(--warn-soft); color: var(--now); font-weight: 700; }
.tbl th.selcol, .tbl td.selcol { background: var(--accent-soft); }
.expr { font-family: var(--mono); font-size: .86rem; background: var(--code); border-radius: 4px; padding: .5rem .7rem; margin: .4rem 0; white-space: pre-wrap; } .expr .dim { color: var(--muted); }

/* ── 鎖を歩く(オカレンス図) ── */
.graph { position: relative; background: var(--deep); background-image: radial-gradient(rgba(255, 255, 255, .08) .8px, transparent .8px); background-size: 17px 17px; border-radius: 6px; aspect-ratio: calc(var(--w) / var(--h)); margin: .3rem 0; overflow: hidden; }
.graph svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.graph .wire { fill: none; stroke: var(--deep-line); stroke-width: 1.2; opacity: .6; transition: stroke .25s, opacity .25s; }
.graph .wire.e { stroke: #D9A66B; } .graph .wire.p { stroke: #8FB6DF; } .graph .wire.q { stroke: #8FD1A0; } .graph .wire.a { stroke: #C7A6E8; } .graph .wire.dash { stroke-dasharray: 5 4; }
.graph .wire.active { stroke: var(--lime); stroke-width: 3; opacity: 1; stroke-dasharray: 7 5; animation: flow 1.2s linear infinite; }
.graph .wire.walked { opacity: 1; stroke-width: 2; }
.graph .traveler { fill: var(--lime); filter: drop-shadow(0 0 5px var(--lime)); }
.graph .glabel { position: absolute; left: .6%; transform: translateY(-50%); font-family: var(--mono); font-size: 10px; color: var(--deep-mute); letter-spacing: .1em; pointer-events: none; }
.node { position: absolute; transform: translate(-50%, -50%); padding: 3px 4px; border: 1px solid var(--deep-line); background: var(--deep2); color: var(--deep-ink); border-radius: 4px; text-align: center; line-height: 1.2; cursor: pointer; transition: background .25s, border-color .25s, box-shadow .25s; }
.node strong { display: block; font-size: 12px; font-weight: 600; white-space: nowrap; }
.node small { display: block; font-family: var(--mono); font-size: 9px; color: var(--deep-mute); white-space: nowrap; }
.node.ord { border-color: #D9A66B; } .node.link { background: #2C5A4A; } .node.alt { border-color: #C7A6E8; border-style: dashed; }
.node.current { background: var(--lime); color: #193B32; border-color: var(--lime); box-shadow: 0 0 0 4px rgba(213, 231, 156, .18); animation: pulse 1.6s ease-out infinite; }
.node.current small { color: #36583E; }
.node.next { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(222, 204, 154, .25); }
.node.found { border-color: var(--lime); } .node.found::after { content: '✓'; position: absolute; right: 3px; top: 1px; color: var(--lime); font-size: 10px; } .node.current.found::after { color: #193B32; }
.node.bad { border-color: #F0A090; } .node.bad::after { content: '!'; position: absolute; right: 4px; top: 1px; color: #F0A090; font-size: 10px; font-weight: 700; }
.node.hl { border-color: var(--now); box-shadow: 0 0 0 2px var(--now); }
.node.static { cursor: default; }
.gkey { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .72rem; color: var(--muted); margin: .2rem 0 .4rem; }
.gkey i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.walk { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1rem; align-items: start; }
.walkside { display: grid; gap: .6rem; }
.walkside h4 { font-size: 1.1rem; margin: 0; }
.walkside .say { font-size: .88rem; color: var(--ink); margin: 0; }
.trace { font-family: var(--mono); font-size: .8rem; background: var(--code); border-radius: 4px; padding: .5rem .7rem; overflow-wrap: anywhere; min-height: 2.6em; }
.trace .ok { color: var(--ok); } .trace .ng { color: var(--now); }
.chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.chip { border: 1px solid var(--ok); background: var(--ok-soft); color: var(--ink); border-radius: 3px; padding: .05rem .5rem; font-size: .8rem; animation: arrive .3s ease-out both; } .chip.bad { border-color: var(--now); background: var(--warn-soft); }
.walkctl { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.walkctl .steps { margin-left: auto; }
.segmented { display: inline-flex; border: 1px solid var(--rule); border-radius: 4px; padding: 2px; gap: 2px; }
.segmented button { border: 0; background: transparent; padding: .15rem .6rem; font-size: .78rem; border-radius: 2px; color: var(--muted); }
.segmented button.on { background: var(--ink); color: var(--paper); }
.cmdlog { font-family: var(--mono); font-size: .74rem; line-height: 1.55; color: var(--muted); background: var(--code); border-radius: 4px; padding: .4rem .6rem; max-height: 9.5em; overflow-y: auto; white-space: pre-wrap; }
.cmdlog .cur { color: var(--ink); font-weight: 700; }

/* ── 見る(動き) ── */
/* 動きは幅いっぱいに(右の帳簿を外したので広く使う)。大きく表示は画面を覆う */
.film { display: block; width: 70%; max-width: 70%; height: auto; margin: 0 auto; background: #E9ECE6; border: 1px solid var(--rule); border-radius: 5px; }
.filmwrap { position: relative; } .filmwrap .fulltop { display: none; }
.filmwrap.full { position: fixed; inset: 0; z-index: 60; background: var(--paper); overflow: auto; padding: .6rem 1.2rem 1rem; display: flex; flex-direction: column; gap: .3rem; }
.filmwrap.full .fulltop { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; } .fullnav { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; } .filmwrap.full .fulltitle { font-size: 1rem; font-weight: 700; } .filmwrap.full .fulltitle .dayb { margin-right: .4rem; }
.filmwrap.full .playrow { margin: 0; }
.filmwrap.full .filmcard { border: 0; background: transparent; padding: 0; margin: 0; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; } .filmwrap.full .filmcard h3 { display: none; }
.filmwrap.full { --zoom: 1; } .filmwrap.full .filmcard { overflow: auto; }
.filmwrap.full .film { width: calc(100% * var(--zoom)); max-width: calc((100vh - 12.5rem) * 760 / 360 * var(--zoom)); margin: 0 auto; }
.zoomctl { display: none; } .filmwrap.full .zoomctl { display: inline-flex; } .zoomctl .zoomv { font-family: var(--mono); font-size: .72rem; padding: .2rem .5rem; color: var(--muted); align-self: center; }
.filmwrap.full .fcap { font-size: 1.05rem; max-width: 62em; margin: .2rem auto 0; }
body.filmfull { overflow: hidden; }
.filmbar { display: flex; flex-wrap: wrap; gap: .5rem .7rem; align-items: center; margin: .5rem 0; }
.filmbar progress { flex: 1 1 8rem; height: 8px; accent-color: var(--accent); }
.fclock { font-family: var(--mono); font-size: .76rem; color: var(--muted); white-space: nowrap; }
.fcap { font-size: .9rem; line-height: 1.7; min-height: 2.6em; margin: .2rem 0; } .fcap b { font-family: var(--serif); font-size: 1rem; margin-right: .5rem; }
.fphases { display: inline-flex; flex-wrap: wrap; gap: .25rem; counter-reset: ph; }
.fph { counter-increment: ph; border: 1px solid var(--rule); background: var(--paper); border-radius: 3px; padding: .15rem .55rem; font-size: .74rem; color: var(--ink); line-height: 1.4; }
.fph::before { content: counter(ph) ' '; font-family: var(--mono); color: var(--muted); }
.fph:hover { background: var(--band); }
.fph.on { border-color: var(--accent); color: var(--accent); font-weight: 700; box-shadow: inset 0 0 0 1px var(--accent); }
.playrow .btn.play { margin-right: .3rem; }
.pnotes { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.pnotes li { border-left: 3px solid var(--rule2); padding: .1rem .8rem .2rem; transition: border-color .2s, background .2s; }
.pnotes li.on { border-left-color: var(--accent); background: var(--accent-soft); border-radius: 0 4px 4px 0; }
.pnt { border: 0; background: transparent; padding: 0; font-family: var(--serif); font-weight: 600; font-size: .98rem; color: var(--ink); text-align: left; cursor: pointer; counter-increment: pn; }
.pnotes { counter-reset: pn; } .pnt::before { content: counter(pn) ' '; font-family: var(--mono); color: var(--accent); font-weight: 400; }
.pnotes li p { margin: .15rem 0 0; font-size: .88rem; line-height: 1.75; }
.stagequiz { margin-top: .8rem; }
.stagequiz .card { background: var(--panel); }
.fnote { font-size: .76rem; color: var(--muted); margin-top: .3rem; }
/* ── 確かめる ── */
.qz { border-top: 1px solid var(--rule2); padding: .7rem 0 .4rem; }
.qq { font-size: .95rem; margin-bottom: .45rem; line-height: 1.6; } .qn { font-family: var(--mono); color: var(--accent); margin-right: .5rem; }
.qz.ok .qq::after { content: ' ✓'; color: var(--ok); font-weight: 700; } .qz.ng .qq::after { content: ' ✗'; color: var(--now); font-weight: 700; }
.qc { display: flex; flex-wrap: wrap; gap: .4rem; } .qc .btn { white-space: normal; text-align: left; } .qc .btn[disabled] { opacity: .75; }
.qscore { font-family: var(--mono); font-size: .8rem; color: var(--muted); }
/* ── 正規化の実験室 ── */
.phase-nav { display: flex; flex-wrap: wrap; gap: .2rem 1.2rem; border-bottom: 1px solid var(--rule); margin-bottom: .8rem; }
.phase-nav button { border: 0; background: transparent; padding: .4rem 0; font-size: .86rem; color: var(--muted); border-bottom: 3px solid transparent; }
.phase-nav button.on { color: var(--ink); border-bottom-color: var(--now); font-weight: 700; }
.phase-nav button span { font-family: var(--mono); font-size: .7rem; margin-right: .4rem; color: var(--now); }
.phase-nav button.done span { color: var(--ok); }
.rules { background: var(--band); border: 1px solid var(--rule); border-radius: 5px; padding: .8rem 1rem; font-size: .84rem; }
.rules h4 { font-size: .95rem; margin: 0 0 .4rem; }
.rules .fd { border-top: 1px solid var(--rule2); padding: .4rem 0; } .rules .fd code { font-family: var(--mono); font-size: .8rem; color: var(--accent); display: block; }
.rules ul { padding-left: 1.2rem; margin: .4rem 0; } .rules li { font-size: .8rem; }
.labgrid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 1rem; align-items: start; }
.closure { background: var(--deep); color: var(--deep-ink); border-radius: 6px; padding: 1rem 1.1rem; margin: .5rem 0; }
.closure h4 { font-size: 1rem; margin: 0 0 .5rem; }
.achips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
.achip { border: 1px solid var(--deep-line); border-radius: 4px; background: transparent; color: var(--deep-ink); padding: .35rem .7rem; font-size: .84rem; transition: background .25s, border-color .25s; }
.achip.seed { background: var(--lime); border-color: var(--lime); color: #15382E; }
.achip.reached { border-color: var(--lime); color: var(--lime); box-shadow: inset 0 -3px var(--lime); animation: arrive .35s ease-out both; }
.cnote { font-size: .84rem; line-height: 1.8; min-height: 2.6em; }
.closure .row { border-top: 1px solid rgba(255, 255, 255, .15); padding-top: .6rem; }
.closure .steps { color: var(--deep-mute); }
.relations { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .6rem; margin: .5rem 0; }
.relation { border: 1px solid var(--rule); border-radius: 5px; padding: .6rem .8rem; background: var(--paper); animation: arrive .4s ease-out both; }
.relation.sel { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.relation h4 { font-size: .92rem; margin: 0; display: flex; justify-content: space-between; gap: .5rem; align-items: center; font-family: var(--sans); }
.relation .attrs { font-size: .84rem; margin: .3rem 0; } .relation .keys { font-size: .72rem; color: var(--muted); }
.badge { font-family: var(--mono); font-size: .64rem; padding: .05rem .4rem; border-radius: 3px; background: var(--warn-soft); color: var(--now); white-space: nowrap; } .badge.good { background: var(--ok-soft); color: var(--ok); } .badge.mid { background: var(--accent-soft); color: var(--accent); }
.split { background: var(--band); border: 1px solid var(--rule); border-radius: 5px; padding: .8rem 1rem; margin-top: .6rem; }
.split h4 { font-size: 1rem; margin: 0 0 .3rem; }
.split-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; background: var(--panel); margin: .5rem 0; }
.split-grid > * { padding: .35rem .7rem; border-bottom: 1px solid var(--rule2); font-size: .84rem; }
.split-grid .gh { background: var(--band); color: var(--muted); font-size: .72rem; }
.split-grid label { display: flex; align-items: center; gap: .4rem; cursor: pointer; }
.split-grid input { accent-color: var(--accent); width: 16px; height: 16px; }
.previews { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.previews h5 { font-size: .78rem; margin: .4rem 0 .2rem; color: var(--muted); }
.checks { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin: .5rem 0; }
.checkcard { padding: .7rem .8rem; background: var(--paper); border: 1px solid var(--rule); border-radius: 5px; animation: arrive .4s ease-out both; animation-delay: calc(var(--i, 0) * .12s); }
.checkcard .sym { font-family: var(--mono); font-size: 1.3rem; color: var(--now); display: block; } .checkcard.good .sym { color: var(--ok); } .checkcard.mid .sym { color: var(--accent); }
.checkcard h4 { font-size: .9rem; margin: 0; font-family: var(--sans); } .checkcard p { font-size: .76rem; color: var(--muted); margin: .3rem 0 0; line-height: 1.6; }
.theory details { border-top: 1px solid var(--rule2); padding: .5rem 0; }
.theory summary { cursor: pointer; font-weight: 700; font-size: .86rem; }
.theory p { font-size: .84rem; color: var(--ink); margin: .5rem 0; }
.proof { font-family: var(--mono); font-size: .76rem; line-height: 1.7; background: var(--code); border-radius: 4px; padding: .5rem .7rem; margin: .4rem 0; }
.done-banner { background: var(--deep); color: var(--deep-ink); padding: 1rem 1.2rem; border-radius: 6px; margin: .6rem 0; animation: arrive .5s ease-out both; }
.done-banner h4 { color: var(--lime); font-size: 1.15rem; margin: 0 0 .3rem; }
.done-banner p { font-size: .88rem; color: var(--deep-ink); }
.srclist { font-size: .78rem; padding-left: 1.2rem; color: var(--muted); } .srclist li { margin: .3rem 0; }

/* ── 図 ── */
.vis { display: block; width: auto; max-width: 100%; height: auto; background: var(--paper); border: 1px solid var(--rule2); border-radius: 3px; }
.visbox .vis { border: 0; }
.vis text { font-family: var(--sans); font-size: 12px; fill: var(--ink); }
.vis .small { font-size: 10px; fill: var(--muted); font-family: var(--mono); } .vis .small.dim { fill: var(--rule); }
.vis .lbl { font-size: 11px; }
.vis .sym { fill: var(--panel); stroke: var(--ink); stroke-width: 1.2; }
.vis .sym.tape { fill: var(--band); } .vis .sym.card { fill: #FBF3DF; } .vis .sym.disk { fill: var(--accent-soft); } .vis .sym.term { fill: var(--accent-soft); } .vis .sym.man { fill: var(--band); }
.vis .arr { stroke: var(--ink); stroke-width: 1.3; fill: none; }
.vis .note { font-size: 10px; fill: var(--muted); }
.vis .floor { fill: var(--band); stroke: var(--rule); }
.vis .dev { fill: var(--panel); stroke: var(--ink); stroke-width: 1.2; }
.vis .dev.cpu { fill: #E4E0D6; } .vis .dev.tapeu { fill: #EFE9DC; } .vis .dev.disku { fill: var(--accent-soft); } .vis .dev.term { fill: #DFE9F1; }
.vis .glyph { fill: none; stroke: var(--ink); stroke-width: 1; } .vis .glyph.f { fill: var(--ink); stroke: none; }
.vis .glyph.paper { fill: var(--paper); stroke: var(--muted); }
.vis .room { font-family: var(--mono); font-size: 10px; fill: var(--muted); letter-spacing: .1em; }
.vis .pcard { fill: #F7EFD9; stroke: #B79A5C; stroke-width: 1.2; }
.vis .hole { fill: var(--ink); }
.vis .fldband { fill: var(--accent); fill-opacity: .12; stroke: var(--accent); stroke-width: .6; }
.vis .fldt { font-size: 9px; fill: var(--accent); font-family: var(--mono); }
.vis .colno { font-size: 6.5px; fill: #8A7A52; font-family: var(--mono); }
.vis .spool { fill: var(--band); stroke: var(--tape); stroke-width: 2; } .vis .spoolc { fill: var(--tape); } .vis .spoolln { stroke: var(--tape); stroke-width: 1; opacity: .5; }
.vis .rec { fill: var(--panel); stroke: var(--rule); stroke-width: 1; transition: fill .2s; } .vis .rec.read { fill: var(--accent-soft); stroke: var(--accent); } .vis .rec.hit { fill: var(--ok-soft); stroke: var(--ok); stroke-width: 1.6; }
.vis .rt { font-family: var(--mono); font-size: 10.5px; } .vis .head { fill: var(--now); }
.vis .fld { fill: var(--panel); stroke: var(--ink); stroke-width: 1.1; } .vis .fld.ptr { fill: var(--accent-soft); stroke: var(--accent); } .vis .fld.ins { fill: var(--warn-soft); stroke: var(--now); stroke-dasharray: 3 2; }
.vis .fk { font-family: var(--mono); font-size: 8.5px; fill: var(--muted); } .vis .fv { font-size: 11px; }
.vis .ruler { stroke: var(--muted); stroke-width: .8; }
.vis .tapeicon circle { fill: var(--band); stroke: var(--tape); stroke-width: 2; } .vis .tapeicon text { font-size: 10.5px; fill: var(--muted); } .vis .tapeicon.new circle { stroke: var(--ok); }
.vis .cpu { fill: var(--panel); stroke: var(--ink); stroke-width: 1.2; } .vis .cput { font-size: 11px; }
.vis .platter { fill: var(--band); stroke: var(--ink); stroke-width: 1.4; } .vis .track { fill: none; stroke: var(--rule); stroke-width: 1; stroke-dasharray: 3 3; } .vis .hub { fill: var(--ink); }
.vis .arm { stroke: var(--now); stroke-width: 3; stroke-linecap: round; } .vis .armhead { fill: var(--now); }
.vis.occ .box { fill: var(--panel); stroke: var(--ink); stroke-width: 1.1; } .vis.occ .box.link { fill: var(--band); }
.vis.occ text { font-size: 11px; } .vis.occ .sub { font-family: var(--mono); font-size: 8.5px; fill: var(--muted); }
.vis .ring { fill: none; stroke: var(--chain); stroke-width: 1.4; } .vis .ring.prior { stroke: var(--muted); stroke-dasharray: 4 3; } .vis .ring.own { stroke: var(--ok); stroke-dasharray: 1.5 3; }
.vis .th { font-weight: 700; font-size: 11px; } .vis .cell { font-family: var(--mono); font-size: 11px; } .vis .cell .key { fill: var(--accent); font-weight: 700; } .vis .cell.hit { fill: var(--now); }
.vis .match { fill: none; stroke: var(--rule); stroke-width: 1; } .vis .match.hit { stroke: var(--now); stroke-width: 2; }
.vis .fd { fill: none; stroke: var(--accent); stroke-width: 1.4; } .vis .fd.done { stroke: var(--ok); }
.vis.anim { border: 0; background: transparent; }

/* ── 帳簿 ── */
/* ── 物語・課題と解決(時代ごとに一本の記事) ── */
.story { padding: 1rem 1.4rem 3rem; }
.essay { max-width: 62em; }
.essay .ehead { margin-bottom: 1.2rem; } .essay .ehead h2 { font-family: var(--serif); font-size: 1.6rem; line-height: 1.35; margin: .2rem 0 .5rem; text-wrap: balance; }
.essay .lead { font-size: .98rem; line-height: 1.8; color: var(--ink); margin: 0; }
.essay .esec { margin: 1.3rem 0 0; border-top: 1px solid var(--rule); padding-top: .8rem; }
.essay .esec h3 { font-family: var(--serif); font-size: 1.15rem; margin: 0 0 .5rem; display: flex; gap: .6rem; align-items: baseline; } .essay .esec h3 .no { font-size: .8rem; color: var(--accent); }
.essay .ep { font-size: .95rem; line-height: 1.9; margin: 0 0 .7rem; }
.essay .ptag { display: inline-block; font-family: var(--mono); font-size: .58rem; letter-spacing: .06em; border: 1px solid var(--rule); border-radius: 3px; padding: 0 .35em; margin-right: .5em; color: var(--muted); vertical-align: .15em; }
.essay .ep.nk .ptag { border-color: var(--accent); color: var(--accent); } .essay .ep.app { color: var(--muted); } .essay .ep.app .ptag { border-style: dashed; }
.essay .refs { margin: .2rem 0 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.essay .ep.math .ptag { border-color: var(--ok); color: var(--ok); }
.essay .formula { font-family: var(--mono); font-size: .86rem; line-height: 1.7; background: var(--code); border-left: 3px solid var(--ok); border-radius: 0 4px 4px 0; padding: .45rem .8rem; margin: .2rem 0 .8rem; white-space: pre-wrap; overflow-x: auto; }
.essay .credit { font-size: .76rem; color: var(--muted); line-height: 1.7; margin-top: 1.4rem; border-top: 1px dashed var(--rule); padding-top: .6rem; }
.tlbox { max-width: 62em; margin-top: 1.6rem; border-top: 2px solid var(--rule); padding-top: .8rem; } .tlbox h3.eyebrow { margin: 0 0 .6rem; }
.story .sh { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1.2rem; margin-bottom: .8rem; } .story .sh h2 { font-size: 1.5rem; } .story .sh .sum { font-size: .92rem; color: var(--ink); line-height: 1.7; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.timeline > li { display: grid; grid-template-columns: 3.6em 1fr; gap: .6rem; font-size: .88rem; line-height: 1.6; }
.timeline .ty { color: var(--accent); font-size: .95rem; padding-top: .05em; }
.timeline ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.timeline .tag { font-family: var(--mono); font-size: .6rem; border: 1px solid var(--rule); border-radius: 3px; padding: 0 .3em; color: var(--muted); margin-right: .35em; white-space: nowrap; } .timeline .tag.nk { border-color: var(--accent); color: var(--accent); }
.timeline .none, .arts .none { color: var(--muted); font-size: .8rem; }
.arts button .lead { font-size: .8rem; color: var(--ink); line-height: 1.6; margin-top: .2rem; }
.arts { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.arts li { animation: arrive .4s ease-out both; }
.arts button { display: grid; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--accent); padding: .35rem .7rem .4rem; background: var(--paper); border-radius: 0 4px 4px 0; font-size: .84rem; line-height: 1.5; cursor: pointer; }
.arts button:hover { background: var(--band); }
.arts button .when { font-family: var(--mono); font-size: .68rem; color: var(--accent); letter-spacing: .06em; }
.arts button b { font-family: var(--serif); font-weight: 600; font-size: .98rem; }
.arts button .who { font-size: .74rem; color: var(--muted); }
.arts li.rel button { border-left-color: var(--now); background: var(--accent-soft); }
.arts .tag { font-family: var(--mono); font-size: .6rem; border: 1px solid var(--rule); border-radius: 3px; padding: 0 .3em; color: var(--muted); margin-left: .4em; }
.arts .none { color: var(--muted); font-size: .8rem; }

/* ── 読み物(ダイアログ) ── */
dialog { border: 0; border-radius: 8px; max-width: 760px; width: calc(100% - 32px); max-height: 88vh; background: var(--paper); color: var(--ink); padding: 0; box-shadow: 0 30px 100px rgba(0, 0, 0, .35); }
dialog::backdrop { background: rgba(16, 45, 41, .78); backdrop-filter: blur(3px); }
.dtop { padding: .8rem 1.6rem; display: flex; justify-content: space-between; align-items: center; gap: .6rem; border-bottom: 1px solid var(--rule); position: sticky; top: 0; background: var(--paper); z-index: 1; }
#dossier-content { padding: 1.6rem 2.2rem 2.2rem; }
.dhead { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.2rem; }
.dyear { font-family: var(--mono); font-size: 2.8rem; color: var(--rule); letter-spacing: -.05em; line-height: 1; }
.drole { font-size: .74rem; background: var(--accent); color: var(--paper); padding: .2rem .6rem; border-radius: 3px; }
.dtag { font-family: var(--mono); font-size: .66rem; border: 1px solid var(--rule); border-radius: 3px; padding: 0 .4em; color: var(--muted); }
#dossier-content h2 { font-size: 1.7rem; margin: .6rem 0 .6rem; line-height: 1.5; }
#dossier-content .who { font-size: .8rem; color: var(--muted); font-family: var(--mono); }
#dossier-content .lead { font-size: 1rem; line-height: 1.9; margin: .8rem 0; }
.credit { font-size: .76rem; color: var(--muted); padding: .7rem .9rem; background: var(--band); border-left: 2px solid var(--accent); margin: 1rem 0; line-height: 1.7; }
.hsec { border-top: 1px solid var(--rule); margin-top: 1.2rem; padding-top: 1rem; }
.hlabel { font-family: var(--mono); font-size: .66rem; letter-spacing: .08em; color: var(--now); }
.hsec h3 { font-size: 1.15rem; margin: .2rem 0 .5rem; line-height: 1.6; }
.hsec p { font-size: .92rem; line-height: 1.9; color: var(--ink); margin: .5rem 0; }
.hsrc { font-size: .76rem; color: var(--muted); padding: .3rem 0; } .hsrc summary { cursor: pointer; } .hsrc p { font-size: .76rem; color: var(--muted); margin: .3rem 0; }
.hbridge { background: var(--band); border-radius: 5px; padding: .9rem 1rem; margin: 1.4rem 0 .8rem; }
.hbridge p { font-size: .9rem; margin: 0 0 .6rem; }
.hrelated { display: grid; gap: .4rem; }
.hrelated .btn { text-align: left; white-space: normal; justify-content: space-between; display: flex; }
.hback { margin-top: 1rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.notice { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 15px); padding: .7rem 1.2rem; max-width: min(600px, 90vw); width: max-content; background: var(--ink); color: var(--paper); border-radius: 5px; box-shadow: 0 5px 20px rgba(0, 0, 0, .2); font-size: .84rem; line-height: 1.6; opacity: 0; pointer-events: none; z-index: 40; transition: .25s; }
.notice.visible { opacity: 1; transform: translate(-50%, 0); }
.foot { border-top: 1px solid var(--rule); padding: 1rem 1.4rem 2rem; display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; font-size: .76rem; color: var(--muted); }
.foot span { flex-basis: 100%; }

@media (max-width: 1000px) {
  .top { grid-template-columns: minmax(0, 1fr); gap: .3rem .8rem; padding: .5rem .9rem .5rem; }
  .brand h1 { font-size: 1.1rem; white-space: normal; } .brand .eyebrow, .brand .tagline { display: none; }
  .tools { grid-column: 1 / -1; width: 100%; justify-content: space-between; padding: 0; } .tools::before { left: .5rem; right: .5rem; } .tool { padding: 0 .1rem; } .tool .n { font-size: .74rem; } .tool .y { font-size: .6rem; } .tool.aside { margin-left: .3rem; }
  .backchip { left: 10px; bottom: 12px; }
  .search { grid-column: 1 / -1; } .search input { width: auto; }
  .maintabs { padding: 0 .5rem; } .maintabs .tabrow { margin-left: -.6rem; } .maintab { padding: .4rem .6rem .3rem; font-size: .9rem; }
  .story { padding: .8rem .9rem 2rem; }
  .stage { padding: .8rem .9rem 1rem; } .stage .sh h2 { font-size: 1.2rem; }
  .sbody { grid-template-columns: minmax(0, 1fr); } .sbody .visbox .vis { width: 100%; max-width: 100%; } .film { width: 100%; max-width: 100%; } .exbody { columns: 1; }
  .days { padding: .7rem .9rem 0; } .day { min-width: 0; flex: 1 1 40%; max-width: none; }
  .bench { padding: .8rem .9rem 2rem; }
  .walk, .labgrid { grid-template-columns: minmax(0, 1fr); }
  .graph { aspect-ratio: calc(var(--w) / var(--h) * .55); }
  .node strong { font-size: 10px; } .node small { font-size: 8px; } .node { padding: 2px 2px; }
  .checks { grid-template-columns: 1fr; } .previews { grid-template-columns: 1fr; }
  #dossier-content { padding: 1.2rem 1.1rem 1.6rem; } #dossier-content h2 { font-size: 1.35rem; } .dyear { font-size: 2rem; }
}

/* ── 全文検索(app-search.js) ── */
.search { display: flex; gap: .3rem; align-items: center; min-width: 0; }
.search input { flex: 1 1 auto; width: 15em; min-width: 0; border: 1px solid var(--rule); border-radius: 4px; padding: .28rem .6rem; background: var(--panel); font-size: .88rem; }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.found .facets { display: flex; flex-wrap: wrap; gap: .3rem; margin: .2rem 0 .8rem; }
.facet { border: 1px solid var(--rule); background: var(--panel); border-radius: 999px; padding: .1rem .7rem; font-size: .8rem; color: var(--muted); cursor: pointer; }
.facet small { font-family: var(--mono); font-size: .68rem; margin-left: .35em; color: var(--accent); }
.facet.on { border-color: var(--ink); color: var(--ink); background: var(--paper); box-shadow: inset 0 0 0 1px var(--ink); }
.hitlist { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.hitrow { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .1rem .6rem; width: 100%; text-align: left; border: 1px solid var(--rule); border-radius: 5px; background: var(--panel); padding: .5rem .8rem; cursor: pointer; line-height: 1.6; font-family: var(--sans); }
.hitrow:hover { border-color: var(--accent); background: var(--band); }
.hitrow .hk { grid-column: 1; grid-row: 1; font-family: var(--mono); font-size: .62rem; letter-spacing: .08em; color: var(--paper); background: var(--muted); border-radius: 3px; padding: 0 .45em; align-self: start; margin-top: .3em; white-space: nowrap; }
.hitrow .hk.k-film { background: var(--chain); } .hitrow .hk.k-essay { background: var(--accent); } .hitrow .hk.k-fig { background: var(--ok); } .hitrow .hk.k-era { background: var(--hier); } .hitrow .hk.k-quiz { background: var(--now); } .hitrow .hk.k-year { background: var(--event); } .hitrow .hk.k-task { background: var(--tape); }
.hitrow .hp { grid-column: 2; font-size: .72rem; color: var(--muted); }
.hitrow .ht { grid-column: 2; font-family: var(--serif); font-weight: 600; font-size: .98rem; }
.hitrow .hs { grid-column: 2; font-size: .86rem; color: var(--ink); }
mark { background: var(--gold); color: #1F2A2E; padding: 0 .1em; border-radius: 2px; }
.sfound { fill: var(--now) !important; font-weight: 700; }
@keyframes locate { from { outline-color: var(--now); } to { outline-color: transparent; } }
.located { outline: 3px solid transparent; outline-offset: 3px; animation: locate 1.8s ease-out both; border-radius: 4px; }
.exbody .pblock { break-inside: avoid; }

/* ── 一次資料の印、年表のタブ ── */
.essay .ep.pri .ptag { border-color: var(--now); color: var(--now); }
.src.pri { border: 1px solid var(--now); color: var(--now); background: transparent; }
.timeline .tag.pri { border-color: var(--now); color: var(--now); }
.tlctl { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; margin: .2rem 0 1rem; font-size: .8rem; color: var(--muted); } .tlctl > span:not(.facets) { margin-right: .1rem; } .tlctl .facets { display: inline-flex; flex-wrap: wrap; gap: .3rem; margin-right: .8rem; } .tlctl .steps { margin-left: auto; }
.tl .tl-era { margin-top: .7rem; } .tl .tl-era:first-child { margin-top: 0; }
.tl .tl-jump { grid-column: 2; text-align: left; border: 0; border-left: 4px solid var(--h, var(--accent)); background: var(--band); border-radius: 0 4px 4px 0; padding: .3rem .7rem; font-family: var(--serif); font-weight: 600; font-size: .95rem; color: var(--ink); cursor: pointer; line-height: 1.5; } .tl .tl-jump:hover { background: var(--accent-soft); }
.tl .tl-y { border: 0; background: transparent; padding: 0; color: var(--accent); font-size: .95rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-align: left; align-self: start; }
.tl .tk { font-size: .6rem; color: var(--muted); border: 1px solid var(--rule2); border-radius: 3px; padding: 0 .3em; margin-right: .35em; white-space: nowrap; }

/* ── 読み物の列: 行の長さは保ち(62em)、列は中央に。広い画面では右に節の目次。年表と比較は幅いっぱい(2026-09-14 ユーザー指示) ── */
.readwrap { display: grid; grid-template-columns: minmax(0, 62em); justify-content: center; gap: 2.4rem; align-items: start; }
.readwrap .readcol { min-width: 0; }
.readwrap .essay, .readwrap .tlbox { max-width: none; }
.toc { display: none; }
@media (min-width: 1400px) {
  .readwrap:not(.solo) { grid-template-columns: minmax(0, 62em) 15em; }
  .toc { display: block; position: sticky; top: calc(var(--topH) + 3.6rem); font-size: .82rem; line-height: 1.5; }
}
.toc h4 { font-family: var(--sans); font-weight: 400; font-size: .66rem; letter-spacing: .12em; color: var(--muted); margin: .4rem 0 .5rem; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--rule); }
.toc li a { display: block; padding: .22rem .7rem; color: var(--muted); text-decoration: none; border-left: 2px solid transparent; margin-left: -2px; }
.toc li a:hover { color: var(--ink); }
.toc li.on a { color: var(--ink); border-left-color: var(--accent); }
.toc .no { font-family: var(--mono); font-size: .68rem; color: var(--accent); margin-right: .4em; }
#timeline .essay, #compare .essay { max-width: 62em; margin-left: auto; margin-right: auto; } #timeline .lead, #compare .lead { max-width: 62em; } /* 年表と比較も同じ中央の列(2026-09-14 ユーザー指示) */

/* ── すべて物語と同じ 62em の中央の列(2026-09-14 ユーザー指示)。動きの絵は列いっぱい、SVG の図は押すと大きく表示 ── */
.stage > * { max-width: 62em; margin-left: auto; margin-right: auto; }
.days, .bench { max-width: calc(62em + 2.8rem); margin-left: auto; margin-right: auto; }
.film { width: 100%; max-width: 100%; }

/* ── 図の拡大表示: SVG の図(読み物の図、概要の図、系譜図)を押すと画面いっぱいに ── */
figure.fig svg, .visbox svg, .lineage svg { cursor: zoom-in; }
.zoom { position: fixed; inset: 0; z-index: 70; background: rgba(16, 45, 41, .78); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 2vh 2vw; }
.zoombox { background: var(--paper); color: var(--ink); border-radius: 8px; box-shadow: 0 30px 100px rgba(0, 0, 0, .35); max-width: min(96vw, 1600px); max-height: 96vh; display: flex; flex-direction: column; overflow: hidden; }
.ztop { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .5rem .9rem; border-bottom: 1px solid var(--rule); font-size: .84rem; color: var(--muted); }
.zbody { overflow: auto; padding: .8rem; }
.zbody svg { width: min(92vw, 1500px); max-width: none; height: auto; display: block; background: var(--paper); }
body.zoomed { overflow: hidden; }
/* 系譜図の丸数字と小さな文字を大きく(列が 62em になって縮んだため。2026-09-14 ユーザー指摘) */
.lineage .fta { font-size: 15px; font-weight: 700; } .lineage .frow { font-size: 13px; } .lineage .fts { font-size: 11.5px; } .lineage .ftc { font-size: 10.5px; }
.lineage .lgd { font-size: .86rem; } .lineage .lgd .no { font-size: 1.1rem; }
