/* DetPhys のドキュメント。正確・落ち着いた・確かめられる。
   色: 紙（わずかに冷たい灰）と墨の階段。色が付くのは 2 つのピアだけ（ホスト = 青、ゲスト = 琥珀）と、ずれ（赤）。
   印: 2 つの半円が 1 つの点になる「一致」の印（ずれると割れる）。帳面・ロゴ・数字の表の一致の行だけに使う。 */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible Mono";
  src: url("fonts/atkinson-hyperlegible-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #f3f4f1;
  --surface: #ffffff;
  --sunk: #e8eae5;
  --ink: #191c1b;
  --ink2: #454b48;
  --ink3: #646a67;
  --rule: rgba(25, 28, 27, .12);
  --rule2: rgba(25, 28, 27, .07);
  --host: #2d4fcf;
  --host-ink: #2442b5;
  --host-tint: #e4e9f8;
  --guest: #b8650f;
  --guest-tint: #f5e9da;
  --bad: #b3362e;
  --bad-tint: #f7e3df;
  --sans: "Atkinson Hyperlegible Next", "BIZ UDPGothic", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, system-ui, sans-serif;
  --mono: "Atkinson Hyperlegible Mono", "BIZ UDGothic", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --top: 56px;
  --ul: rgba(36, 66, 181, .35);
  --rule-strong: rgba(25, 28, 27, .32);
  --on-host: #ffffff;
  --btn-hover: var(--host-ink);
  --lift: 0 1px 2px rgba(25, 28, 27, .04), 0 12px 32px -16px rgba(25, 28, 27, .18);
  --float: 0 24px 64px -24px rgba(25, 28, 27, .35);
  --scrim: rgba(25, 28, 27, .28);
  color-scheme: light;
}

/* 暗い画面: 端末の設定に合わせる。同じ冷たい灰の階段を夜の側へ。色を持つのは 2 つのピアとずれだけ、のまま。
   奥行きは影ではなく面の段と細い線で出す */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161918;
    --surface: #1d2120;
    --sunk: #272c2a;
    --ink: #e6e9e6;
    --ink2: #b4bab7;
    --ink3: #8b928e;
    --rule: rgba(230, 233, 230, .14);
    --rule2: rgba(230, 233, 230, .08);
    --rule-strong: rgba(230, 233, 230, .34);
    --host: #7c95f5;
    --host-ink: #9db0ff;
    --host-tint: #232b47;
    --guest: #e0954a;
    --guest-tint: #3a2d1d;
    --bad: #ef7a6e;
    --bad-tint: #3c2321;
    --ul: rgba(157, 176, 255, .4);
    --on-host: #101312;
    --btn-hover: #9db0ff;
    --lift: none;
    --float: 0 24px 64px -24px rgba(0, 0, 0, .6);
    --scrim: rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 16px); }
/* エンジンを選ぶ帯（上に貼り付く）がある頁は、#で飛んだ見出しが帯の下に隠れないようにする */
html:has(.picker) { scroll-padding-top: calc(var(--top) + 76px); }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 16px/1.65 var(--sans); font-variant-numeric: tabular-nums;
  text-rendering: optimizeLegibility;
}
html[lang="ja"] body { line-height: 1.85; font-feature-settings: "palt" 0; }
a { color: var(--host-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--ul); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--host); outline-offset: 2px; border-radius: 4px; }
code, kbd, pre { font-family: var(--mono); }
strong, b { font-weight: 600; }
h1, h2, h3, h4 { font-weight: 600; color: var(--ink); }
html[lang="ja"] :is(h1, h2, h3, .lede) { word-break: auto-phrase; }
small { font-size: 13px; }

/* ---------------- 上の帯 ---------------- */
.top { position: sticky; top: 0; z-index: 20; height: var(--top); background: var(--paper); border-bottom: 1px solid var(--rule); }
.top-row { height: 100%; max-width: 1440px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 16px; }
.home .top-row { max-width: 1200px; padding: 0 32px; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 18px; letter-spacing: .01em; margin-right: auto; }
.brand small { font-weight: 400; color: var(--ink3); font-size: 14px; margin-left: 4px; }
.home .brand { margin-right: 32px; }
.topnav { display: flex; gap: 4px; margin-right: auto; }
.topnav a { color: var(--ink2); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: 15px; }
.topnav a:hover { color: var(--ink); background: var(--sunk); }
.sbtn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 12px; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); color: var(--ink2); font: inherit; font-size: 14px; cursor: pointer; min-width: 200px; transition: border-color .15s var(--ease); }
.sbtn:hover { border-color: var(--rule-strong); }
.sbtn span { margin-right: auto; }
kbd { font-size: 12px; color: var(--ink3); border: 1px solid var(--rule); border-bottom-width: 2px; border-radius: 4px; padding: 0 6px; line-height: 20px; background: var(--paper); }
.lang { color: var(--ink2); text-decoration: none; font-size: 14px; padding: 6px 8px; border-radius: 8px; }
.lang:hover { background: var(--sunk); color: var(--ink); }
.menu { display: none; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); color: var(--ink2); font: inherit; font-size: 14px; cursor: pointer; }

/* 一致の印: 2 つの半円が 1 つの点になる。.off で割れる */
.twin { display: inline-flex; width: 14px; height: 14px; flex: none; gap: 0; transition: gap .2s var(--ease); vertical-align: -2px; }
.twin i { display: block; width: 7px; height: 14px; background: var(--host); border-radius: 7px 0 0 7px; }
.twin i + i { background: var(--guest); border-radius: 0 7px 7px 0; }
.twin.off { width: 18px; gap: 4px; }

/* ---------------- 文書の頁 ---------------- */
.shell { display: grid; grid-template-columns: 256px minmax(0, 1fr) 232px; max-width: 1440px; margin: 0 auto; }
.side { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; padding: 24px 16px 40px 24px; border-right: 1px solid var(--rule); font-size: 15px; }
.side .grp { margin: 24px 0 4px 8px; font-size: 13px; color: var(--ink3); }
.side .grp:first-child { margin-top: 0; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side li a { display: block; padding: 4px 8px; margin: 2px 0; border-radius: 8px; color: var(--ink2); text-decoration: none; line-height: 1.5; }
.side li a:hover { background: var(--sunk); color: var(--ink); }
.side li a[aria-current="page"], .side li a.in { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--rule); font-weight: 600; }
.side ul.sub { margin: 4px 0 8px 12px; padding-left: 8px; border-left: 1px solid var(--rule); }
.side ul.sub a { font-size: 13px; padding: 2px 8px; font-weight: 400; }
.side ul.sub a code { font-size: 12.5px; }
.side ul.here { display: none; }
.side ul.sub a[aria-current="page"] { font-weight: 600; }

main { min-width: 0; padding: 40px 48px 0; }
article { max-width: 760px; }
article > h1 { font-size: 36px; line-height: 1.25; margin: 0 0 16px; letter-spacing: -.005em; }
html[lang="ja"] article > h1 { font-size: 34px; letter-spacing: 0; line-height: 1.35; }
.api article > h1 code { font-size: .9em; font-weight: 600; background: none; padding: 0; }
.h1s { display: block; font-size: 18px; font-weight: 400; color: var(--ink2); margin-top: 8px; line-height: 1.5; }
.lede { font-size: 18px; color: var(--ink2); margin: 0 0 32px; max-width: 40em; }
article h2 { font-size: 25px; line-height: 1.35; margin: 56px 0 16px; padding-top: 24px; border-top: 1px solid var(--rule); }
article h3 { font-size: 19px; line-height: 1.45; margin: 40px 0 12px; }
article h4 { font-size: 16px; margin: 32px 0 8px; }
article .sec:first-of-type > h2:first-child, article .picker + .sec > h2:first-child { margin-top: 32px; }
article .picker + .sec > h2:first-child { border-top: 0; padding-top: 0; }
article h2, article h3, article h4 { position: relative; }
.hl { position: absolute; left: -24px; width: 20px; color: var(--ink3); text-decoration: none; opacity: 0; font-weight: 400; }
h2 .hl { top: 24px; }
h2:hover .hl, h3:hover .hl, h4:hover .hl, .hl:focus { opacity: 1; }
article p, article li { color: var(--ink); }
article p { margin: 0 0 16px; }
article ul, article ol { margin: 0 0 16px; padding-left: 24px; }
article li { margin: 4px 0; }
article li > ul, article li > ol { margin: 4px 0 8px; }
article :not(pre) > code { background: var(--sunk); padding: 1px 5px; border-radius: 4px; font-size: .87em; overflow-wrap: break-word; }
article a.api { text-decoration: none; }
article a.api code { color: var(--host-ink); box-shadow: inset 0 -1px 0 var(--ul); }
article a.api:hover code { box-shadow: inset 0 -1px 0 currentColor; }

.tw td:first-child { min-width: 8em; }
td .use { display: block; margin-top: 4px; font-size: .8125rem; color: var(--ink3); text-decoration: none; }
td .use:hover, td .use:focus-visible { color: var(--host-ink); text-decoration: underline; }
.tw { overflow-x: auto; margin: 16px 0 24px; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; line-height: 1.6; }
th, td { text-align: left; vertical-align: top; padding: 8px 12px; border-bottom: 1px solid var(--rule2); }
thead th { font-weight: 600; color: var(--ink2); font-size: 13.5px; border-bottom: 1px solid var(--rule); white-space: nowrap; background: var(--paper); }
tbody tr:last-child > * { border-bottom: 0; }
td :not(pre) > code, th :not(pre) > code { font-size: 13px; }
tr:target { background: var(--host-tint); }
td:first-child code { white-space: nowrap; }

.code { position: relative; margin: 16px 0 24px; }
.code pre { margin: 0; tab-size: 4; padding: 16px 20px; overflow-x: auto; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; font-size: 13.5px; line-height: 1.6; }
.cp { position: absolute; top: 8px; right: 8px; height: 28px; padding: 0 10px; font: inherit; font-size: 12.5px; color: var(--ink2); background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; cursor: pointer; opacity: 0; transition: opacity .15s var(--ease); }
.code:hover .cp, .cp:focus-visible { opacity: 1; }
/* エンジンごとのコードの組。上の帯で選ぶ。JS が無ければ全部を名前つきで並べる */
.codes { margin: 16px 0 24px; }
.codes .tabs { display: none; }
.codes .pane::before { content: attr(data-label); display: block; margin: 0 0 4px; font-size: 13px; color: var(--ink3); }
.codes .pane .code { margin: 0 0 16px; }
.js .codes .tabs { position: relative; display: flex; flex-wrap: nowrap; gap: 0 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--rule); margin: 0 0 12px; }
.js .codes .pane { display: none; }
.js .codes .pane.on { display: block; }
.js .codes .pane::before { content: none; }
.js .codes .pane .code { margin: 0; }
.codes [role=tab] { flex: none; white-space: nowrap; height: 36px; padding: 0 12px; margin-bottom: -1px; font: inherit; font-size: 14px; color: var(--ink2); background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; transition: color .15s var(--ease), border-color .15s var(--ease); }
.codes [role=tab] span { margin-left: 6px; color: var(--ink3); }
.codes [role=tab]:hover { color: var(--ink); }
.codes [role=tab][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.codes [role=tab][aria-selected="true"] span { font-weight: 400; }
.callout { margin: 0 0 32px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; }
.callout p:last-child { margin-bottom: 0; }

.figure { margin: 24px 0 32px; padding: 20px; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; overflow-x: auto; }
.figure figcaption { margin-top: 8px; font-size: 13px; color: var(--ink3); }
.fig { display: block; width: 100%; min-width: 600px; height: auto; font-family: var(--sans); }
/* マニュアルの画像（見本の画面など）: 本文の幅いっぱい（最大は本文の幅）。狭い画面でも縮むだけで、はみ出さない */
.shot { margin: 24px 0 32px; }
.shot img { display: block; width: 100%; max-width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); }
.shot + .shot { margin-top: -16px; }
.fg-t { font-size: 14px; font-weight: 600; fill: var(--ink); }
.fg-n { font: 12px var(--mono); fill: var(--ink3); text-anchor: middle; }
.fg-l { font-size: 13px; fill: var(--ink2); }
.fg-s { font-size: 12.5px; fill: var(--ink2); }
.fg-strong { fill: var(--ink); font-weight: 600; }
.fg-v { font: 12px var(--mono); fill: var(--ink2); }
.fg-grid { stroke: var(--rule); stroke-width: 1; }
.fg-host { fill: var(--host); }
.fg-guest { fill: var(--guest); }
.fg-pred { fill: none; stroke: var(--guest); stroke-width: 1.5; stroke-dasharray: 4 3; }
.fg-conf { fill: var(--ink2); }
.fg-ring { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.fg-resim { fill: var(--host-tint); stroke: var(--host); stroke-width: 1.5; }
.fg-arrow { fill: none; stroke: var(--host); stroke-width: 1.5; stroke-linecap: round; }
.fg-budget { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart .hit { fill: transparent; }
.fg-bg { fill: var(--surface); }
.halo { paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.chart .bar:hover rect:first-of-type { opacity: .8; }

.picker { position: sticky; top: var(--top); z-index: 5; display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 12px 0; margin: 0 0 8px; background: var(--paper); border-bottom: 1px solid var(--rule); }
.seg { display: inline-flex; align-items: center; gap: 4px; }
.seg span { font-size: 13px; color: var(--ink3); margin-right: 4px; }
.seg button { height: 32px; padding: 0 12px; font: inherit; font-size: 14px; color: var(--ink2); background: transparent; border: 1px solid var(--rule); border-radius: 8px; cursor: pointer; transition: background-color .15s var(--ease), border-color .15s var(--ease); }
.seg button:hover { background: var(--sunk); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); border-color: var(--rule-strong); font-weight: 600; }
html[data-eng="unity"] [data-engine]:not([data-engine="unity"]),
html[data-eng="godot"] [data-engine]:not([data-engine="godot"]),
html[data-eng="unreal"] [data-engine]:not([data-engine="unreal"]) { display: none; }
html[data-dim="2d"] [data-dim="3d"], html[data-dim="3d"] [data-dim="2d"] { display: none; }

.triage { margin: 0 0 40px; }
.triage-h { font-size: 15px !important; color: var(--ink2); margin: 0 0 8px !important; padding: 0 !important; border: 0 !important; }
.triage ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.triage li { margin: 0; }
.triage a { display: block; height: 100%; padding: 12px 16px; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; text-decoration: none; color: var(--ink); transition: border-color .15s var(--ease); }
.triage a:hover { border-color: var(--rule-strong); }
.triage b { display: block; font-size: 15.5px; }
.triage a span { display: block; font-size: 13.5px; color: var(--ink2); line-height: 1.55; margin-top: 2px; }

.filter { display: flex; flex-direction: column; gap: 4px; margin: 0 0 8px; }
.filter label { font-size: 13.5px; color: var(--ink2); }
.filter input { height: 40px; padding: 0 12px; font: inherit; font-size: 15px; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); color: var(--ink); max-width: 420px; }
.api-none { color: var(--ink3); }
.apilist td.where, .hdrs td.num { color: var(--ink3); white-space: nowrap; font-size: 13px; }
.hdrs td.num { text-align: right; }

.toc { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; padding: 40px 24px 40px 8px; font-size: 13.5px; }
.toc p { margin: 0 0 8px; color: var(--ink3); font-size: 13px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule); }
.toc li a { display: block; padding: 3px 0 3px 12px; margin-left: -1px; border-left: 1px solid transparent; color: var(--ink2); text-decoration: none; line-height: 1.45; }
.toc li.l3 a { padding-left: 24px; font-size: 13px; color: var(--ink3); }
.toc li a:hover { color: var(--ink); }
.toc li a.on { color: var(--ink); border-left-color: var(--ink); }

.pn { display: flex; justify-content: space-between; gap: 16px; max-width: 760px; margin: 64px 0 0; padding-top: 24px; border-top: 1px solid var(--rule); }
.pn a { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); font-weight: 600; padding: 8px 0; }
.pn a small { font-weight: 400; color: var(--ink3); }
.pn .nx { text-align: right; }

.foot { max-width: 760px; margin: 40px 0 0; padding: 24px 0 40px; border-top: 1px solid var(--rule); font-size: 13.5px; color: var(--ink3); line-height: 1.7; }
.foot p { margin: 0 0 8px; }
.foot .fm { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.home .foot { max-width: 1200px; margin: 0 auto; padding: 32px 32px 48px; }

/* ---------------- トップ ---------------- */
.landing { padding: 0; }
.hero { max-width: 1200px; margin: 0 auto; padding: 72px 32px 72px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 64px; align-items: center; }
.hero h1 { font-size: 52px; line-height: 1.15; letter-spacing: -.012em; margin: 0 0 24px; text-wrap: balance; }
html[lang="ja"] .hero h1 { font-size: 46px; line-height: 1.3; letter-spacing: 0; }
.hero .lede { font-size: 18px; margin: 0 0 32px; max-width: 34em; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin: 0; }
.btn { display: inline-flex; align-items: center; height: 48px; padding: 0 24px; border-radius: 10px; background: var(--host); color: var(--on-host); font-weight: 600; text-decoration: none; transition: background-color .15s var(--ease); }
.btn:hover { background: var(--btn-hover); }
.btn:active { transform: scale(.98); }
.btn-q { color: var(--ink); font-weight: 600; }

.ledger { margin: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: 16px; padding: 8px 8px 16px; box-shadow: var(--lift); }
.ledger table { font-family: var(--mono); font-size: 14px; }
.ledger thead th { background: transparent; font-family: var(--sans); font-size: 14px; color: var(--ink); padding: 12px 12px 10px; white-space: normal; vertical-align: bottom; }
.ledger thead th small { display: block; font-weight: 400; color: var(--ink3); font-size: 12.5px; }
.ledger th.tk, .ledger td.tk { width: 56px; color: var(--ink3); text-align: right; }
.ledger td { padding: 5px 12px; border-bottom: 1px solid var(--rule2); }
.ledger .mk { width: 40px; text-align: center; }
.ledger .hv { letter-spacing: .02em; }
.pd { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.pd.host { background: var(--host); }
.pd.guest { background: var(--guest); }
.ledger tr.bad td { background: var(--bad-tint); }
.ledger tr.bad td:last-child { color: var(--bad); }
.ledger tr.bad .twin i { box-shadow: 0 0 0 1px var(--bad-tint); }
.lg-rep td { padding: 8px 12px 4px; }
.rep { border-left: 2px solid var(--bad); padding: 4px 0 4px 12px; font-size: 13px; line-height: 1.6; }
.rep p { margin: 0; }
.rep-h { font-family: var(--sans); color: var(--bad); font-weight: 600; }
.rep-v { display: flex; flex-wrap: wrap; gap: 0 16px; color: var(--ink); font-family: var(--sans); }
.rep-v code { font-family: var(--mono); color: var(--ink); }
.rep-v code.bits { color: var(--ink3); }
.rep-c { font-family: var(--sans); color: var(--ink2); }
.lg-sync td { font-family: var(--sans); font-size: 13px; color: var(--host-ink); padding: 6px 12px 8px 80px; }
.ledger figcaption { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 12px 0; font-size: 13px; color: var(--ink3); }
.lg-again { flex: none; height: 30px; padding: 0 12px; font: inherit; font-size: 13px; color: var(--ink2); background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; cursor: pointer; }
.lg-again:hover { color: var(--ink); }
.js .ledger.play tbody tr { opacity: 0; }
.js .ledger.play tbody tr.on { opacity: 1; transition: opacity .18s var(--ease); }
.js .ledger.play tr.bad .twin.off { gap: 0; width: 14px; }
.js .ledger.play tr.bad.split .twin.off { gap: 4px; width: 18px; }

.band { max-width: 1200px; margin: 0 auto; padding: 56px 32px; border-top: 1px solid var(--rule); }
.band > h2, .band h2 { font-size: 25px; margin: 0 0 24px; line-height: 1.35; }
.spec { font-size: 15px; }
.spec thead th { background: transparent; }
.spec th[scope="row"] { width: 160px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.spec td.v { font-weight: 600; white-space: nowrap; }
.spec td.v .twin { margin-right: 8px; }
.spec td:last-child { color: var(--ink2); }
.more { margin: 0; font-size: 15px; }

.engines { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.engines li { border-top: 2px solid var(--ink); padding-top: 16px; display: flex; flex-direction: column; }
.engines li a { margin-top: auto; align-self: flex-start; }
.engines h3 { font-size: 20px; margin: 0; }
.engines .ver { margin: 4px 0 0; font-size: 16px; color: var(--ink); }
.engines .pkg { margin: 4px 0 16px; font-size: 14px; color: var(--ink2); }
.engines .pkg code { font-size: 13px; color: var(--ink); }
.engines a { font-weight: 600; }
.note { margin: 24px 0 0; color: var(--ink2); }
.band.two { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; }
.plain { margin: 0 0 16px; padding-left: 20px; color: var(--ink2); }
.plain li { margin: 6px 0; }

/* ---------------- 検索 ---------------- */
dialog.search { width: min(680px, calc(100vw - 32px)); max-height: min(640px, 80vh); margin: 10vh auto auto; padding: 0; border: 1px solid var(--rule); border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: var(--float); overflow: hidden; }
dialog.search[open] { display: flex; flex-direction: column; }
dialog.search::backdrop { background: var(--scrim); }
.sq { display: flex; align-items: center; gap: 12px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--rule); color: var(--ink3); }
.sq input::-webkit-search-cancel-button { display: none; }
.sq input { flex: 1; height: 56px; border: 0; outline: 0; font: inherit; font-size: 18px; color: var(--ink); background: transparent; }
.sx { height: 30px; padding: 0 10px; font: inherit; font-size: 13px; color: var(--ink2); background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; cursor: pointer; }
.sr { list-style: none; margin: 0; padding: 8px; overflow-y: auto; }
.sr li a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.sr li a b { font-weight: 600; }
.sr li a small { color: var(--ink3); margin-left: 8px; }
.sr li a span { display: block; color: var(--ink2); font-size: 13.5px; line-height: 1.55; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr li a mark { background: var(--host-tint); color: inherit; border-radius: 2px; }
.sr li.on a, .sr li a:hover { background: var(--sunk); }
.sr .none { padding: 16px 12px; color: var(--ink2); }
.sh { margin: 0; padding: 8px 16px; border-top: 1px solid var(--rule); font-size: 12.5px; color: var(--ink3); }

/* ---------------- 幅ごと ---------------- */
@media (max-width: 1240px) {
  .shell { grid-template-columns: 248px minmax(0, 1fr); }
  .toc { display: none; }
  .side ul.here { display: block; }
}
@media (max-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 48px; padding-top: 48px; }
  .topnav { display: none; }
  .home .brand { margin-right: auto; }
}
@media (max-width: 900px) {
  .shell { display: block; }
  .menu { display: inline-flex; }
  .brand { margin-right: auto; }
  .side { position: fixed; z-index: 30; top: 0; left: 0; bottom: 0; width: min(300px, 86vw); height: auto; background: var(--paper); transform: translateX(-102%); transition: transform .2s var(--ease); box-shadow: var(--float); padding-top: 24px; }
  body.nav-open .side { transform: none; }
  .scrim { position: fixed; inset: 0; z-index: 25; background: var(--scrim); }
  main { padding: 32px 24px 0; }
}
@media (max-width: 640px) {
  .top-row, .home .top-row { padding: 0 16px; gap: 8px; }
  .sbtn { min-width: 0; padding: 0 10px; }
  .sbtn span, .sbtn kbd { display: none; }
  .menu span { display: none; }
  .brand small { display: none; }
  main { padding: 24px 16px 0; }
  article > h1, html[lang="ja"] article > h1 { font-size: 28px; }
  .lede, .hero .lede { font-size: 17px; }
  article h2 { font-size: 22px; }
  .hl { display: none; }
  .hero { padding: 32px 16px 48px; gap: 32px; }
  .hero h1 { font-size: 34px; }
  html[lang="ja"] .hero h1 { font-size: 30px; }
  .btn { width: 100%; justify-content: center; }
  .ledger { padding: 4px 0 12px; border-radius: 12px; }
  .ledger table { font-size: 13px; }
  .ledger td, .ledger thead th { padding-left: 8px; padding-right: 8px; }
  .ledger th.tk, .ledger td.tk { width: 40px; }
  .ledger .mk { width: 28px; }
  .ledger tr.early { display: none; }
  .lg-sync td { padding-left: 48px; }
  .ledger figcaption { flex-direction: column; align-items: flex-start; }
  .band { padding: 40px 16px; }
  .engines { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .band.two { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .spec thead { display: none; }
  .spec tr { display: grid; grid-template-columns: minmax(0, 1fr); padding: 12px 16px; border-bottom: 1px solid var(--rule2); }
  .spec tbody tr:last-child { border-bottom: 0; }
  .spec th, .spec td { display: block; padding: 0; border: 0; }
  .spec td:last-child { font-size: 14px; margin-top: 2px; }
  .spec th[scope="row"] { width: auto; white-space: normal; }
  .spec td.v { white-space: normal; }
  .triage ol { grid-template-columns: 1fr; }
  .picker { gap: 8px 16px; }
  .home .foot { padding: 24px 16px 40px; }
  .filter input { max-width: none; }
  /* 狭い画面: 表の余白を詰め、セルの中のコードを折り返して、文の表が横にはみ出さないようにする（数字の多い広い表は横にスクロール） */
  th, td { padding: 8px 6px; }
  .tw td:first-child { min-width: 4em; }
  thead th { white-space: normal; }
  td :not(pre) > code, th :not(pre) > code { overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .top, .side, .toc, .pn, .picker, .cp { display: none !important; }
  .shell { display: block; }
}

/* 見つからない時の頁（404.html。英日を 1 枚に並べる） */
.nf .shell { display: block; max-width: 856px; }
.nf h1 { font-size: 30px; line-height: 1.3; margin: 0 0 12px; }
.nf section + section { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--rule); }
@media (max-width: 720px) { .nf main { padding: 24px 16px 0; } }
