/* Control Rig Creator documentation · 1.0. No external fonts or UI libraries. */
:root {
  color-scheme: dark;
  --bg: #10141c;
  --surface: #151b25;
  --surface-raised: #1a2330;
  --surface-hover: #202d3e;
  --rail-bg: #121821;
  --header-bg: #101720;
  --text: #e9eef6;
  --muted: #b0bbcc;
  --subtle: #8e9db2;
  --line: #2b3546;
  --line-soft: #222d3c;
  --cyan: #83c7ff;
  --accent: #83c7ff;
  --accent-bg: #1a3046;
  --accent-ink: #0f2233;
  --gold: #e7c27c;
  --note-bg: #231f1a;
  --note-text: #d7cbb6;
  --shadow: 0 18px 60px #0005;
  --header: 76px;
  --rail: 268px;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Noto Sans", Arial, sans-serif;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #f7f9fc;
  --surface-raised: #eef3f9;
  --surface-hover: #e8eff8;
  --rail-bg: #f8fafc;
  --header-bg: #ffffff;
  --text: #192739;
  --muted: #475970;
  --subtle: #596c82;
  --line: #d8e1ed;
  --line-soft: #e8edf4;
  --cyan: #1b5fab;
  --accent: #195da7;
  --accent-bg: #e6f0fc;
  --accent-ink: #ffffff;
  --gold: #865518;
  --note-bg: #fff9ec;
  --note-text: #654f2e;
  --shadow: 0 18px 60px #243b5520;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 104px; scrollbar-gutter: stable; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.7; }
body.modal-lock, body.menu-open { overflow: hidden; }
button, input, select { font: inherit; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }
button, input, select, a, summary { outline-offset: 4px; }
:focus-visible { outline: 2px solid var(--accent); }
::selection { background: var(--accent); color: var(--accent-ink); }
[hidden] { display: none !important; }
svg { width: 20px; height: 20px; flex: 0 0 auto; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--text); line-height: 1.25; }
h1 { font-size: clamp(2.2rem, 3.5vw, 3.3rem); letter-spacing: -.045em; font-weight: 650; margin-bottom: 22px; }
h2 { font-size: clamp(1.65rem, 2.5vw, 2.25rem); letter-spacing: -.025em; font-weight: 650; }
h3 { font-size: 1.02rem; font-weight: 650; }
p { margin-bottom: 18px; }
p:last-child { margin-bottom: 0; }
small { font-size: .82rem; }
code { font-family: "Cascadia Code", Consolas, monospace; font-size: .88em; color: var(--accent); overflow-wrap: anywhere; }
summary { cursor: pointer; }
summary::-webkit-details-marker { display: none; }
kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 21px; min-height: 22px; border: 1px solid var(--line); border-radius: 4px; font: 11px/1.2 "Segoe UI", sans-serif; color: var(--subtle); padding: 2px 5px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip { position: fixed; top: -100px; left: 16px; z-index: 300; background: var(--accent); color: var(--accent-ink); padding: 10px 18px; border-radius: 6px; }
.skip:focus { top: 10px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex: 0 0 auto; padding: 0; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); }
.icon-button:hover { color: var(--text); background: var(--surface-hover); border-color: var(--line); }

/* Site header */
.topbar { position: sticky; top: 0; z-index: 70; background: var(--header-bg); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1664px; min-height: var(--header); display: flex; gap: 28px; align-items: center; margin: auto; padding: 12px 30px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand img { width: 42px; height: 42px; object-fit: contain; }
.brand b { display: block; font-size: .99rem; font-weight: 650; line-height: 1.25; letter-spacing: -.02em; }
.brand small { display: block; margin-top: 3px; color: var(--subtle); font-size: .67rem; letter-spacing: .055em; }
.brand-divider { color: var(--line); margin: 0 5px; }
.version-badge { align-self: flex-start; margin-top: 2px; border: 1px solid var(--line); border-radius: 5px; color: var(--subtle); font-size: .68rem; line-height: 1.5; padding: 1px 5px; }
.header-search { display: flex; align-items: center; gap: 10px; width: 320px; max-width: 34vw; min-width: 140px; margin-left: auto; padding: 9px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; color: var(--subtle); font-size: .81rem; text-align: left; line-height: 1.5; }
.header-search:hover { border-color: var(--accent); }
.header-search svg { width: 17px; height: 17px; }
.header-search span { flex: 1; }
.header-search kbd { flex-shrink: 0; }
.header-actions { display: flex; gap: 10px; align-items: center; }
.studio-link { display: flex; align-items: center; gap: 3px; font-size: .82rem; color: var(--muted); margin-left: 7px; }
.studio-link svg { width: 15px; height: 15px; }
.language { position: relative; }
.language summary { list-style: none; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 7px 9px; border-radius: 7px; color: var(--muted); font-size: .81rem; white-space: nowrap; }
.language summary:hover, .language[open] summary { background: var(--surface-hover); color: var(--text); }
.language summary svg { width: 17px; height: 17px; }
.language summary::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); margin-left: 2px; }
.language-list { position: absolute; right: 0; top: calc(100% + 10px); z-index: 75; width: 222px; max-width: calc(100vw - 24px); max-height: min(600px, 76dvh); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; }
.language-list a { display: flex; justify-content: space-between; gap: 12px; align-items: center; min-height: 37px; padding: 6px 12px; border-radius: 5px; color: var(--muted); font-size: .86rem; }
.language-list a:hover { text-decoration: none; background: var(--surface-hover); }
.language-list a[aria-current] { background: var(--accent-bg); color: var(--accent); }
.language-code { display: none; }
.menu-button { display: none; }
.reading-progress { position: absolute; bottom: -1px; height: 2px; width: 100%; pointer-events: none; }
.reading-progress span { display: block; width: 100%; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left center; }

/* Three-column documentation workspace */
.layout { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr) 222px; max-width: 1600px; margin: auto; align-items: start; }
.sidebar { position: sticky; top: var(--header); height: calc(100dvh - var(--header)); display: flex; flex-direction: column; padding: 25px 20px 18px; gap: 24px; background: var(--rail-bg); border-right: 1px solid var(--line-soft); overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.sidebar-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; color: var(--subtle); font-size: .71rem; }
.sidebar-product { font-size: .79rem; font-weight: 700; color: var(--text); letter-spacing: .04em; }
.sidebar-product span { color: var(--subtle); margin-left: 3px; font-size: .69rem; font-weight: 400; }
.nav-group { margin-bottom: 25px; }
.nav-group:last-child { margin-bottom: 0; }
.nav-label { font-size: .65rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--subtle); margin: 0 10px 7px; }
.nav-group a { position: relative; display: block; padding: 7px 10px; color: var(--muted); border-radius: 6px; font-size: .82rem; line-height: 1.48; margin: 1px 0; overflow-wrap: break-word; }
.nav-group a:hover { text-decoration: none; background: var(--surface-hover); color: var(--text); }
.nav-group a.active { color: var(--accent); background: var(--accent-bg); font-weight: 600; }
.nav-group a.active::before { content: ""; position: absolute; left: 0; width: 2px; top: 9px; bottom: 9px; background: var(--accent); border-radius: 2px; }
.sidebar-footer { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
.sidebar-footer button { display: flex; align-items: flex-start; gap: 10px; border: 0; background: transparent; padding: 7px 8px; border-radius: 6px; width: 100%; color: var(--muted); text-align: left; font-size: .76rem; line-height: 1.5; }
.sidebar-footer button:hover { background: var(--surface-hover); color: var(--text); }
.sidebar-footer svg { width: 16px; height: 16px; margin-top: 1px; }
.sidebar-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--subtle); margin: 17px 8px 0; font-size: .65rem; }
.sidebar-head { display: none; }
.menu-scrim { position: fixed; inset: 0; z-index: 80; background: #040b16a6; }
.reading { min-width: 0; padding: 32px clamp(25px, 3.7vw, 56px) 0; }
.reading p { overflow-wrap: break-word; }
.reading:focus { outline: none; }
.breadcrumb { display: flex; align-items: center; gap: 9px; font-size: .72rem; line-height: 1.5; color: var(--subtle); margin-bottom: 43px; min-height: 22px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb svg { width: 12px; height: 12px; }
.breadcrumb-current { min-width: 0; overflow-wrap: anywhere; }
.section-counter { margin-left: auto; flex-shrink: 0; font-variant-numeric: tabular-nums; font-size: .65rem; letter-spacing: .05em; color: var(--subtle); padding-left: 12px; }
.reader-toolbar, .mobile-toc { display: none; }
.doc-section { scroll-margin-top: 108px; margin-top: 56px; padding-top: 44px; border-top: 1px solid var(--line); }
.doc-section:first-of-type { padding-top: 0; border-top: 0; margin-top: 0; }
.enhanced:not(.full-guide) .doc-section { margin-top: 0; padding-top: 0; border-top: 0; }
.index { display: block; color: var(--subtle); font-size: .64rem; font-weight: 600; letter-spacing: .13em; margin-bottom: 14px; }
#overview > .index { color: var(--accent); }
.section-head { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 24px; }
.section-head h2 { margin: 0; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.copy-link { display: inline-flex; justify-content: center; align-items: center; flex-shrink: 0; background: transparent; border: 1px solid var(--line); width: 34px; height: 34px; border-radius: 6px; color: var(--subtle); }
.copy-link svg { width: 16px; height: 16px; }
.copy-link:hover { color: var(--accent); border-color: var(--accent); }
.intro { font-size: 1.02rem; line-height: 1.8; color: var(--muted); max-width: 70ch; }
.specs { display: flex; flex-wrap: wrap; gap: 7px; margin: 22px 0 26px; }
.specs span { padding: 4px 9px; border-radius: 5px; border: 1px solid var(--line); color: var(--muted); font-size: .67rem; line-height: 1.6; }
.specs span:first-child { color: var(--accent); border-color: var(--accent); }
.start-actions { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; margin: 26px 0 38px; }
.primary-action { display: inline-flex; align-items: center; justify-content: space-between; gap: 22px; padding: 10px 17px; border: 1px solid var(--accent); border-radius: 7px; background: var(--accent); color: var(--accent-ink); font-size: .85rem; font-weight: 650; line-height: 1.5; }
.primary-action:hover { text-decoration: none; filter: brightness(1.06); }
.primary-action svg { width: 18px; height: 18px; }
.resume-link { display: inline-flex; gap: 9px; align-items: center; font-size: .81rem; line-height: 1.4; }
.resume-link svg { width: 16px; height: 16px; }
.workspace-heading { font-size: .9rem; letter-spacing: 0; font-weight: 600; margin: 0 0 16px; }
.workspace-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.workspace-card { position: relative; display: flex; flex-direction: column; padding: 22px 23px 24px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text); transition: border-color .16s, background .16s; }
.workspace-card:hover { text-decoration: none; border-color: var(--accent); background: var(--surface-raised); }
.card-label { display: flex; justify-content: space-between; align-items: center; color: var(--subtle); font-size: .64rem; font-variant-numeric: tabular-nums; letter-spacing: .08em; margin-bottom: 19px; }
.card-label span { border: 1px solid var(--line); padding: 2px 7px; border-radius: 4px; }
.card-label svg { width: 18px; height: 18px; color: var(--accent); }
.workspace-card h3 { font-size: 1.14rem; margin-bottom: 11px; letter-spacing: -.02em; }
.workspace-card p { color: var(--muted); font-size: .83rem; line-height: 1.75; }
.quick-reference { margin: 34px 0 26px; }
.quick-reference h2 { font-size: .78rem; letter-spacing: 0; color: var(--subtle); margin: 0 0 10px; }
.quick-reference > div { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
.quick-reference a { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line-soft); padding: 11px 0; color: var(--muted); font-size: .78rem; }
.quick-reference a:hover { color: var(--accent); text-decoration: none; }
.quick-reference svg { width: 15px; height: 15px; }

/* Article content and reference records */
.entry { padding: 23px 0; border-top: 1px solid var(--line-soft); scroll-margin-top: 108px; }
.entry:first-of-type { border-top: 0; }
.entry h3 { margin-bottom: 10px; line-height: 1.6; overflow-wrap: anywhere; }
.entry p { color: var(--muted); line-height: 1.85; font-size: .94rem; }
.entry-label { font-size: .73rem; color: var(--accent); letter-spacing: .04em; margin-bottom: 6px; display: block; }
.entry a.permalink { font-weight: 400; font-size: .82rem; opacity: .45; margin-left: 7px; }
.entry:hover a.permalink, .entry a.permalink:focus { opacity: 1; }
.entry:focus { outline-offset: 8px; }
.note { border: 1px solid var(--line); border-left: 3px solid var(--gold); padding: 17px 20px; border-radius: 0 7px 7px 0; margin: 26px 0; color: var(--note-text); background: var(--note-bg); font-size: .81rem; line-height: 1.8; }
.note strong { display: block; color: var(--gold); font-weight: 650; margin-bottom: 6px; }
.section-mini-nav { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 24px; }
.section-mini-nav a { color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 5px 9px; font-size: .72rem; line-height: 1.6; overflow-wrap: anywhere; }
.section-mini-nav a:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.color-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 26px 0; }
.color-key { border: 1px solid var(--line); border-radius: 7px; background: var(--surface); font-size: .77rem; padding: 14px 16px; color: var(--text); }
.swatch { background: var(--swatch); height: 4px; border-radius: 4px; margin-bottom: 11px; }
.operation { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; margin: 10px 0; scroll-margin-top: 108px; }
.operation > summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 16px 18px; }
.operation > summary::after { content: "+"; color: var(--accent); font-size: 1.2rem; line-height: 1; }
.operation[open] > summary::after { content: "−"; }
.operation > summary:hover { background: var(--surface-hover); border-radius: 7px; }
.operation h3 { font-size: .91rem; line-height: 1.55; margin: 0; }
.operation h3 small { color: var(--subtle); margin-right: 13px; font-size: .69rem; font-weight: 400; font-variant-numeric: tabular-nums; }
.operation-body { padding: 2px 20px 20px; color: var(--muted); font-size: .89rem; line-height: 1.8; }
.field-label { font-size: .74rem; color: var(--subtle); margin: 20px 0 9px; }
.field-list { display: flex; flex-wrap: wrap; gap: 6px; }
.field-list a { display: inline-block; border: 1px solid var(--line); border-radius: 4px; font: .71rem/1.6 "Cascadia Code", Consolas, monospace; padding: 3px 7px; color: var(--accent); }
.field-list a:hover { text-decoration: none; background: var(--accent-bg); border-color: var(--accent); }
.expand-tools { display: flex; justify-content: flex-end; gap: 18px; margin: 0 0 18px; }
.expand-tools button { border: 0; background: transparent; padding: 4px 0; color: var(--accent); font-size: .76rem; }
.expand-tools button:hover { text-decoration: underline; text-underline-offset: 4px; }
.table-wrap { max-width: 100%; overflow-x: auto; margin: 22px 0; border: 1px solid var(--line); border-radius: 7px; }
.defaults-table { width: 100%; border-collapse: collapse; font-size: .81rem; }
.defaults-table th { text-align: left; padding: 12px 16px; background: var(--surface-raised); color: var(--text); font-weight: 600; }
.defaults-table td { border-top: 1px solid var(--line-soft); padding: 10px 16px; color: var(--muted); }
.defaults-table tbody tr:nth-child(even) { background: var(--surface); }
.defaults-table td:last-child { font-family: "Cascadia Code", Consolas, monospace; }
.related { display: flex; flex-wrap: wrap; gap: 10px 24px; border-top: 1px solid var(--line); padding: 21px 0 4px; margin-top: 26px; font-size: .79rem; }
.sources { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; margin: 28px 0 0; padding: 15px 19px; font-size: .78rem; }
.sources strong { color: var(--subtle); font-size: .69rem; font-weight: 500; display: block; margin-bottom: 5px; }
.sources a { display: block; }
.catalog-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 24px; }
.catalog-bar input, .catalog-bar select { max-width: 100%; min-height: 41px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 8px 11px; font-size: .8rem; }
.catalog-bar input { flex: 1 1 220px; min-width: 0; }
.catalog-bar input::placeholder { color: var(--subtle); opacity: 1; }
.catalog-bar select { max-width: 180px; }
.subtle-button { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--muted); padding: 8px 12px; font-size: .78rem; line-height: 1.6; }
.subtle-button:hover { color: var(--accent); border-color: var(--accent); background: var(--surface-hover); }
.catalog-count { font-size: .75rem; color: var(--subtle); margin: 13px 0 20px; }
.catalog-section { margin: 10px 0; border: 1px solid var(--line); border-radius: 7px; scroll-margin-top: 108px; overflow: clip; }
.catalog-section > summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--surface); padding: 15px 18px; color: var(--text); font-size: .85rem; font-weight: 600; }
.catalog-section > summary::after { content: "+"; color: var(--accent); font-size: 1.15rem; }
.catalog-section[open] > summary::after { content: "−"; }
.catalog-record { margin: 0 18px; border-top: 1px solid var(--line-soft); scroll-margin-top: 108px; }
.catalog-record > summary { list-style: none; display: flex; justify-content: space-between; gap: 14px; color: var(--muted); font: .75rem/1.7 "Cascadia Code", Consolas, monospace; padding: 12px 0; overflow-wrap: anywhere; }
.catalog-record > summary::after { content: "›"; color: var(--subtle); flex-shrink: 0; }
.catalog-record[open] > summary { color: var(--accent); }
.catalog-record[open] > summary::after { content: "⌄"; }
.catalog-record dl { display: grid; grid-template-columns: minmax(100px, 24%) minmax(0, 1fr); gap: 8px 16px; margin: 0 0 20px; padding: 15px 17px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 5px; font-size: .76rem; line-height: 1.85; }
.catalog-record dt { color: var(--subtle); overflow-wrap: anywhere; }
.catalog-record dd { margin: 0; color: var(--muted); overflow-wrap: anywhere; }

/* Images open in the shared viewer. */
.shot { display: block; margin: 28px 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.shot-image { display: block; width: 100%; background: var(--surface); cursor: zoom-in; }
.shot-image img { width: 100%; height: auto; max-height: 800px; object-fit: contain; background: var(--surface); }
.shot figcaption { display: flex; gap: 14px; padding: 12px 16px; background: var(--surface); color: var(--muted); font-size: .74rem; line-height: 1.7; }
.shot figcaption span { color: var(--subtle); white-space: nowrap; }
.image-dialog { width: min(1440px, 96vw); max-width: 96vw; max-height: 94dvh; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); box-shadow: var(--shadow); }
.image-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.image-caption { font-size: .8rem; color: var(--muted); }
.image-stage { max-height: 76dvh; overflow: auto; display: flex; justify-content: center; background: #080c13; }
.image-stage img { max-width: 100%; max-height: 76dvh; width: auto; height: auto; object-fit: contain; }
.image-original { display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 10px 17px; font-size: .76rem; }
.image-original svg { width: 16px; height: 16px; }

/* Contextual section outline and reading navigation */
.page-outline { position: sticky; top: calc(var(--header) + 34px); padding: 0 24px 0 0; margin-top: 34px; max-height: calc(100dvh - var(--header) - 62px); overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.outline-inner { border-left: 1px solid var(--line-soft); padding-left: 19px; }
.outline-title { font-size: .67rem; letter-spacing: .04em; color: var(--text); margin: 0 0 14px; font-weight: 650; }
.outline-links { display: flex; flex-direction: column; gap: 2px; }
.outline-links a { display: block; color: var(--subtle); font-size: .72rem; line-height: 1.6; padding: 5px 0; overflow-wrap: anywhere; }
.outline-links a:hover { color: var(--accent); text-decoration: none; }
.outline-links a.active { color: var(--accent); }
.outline-links p { color: var(--subtle); font-size: .74rem; }
.outline-tools { border-top: 1px solid var(--line-soft); margin-top: 24px; padding-top: 16px; }
.outline-tools button, .outline-tools a { display: flex; align-items: flex-start; gap: 7px; font-size: .68rem; line-height: 1.65; padding: 7px 0; color: var(--subtle); background: transparent; border: 0; text-align: left; }
.outline-tools button:hover, .outline-tools a:hover { color: var(--accent); text-decoration: none; }
.outline-tools svg { width: 14px; height: 14px; margin-top: 3px; }
.chapter-pagination { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; border-top: 1px solid var(--line); margin-top: 44px; padding-top: 24px; }
.chapter-pagination a { border: 1px solid var(--line); border-radius: 7px; padding: 15px 18px; min-width: 0; }
.chapter-pagination a:hover { border-color: var(--accent); background: var(--surface); text-decoration: none; }
.chapter-pagination small { display: block; font-size: .66rem; color: var(--subtle); margin-bottom: 5px; }
.chapter-pagination strong { display: block; font-size: .81rem; font-weight: 600; line-height: 1.6; overflow-wrap: anywhere; }
.next-page { grid-column: 2; text-align: right; }
.footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line-soft); margin-top: 32px; padding: 25px 0 28px; }
.footer > a { flex-shrink: 0; }
.footer img { width: 106px; height: 46px; object-fit: contain; }
:root[data-theme="light"] .footer > a { border-radius: 6px; background: #111b29; padding: 5px 8px; }
.footer > div { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 7px 15px; }
.footer a { font-size: .69rem; color: var(--subtle); }
.copyright { width: 100%; text-align: right; font-size: .63rem; color: var(--subtle); margin-top: 3px; }

/* Full-guide search */
dialog::backdrop { background: #040a14b3; backdrop-filter: blur(4px); }
.search-dialog { width: min(720px, calc(100vw - 32px)); max-width: calc(100vw - 32px); padding: 0; margin: min(14vh, 100px) auto auto; max-height: 80dvh; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: var(--bg); box-shadow: var(--shadow); overflow: hidden; }
.search-dialog[open] { display: flex; flex-direction: column; }
.search-dialog-head { display: flex; align-items: center; gap: 13px; padding: 14px 17px; border-bottom: 1px solid var(--line); margin: 0; }
.search-dialog-head > svg { width: 21px; height: 21px; color: var(--accent); }
.search-dialog-head input { width: 100%; min-width: 0; border: 0; padding: 5px 0; background: transparent; color: var(--text); font-size: 1rem; line-height: 1.6; }
.search-dialog-head input:focus { outline: none; }
.search-dialog-head:focus-within { border-bottom-color: var(--accent); }
.search-dialog-head input::placeholder { color: var(--subtle); opacity: 1; }
.search-dialog-head input::-webkit-search-cancel-button { cursor: pointer; }
.search-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 13px 18px 5px; }
.search-filters button { background: transparent; border: 1px solid transparent; border-radius: 5px; color: var(--muted); font-size: .75rem; line-height: 1.5; padding: 6px 11px; }
.search-filters button:hover { background: var(--surface); }
.search-filters button[aria-pressed="true"] { background: var(--accent-bg); color: var(--accent); border-color: var(--line); }
.search-meta { color: var(--subtle); padding: 10px 20px 12px; font-size: .75rem; line-height: 1.65; }
.search-scroll { overflow-y: auto; min-height: 0; overscroll-behavior: contain; scrollbar-width: thin; padding: 0 9px 9px; }
.search-results { list-style: none; margin: 0; padding: 0; }
.search-results a { display: block; padding: 13px 13px 15px; border: 1px solid transparent; border-radius: 7px; color: var(--text); }
.search-results a:hover, .search-results a:focus-visible { text-decoration: none; background: var(--surface-raised); border-color: var(--line); outline: none; }
.search-results a:focus-visible { border-color: var(--accent); }
.search-results small { display: block; color: var(--subtle); font-size: .66rem; line-height: 1.6; margin-bottom: 3px; }
.search-results strong { font-size: .9rem; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.search-results p { font-size: .76rem; color: var(--muted); line-height: 1.75; margin: 5px 0 0; overflow-wrap: anywhere; }
.search-results mark { background: var(--accent-bg); color: var(--accent); border-radius: 2px; padding: 0 1px; }
.search-empty { text-align: center; padding: 26px 20px 34px; color: var(--muted); font-size: .83rem; }
.search-more { display: block; width: calc(100% - 24px); margin: 10px 12px 2px; }
.search-dialog-foot { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 17px; padding: 10px 18px; background: var(--surface); border-top: 1px solid var(--line); color: var(--subtle); font-size: .65rem; }
.search-dialog-foot span { display: flex; align-items: center; gap: 4px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); max-width: calc(100vw - 32px); z-index: 150; padding: 11px 20px; background: var(--surface-raised); color: var(--text); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); font-size: .83rem; text-align: center; overflow-wrap: anywhere; }

/* Medium screens keep a collapsible local outline above the article. */
@media (max-width: 1380px) {
  .layout { grid-template-columns: var(--rail) minmax(0, 1fr); max-width: 1280px; }
  .page-outline { display: none; }
  .reading { padding-inline: clamp(28px, 5vw, 64px); }
  .breadcrumb { margin-bottom: 16px; }
  .reader-toolbar { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line-soft); margin-bottom: 30px; padding-bottom: 9px; }
  .mobile-toc-button { display: inline-flex; align-items: center; gap: 13px; border: 0; padding: 8px 0; background: transparent; color: var(--subtle); font-size: .77rem; }
  .mobile-toc { display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 12px 16px; margin: -13px 0 26px; max-height: 40dvh; overflow: auto; }
  .mobile-toc a { color: var(--muted); padding: 5px 0; font-size: .78rem; line-height: 1.6; overflow-wrap: anywhere; }
  .mobile-toc a.active { color: var(--accent); }
}
@media (max-width: 1080px) {
  :root { --rail: 245px; }
  .topbar-inner { gap: 15px; padding-inline: 22px; }
  .studio-link { display: none; }
  .reading { padding-inline: 32px; }
  .brand small { max-width: 190px; }
}
@media (max-width: 900px) {
  :root { --header: 68px; }
  html { scrollbar-gutter: auto; }
  .topbar-inner { min-height: var(--header); padding: 10px 18px; gap: 13px; }
  .menu-button { display: inline-flex; }
  .layout { display: block; }
  .sidebar { display: none; }
  .sidebar.open { display: flex; position: fixed; z-index: 90; top: 0; left: 0; height: 100dvh; width: min(340px, calc(100vw - 42px)); padding: 18px 20px max(20px, env(safe-area-inset-bottom)); border-right: 1px solid var(--line); box-shadow: var(--shadow); }
  .sidebar.open .sidebar-head { display: flex; justify-content: space-between; gap: 15px; align-items: center; }
  .sidebar-head strong { font-size: .9rem; }
  .sidebar.open .sidebar-title { display: none; }
  .sidebar .nav-group a { font-size: .87rem; padding-block: 9px; }
  .nav-label { font-size: .69rem; }
  .sidebar-footer button { font-size: .81rem; min-height: 38px; }
  .reading { max-width: 890px; margin: auto; padding: 26px 34px 0; }
  .header-search { width: 38px; min-width: 38px; max-width: 38px; height: 38px; padding: 0; display: inline-flex; align-items: center; justify-content: center; background: transparent; border-color: transparent; }
  .header-search span, .header-search kbd { display: none; }
  .header-search:hover { background: var(--surface-hover); border-color: var(--line); }
  .header-search svg { width: 20px; height: 20px; }
  .brand { margin-right: auto; }
  .header-actions { gap: 7px; }
  .brand img { width: 38px; height: 38px; }
  .version-badge { display: none; }
  .doc-section, .entry, .operation, .catalog-record, .catalog-section { scroll-margin-top: 90px; }
}
@media (max-width: 600px) {
  :root { --header: 62px; }
  .topbar-inner { gap: 7px; padding: 9px 12px; }
  .brand { gap: 8px; }
  .brand b { font-size: .83rem; line-height: 1.25; }
  .brand small { display: none; }
  .brand img { width: 32px; height: 32px; }
  .header-actions { gap: 2px; }
  .topbar .icon-button, .header-search { width: 32px; min-width: 32px; max-width: 32px; height: 34px; }
  .language summary { gap: 4px; padding: 5px 6px; font-size: .72rem; min-height: 34px; }
  .language summary svg { display: none; }
  .language-name { display: none; }
  .language-code { display: inline; }
  .reading { padding: 21px 22px 0; }
  .breadcrumb { font-size: .68rem; gap: 7px; }
  .section-counter { font-size: .61rem; padding-left: 4px; }
  .reader-toolbar { margin-bottom: 28px; }
  h1 { font-size: 2.35rem; line-height: 1.1; }
  h2 { font-size: 1.65rem; }
  .index { font-size: .59rem; letter-spacing: .1em; }
  .intro { font-size: .94rem; line-height: 1.85; }
  .specs { gap: 6px; margin-block: 20px; }
  .specs span { font-size: .64rem; padding: 4px 7px; }
  .start-actions { gap: 14px; margin: 23px 0 30px; }
  .primary-action { font-size: .8rem; min-height: 44px; }
  .workspace-cards { grid-template-columns: 1fr; gap: 12px; }
  .workspace-card { padding: 19px 20px 21px; }
  .card-label { margin-bottom: 14px; }
  .workspace-card h3 { font-size: 1.14rem; }
  .workspace-card p { font-size: .85rem; }
  .quick-reference > div { grid-template-columns: 1fr; }
  .quick-reference a { font-size: .8rem; min-height: 44px; }
  .entry { padding-block: 21px; }
  .entry h3 { font-size: .95rem; }
  .entry p { font-size: .91rem; }
  .section-head { gap: 13px; }
  .copy-link { width: 32px; height: 32px; }
  .color-row { gap: 7px; }
  .color-key { padding: 12px 10px; font-size: .72rem; }
  .note { padding: 15px 17px; font-size: .81rem; }
  .catalog-bar input { flex-basis: 100%; }
  .catalog-bar input, .catalog-bar select { font-size: 1rem; }
  .catalog-bar select { flex: 1; }
  .catalog-bar .subtle-button { flex: 1; }
  .catalog-record { margin-inline: 12px; }
  .catalog-record dl { grid-template-columns: 1fr; gap: 3px; padding: 12px; }
  .catalog-record dt { margin-top: 7px; font-size: .66rem; }
  .catalog-record dt:first-child { margin-top: 0; }
  .catalog-record dd { margin-bottom: 7px; }
  .catalog-section > summary { padding: 14px; font-size: .81rem; }
  .section-mini-nav a { font-size: .71rem; }
  .shot figcaption { flex-direction: column; gap: 1px; }
  .chapter-pagination { gap: 10px; margin-top: 34px; }
  .chapter-pagination a { padding: 12px; }
  .chapter-pagination strong { font-size: .75rem; }
  .chapter-pagination small { font-size: .63rem; }
  .footer { gap: 17px; padding-block: 22px; align-items: flex-start; }
  .footer img { width: 81px; height: 40px; }
  .footer > div { gap: 6px 13px; }
  .footer a { font-size: .64rem; }
  .copyright { font-size: .59rem; line-height: 1.7; }
  .search-dialog { margin-top: 18px; max-height: calc(100dvh - 36px); width: calc(100vw - 24px); max-width: calc(100vw - 24px); }
  .search-dialog-head { padding: 12px; gap: 9px; }
  .search-dialog-head input { font-size: 1rem; }
  .search-dialog-foot { display: none; }
  .search-meta { font-size: .73rem; }
  .search-results a { padding: 12px 10px; }
  .search-filters { padding-inline: 12px; }
  .search-filters button { font-size: .73rem; }
  .image-dialog { max-height: 94dvh; }
  .image-caption { font-size: .69rem; }
}
@media (max-width: 370px) {
  .topbar-inner { gap: 5px; padding-inline: 8px; }
  .brand img { display: none; }
  .brand b { max-width: 108px; font-size: .78rem; }
  .reading { padding-inline: 17px; }
  h1 { font-size: 2.1rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
@media print {
  :root { color-scheme: light; --bg: #fff; --text: #17202b; --muted: #253447; --subtle: #405068; --line: #b7c3d0; --line-soft: #dce2e9; --surface: #f5f7fa; --surface-raised: #edf1f5; --accent: #124b87; --gold: #78500f; --note-bg: #fff; --note-text: #403925; }
  html, body { background: #fff; color: #17202b; font-size: 10pt; overflow: visible !important; }
  .topbar, .sidebar, .page-outline, .reader-toolbar, .mobile-toc, .breadcrumb, .chapter-pagination, dialog, .toast, .skip, .menu-scrim, .copy-link, .permalink, .catalog-bar, .catalog-count, .expand-tools, .start-actions, .related, .quick-reference { display: none !important; }
  .layout { display: block; max-width: none; }
  .reading { display: block; max-width: none; padding: 0; }
  .doc-section, .enhanced:not(.full-guide) .doc-section { margin: 24pt 0 0; padding: 18pt 0 0; border-top: 1px solid var(--line); }
  .doc-section:first-of-type { margin-top: 0; padding-top: 0; border: 0; }
  h1 { font-size: 28pt; }
  h2 { font-size: 21pt; }
  h3 { font-size: 12pt; }
  h1, h2, h3, summary { break-after: avoid; }
  .entry { padding: 12pt 0; }
  .entry p, .intro { font-size: 10pt; }
  .workspace-card, .note, .shot { break-inside: avoid; }
  .workspace-card { background: #fff; padding: 14pt; }
  .catalog-section, .operation, .table-wrap { overflow: visible; }
  .catalog-record { margin-inline: 10pt; }
  .operation, .catalog-section { background: #fff; }
  .catalog-record dl { display: block; }
  .catalog-record dt { font-weight: 600; }
  .catalog-record dd { margin-bottom: 6pt; }
  .catalog-record > summary, .catalog-section > summary { color: #17202b; }
  .shot img { max-height: 420pt; }
  .defaults-table { font-size: 9pt; }
  .table-wrap { border-radius: 0; }
  a { color: #124b87; }
  .footer { margin-top: 20pt; padding-top: 12pt; }
  .footer > a { background: #111b29 !important; padding: 5px 8px; }
}
