@charset "UTF-8";

:root {
  color-scheme: light;
  --white: #ffffff;
  --rail: #f8fafc;
  --ink: #0f172a;
  --body: #334155;
  --muted: #475569;
  --quiet: #59687c;
  --line: #e2e8f0;
  --blue: #2563eb;
  --link: #1d4ed8;
  --selected: #eaf1ff;
  --header: 65px;
  --rail-width: clamp(244px, 18.5vw, 282px);
  --page-gutter: clamp(26px, 3.2vw, 64px);
  --rule: 1px solid var(--line);
  --ease: 160ms ease-out;
  font-family: Inter, "Noto Sans JP", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  color: var(--ink);
  background: var(--white);
  font-synthesis: none;
}
*, *::before, *::after { box-sizing: border-box; }
html { scrollbar-color: #abb7c7 var(--rail); }
body { margin: 0; font-size: 16px; line-height: 1.75; -webkit-text-size-adjust: 100%; }
::selection { background: #dbeafe; color: var(--ink); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
[tabindex="-1"]:focus:not(:focus-visible) { outline: none; }
[hidden] { display: none !important; }
button, input, select, textarea { color: inherit; font: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: default; opacity: .6; }
button { touch-action: manipulation; }
input, textarea { caret-color: var(--blue); }
a { color: var(--link); text-underline-offset: .19em; }
a:hover { text-decoration-thickness: 2px; }
p, figure, ol, ul, dl, dd, h1, h2, h3 { margin: 0; }
h1, h2, h3 { color: var(--ink); line-height: 1.48; font-weight: 700; line-break: strict; overflow-wrap: anywhere; }
h1 { font-size: clamp(30px, 3vw, 46px); letter-spacing: -.035em; }
h2 { font-size: clamp(21px, 1.65vw, 26px); letter-spacing: -.025em; }
h3 { font-size: 18px; letter-spacing: -.015em; }
svg.icon { flex: 0 0 auto; width: 18px; height: 18px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; inset: 7px auto auto 12px; z-index: 9; padding: 8px 14px; background: var(--white); transform: translateY(-160%); }
.skip:focus { transform: none; }
.initial { padding: 3rem; }
.masthead { position: sticky; top: 0; z-index: 4; background: var(--white); border-bottom: var(--rule); }
.mast-inner, .docs-shell { width: 100%; max-width: 1680px; margin: auto; }
.mast-inner { height: calc(var(--header) - 1px); display: flex; align-items: stretch; }
.brand { flex: 0 0 var(--rail-width); display: flex; align-items: center; gap: 10px; padding: 0 24px; color: var(--ink); text-decoration: none; background: var(--rail); border-right: var(--rule); }
.brand-mark, .book-emblem { clip-path: polygon(0 0, 32% 0, 32% 41%, 68% 25%, 68% 0, 100% 0, 100% 100%, 68% 100%, 68% 59%, 32% 75%, 32% 100%, 0 100%); }
.brand-mark { width: 26px; height: 27px; background: var(--blue); }
.word { font-size: 23px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.brand-divider { height: 21px; border-left: 1px solid #cbd5e1; transform: rotate(15deg); margin-inline: 1px; }
.docs-word { font-size: 17px; font-weight: 500; color: var(--muted); letter-spacing: -.025em; }
.portal-nav { display: flex; align-items: stretch; gap: clamp(20px, 2.4vw, 38px); padding-inline: var(--page-gutter); }
.portal-nav a { display: inline-flex; align-items: center; position: relative; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 600; }
.portal-nav a[aria-current="page"], .portal-nav a:hover { color: var(--link); }
.portal-nav a[aria-current="page"]::after { content: ""; position: absolute; bottom: -1px; height: 2px; inset-inline: 0; background: var(--blue); }
#menu-open { display: none; }
.docs-shell { display: grid; grid-template-columns: var(--rail-width) minmax(0, 1fr); min-height: calc(100vh - var(--header)); }
.rail-slot { min-width: 0; background: var(--rail); border-right: var(--rule); }
.docs-rail { position: sticky; top: var(--header); display: flex; flex-direction: column; height: calc(100vh - var(--header)); height: calc(100dvh - var(--header)); min-height: 0; }
.rail-tools { padding: 25px 18px 15px; }
.search-field { display: flex; align-items: center; min-width: 0; gap: 10px; border: 1px solid #bdc9d9; border-radius: 9px; background: var(--white); color: var(--quiet); transition: border-color var(--ease); }
.search-field:focus-within { border-color: var(--blue); outline: 2px solid #bfdbfe; }
.search-field input { width: 100%; min-width: 0; border: 0; outline: none; background: transparent; padding: 0; }
.search-field input:focus-visible { outline: none; }
.search-field input::placeholder { color: var(--quiet); opacity: 1; }
.search-field kbd { min-width: 21px; height: 22px; background: var(--rail); border: var(--rule); border-radius: 4px; text-align: center; font: 13px/20px Inter, sans-serif; }
.rail-search { padding-inline: 11px 8px; gap: 7px; font-size: 13px; }
.rail-search input { height: 40px; }
.rail-search .icon { width: 16px; }
.rail-scroll { padding: 0 12px 24px; overflow: auto; overscroll-behavior: contain; min-height: 0; flex: 1; scrollbar-width: thin; }
.guide-nav a, .guide-nav summary, .mobile-links a { color: var(--body); text-decoration: none; }
.nav-home, .nav-library, .nav-group summary, .nav-group a { display: flex; align-items: center; gap: 10px; min-height: 39px; padding: 7px 10px; border-radius: 7px; line-height: 1.6; }
.nav-home, .nav-library { font-size: 14px; font-weight: 600; }
.guide-nav [aria-current="page"] { color: var(--link); background: var(--selected); font-weight: 650; }
.nav-heading { margin: 24px 10px 8px; font-size: 12px; color: var(--quiet); font-weight: 600; }
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
.nav-group { margin-bottom: 3px; }
.nav-group summary { font-size: 13px; font-weight: 600; gap: 8px; }
.nav-group summary > .icon:first-child { width: 16px; color: var(--quiet); }
.nav-group summary > span { flex: 1; }
.nav-group summary > .icon:last-child, .inline-toc summary > .icon:last-child, .prompt-entry summary > .icon { width: 13px; height: 13px; margin-left: auto; color: var(--quiet); transition: transform var(--ease); }
details[open] > summary > .icon:last-child { transform: rotate(90deg); }
.nav-group ul { list-style: none; padding: 2px 0 5px 14px; }
.nav-group a { font-size: 12.5px; min-height: 35px; }
.nav-number, .row-number { color: var(--quiet); font-size: 11px; font-weight: 550; font-variant-numeric: tabular-nums; }
.nav-group a[aria-current] .nav-number { color: var(--link); }
.read-tick { margin-left: auto; color: #08734e; line-height: 1; }
.read-tick .icon { width: 15px; }
.nav-library { margin-top: 17px; border-top: var(--rule); border-radius: 0; padding-top: 16px; }
.guide-nav a:hover, .nav-group summary:hover { background: #edf2f8; color: var(--link); }
.read-progress { margin: 0 20px; border-top: var(--rule); padding: 15px 0 19px; }
.read-progress label { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--muted); }
.read-progress label span { font-variant-numeric: tabular-nums; }
progress { appearance: none; display: block; margin-top: 7px; width: 100%; height: 4px; border: 0; border-radius: 4px; background: var(--line); color: var(--blue); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--blue); }
progress::-moz-progress-bar { background: var(--blue); }
.mobile-links, .inline-toc { display: none; }

.reading-layout { display: grid; grid-template-columns: minmax(0, 860px) minmax(150px, 200px); justify-content: center; gap: var(--page-gutter); padding: 28px var(--page-gutter) 72px; }
.content-column { min-width: 0; overflow-wrap: anywhere; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 33px; font-size: 12px; font-weight: 500; color: var(--quiet); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .icon { width: 11px; height: 11px; color: #718096; }
.outline { min-width: 0; }
.outline-inner { position: sticky; top: calc(var(--header) + 30px); display: flex; flex-direction: column; max-height: calc(100dvh - var(--header) - 54px); font-size: 12px; }
.outline-title { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; margin-bottom: 14px; }
.outline-title .icon { width: 16px; }
.outline nav, .inline-toc nav { border-left: var(--rule); }
.outline nav { overflow: auto; scrollbar-width: thin; min-height: 0; overscroll-behavior: contain; }
[data-toc] { display: block; text-decoration: none; color: var(--muted); padding: 5px 8px 5px 13px; border-left: 2px solid transparent; line-height: 1.65; }
[data-toc]:hover { color: var(--link); }
.toc-level-3 { padding-left: 23px; }
[data-toc][aria-current="location"] { color: var(--link); border-color: var(--blue); font-weight: 600; }
.outline-extra { display: flex; align-items: flex-start; gap: 9px; border-top: var(--rule); margin-top: 21px; padding-top: 17px; color: var(--link); }
.outline-extra > .icon { width: 16px; margin-top: 3px; }
.outline-extra a { font-size: 12px; line-height: 1.75; font-weight: 550; text-decoration: none; }
.outline-extra a:hover { text-decoration: underline; }
.outline-extra a .icon { width: 12px; height: 12px; vertical-align: middle; }

.hub-intro { position: relative; isolation: isolate; display: flex; align-items: center; min-height: 150px; padding: 0 0 21px; }
.hub-title { position: relative; z-index: 1; width: 70%; }
.hub-title h1 { font-size: clamp(34px, 3.4vw, 54px); line-height: 1.35; letter-spacing: -.035em; }
.hub-title p, .chapter-summary, .topic-head > p { color: var(--muted); margin-top: 13px; line-height: 1.85; }
.hub-title p { max-width: 32em; font-size: 15px; }
.book-art { width: 158px; height: 130px; position: absolute; right: 4%; top: 2px; pointer-events: none; transform: rotate(-9deg); }
.book-art > div { position: absolute; width: 98px; height: 106px; border-radius: 3px 8px 8px 3px; transform: skewY(-9deg) rotate(13deg); }
.book-base { left: 36px; top: 20px; background: #dce7fa; box-shadow: 1px 3px #bdcee9; }
.book-back { left: 27px; top: 12px; background: #afc6f9; box-shadow: 1px 3px #819fdd; }
.book-cover { left: 17px; top: 4px; background: #2454d2; border-right: 1px solid #234ab3; box-shadow: 1px 2px #eff5ff, 2px 4px #b1c4e4, 3px 6px #2043a3; overflow: hidden; }
.book-spine { position: absolute; inset: 0 auto 0 0; width: 9px; background: #143ba2; border-right: 1px solid #7597eb; }
.book-emblem { position: absolute; top: 19px; left: 20px; width: 25px; height: 24px; background: #f1f6ff; }
.book-cover i { display: block; position: absolute; left: 21px; right: 17px; bottom: 23px; height: 2px; background: #9cb9fa; }
.book-cover i:last-child { right: 36px; bottom: 16px; }
.hub-search { margin-top: 12px; }
.wide-search { gap: 12px; padding-inline: 18px 13px; border-color: #b8c6d9; }
.wide-search .icon { color: var(--blue); width: 21px; height: 21px; }
.wide-search input { height: 53px; font-size: 15px; }
.wide-search kbd { min-width: 25px; height: 25px; line-height: 23px; }
.hub-guides { margin-top: 40px; }
.section-title { display: flex; flex-wrap: wrap; gap: 14px; align-items: baseline; margin-bottom: 16px; }
.section-title span { font-size: 12px; font-weight: 550; color: var(--quiet); }
.topic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.topic-card { display: block; padding: 19px 20px 21px; border: var(--rule); border-radius: 13px; color: inherit; text-decoration: none; transition: border-color var(--ease), background var(--ease); }
.topic-card:hover, .topic-card:focus-visible { background: #f8faff; border-color: #9ab5ef; }
.card-top { display: flex; align-items: center; justify-content: space-between; }
.card-top > span:last-child { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--quiet); font-variant-numeric: tabular-nums; }
.card-top > span:last-child .icon { width: 15px; transition: transform var(--ease); }
.topic-card:hover .card-top > span:last-child .icon, .chapter-rows a:hover > .icon { color: var(--blue); transform: translateX(3px); }
.topic-icon { display: inline-grid; place-items: center; width: 37px; height: 37px; border-radius: 9px; }
.topic-icon .icon { width: 22px; height: 22px; }
.tone-blue { color: #2459c4; background: #eaf2ff; }
.tone-indigo { color: #5945a9; background: #f1effb; }
.tone-teal { color: #137267; background: #e8f6f1; }
.tone-orange { color: #96511a; background: #fbf1e6; }
.topic-card h3 { margin-top: 13px; font-size: clamp(15px, 1.22vw, 18px); }
.topic-card p { font-size: 13px; color: var(--muted); line-height: 1.8; margin-top: 5px; }
.help-strip { position: relative; margin-top: 33px; border-top: var(--rule); padding: 24px 0 0; display: flex; flex-wrap: wrap; column-gap: 18px; align-items: baseline; }
.help-strip > div { width: 100%; }
.help-strip h2 { font-size: 19px; }
.help-strip p { margin: 5px 0 9px; font-size: 14px; color: var(--muted); }
.help-strip a, .text-link { font-size: 13px; font-weight: 600; }
.help-strip .icon, .text-link .icon { width: 14px; height: 14px; vertical-align: middle; }
.help-mail { overflow-wrap: anywhere; }
.matches ul, .chapter-rows { list-style: none; padding: 0; }
.match-count { margin: 8px 0; color: var(--quiet); font-size: 12px; }
.matches li + li { border-top: var(--rule); }
.matches a { display: grid; gap: 3px; padding: 13px 6px; text-decoration: none; color: var(--body); border-radius: 4px; }
.matches a:hover, .matches a:focus-visible { background: #edf3ff; }
.matches strong { font-size: 14px; color: var(--ink); }
.match-kind { font-size: 11px; color: var(--quiet); }
.excerpt, .empty-search { color: var(--muted); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.rail-matches { padding-inline: 6px; }
.hub-matches { margin-top: 18px; }
mark { background: #fff1af; color: #352600; border-radius: 2px; }

.topic-head { padding: 5px 0 30px; }
.topic-head > .topic-icon { margin-bottom: 12px; width: 46px; height: 46px; }
.chapter-rows { border-top: var(--rule); }
.chapter-rows a { display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 17px; padding: 19px 4px; border-bottom: var(--rule); text-decoration: none; }
.row-number { margin-top: 3px; padding: 2px 6px; border: var(--rule); border-radius: 5px; font-size: 12px; }
.chapter-rows h3 { font-size: 17px; }
.chapter-rows p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.chapter-rows .icon { margin-top: 5px; transition: transform var(--ease); }
.chapter-rows a:hover h3 { color: var(--link); }
.chapter-head { padding-bottom: 22px; margin-bottom: 27px; border-bottom: var(--rule); }
.chapter-meta { display: flex; gap: 10px 15px; flex-wrap: wrap; align-items: center; margin-bottom: 17px; font-size: 12px; color: var(--muted); }
.chapter-meta span { display: inline-flex; align-items: center; gap: 5px; }
.chapter-meta .icon { width: 15px; height: 15px; }
.chapter-badge { background: var(--selected); color: var(--link); border-radius: 5px; padding: 2px 8px; font-weight: 650; }
.chapter-info { margin-top: 18px; font-size: 12.5px; color: var(--muted); }
.chapter-info > div { display: grid; grid-template-columns: 7.2em minmax(0, 1fr); column-gap: 12px; margin-top: 4px; }
.chapter-info dt { font-weight: 600; color: var(--body); }
.prose { font-size: 15.5px; line-height: 1.95; line-break: strict; color: var(--body); }
.prose p + p, .prose ul, .prose ol { margin-top: 13px; }
.prose li + li { margin-top: 7px; }
.prose > p, .doc-section > p, .doc-section > ul, .doc-section > ol { margin-block: 12px; }
.prose ul { padding-left: 1.5em; }
.prose ul li::marker { color: #718096; }
.doc-section { margin: 34px 0; }
.doc-section h2 { font-size: clamp(21px, 1.7vw, 26px); margin-bottom: 15px; }
.doc-section h3 { font-size: 18px; margin: 24px 0 9px; }
.doc-section h2, .doc-section h3, .prompt-group h2, #guides, #support, #chapters { scroll-margin-top: calc(var(--header) + 20px); }
.prose a { text-decoration-color: #94b3f6; }
.steps { list-style: none; counter-reset: step; padding: 0; }
.steps > li { position: relative; padding: 12px 14px 12px 52px; border: var(--rule); border-radius: 9px; counter-increment: step; background: var(--white); }
.steps > li::before { content: counter(step); position: absolute; top: 14px; left: 13px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; color: var(--link); background: var(--selected); font-size: 12px; line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; }
.callout { padding: 20px 22px; border-radius: 12px; }
.callout :last-child { margin-bottom: 0; }
.callout h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; font-size: 17px; }
.callout h2 .icon { width: 19px; height: 19px; }
.callout.important { background: #f0f5ff; }
.callout.important h2 { color: #1947a3; }
.callout.caution { background: #fff7e9; }
.callout.caution h2 { color: #80460a; }
.callout.ai-tip { background: #f3f1fc; }
.callout.ai-tip h2 { color: #514193; }
.shot { margin: 23px 0 19px; }
.shot button { position: relative; display: block; width: 100%; border: var(--rule); background: var(--rail); padding: clamp(5px, 1vw, 11px); border-radius: 12px; cursor: zoom-in; }
.shot button:hover { border-color: #a9bde4; }
.shot img { display: block; max-width: 100%; height: auto; margin: auto; border-radius: 5px; }
.zoom-sign { position: absolute; display: grid; place-items: center; bottom: 14px; right: 14px; width: 31px; height: 31px; border: var(--rule); border-radius: 8px; background: var(--white); color: var(--body); }
.shot figcaption, #image-caption { margin-top: 8px; font-size: 12.5px; color: var(--muted); line-height: 1.75; }
.table-wrap { overflow-x: auto; margin: 15px 0; border: var(--rule); border-radius: 9px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13.5px; }
th, td { padding: 9px 12px; border-bottom: var(--rule); vertical-align: top; }
th { font-weight: 600; background: var(--rail); }
tr:last-child td { border-bottom: 0; }
.prose td { min-width: 7em; }
code { font: .9em/1.7 ui-monospace, "Cascadia Code", Consolas, "Noto Sans JP", monospace; overflow-wrap: anywhere; }
:not(pre) > code { font-size: .88em; padding: .1em .35em; border-radius: 4px; background: #edf1f7; color: #26344b; }
.code-block { overflow: hidden; background: #192537; color: #f2f6fc; border-radius: 9px; margin: 12px 0; }
.code-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: #d6e2f5; background: #243348; padding: 4px 7px 4px 15px; font-size: 12px; font-weight: 550; }
.code-tools button, .dialog-head button, #menu-open, .read-button { display: inline-flex; gap: 6px; align-items: center; justify-content: center; background: var(--white); border: var(--rule); border-radius: 7px; }
.code-tools button { background: transparent; color: #f4f7ff; border: 1px solid #60728a; padding: 3px 8px; min-height: 34px; font-size: 12px; }
.code-tools button:hover { background: #33455e; }
.code-tools .icon { width: 14px; height: 14px; }
.code-block pre { margin: 0; padding: 15px 17px 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.code-block code { font-size: 13.5px; line-height: 1.85; }
.reader-end { display: flex; justify-content: flex-end; margin: 24px 0; }
.read-button { min-height: 42px; padding: 7px 14px; font-size: 13px; font-weight: 600; }
.read-button:hover { border-color: #9eb5dd; }
.read-button[aria-pressed="true"] { color: #11694b; background: #eaf7f0; border-color: #a7d9c4; }
.chapter-turns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.chapter-turn { display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 16px; min-height: 90px; border: var(--rule); border-radius: 11px; text-decoration: none; }
.chapter-turn:hover { border-color: #9ab5ef; background: var(--rail); }
.chapter-turn small { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--quiet); }
.chapter-turn small .icon { width: 14px; height: 14px; }
.chapter-turn strong { font-size: 15px; font-weight: 650; }
.chapter-turn:last-child { align-items: flex-end; text-align: right; }
.chapter-turn:last-child small { flex-direction: row-reverse; }
.prompt-group { margin: 28px 0; }
.prompt-group h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 19px; }
.prompt-group .topic-icon { width: 30px; height: 30px; }
.prompt-group .topic-icon .icon { width: 17px; }
.prompt-entry { border-bottom: var(--rule); }
.prompt-entry summary { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 7px 4px; font-size: 14px; font-weight: 600; }
.prompt-entry > div { padding: 0 0 16px; }
.prompt-entry summary:hover { color: var(--link); }

.ancillary { min-width: 0; width: 100%; max-width: 1080px; padding: 42px var(--page-gutter) 72px; overflow-wrap: anywhere; }
.ancillary h1 { margin-bottom: 12px; font-size: clamp(26px, 2.5vw, 39px); }
.ancillary h2 { margin: 25px 0 10px; }
.ancillary h3 { margin: 15px 0 7px; }
.ancillary p { margin-bottom: 10px; }
.page-head { margin-bottom: 24px; }
.lede { max-width: 60em; color: var(--muted); }
.split { display: grid; grid-template-columns: minmax(155px, .36fr) 1fr; gap: 26px; align-items: start; }
.split.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sheet, .bank-form, .issue { padding: 20px; border: var(--rule); border-radius: 12px; }
.sheet, .bank-form, .issue, .account { max-width: 540px; }
.field { display: grid; gap: 5px; margin: 0 0 15px; font-weight: 600; font-size: 14px; }
.field input, .field select, .field textarea, .copy-field input { width: 100%; min-height: 44px; border: 1px solid #aab9ca; border-radius: 7px; background: white; padding: 9px 11px; font-weight: 400; }
.field textarea { min-height: 130px; resize: vertical; }
.btn, .tabs button, .side-nav button { min-height: 42px; padding: 8px 14px; border: var(--rule); border-radius: 7px; font-size: 14px; font-weight: 600; background: var(--white); }
.btn, .tabs button[aria-selected="true"] { background: var(--blue); color: white; border-color: transparent; }
.btn.secondary { background: var(--white); color: var(--ink); border: var(--rule); }
.btn.quiet { background: transparent; color: var(--link); }
.tabs, .copy-field { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.copy-field input { flex: 1 1 220px; }
.copy-confirm { width: 100%; color: #10643d; font-size: 13px; }
.side-nav { display: grid; gap: 6px; margin-top: 24px; }
.side-nav button { text-align: left; }
.side-nav button[aria-pressed="true"] { background: var(--selected); color: var(--link); }
.board { list-style: none; padding: 0; }
.board li { padding: 12px 0; border-bottom: var(--rule); }
.board h3 { font-size: 16px; }
.board p, .contact-links { font-size: 14px; }
.status { padding: 1px 7px; border-radius: 4px; font-size: 12px; background: var(--selected); }
.status.review { background: #fff5d8; }
.status.planned { background: #e5f6ed; }
.alert { padding: 10px; background: #fff1e9; border-radius: 6px; color: #883c12; }
.account { display: grid; grid-template-columns: auto 1fr; gap: 5px 22px; margin-bottom: 14px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
#menu-open { display: none; }
dialog { border: 0; padding: 0; color: var(--ink); background: var(--white); }
dialog::backdrop { background: rgb(15 23 42 / 56%); }
body:has(dialog[open]) { overflow: hidden; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 17px; border-bottom: var(--rule); font-size: 14px; font-weight: 600; }
.dialog-head button { font-size: 13px; padding: 6px 11px; min-height: 40px; }
#nav-dialog { inset: 0 auto 0 0; margin: 0; width: min(340px, 91vw); max-width: none; height: 100%; max-height: 100%; background: var(--rail); }
#nav-dialog[open] { animation: drawer-in 180ms ease-out; }
@keyframes drawer-in { from { transform: translateX(-100%); } }
.drawer-panel { display: flex; flex-direction: column; height: 100%; }
#drawer-content { flex: 1; min-height: 0; }
#drawer-content .docs-rail { display: flex; position: static; height: 100%; }
#image-dialog { width: fit-content; max-width: min(97vw, 1500px); max-height: 94dvh; border-radius: 12px; }
.lightbox-panel { max-height: 94dvh; display: flex; flex-direction: column; }
.lightbox-panel figure { min-height: 0; display: flex; flex-direction: column; padding: 10px 12px 14px; }
.image-scroll { min-height: 0; overflow: auto; background: var(--rail); }
.image-scroll img { display: block; max-width: 100%; width: auto; height: auto; max-height: calc(94dvh - 155px); margin: auto; object-fit: contain; }
#image-dialog[data-size="actual"] .image-scroll img { max-width: none; max-height: none; }
#image-caption { flex: 0 0 auto; max-height: 20dvh; overflow: auto; }

@media (min-width: 1681px) {
  .docs-shell { border-inline: var(--rule); }
}
@media (max-width: 1150px) {
  .reading-layout { grid-template-columns: minmax(0, 820px); }
  .outline { display: none; }
  .inline-toc { display: block; margin: 0 0 23px; border-block: var(--rule); }
  .inline-toc summary { display: flex; align-items: center; gap: 8px; padding: 10px 0; font-size: 13px; font-weight: 600; }
  .inline-toc nav { margin-bottom: 15px; font-size: 13px; }
}
@media (max-width: 860px) {
  :root { --rail-width: 0px; --header: 57px; --page-gutter: clamp(17px, 4.5vw, 38px); }
  .mast-inner { align-items: center; justify-content: space-between; padding-inline: var(--page-gutter); }
  .brand { flex-basis: auto; padding: 0; gap: 8px; background: transparent; border: 0; }
  .brand-mark { width: 23px; height: 24px; }
  .word { font-size: 21px; }
  .docs-word { font-size: 16px; }
  .portal-nav, .rail-slot { display: none; }
  #menu-open { display: inline-flex; min-height: 40px; padding: 6px 10px; font-size: 13px; }
  .docs-shell { display: block; }
  .reading-layout { padding-top: 19px; padding-bottom: 42px; }
  .crumbs { margin-bottom: 25px; }
  .rail-tools { padding: 16px 16px 12px; }
  .rail-search input { height: 44px; font-size: 16px; }
  .search-field kbd { display: none; }
  .mobile-links { display: flex; flex-wrap: wrap; gap: 0 15px; border-top: var(--rule); margin: 14px 10px 0; }
  .mobile-links a { display: inline-flex; align-items: center; min-height: 44px; font-size: 12px; }
  .nav-group a, .nav-group summary, .nav-home, .nav-library { min-height: 44px; }
  .read-progress { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .wide-search input { font-size: 16px; }
  .ancillary { padding-top: 27px; }
  .split, .split.even { grid-template-columns: minmax(0, 1fr); gap: 15px; }
  .side-nav { margin-top: 0; }
  .code-tools button, .dialog-head button, .inline-toc summary, .read-button { min-height: 44px; }
}
@media (max-width: 580px) {
  h1 { font-size: 30px; }
  .hub-intro { min-height: 111px; padding-bottom: 8px; }
  .hub-title { width: calc(100% - 82px); }
  .hub-title h1 { font-size: clamp(26px, 7.5vw, 37px); }
  .hub-title p { margin-top: 8px; font-size: 13.5px; }
  .book-art { right: -9px; top: 1px; transform: scale(.61) rotate(-9deg); transform-origin: top right; }
  .wide-search { padding-inline: 12px; gap: 7px; }
  .wide-search input { height: 48px; }
  .hub-guides { margin-top: 28px; }
  .topic-grid { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .topic-card { position: relative; padding: 14px 34px 14px 65px; min-height: 84px; }
  .card-top > .topic-icon { position: absolute; top: 15px; left: 15px; width: 36px; height: 36px; }
  .card-top > span:last-child { position: absolute; right: 12px; inset-block: 0; font-size: 0; gap: 0; }
  .topic-card h3 { font-size: 15px; margin: 0; }
  .topic-card p { margin-top: 3px; font-size: 12.5px; }
  .chapter-info > div { grid-template-columns: 6.8em minmax(0, 1fr); gap: 8px; }
  .prose { font-size: 15px; line-height: 1.9; }
  .callout { padding: 16px; }
  .doc-section { margin: 27px 0; }
  .steps > li { padding: 12px 10px 12px 43px; }
  .steps > li::before { left: 10px; top: 14px; width: 21px; height: 21px; }
  .chapter-turns { grid-template-columns: 1fr; }
  .chapter-turn { min-height: 70px; padding: 12px 15px; }
  .chapter-rows a { gap: 10px; }
  .chapter-rows h3 { font-size: 16px; }
  .chapter-rows p { font-size: 13px; }
  #image-dialog { width: 96vw; }
  .help-strip { row-gap: 3px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
