/* Mistgate docs. Tokens follow the Mistgate design system; dark is the default look, light follows the system
   (color-scheme + light-dark()), and html[data-theme] pins one of them once the reader has toggled it. */

@font-face { font-family: "Onest"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("/fonts/onest-cyrillic-ext.woff2") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("/fonts/onest-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("/fonts/onest-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("/fonts/onest-latin.woff2") format("woff2"); 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: "JetBrains Mono"; font-style: normal; font-weight: 500 700; font-display: swap; src: url("/fonts/jetbrains-mono-cyrillic-ext.woff2") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500 700; font-display: swap; src: url("/fonts/jetbrains-mono-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500 700; font-display: swap; src: url("/fonts/jetbrains-mono-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500 700; font-display: swap; src: url("/fonts/jetbrains-mono-latin.woff2") format("woff2"); 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 {
  color-scheme: light dark;
  --bg: light-dark(#f8f8f6, #0c0c0e);
  --surface: light-dark(#ffffff, #141417);
  --surface-2: light-dark(#efefec, #1d1d22);
  --border: light-dark(#e3e3df, #25252b);
  --text: light-dark(#16161a, #f3f3f5);
  --muted: light-dark(#6b6b73, #8b8b94);
  --faint: light-dark(#c4c4c8, #4a4a52);
  --accent: #b8acf2;
  --accent-soft: light-dark(#e8e5f9, #201e28);
  --accent-line: light-dark(#c6bfef, #6a6488);
  --accent-text: light-dark(#45405e, #b8acf2);
  --accent-fill: #6f5fc9;
  --accent-fill-hover: #6354bd;
  --focus: light-dark(#5b4cb5, #b8acf2);
  --ink-on-accent: #0c0c0e;
  --warning-soft: light-dark(rgba(254, 188, 46, 0.2), rgba(254, 188, 46, 0.12));
  --warning-line: light-dark(rgba(190, 130, 0, 0.45), rgba(254, 188, 46, 0.35));
  --warning-text: light-dark(#63470b, #febc2e);
  --backdrop: rgba(0, 0, 0, 0.5);
  --shadow-pop: light-dark(0 12px 40px -12px rgba(20, 20, 30, 0.25), 0 14px 30px -10px rgba(0, 0, 0, 0.5));
  --tone-lavender: light-dark(#473a73, #b8acf2); --tone-lavender-bg: light-dark(#eae8fc, #2d2b38);
  --tone-sky: light-dark(#174e6a, #8ec8ea);      --tone-sky-bg: light-dark(#e0f0fa, #263037);
  --tone-sand: light-dark(#5c4a12, #dcc68c);     --tone-sand-bg: light-dark(#f5efdf, #332f25);
  --tone-sage: light-dark(#3b511d, #b0cc90);     --tone-sage-bg: light-dark(#e8f1e0, #2c3126);
  --tone-mint: light-dark(#00582f, #7dd3a0);     --tone-mint-bg: light-dark(#dcf3e4, #243229);
  --tone-rose: light-dark(#67343e, #e6a6b0);     --tone-rose-bg: light-dark(#f9e6e8, #362a2c);
  --font-sans: "Onest", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r-chip: 7px; --r-ctl: 11px; --r-field: 14px; --r-card: 16px; --r-card-lg: 18px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --hh: 68px;
  --pad: 28px;
}
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }
@supports (color: oklch(from red l c h)) {
  :root { --accent-fill: oklch(from var(--accent) 0.52 calc(c * 1.7) h); --accent-fill-hover: oklch(from var(--accent) 0.47 calc(c * 1.7) h); }
}
[data-tone="lavender"] { --tone: var(--tone-lavender); --tone-bg: var(--tone-lavender-bg); }
[data-tone="sky"] { --tone: var(--tone-sky); --tone-bg: var(--tone-sky-bg); }
[data-tone="sand"] { --tone: var(--tone-sand); --tone-bg: var(--tone-sand-bg); }
[data-tone="sage"] { --tone: var(--tone-sage); --tone-bg: var(--tone-sage-bg); }
[data-tone="mint"] { --tone: var(--tone-mint); --tone-bg: var(--tone-mint-bg); }
[data-tone="rose"] { --tone: var(--tone-rose); --tone-bg: var(--tone-rose-bg); }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body.mg { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 16px/1.65 var(--font-sans); -webkit-font-smoothing: antialiased; }
html.nav-open body { overflow: hidden; }
a { color: var(--accent-text); text-decoration: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
button { font: inherit; color: inherit; cursor: pointer; margin: 0; }
img { max-width: 100%; height: auto; }
[id] { scroll-margin-top: 88px; }
main:focus { outline: none; }
.sr { 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; left: 12px; top: -80px; z-index: 100; padding: 10px 16px; border-radius: var(--r-ctl); background: var(--accent-fill); color: #fff; font-weight: 700; transition: top 0.15s; }
.skip:focus { top: 12px; }
.muted { color: var(--muted); }
.label { font-size: 11px; line-height: 1.4; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 0; display: flex; align-items: center; gap: 6px; }
.js-only { display: none !important; }
.js .js-only { display: inline-flex !important; }
.wordmark { font-weight: 800; letter-spacing: -0.03em; line-height: 1; color: var(--text); white-space: nowrap; }
.wordmark span { color: var(--accent-text); }
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--r-ctl); background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap; }
.chip-id { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: var(--r-chip); background: var(--tone-bg); color: var(--tone); }
.ico { display: block; flex: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: var(--r-field); font-size: 14px; font-weight: 800; white-space: nowrap; transition: transform 0.2s var(--ease), background-color 0.2s; }
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--accent-fill); color: #fff; }
.btn--primary:hover { background: var(--accent-fill-hover); color: #fff; }
.btn--secondary { border-color: var(--border); background: var(--surface); color: var(--text); font-weight: 700; }
.btn--secondary:hover { border-color: var(--accent-line); }
.ib { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--border); border-radius: var(--r-ctl); background: var(--surface); color: var(--text); transition: border-color 0.2s, background-color 0.2s; }
.ib:hover { border-color: var(--accent-line); background: var(--surface-2); color: var(--text); }
.theme-ico { display: none; }
:root:not([data-theme]) .theme-ico--sun { display: flex; }
:root[data-theme="dark"] .theme-ico--sun, :root[data-theme="light"] .theme-ico--moon { display: flex; }
@media (prefers-color-scheme: light) { :root:not([data-theme]) .theme-ico--sun { display: none; } :root:not([data-theme]) .theme-ico--moon { display: flex; } }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--border); background: color-mix(in oklch, var(--bg) 86%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.top__in { max-width: 1360px; margin: 0 auto; padding: 0 var(--pad); height: var(--hh); display: flex; align-items: center; gap: 10px; }
.grow { flex: 1 1 auto; }
.brand { display: flex; align-items: center; gap: 10px; min-height: 40px; color: var(--text); font-size: 17px; min-width: 0; }
.brand img { display: block; width: 32px; height: 32px; }
.menu-btn { display: none; }
.search-btn { align-items: center; gap: 10px; width: 340px; max-width: 100%; height: 44px; padding: 0 10px 0 12px; border: 1px solid var(--border); border-radius: var(--r-field); background: var(--surface); color: var(--muted); font-size: 14px; text-align: left; transition: border-color 0.2s; }
.search-btn:hover { border-color: var(--accent-line); }
.search-btn__t { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
kbd { display: inline-flex; align-items: center; justify-content: center; height: 24px; min-width: 24px; padding: 0 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: var(--r-chip); background: var(--surface-2); color: var(--text); font: 700 12px var(--font-mono); }
.lang { display: flex; gap: 2px; padding: 2px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); }
.lang a { display: inline-flex; align-items: center; justify-content: center; height: 28px; min-width: 36px; padding: 0 8px; border-radius: var(--r-ctl); font: 700 11px var(--font-mono); color: var(--muted); }
.lang a:hover { color: var(--text); }
.lang a[aria-current] { background: var(--accent); color: var(--ink-on-accent); }

/* ---------- shell ---------- */
.shell { max-width: 1360px; margin: 0 auto; padding: 0 var(--pad); display: flex; gap: 40px; align-items: flex-start; }
.main { flex: 1 1 0; min-width: 0; padding: 40px 0 72px; }
.side { flex: 0 0 232px; position: sticky; top: var(--hh); max-height: calc(100vh - var(--hh)); max-height: calc(100dvh - var(--hh)); overflow-y: auto; overscroll-behavior: contain; padding: 28px 0 40px; scrollbar-width: thin; }
.side__head, .side__tools { display: none; }
.side__scroll { display: flex; flex-direction: column; gap: 24px; }
.grp { display: flex; flex-direction: column; gap: 2px; }
.grp__label { display: flex; align-items: center; gap: 8px; padding: 0 10px 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.nav-link { display: flex; align-items: center; min-height: 34px; padding: 6px 10px; border-radius: var(--r-ctl); font-size: 13px; line-height: 1.3; font-weight: 600; color: var(--muted); transition: background-color 0.18s, color 0.18s; }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link[aria-current] { background: var(--accent-soft); color: var(--text); }
.toc { flex: 0 0 200px; position: sticky; top: var(--hh); max-height: calc(100vh - var(--hh)); max-height: calc(100dvh - var(--hh)); overflow-y: auto; padding: 40px 0; display: flex; flex-direction: column; gap: 12px; scrollbar-width: thin; }
.toc ul, .toc-inline ul { list-style: none; margin: 0; padding: 0; }
.toc ul { border-left: 1px solid var(--border); }
.toc a { display: block; margin-left: -1px; padding: 5px 0 5px 14px; border-left: 2px solid transparent; font-size: 13px; line-height: 1.45; color: var(--muted); overflow-wrap: anywhere; transition: color 0.18s, border-color 0.18s; }
.toc .l3 a { padding-left: 26px; }
.toc a:hover { color: var(--text); }
.toc a.is-active { color: var(--text); font-weight: 600; border-left-color: var(--accent); }
.backdrop { display: none; }
.toc-inline { display: none; }

/* drawer below 900 px */
@media (max-width: 899px) {
  :root { --hh: 60px; }
  .menu-btn { display: inline-flex; }
  .side { position: fixed; z-index: 50; left: 0; top: 0; bottom: 0; width: min(320px, 86vw); max-height: none; padding: 0; background: var(--bg); border-right: 1px solid var(--border); transform: translateX(-100%); visibility: hidden; transition: transform 0.3s var(--ease), visibility 0s 0.3s; display: flex; flex-direction: column; overflow: hidden; }
  .side:target, .nav-open .side { transform: none; visibility: visible; transition: transform 0.3s var(--ease); box-shadow: var(--shadow-pop); }
  .side__head { display: flex; align-items: center; justify-content: space-between; height: var(--hh); flex: none; padding: 0 12px 0 16px; border-bottom: 1px solid var(--border); }
  .side__scroll { flex: 1 1 auto; overflow-y: auto; padding: 20px 12px 28px; overscroll-behavior: contain; }
  .nav-link { min-height: 44px; font-size: 14px; }
  .side__tools { display: flex; gap: 8px; padding: 4px 10px 0; }
  .backdrop { display: block; position: fixed; inset: 0; z-index: 45; background: var(--backdrop); opacity: 0; pointer-events: none; transition: opacity 0.25s; }
  .side:target + .backdrop, .nav-open .backdrop { opacity: 1; pointer-events: auto; }
  .search-btn { width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: var(--r-ctl); }
  .search-btn__t, .search-btn kbd { display: none; }
  .main { padding-top: 28px; }
}
@media (max-width: 1099px) { .shell { gap: 32px; } }
@media (min-width: 900px) { .search-btn { min-width: 220px; } }
@media (max-width: 1199px) {
  .toc { display: none; }
  .toc-inline { display: block; margin: 0 0 28px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); }
  .toc-inline summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 16px; cursor: pointer; list-style: none; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; color: var(--muted); }
  .toc-inline summary::-webkit-details-marker { display: none; }
  .toc-inline summary::after { content: ""; width: 8px; height: 8px; margin-right: 4px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform 0.2s; }
  .toc-inline[open] summary::after { transform: rotate(-135deg); }
  .toc-inline ul { padding: 0 8px 10px; }
  .toc-inline a { display: flex; align-items: center; min-height: 40px; padding: 6px 8px; border-radius: var(--r-ctl); font-size: 14px; line-height: 1.35; color: var(--text); }
  .toc-inline a:hover { background: var(--surface-2); }
  .toc-inline .l3 a { padding-left: 24px; color: var(--muted); }
}
@media (max-width: 719px) {
  :root { --pad: 16px; }
  .hide-s, .js .hide-s { display: none !important; }
  .top__in { gap: 8px; }
  .chip.tag { display: none; }
}
@media (max-width: 479px) { .brand { font-size: 16px; } }
@media (max-width: 419px) { .js .hide-xs { display: none !important; } }
@media (max-width: 1100px), (pointer: coarse) {
  .lang a { height: 40px; min-width: 40px; }
  .nav-link { min-height: 40px; }
}

/* ---------- document ---------- */
.doc { max-width: 800px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs [aria-current] { color: var(--text); }
.doc-h1 { margin: 0; font-size: clamp(30px, 6vw, 44px); line-height: 1.1; font-weight: 800; letter-spacing: -0.035em; text-wrap: balance; overflow-wrap: anywhere; }
.doc-lead { margin: 14px 0 0; max-width: 62ch; font-size: 17px; line-height: 1.55; color: var(--muted); text-wrap: pretty; }
.doc-head { padding-bottom: 28px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }

.prose { margin-top: 28px; }
.prose > :first-child:not(h2) { margin-top: 0; }
.prose p, .prose ul, .prose ol { max-width: 74ch; }
.prose p { margin: 0 0 16px; text-wrap: pretty; }
.prose h2, .prose h3, .prose h4 { position: relative; font-weight: 800; letter-spacing: -0.035em; line-height: 1.3; text-wrap: balance; overflow-wrap: anywhere; }
.prose h2 { margin: 56px 0 16px; font-size: 26px; }
.prose h3 { margin: 36px 0 12px; font-size: 19px; letter-spacing: -0.025em; }
.prose h4 { margin: 28px 0 10px; font-size: 16px; letter-spacing: -0.02em; }
.prose h2 + h3 { margin-top: 24px; }
.anchor { display: inline-block; margin: -10px 0 -10px 4px; padding: 10px 8px; color: var(--muted); font-weight: 600; opacity: 0; transition: opacity 0.15s; }
:is(h2, h3, h4):hover .anchor, .anchor:focus-visible { opacity: 1; }
@media (hover: none) { .anchor { opacity: 0.55; } }
.prose a:not(.anchor) { text-decoration: underline; text-decoration-color: var(--accent-line); text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; transition: text-decoration-color 0.15s; }
.prose a:not(.anchor):hover { text-decoration-color: currentColor; }
.prose strong { font-weight: 700; }
.pending { color: var(--muted); border-bottom: 1px dotted var(--faint); cursor: help; }
strong.planned { display: inline-block; padding: 0 7px; border-radius: 9px; background: var(--tone-sky-bg); color: var(--tone-sky); font-size: 0.78em; line-height: 1.7; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; vertical-align: 0.08em; }
.prose hr { margin: 40px 0; border: 0; border-top: 1px solid var(--border); }

.prose ul { margin: 0 0 16px; padding-left: 1.3em; }
.prose li { margin: 6px 0; padding-left: 4px; }
.prose li::marker { color: var(--accent-line); }
.prose li > :is(p, ul, ol) { margin-top: 6px; margin-bottom: 6px; }
.prose ol { counter-reset: step; list-style: none; margin: 0 0 20px; padding: 0; }
.prose ol > li { counter-increment: step; position: relative; margin: 0; padding: 3px 0 14px 44px; }
.prose ol > li::before { content: counter(step); position: absolute; left: 0; top: 2px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent-text); font: 700 12px var(--font-mono); }
.prose ol > li::after { content: ""; position: absolute; left: 13.5px; top: 36px; bottom: 6px; width: 1px; background: var(--border); }
.prose ol > li:last-child::after { display: none; }
.prose ol ol, .prose ul ol { margin-top: 10px; }

code, kbd, samp { font-family: var(--font-mono); }
.prose :not(pre) > code { padding: 0.12em 0.4em; border-radius: var(--r-chip); background: var(--surface-2); font-size: 0.86em; font-weight: 500; overflow-wrap: anywhere; }
.prose blockquote { margin: 0 0 16px; padding: 2px 0 2px 16px; border-left: 3px solid var(--accent-line); color: var(--muted); max-width: 74ch; }
.prose blockquote > :last-child { margin-bottom: 0; }

/* callouts: Note / Warning (Важно / Внимание) */
.callout { margin: 0 0 20px; padding: 14px 16px; border-radius: var(--r-field); border: 1px solid var(--accent-line); background: var(--accent-soft); max-width: none; }
.callout--warning { border-color: var(--warning-line); background: var(--warning-soft); }
.callout__label { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-text); }
.callout--warning .callout__label { color: var(--warning-text); }
.callout__body { font-size: 15px; line-height: 1.6; color: var(--text); }
.callout__body > :last-child { margin-bottom: 0; }
.callout__body p, .callout__body ul, .callout__body ol { max-width: none; }
.callout__body p { margin-bottom: 10px; }
.callout .code { margin: 10px 0; }

/* tables scroll inside their own box */
.table-wrap { margin: 0 0 24px; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
/* scroll shadows: an edge darkens only while there is more to scroll in that direction */
.table-wrap { background: linear-gradient(to right, var(--surface) 30%, transparent) left center / 40px 100% no-repeat local, linear-gradient(to left, var(--surface) 30%, transparent) right center / 40px 100% no-repeat local, radial-gradient(farthest-side at 0 50%, color-mix(in srgb, var(--text) 22%, transparent), transparent) left center / 12px 100% no-repeat scroll, radial-gradient(farthest-side at 100% 50%, color-mix(in srgb, var(--text) 22%, transparent), transparent) right center / 12px 100% no-repeat scroll, var(--surface); }
.table-wrap:focus-visible { outline-offset: 0; border-radius: var(--r-card); }
table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
th { padding: 11px 14px; text-align: left; vertical-align: bottom; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
td { padding: 11px 14px; vertical-align: top; border-top: 1px solid var(--border); }
td:first-child { font-weight: 600; }
td code:not(.nw) { word-break: break-word; }
.nw { white-space: nowrap; }
tr:hover td { background: color-mix(in oklch, var(--surface-2) 40%, transparent); }
@media (max-width: 719px) {
  table { min-width: 30rem; } th, td { padding: 10px 12px; }
  td:last-child:nth-child(n+3) { min-width: 15rem; }
  td:nth-child(n+2):not(:last-child) { min-width: 7.5rem; }
}

/* code */
.code { margin: 0 0 24px; border: 1px solid var(--border); border-radius: var(--r-field); background: var(--surface); overflow: hidden; }
.code__bar { display: flex; align-items: center; justify-content: space-between; min-height: 38px; padding: 4px 6px 4px 14px; border-bottom: 1px solid var(--border); background: color-mix(in oklch, var(--surface-2) 55%, var(--surface)); }
.code__lang { font: 600 11px var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.copy { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; transition: background-color 0.15s, color 0.15s; }
.copy:hover { background: var(--surface-2); color: var(--text); }
.copy.is-done { color: var(--tone-mint); }
@media (pointer: coarse) { .copy { height: 40px; padding: 0 14px; } .code__bar { padding-block: 2px; } }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; font: 500 13px/1.7 var(--font-mono); tab-size: 2; scrollbar-width: thin; -webkit-text-size-adjust: 100%; }
.code pre:focus-visible { outline-offset: -2px; }
.code code { font: inherit; }
.code .line span { color: light-dark(var(--shiki-light), var(--shiki-dark)); }
.code .line { min-height: 1.7em; }

/* previous / next, edit link */
.edit { margin: 40px 0 16px; font-size: 14px; }
.edit a { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; color: var(--muted); }
.edit a:hover { color: var(--text); }
.pns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.pn { display: flex; flex-direction: column; gap: 4px; min-height: 64px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); color: var(--text); transition: border-color 0.2s, transform 0.3s cubic-bezier(0.3, 1.5, 0.5, 1); }
.pn:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.pn--next { text-align: right; align-items: flex-end; grid-column: 2; }
.pn--prev { grid-column: 1; }
.pn .label { gap: 4px; }
.pn__t { font-size: 15px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.3; }
@media (max-width: 539px) { .pns { grid-template-columns: 1fr; } .pn--next, .pn--prev { grid-column: 1; text-align: left; align-items: flex-start; } .pn--next { order: -1; } }

/* ---------- home hero ---------- */
.hero { position: relative; isolation: isolate; display: flex; flex-direction: column; gap: 24px; padding-bottom: 4px; }
.hero__arch { position: absolute; z-index: -1; right: 0; top: -8px; width: 300px; height: 260px; pointer-events: none; -webkit-mask-image: linear-gradient(to bottom, #000 45%, transparent 100%); mask-image: linear-gradient(to bottom, #000 45%, transparent 100%); }
.hero__id { display: flex; align-items: center; gap: 20px; }
.hero__id img { display: block; width: 72px; height: 72px; flex: none; }
.hero__id > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hero__h1 { margin: 0; font-size: 56px; line-height: 1; }
.hero__lead { margin: 0; max-width: 540px; font-size: 18px; line-height: 1.55; text-wrap: pretty; }
.hero__lead code { padding: 0.12em 0.4em; border-radius: var(--r-chip); background: var(--surface-2); font-size: 0.86em; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 8px; }
.doc--home .prose { margin-top: 24px; }
@media (max-width: 719px) { .hero__h1 { font-size: 44px; } .hero__arch { display: none; } .hero__id { gap: 14px; } .hero__id img { width: 56px; height: 56px; } .hero__lead { font-size: 17px; } .prose h2 { font-size: 23px; margin-top: 44px; } }
@media (max-width: 379px) { .hero__h1 { font-size: 38px; } }

/* ---------- footer, 404 ---------- */
.foot { border-top: 1px solid var(--border); }
.foot__in { max-width: 1360px; margin: 0 auto; padding: 24px var(--pad) 40px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; font-size: 13px; color: var(--muted); }
.foot__brand { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.foot__brand img { display: block; width: 24px; height: 24px; }
.foot__links { display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; }
.foot__links a { display: inline-flex; align-items: center; min-height: 40px; color: var(--muted); }
.foot__links a:hover { color: var(--text); }
.nf { max-width: 640px; margin: 0 auto; padding: 72px var(--pad) 96px; display: flex; flex-direction: column; gap: 4px; }
.nf__code { margin: 0; font: 700 14px var(--font-mono); color: var(--accent-text); letter-spacing: 0.1em; }
.nf .hero__cta { margin-top: 24px; }

/* ---------- search dialog ---------- */
dialog.search { width: min(640px, calc(100vw - 24px)); max-height: min(560px, calc(100vh - 24px)); max-height: min(560px, calc(100dvh - 24px)); margin: 10vh auto auto; padding: 0; border: 1px solid var(--border); border-radius: var(--r-card-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop); overflow: hidden; }
dialog.search[open] { display: flex; flex-direction: column; animation: pop 0.2s var(--ease); }
dialog.search::backdrop { background: var(--backdrop); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.985); } }
.search__field { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 16px; border-bottom: 1px solid var(--border); color: var(--muted); }
.search__field input { flex: 1 1 auto; min-width: 0; height: 48px; border: 0; outline: 0; background: transparent; color: var(--text); font: 500 16px var(--font-sans); }
.search__field input::placeholder { color: var(--muted); }
.search__field input::-webkit-search-cancel-button { display: none; }
.search__list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; overscroll-behavior: contain; }
.search__list:empty { display: none; }
.search__list a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 6px 10px; border-radius: var(--r-ctl); color: var(--text); }
.search__list li[aria-selected="true"] a, .search__list a:hover { background: var(--surface-2); }
.search__list .t { display: flex; flex-direction: column; min-width: 0; font-size: 14px; font-weight: 700; line-height: 1.3; }
.search__list .t small { font-size: 12px; font-weight: 500; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search__list .chip { flex: none; }
.search__empty { margin: 0; padding: 18px 18px 22px; font-size: 14px; color: var(--muted); }
@media (max-width: 719px) { dialog.search { margin-top: 8px; } }

/* ---------- motion / print ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
@media print { .top, .side, .toc, .toc-inline, .foot, .pns, .edit, .backdrop { display: none !important; } .shell { display: block; } }
