:root {
  --ink: #17252d;
  --heading: #123849;
  --paper: #f4f6f3;
  --surface: #fff;
  --line: #d5dcd8;
  --line-strong: #b8c7c2;
  --blue: #346b9a;
  --teal: #28766d;
  --green: #4c7740;
  --coral: #b8514d;
  --gold: #9c6a20;
  --plum: #76547d;
  --indigo: #5d5f9c;
  --shadow-sm: 0 2px 8px rgb(26 48 58 / 8%);
  --shadow-md: 0 10px 28px rgb(26 48 58 / 11%);
  color: var(--ink);
  background: var(--paper);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}
* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: clip; }
body { min-height: 100vh; margin: 0; background: var(--paper); }
main, main > *, section, article, form, fieldset, details, nav, aside { min-width: 0; }
h1, h2, h3, p, li, blockquote, summary, a { overflow-wrap: anywhere; }
input, textarea, select, button { max-width: 100%; }
h1[tabindex="-1"]:focus { outline: none; }
a { color: #145c7c; text-underline-offset: 0.18em; transition: color 160ms ease; }
a:hover { color: #0b3e59; }
a:focus-visible, button:focus-visible { outline: 3px solid #b45a21; outline-offset: 3px; }
button, a { min-height: 44px; }
button { border: 1px solid #39718a; border-radius: 5px; background: var(--surface); color: #174e68; padding: 0.55rem 0.9rem; box-shadow: 0 1px 2px rgb(20 55 70 / 8%); font: inherit; cursor: pointer; transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, border-color 160ms ease; }
button:hover { border-color: #174e68; background: #edf5f7; box-shadow: var(--shadow-sm); transform: translateY(-1px); }
button:active { box-shadow: none; transform: translateY(0); }
.frame { width: calc(100% - 2rem); max-width: 68rem; margin: 0 auto; }
.site-header { position: sticky; z-index: 20; top: 0; border-top: 4px solid transparent; border-bottom: 1px solid var(--line); border-image: linear-gradient(90deg, var(--teal) 0 22%, var(--gold) 22% 40%, var(--coral) 40% 60%, var(--plum) 60% 78%, var(--blue) 78%) 1; background: #fff; box-shadow: 0 3px 16px rgb(24 49 60 / 7%); }
.nav { display: flex; gap: 1.25rem; align-items: center; min-height: 4rem; padding-block: 0.35rem; }
.nav-toggle { display: none; }
.nav-links { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.nav a { position: relative; display: inline-flex; align-items: center; padding: 0 0.1rem; font-weight: 650; text-decoration: none; }
.nav a::after { position: absolute; right: 0; bottom: 0.35rem; left: 0; height: 3px; border-radius: 3px; background: var(--coral); content: ""; opacity: 0; transform: scaleX(0.35); transition: opacity 160ms ease, transform 160ms ease; }
.nav a:hover::after, .nav a[aria-current="page"]::after { opacity: 1; transform: scaleX(1); }
.nav a[aria-current="page"] { color: #813c39; }
main { --accent: var(--teal); --accent-soft: #eaf6f3; padding-block: 3rem 4rem; }
main[data-route="overview"] { --accent: var(--gold); --accent-soft: #fff4e5; }
main[data-route="chapters"], main[data-route="chapter"], main[data-route="record"] { --accent: var(--teal); --accent-soft: #eaf6f3; }
main[data-route="topics"], main[data-route="topic"] { --accent: var(--green); --accent-soft: #eef7ea; }
main[data-route="viewpoints"], main[data-route="viewpoint"] { --accent: var(--plum); --accent-soft: #f5eef7; }
main[data-route="questions"], main[data-route="question"] { --accent: var(--coral); --accent-soft: #fff0ef; }
main[data-route="search"] { --accent: var(--blue); --accent-soft: #edf5fb; }
main[data-route="graph"] { --accent: var(--indigo); --accent-soft: #f0f1fb; }
main[data-route="ask"] { --accent: var(--gold); --accent-soft: #fff6e6; }
main[data-route="create"] { --accent: var(--coral); --accent-soft: #fff1ed; }
main > * { animation: page-enter 420ms cubic-bezier(.2, .7, .2, 1) both; }
main > *:nth-child(2) { animation-delay: 45ms; }
main > *:nth-child(3) { animation-delay: 90ms; }
main > *:nth-child(n+4) { animation-delay: 120ms; }
h1, h2 { color: var(--heading); line-height: 1.25; }
h1 { margin: 0 0 0.75rem; font-size: 2.6rem; }
h1::after { display: block; width: 3.25rem; height: 4px; margin-top: 0.65rem; border-radius: 3px; background: var(--accent); content: ""; }
h2 { margin: 0 0 0.5rem; font-size: 1.35rem; }
p { max-width: 46rem; }
.intro { position: relative; padding-bottom: 2.5rem; border-bottom: 1px solid var(--line); }
.intro a { display: inline-flex; align-items: center; margin-top: 0.7rem; font-weight: 700; }
.page-guide { width: 100%; max-width: 52rem; margin: 0.9rem 0 1.6rem; padding: 0.8rem 1rem; border-left: 4px solid var(--accent); border-radius: 0 6px 6px 0; background: var(--accent-soft); box-shadow: 0 2px 10px rgb(22 48 58 / 6%); color: #33444d; overflow-wrap: anywhere; }
.page-guide p { margin: 0.3rem 0; }
.data-layer { padding: 2rem 0; border-bottom: 1px solid var(--line); }
.data-layer:nth-of-type(2) { --accent: var(--teal); }
.data-layer:nth-of-type(3) { --accent: var(--gold); }
.data-layer:nth-of-type(4) { --accent: var(--plum); }
.data-layer h2::before, .chapter-section > h2::before { display: inline-block; width: 0.55rem; height: 0.55rem; margin-right: 0.55rem; border: 2px solid var(--accent); background: var(--surface); content: ""; transform: rotate(45deg); vertical-align: 0.08rem; }
.data-layer dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 1.25rem 0 0; }
.metric { min-width: 0; padding: 0.85rem 1rem; border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow-sm); transition: transform 180ms ease, box-shadow 180ms ease; }
.metric:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.metric dt { font-weight: 700; }
.metric dd { margin: 0.2rem 0; color: var(--accent); font-size: 1.75rem; font-variant-numeric: tabular-nums; }
.metric p { margin: 0; color: #4c5962; font-size: 0.9rem; }
.page-state { min-height: 18rem; padding: 3rem 0; }
.chapter-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; margin-top: 2rem; }
.chapter-group { position: relative; overflow: hidden; padding: 1.25rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow-sm); transition: transform 180ms ease, box-shadow 180ms ease; }
.chapter-group::before { position: absolute; inset: 0 0 auto; height: 4px; background: var(--accent); content: ""; }
.chapter-group:nth-child(2)::before { background: var(--gold); }
.chapter-group:nth-child(3)::before { background: var(--coral); }
.chapter-group:nth-child(4)::before { background: var(--plum); }
.chapter-group:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.chapter-list { margin: 0; padding-left: 1.4rem; }
.chapter-list li { padding: 0.42rem 0; }
.chapter-list li.nested { margin-left: 0.75rem; }
.chapter-list a { font-weight: 650; }
.chapter-list span { display: block; color: #5b6870; font-size: 0.88rem; }
.chapter-list .chapter-code { color: #6b747a; font-size: 0.8rem; letter-spacing: 0; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 1.5rem; color: #59646c; }
.breadcrumb a { min-height: auto; }
.chapter-heading { padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.body-entry { max-width: 52rem; padding: 2rem 1.25rem; border-left: 4px solid var(--accent); background: rgb(255 255 255 / 62%); box-shadow: inset 0 -1px var(--line); counter-reset: body-paragraph; list-style: none; }
.body-entry li { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); gap: 0.65rem; padding: 0.5rem 0; counter-increment: body-paragraph; }
.body-entry li::before { color: #52636b; content: counter(body-paragraph) "."; font-variant-numeric: tabular-nums; text-align: right; }
.body-paragraph-text { min-width: 0; overflow-wrap: anywhere; }
.chapter-section { max-width: 52rem; padding: 2rem 0; border-top: 1px solid var(--line); }
.chapter-section h3 { margin: 1.5rem 0 0.35rem; color: #284656; font-size: 1.05rem; }
.chapter-section ul, .chapter-section ol { padding-left: 1.35rem; }
.chapter-section li { padding: 0.45rem 0; }
.knowledge-block { margin-top: 1.5rem; }
.evidence-actions { display: inline-flex; max-width: 100%; margin-left: 0.6rem; vertical-align: middle; }
.evidence-link { display: inline-flex; align-items: center; max-width: 100%; font-size: 0.9rem; font-weight: 700; }
.empty-state { color: #59646c; font-style: italic; }
.record-heading { padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.record-text { max-width: 52rem; font-family: ui-serif, Georgia, "Noto Serif SC", serif; font-size: 1.08rem; line-height: 1.9; }
mark { padding: 0.08em 0.12em; background: #f4d77a; color: inherit; }
.raw-json { max-width: 52rem; padding: 1rem 0; border-top: 1px solid #d6dad7; }
.raw-json summary { cursor: pointer; font-weight: 700; }
.raw-json pre { overflow-wrap: anywhere; white-space: pre-wrap; font: 0.82rem/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.adjacent { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid #d6dad7; padding-top: 1.5rem; }
.adjacent a { max-width: 46%; }
.cross-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; margin-top: 2rem; }
.cross-card { min-width: 0; padding: 1.25rem; border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow-sm); transition: transform 180ms ease, box-shadow 180ms ease; }
.cross-card:nth-child(3n+2) { border-top-color: var(--gold); }
.cross-card:nth-child(3n) { border-top-color: var(--coral); }
.cross-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.cross-card h2 { font-size: 1.15rem; }
.cross-card p { overflow-wrap: anywhere; }
.cross-evidence { max-width: 52rem; padding-left: 1.35rem; }
.cross-evidence li { padding: 1rem 0; border-bottom: 1px solid #e1e4e0; }
.cross-evidence p { margin: 0 0 0.5rem; }
.cross-evidence blockquote { margin: 0.6rem 0; padding-left: 0.8rem; border-left: 3px solid #86a4b4; overflow-wrap: anywhere; }
.search-page { max-width: 52rem; }
.search-form { display: grid; gap: 0.8rem; padding: 1.25rem; border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow-md); }
.search-form label { display: grid; gap: 0.25rem; font-weight: 700; }
.search-form input { min-height: 44px; width: 100%; padding: 0.55rem; border: 1px solid #86a4b4; border-radius: 4px; font: inherit; transition: border-color 160ms ease, box-shadow 160ms ease; }
.search-form input:focus, .ask-form textarea:focus, .graph-filters input:focus, .graph-filters select:focus { border-color: var(--accent); outline: 0; box-shadow: 0 0 0 3px rgb(52 107 154 / 16%); }
.search-form button[type="submit"], .ask-form button[type="submit"], .graph-filters button[type="submit"] { border-color: var(--accent); background: var(--accent); color: #fff; font-weight: 750; }
.search-form button[type="submit"]:hover, .ask-form button[type="submit"]:hover, .graph-filters button[type="submit"]:hover { filter: brightness(0.94); }
.search-help, .search-live { margin: -0.45rem 0 0; color: #59646c; font-size: 0.9rem; }
.search-filters { padding: 0.65rem 0; }
.search-filters summary { min-height: 44px; cursor: pointer; font-weight: 700; }
.search-checks { display: flex; flex-wrap: wrap; gap: 0.45rem 0.8rem; margin: 0.7rem 0; border: 0; padding: 0; }
.search-checks legend { font-weight: 700; }
.search-checks label { display: inline-flex; grid-template-columns: none; align-items: center; gap: 0.3rem; font-weight: 400; }
.search-checks input { min-height: auto; width: auto; }
.search-examples, .search-actions, .search-pagination { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-top: 1rem; }
.search-examples p { width: 100%; margin: 0; font-weight: 700; }
.search-summary { padding: 2rem 0 1rem; }
.search-groups { display: grid; gap: 1rem; }
.search-group { min-width: 0; padding: 1rem; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow-sm); }
.search-card { min-width: 0; padding: 1rem 0; border-top: 1px solid #e1e4e0; }
.search-card:first-of-type { border-top: 0; }
.search-card h3, .search-card p { overflow-wrap: anywhere; }
.search-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.search-chip { padding: 0.1rem 0.5rem; border: 1px solid #c9dde7; border-radius: 1rem; background: #eaf4f8; color: #284f63; font-size: 0.88rem; }
.search-actions a { display: inline-flex; align-items: center; font-weight: 700; }
.questions-page { max-width: 52rem; }
.question-filters { margin: 1.25rem 0; padding: 1rem; border: 1px solid #e4cecc; border-left: 4px solid var(--accent); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow-sm); }
.question-filters p { margin: 0.45rem 0; }
.question-filter-group { margin: 0.55rem 0; }
.question-filter-group summary { min-height: 44px; padding: 0.5rem 0; color: #27424f; font-weight: 700; cursor: pointer; }
.question-filter-options { display: flex; flex-wrap: wrap; gap: 0.3rem 0.55rem; align-items: center; padding: 0.3rem 0; }
.question-filter-group[open] .question-filter-options { max-height: 12rem; overflow-y: auto; padding: 0.7rem; border: 1px solid #eadbd9; border-radius: 5px; background: #fff8f7; }
.question-filter-options a { min-height: auto; }
.question-list { max-width: 52rem; padding-left: 1.35rem; }
.question-list { list-style-position: outside; }
.question-list li { margin: 0.6rem 0; padding: 0.9rem 1rem; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 5px; background: var(--surface); box-shadow: var(--shadow-sm); transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease; }
.question-list li:nth-child(3n+2) { border-left-color: var(--gold); }
.question-list li:nth-child(3n) { border-left-color: var(--plum); }
.question-list li:hover { border-color: #c4cfcb; box-shadow: var(--shadow-md); transform: translateX(3px); }
.question-list a { font-weight: 700; }
.question-list p { margin: 0.3rem 0 0; color: #59646c; }
.question-pagination { display: flex; gap: 0.75rem; margin-top: 1.5rem; }
.question-detail { max-width: 52rem; }
.question-detail > h2 { margin-top: 1.8rem; }
.ask-page { max-width: 68rem; }
.ask-form { display: grid; gap: 0.8rem; max-width: 52rem; padding: 1.25rem; border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow-md); }
.ask-form label { display: grid; gap: 0.3rem; font-weight: 700; }
.ask-form textarea { width: 100%; min-height: 5.5rem; padding: 0.55rem; resize: vertical; border: 1px solid #86a4b4; font: inherit; line-height: 1.5; }
.ask-live { min-height: 1.6rem; color: #59646c; }
.ask-error { max-width: 52rem; padding: 1rem; border-left: 4px solid #b45a21; background: #fff4eb; overflow-wrap: anywhere; }
.ask-content { display: grid; grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.8fr); gap: 1.25rem; margin-top: 1.5rem; align-items: start; }
.ask-answer, .ask-evidence, .ask-related { min-width: 0; padding: 1.25rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow-sm); overflow-wrap: anywhere; }
.ask-answer { border-top: 4px solid var(--gold); }
.ask-evidence { border-top: 4px solid var(--teal); }
.ask-related { border-left: 4px solid var(--plum); }
.ask-citations { font-weight: 700; color: #284656; }
.ask-evidence ol { margin: 0; padding-left: 1.35rem; }
.ask-evidence-card { padding: 0.8rem 0; border-bottom: 1px solid #e1e4e0; }
.ask-evidence-card:last-child { border-bottom: 0; }
.ask-evidence-card p, .ask-evidence-card blockquote { overflow-wrap: anywhere; }
.ask-evidence-card blockquote { margin: 0.5rem 0; padding-left: 0.8rem; border-left: 3px solid #86a4b4; }
.ask-related { max-width: 52rem; margin-top: 1.25rem; }
.ask-related p { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.creation-page { max-width: 68rem; }
.creation-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; max-width: 58rem; padding: 1.25rem; border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow-md); }
.creation-form > label { display: grid; min-width: 0; gap: 0.35rem; font-weight: 700; }
.creation-form select, .creation-form input[type="text"], .creation-form input:not([type]) { width: 100%; min-width: 0; min-height: 44px; padding: 0.55rem; border: 1px solid #9a8f8a; border-radius: 4px; background: #fff; font: inherit; }
.creation-form > label:nth-last-of-type(1) { grid-column: 1 / -1; }
.creation-types { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; margin: 0; padding: 0; border: 0; }
.creation-types legend { margin-bottom: 0.55rem; font-weight: 750; }
.creation-types label { display: grid; grid-template-columns: 1.35rem minmax(0, 1fr); gap: 0.25rem 0.55rem; min-width: 0; padding: 1rem; border: 1px solid #d8c4bd; border-radius: 6px; background: #fffaf8; cursor: pointer; }
.creation-types input { grid-row: 1 / span 2; width: 1.1rem; height: 1.1rem; margin-top: 0.1rem; accent-color: var(--accent); }
.creation-types strong { color: var(--heading); }
.creation-types span { color: #59646c; font-size: 0.92rem; line-height: 1.5; }
.creation-form button[type="submit"] { grid-column: 1 / -1; justify-self: start; border-color: var(--accent); background: var(--accent); color: #fff; font-weight: 750; }
.creation-form select:focus, .creation-form input:focus { border-color: var(--accent); outline: 0; box-shadow: 0 0 0 3px rgb(180 90 65 / 15%); }
.creation-live { min-height: 1.5rem; color: #59646c; }
.creation-error { max-width: 58rem; padding: 1rem; border-left: 4px solid #b45a21; background: #fff4eb; }
.creation-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; max-width: 58rem; margin: 1.5rem 0 0.8rem; padding: 1rem; border: 1px solid #dfd3c6; background: #fffaf3; box-shadow: var(--shadow-sm); }
.creation-actions button:first-child { border-color: #496f5d; background: #496f5d; color: #fff; font-weight: 750; }
.creation-result { max-width: 58rem; padding: 2rem clamp(1rem, 4vw, 3rem); border: 1px solid var(--line); border-top: 5px solid var(--accent); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow-md); }
.creation-result > p:first-child { color: #7d433d; font-weight: 750; }
.creation-result > h2 { font-size: 1.8rem; }
.creation-section { padding: 1.5rem 0; border-top: 1px solid var(--line); }
.creation-section h3, .creation-suggestions h3 { color: #284656; }
.creation-section > p { white-space: pre-line; }
.creation-sources { margin-top: 1rem; padding: 0.8rem 1rem; border-left: 4px solid var(--teal); background: #edf6f3; font-size: 0.92rem; }
.creation-sources h4 { margin: 0 0 0.45rem; color: #31584e; }
.creation-sources p { margin: 0.45rem 0; overflow-wrap: anywhere; }
.creation-suggestions { padding: 1.2rem; border-left: 4px solid var(--gold); background: #fff7e9; }
.graph-page { min-width: 0; }
.graph-filters, .graph-actions, .graph-view-controls { display: flex; flex-wrap: wrap; gap: 0.65rem; align-items: center; margin: 1.25rem 0; }
.graph-filters input, .graph-filters select { min-width: min(100%, 11rem); min-height: 44px; padding: 0.5rem; border: 1px solid #86a4b4; background: #fff; font: inherit; }
.graph-legend { display: flex; flex-wrap: wrap; gap: 0.65rem 1rem; padding: 0; list-style: none; }
.graph-legend li { display: inline-flex; min-width: 0; align-items: center; gap: 0.35rem; }
.graph-legend li::before { display: inline-block; flex: 0 0 0.85rem; width: 0.85rem; height: 0.85rem; border: 2px solid #17212b; content: ""; }
.graph-legend-person::before { border-radius: 50%; background: #0d4d73; }
.graph-legend-work::before { background: #805e9b; transform: rotate(45deg); }
.graph-legend-concept::before { border-radius: 0.2rem; background: #5b7f91; }
.graph-legend-topic::before { background: #667b48; transform: rotate(45deg); }
.graph-legend-chapter::before { background: #b45a21; }
.graph-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(16rem, 0.75fr); gap: 1rem; margin-top: 0.8rem; }
.graph-canvas { min-height: clamp(20rem, 55vw, 38rem); max-height: 42rem; border: 1px solid #9da1ca; border-radius: 6px; background: #fbfbfe; box-shadow: var(--shadow-md); }
.graph-detail, .graph-alternative, .graph-empty { min-width: 0; padding: 1rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow-sm); overflow-wrap: anywhere; }
.graph-detail { border-top: 4px solid var(--accent); }
.graph-actions a { display: inline-flex; align-items: center; font-weight: 700; }
.graph-detail h3 { margin: 1rem 0 0.35rem; color: #284656; font-size: 1rem; }
.graph-detail ul, .graph-evidence { margin-top: 0.35rem; padding-left: 1.35rem; }
.graph-evidence blockquote { margin: 0.4rem 0; padding-left: 0.75rem; border-left: 3px solid #86a4b4; }
.graph-neighborhood { padding: 0.65rem; background: #eef4f5; }
.graph-empty { max-width: 48rem; margin-top: 1rem; border-left: 4px solid #b45a21; }
.graph-alternative { margin-top: 1rem; }
.graph-alternative h3 { margin-bottom: 0.35rem; color: #284656; font-size: 1rem; }
.graph-list-node, .graph-list-edge { margin: 0.2rem 0.35rem 0.2rem 0; min-height: 2.4rem; text-align: left; }
.graph-list-edge { border-style: dashed; }
.graph-list-node[aria-current="true"], .graph-list-edge[aria-current="true"] { border-width: 3px; border-color: #b45a21; }
@keyframes page-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 42rem) {
  .frame { width: calc(100% - 1.5rem); }
  main { padding-block: 2rem 3rem; }
  h1 { font-size: 1.9rem; }
  .page-guide, .chapter-group, .cross-card, .search-form, .question-filters, .ask-form, .ask-answer, .ask-evidence, .ask-related, .creation-form, .creation-result, .graph-detail, .graph-alternative, .graph-empty { padding-inline: 1rem; }
  .data-layer dl, .chapter-groups, .cross-grid, .ask-content, .graph-layout { grid-template-columns: minmax(0, 1fr); }
  .chapter-groups { gap: 1rem; }
  .adjacent { flex-direction: column; }
  .adjacent a { max-width: none; }
  .body-entry { padding-inline: 0.65rem 0.9rem; }
  .body-entry li { grid-template-columns: 2.35rem minmax(0, 1fr); gap: 0.55rem; }
  .body-entry ul, .body-entry ol, .chapter-section ul, .chapter-section ol, .cross-evidence, .question-evidence ol, .ask-evidence ol, .graph-detail ul, .graph-evidence { padding-left: 1.2rem; }
  .chapter-section .body-entry { padding-left: 0.65rem; }
  .evidence-actions { display: flex; width: fit-content; margin: 0.35rem 0 0; }
  .evidence-link { min-height: 2.75rem; white-space: normal; }
  .search-form, .ask-form { width: 100%; }
  .creation-form, .creation-types { grid-template-columns: minmax(0, 1fr); width: 100%; }
  .creation-form > label, .creation-form > label:nth-last-of-type(1), .creation-form button[type="submit"] { grid-column: 1; }
  .creation-form button[type="submit"], .creation-actions button { width: 100%; }
  .search-form button[type="submit"], .ask-form button, .graph-filters button[type="submit"] { width: 100%; }
  .search-examples, .search-actions, .search-pagination, .question-pagination, .ask-related p, .graph-actions { align-items: stretch; }
  .search-examples button, .search-actions > *, .search-pagination > *, .question-pagination > * { flex: 1 1 9rem; }
  .question-filter-options { align-items: flex-start; }
  .question-list { padding-left: 1.25rem; }
  .question-list li { padding-inline: 0.85rem; }
  .graph-filters { display: grid; grid-template-columns: minmax(0, 1fr); }
  .graph-filters input, .graph-filters select, .graph-filters button { width: 100%; min-width: 0; }
  .graph-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem 0.8rem; }
  .graph-view-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .graph-view-controls button { width: 100%; padding-inline: 0.45rem; }
  .graph-canvas { min-height: 19rem; max-height: 28rem; }
  .graph-list-node, .graph-list-edge { max-width: 100%; white-space: normal; }
  .site-header { position: relative; }
  .nav { align-items: stretch; flex-direction: column; gap: 0.35rem; padding-block: 0.6rem; }
  .nav-toggle { display: block; align-self: flex-start; }
  .nav-links { align-items: stretch; flex-direction: column; gap: 0; border-top: 1px solid var(--line); }
  .nav-links[data-open="false"] { display: none; }
  .nav a { width: 100%; min-height: 2.75rem; }
  .nav a::after { right: auto; bottom: 0.2rem; width: 2.5rem; }
}
@media (max-width: 22rem) {
  .frame { width: calc(100% - 1rem); }
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.2rem; }
  .page-guide, .chapter-group, .cross-card, .search-form, .question-filters, .ask-form, .ask-answer, .ask-evidence, .ask-related, .creation-form, .creation-result, .graph-detail, .graph-alternative, .graph-empty { padding-inline: 0.8rem; }
  .graph-legend { grid-template-columns: minmax(0, 1fr); }
}
@media (hover: none) {
  button:hover, .metric:hover, .chapter-group:hover, .cross-card:hover, .question-list li:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto; transition: none !important; animation: none !important; } }
