/* nsin docs — one stylesheet, no framework.
 *
 * Dark is the default (the brand is dark and readers come from a dark site);
 * light is a full theme. Every direction-dependent rule uses logical
 * properties, so the Persian pages (dir="rtl") need no extra CSS. */

@font-face { font-family: 'Vazirmatn'; src: url('fonts/Vazirmatn-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('fonts/Vazirmatn-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('fonts/Vazirmatn-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('fonts/Vazirmatn-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('fonts/IBMPlexMono-Regular-latin.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('fonts/IBMPlexMono-Medium-latin.woff2') format('woff2'); font-weight: 500; font-display: swap; }

:root {
  --font: 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --header-h: 3.75rem;
  --sidebar-w: 16.5rem;
  --rail-w: 13.5rem;
  --content-w: 46rem;
  --radius: 10px;

  color-scheme: dark;
  --bg: #0b1219;
  --bg-soft: #0f1821;
  --surface: #121c26;
  --surface-2: #17232f;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #c5d0db;
  --text-strong: #f1f5f9;
  --muted: #8796a6;
  --faint: #5d6c7b;
  --accent: #22d3ee;
  --accent-text: #67e8f9;
  --accent-soft: rgba(34, 211, 238, 0.1);
  --accent-ink: #00141a;
  --code-bg: #0a1017;
  --code-text: #d6e2ee;
  --inline-code: rgba(255, 255, 255, 0.07);
  --note: #60a5fa; --tip: #34d399; --caution: #fbbf24; --danger: #f87171;
  --get: #34d399; --post: #60a5fa; --put: #fbbf24; --patch: #c084fc; --delete: #f87171;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

:root[data-theme='light'] {
  color-scheme: light;
  --bg: #ffffff;
  --bg-soft: #f7f9fb;
  --surface: #f3f6f9;
  --surface-2: #eaeff4;
  --line: #e3e8ee;
  --line-strong: #cfd7e0;
  --text: #334155;
  --text-strong: #0b1219;
  --muted: #64748b;
  --faint: #94a3b8;
  --accent: #0891b2;
  --accent-text: #0e7490;
  --accent-soft: rgba(8, 145, 178, 0.08);
  --accent-ink: #ffffff;
  --code-bg: #0f1720;
  --code-text: #d6e2ee;
  --inline-code: #eef2f6;
  --note: #2563eb; --tip: #059669; --caution: #b45309; --danger: #dc2626;
  --get: #059669; --post: #2563eb; --put: #b45309; --patch: #9333ea; --delete: #dc2626;
  --shadow: 0 20px 60px rgba(15, 23, 32, 0.18);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 1.25rem); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.8 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; inset-inline-start: -999px; top: 0.5rem; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 0.5rem 1rem; border-radius: 6px; }
.skip:focus { inset-inline-start: 0.5rem; }
.ico { width: 1.125rem; height: 1.125rem; flex: none; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.top-in {
  max-width: 90rem; height: 100%; margin: 0 auto;
  padding-inline: 1.25rem;
  display: flex; align-items: center; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: 0.55rem; color: var(--text-strong); flex: none; }
.brand:hover { text-decoration: none; }
.brand img { width: 26px; height: 26px; }
.brand b { font-weight: 700; font-size: 1.0625rem; letter-spacing: 0.01em; }
.brand span {
  font: 500 0.75rem/1 var(--mono); color: var(--muted);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 0.3rem 0.55rem;
}
.search-btn {
  flex: 1; max-width: 26rem; margin-inline: auto;
  display: flex; align-items: center; gap: 0.6rem;
  height: 2.375rem; padding-inline: 0.8rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  color: var(--muted); font-size: 0.875rem; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.search-btn:hover { border-color: var(--line-strong); background: var(--surface-2); text-decoration: none; }
.search-btn kbd { margin-inline-start: auto; font: 500 0.6875rem/1 var(--mono); color: var(--faint); border: 1px solid var(--line-strong); border-radius: 5px; padding: 0.25rem 0.4rem; }
.top-right { display: flex; align-items: center; gap: 0.5rem; flex: none; }
.top-link { color: var(--muted); font-size: 0.875rem; padding: 0.4rem 0.6rem; border-radius: 6px; }
.top-link:hover { color: var(--text-strong); background: var(--surface); text-decoration: none; }
.lang { display: flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.lang a { font-size: 0.75rem; padding: 0.3rem 0.6rem; color: var(--muted); }
.lang a:hover { color: var(--text-strong); text-decoration: none; }
.lang a[aria-current] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.icon-btn {
  display: grid; place-items: center; width: 2.25rem; height: 2.25rem;
  background: none; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { color: var(--text-strong); border-color: var(--line-strong); }
.theme-dark { display: none; }
:root[data-theme='light'] .theme-dark { display: block; }
:root[data-theme='light'] .theme-light { display: none; }
.login {
  background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 0.8125rem;
  padding: 0.5rem 1rem; border-radius: 7px; white-space: nowrap;
}
.login:hover { text-decoration: none; filter: brightness(1.08); }
.menu-btn { display: none; }

/* ---------- shell ---------- */
.shell {
  max-width: 90rem; margin: 0 auto; padding-inline: 1.25rem;
  display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--rail-w);
  gap: 3rem;
}
.shell.wide { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }

/* ---------- sidebar ---------- */
.side {
  position: sticky; top: var(--header-h); align-self: start;
  height: calc(100vh - var(--header-h)); overflow-y: auto;
  padding: 1.75rem 0.5rem 3rem 0; scrollbar-width: thin;
  font-size: 0.9rem; line-height: 1.5;
}
[dir='rtl'] .side { padding: 1.75rem 0 3rem 0.5rem; }
.side-group + .side-group { margin-top: 1.5rem; }
.side-title {
  display: flex; align-items: center; gap: 0.5rem;
  margin: 0 0 0.4rem; padding-inline: 0.65rem;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-strong);
}
.side-title .ico { width: 0.95rem; height: 0.95rem; color: var(--accent-text); }
.side ul { list-style: none; margin: 0; padding: 0; }
.side li a {
  display: block; padding: 0.32rem 0.65rem; border-radius: 6px;
  color: var(--muted); border-inline-start: 2px solid transparent;
}
.side li a:hover { color: var(--text-strong); background: var(--surface); text-decoration: none; }
.side li a[aria-current='page'] {
  color: var(--accent-text); background: var(--accent-soft); font-weight: 500;
  border-inline-start-color: var(--accent); border-start-start-radius: 0; border-end-start-radius: 0;
}
.side .sub { margin: 0.15rem 0 0.35rem; padding-inline-start: 0.75rem; }
.side .sub a { font-size: 0.84rem; padding-block: 0.22rem; }

/* ---------- article ---------- */
main { min-width: 0; padding: 2.25rem 0 4rem; }
.doc { max-width: var(--content-w); }
.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem;
  margin: 0 0 1rem; padding: 0; list-style: none;
  font: 500 0.75rem/1.4 var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: 0.04em;
}
[dir='rtl'] .crumbs { font-family: var(--font); letter-spacing: 0; }
.crumbs a { color: var(--muted); }
.crumbs li + li::before { content: '/'; margin-inline-end: 0.35rem; color: var(--faint); }
.doc h1 {
  margin: 0 0 0.75rem; color: var(--text-strong);
  font-size: clamp(1.9rem, 3.2vw, 2.5rem); line-height: 1.2; font-weight: 600; letter-spacing: -0.015em;
}
[dir='rtl'] .doc h1 { letter-spacing: 0; }
.lead { margin: 0 0 2rem; font-size: 1.125rem; line-height: 1.7; color: var(--muted); }
.prose > :first-child { margin-top: 0; }
.prose h2, .prose h3, .prose h4 { color: var(--text-strong); position: relative; scroll-margin-top: calc(var(--header-h) + 1.25rem); }
.prose h2 {
  margin: 3rem 0 1rem; padding-top: 2rem; border-top: 1px solid var(--line);
  font-size: 1.5rem; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em;
}
.prose h3 { margin: 2.25rem 0 0.75rem; font-size: 1.2rem; line-height: 1.4; font-weight: 600; }
.prose h4 { margin: 1.75rem 0 0.5rem; font-size: 1rem; font-weight: 600; }
.prose .anchor {
  position: absolute; inset-inline-start: -1.4rem; padding-inline-end: 0.4rem;
  color: var(--faint); font-weight: 400; opacity: 0; transition: opacity 0.15s;
}
/* The "#" is drawn by CSS so it never becomes part of the heading text. */
.prose .anchor::before { content: '#'; }
.prose :is(h2, h3, h4):hover .anchor, .prose .anchor:focus { opacity: 1; text-decoration: none; }
.prose p, .prose ul, .prose ol, .prose dl, .prose blockquote { margin: 0 0 1.15rem; }
.prose ul, .prose ol { padding-inline-start: 1.4rem; }
.prose li { margin: 0.3rem 0; }
.prose li::marker { color: var(--faint); }
.prose strong { color: var(--text-strong); font-weight: 600; }
.prose a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent-text) 35%, transparent); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--accent-text); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
.prose blockquote { border-inline-start: 3px solid var(--line-strong); padding-inline-start: 1rem; color: var(--muted); }
.prose img { border-radius: var(--radius); border: 1px solid var(--line); }
code { font-family: var(--mono); font-size: 0.86em; }
:not(pre) > code {
  background: var(--inline-code); color: var(--text-strong);
  padding: 0.12em 0.4em; border-radius: 5px; border: 1px solid var(--line);
  overflow-wrap: anywhere; direction: ltr; unicode-bidi: isolate;
}

/* tables */
.table { overflow-x: auto; margin: 0 0 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); }
.table table { width: 100%; border-collapse: collapse; font-size: 0.9rem; line-height: 1.6; }
.table th { text-align: start; background: var(--surface); color: var(--text-strong); font-weight: 600; }
.table th, .table td { padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table td:first-child { color: var(--text-strong); }

/* code blocks — dark in both themes */
.code { position: relative; margin: 0 0 1.5rem; background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; direction: ltr; }
:root[data-theme='light'] .code { border-color: #1d2833; }
.code-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.4rem 0.5rem 0.4rem 0.9rem; border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font: 500 0.7rem/1 var(--mono); color: #7f8fa0; text-transform: uppercase; letter-spacing: 0.06em;
}
.copy {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: none; border: 1px solid transparent; border-radius: 5px; padding: 0.3rem 0.5rem;
  color: #7f8fa0; font: inherit; cursor: pointer;
}
.copy:hover { color: #e2e8f0; border-color: rgba(255, 255, 255, 0.12); }
.copy .ico { width: 0.85rem; height: 0.85rem; }
.code pre { margin: 0; padding: 1rem 1.1rem; overflow-x: auto; color: var(--code-text); font: 400 0.84rem/1.7 var(--mono); tab-size: 2; }
.code code { font-size: inherit; }
.tok-c { color: #6b7d8f; font-style: italic; }
.tok-s { color: #a5e8a0; }
.tok-k { color: #7dd3fc; }
.tok-n { color: #fbbf77; }
.tok-v { color: #f0abfc; }
.tok-p { color: #67e8f9; }

/* callouts */
.callout {
  --c: var(--note);
  margin: 0 0 1.5rem; padding: 0.9rem 1.1rem;
  background: color-mix(in srgb, var(--c) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 22%, transparent);
  border-inline-start: 3px solid var(--c);
  border-radius: var(--radius);
}
.callout.tip { --c: var(--tip); }
.callout.caution { --c: var(--caution); }
.callout.danger { --c: var(--danger); }
.callout > :last-child { margin-bottom: 0; }
.callout p, .callout ul, .callout ol { margin-bottom: 0.6rem; }
.callout-title {
  display: flex; align-items: center; gap: 0.45rem;
  margin: 0 0 0.35rem !important; color: var(--c); font-weight: 600; font-size: 0.875rem;
}
.callout-title .ico { width: 1rem; height: 1rem; }

/* page foot: edit + prev/next */
.page-foot { margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.edit { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--muted); font-size: 0.85rem; }
.edit .ico { width: 0.95rem; height: 0.95rem; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem; }
.pager a {
  display: block; padding: 1rem 1.15rem; border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color 0.15s, background 0.15s;
}
.pager a:hover { border-color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.pager small { display: block; color: var(--faint); font-size: 0.75rem; }
.pager span { color: var(--text-strong); font-weight: 500; }
.pager .next { grid-column: 2; text-align: end; }

/* right rail */
.rail {
  position: sticky; top: var(--header-h); align-self: start;
  max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  padding: 2.4rem 0 2rem; font-size: 0.82rem; line-height: 1.5;
}
.rail-title { margin: 0 0 0.6rem; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-strong); }
.rail ul { list-style: none; margin: 0; padding: 0; border-inline-start: 1px solid var(--line); }
.rail li a { display: block; padding: 0.28rem 0 0.28rem 0.85rem; margin-inline-start: -1px; border-inline-start: 1px solid transparent; color: var(--muted); }
[dir='rtl'] .rail li a { padding: 0.28rem 0.85rem 0.28rem 0; }
.rail li.l3 a { padding-inline-start: 1.6rem; font-size: 0.78rem; }
.rail li a:hover { color: var(--text-strong); text-decoration: none; }
.rail li a.on { color: var(--accent-text); border-inline-start-color: var(--accent); }
.rail-extra { margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.rail-extra a { display: flex; align-items: center; gap: 0.4rem; color: var(--muted); padding: 0.2rem 0; }
.rail-extra .ico { width: 0.9rem; height: 0.9rem; }
.toc-inline { display: none; }

/* ---------- docs home ---------- */
.hero { padding: 1.5rem 0 2.25rem; }
.hero h1 { margin: 0 0 0.75rem; font-size: clamp(2.1rem, 4vw, 3rem); line-height: 1.15; font-weight: 700; color: var(--text-strong); letter-spacing: -0.02em; }
[dir='rtl'] .hero h1 { letter-spacing: 0; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--accent), #60a5fa); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin: 0 0 1.5rem; max-width: 38rem; font-size: 1.15rem; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.btn { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.65rem 1.1rem; border-radius: 8px; font-weight: 600; font-size: 0.9rem; border: 1px solid var(--line-strong); color: var(--text-strong); }
.btn:hover { text-decoration: none; border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn .ico { width: 1rem; height: 1rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); gap: 1rem; margin: 0 0 3rem; }
.card {
  display: flex; flex-direction: column; padding: 1.25rem; border: 1px solid var(--line); border-radius: 12px;
  background: linear-gradient(180deg, var(--bg-soft), transparent);
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); transform: translateY(-2px); }
.card-ico { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; margin-bottom: 0.9rem; border-radius: 9px; background: var(--accent-soft); color: var(--accent-text); }
.card h2 { margin: 0 0 0.6rem; font-size: 1rem; font-weight: 600; color: var(--text-strong); }
.card ul { list-style: none; margin: 0; padding: 0; font-size: 0.875rem; line-height: 1.5; }
.card li + li { margin-top: 0.35rem; }
.card li a { color: var(--muted); }
.card li a:hover { color: var(--accent-text); }
.section-h { margin: 0 0 1rem; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }

/* ---------- API reference ---------- */
.m {
  display: inline-block; min-width: 3.6rem; padding: 0.15rem 0.4rem; border-radius: 5px; text-align: center;
  font: 600 0.68rem/1.4 var(--mono); letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--mc); background: color-mix(in srgb, var(--mc) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--mc) 28%, transparent);
}
.m.get { --mc: var(--get); } .m.post { --mc: var(--post); } .m.put { --mc: var(--put); }
.m.patch { --mc: var(--patch); } .m.delete { --mc: var(--delete); }
.endpoint {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  margin: 0 0 1.75rem; padding: 0.8rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-soft);
  font: 500 0.92rem/1.5 var(--mono); color: var(--text-strong); direction: ltr; overflow-wrap: anywhere;
}
.endpoint .host { color: var(--faint); }
.ep-filter {
  width: 100%; margin: 0 0 1.5rem; padding: 0.7rem 0.9rem; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text-strong); font: inherit; font-size: 0.9rem;
}
.ep-filter:focus { outline: none; border-color: var(--accent); }
.ep-group { margin: 0 0 2.25rem; }
.ep-group h2 { margin: 0 0 0.35rem !important; padding-top: 0 !important; border-top: 0 !important; font-size: 1.15rem !important; }
.ep-group > p { margin: 0 0 0.85rem; color: var(--muted); font-size: 0.9rem; }
.ep-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ep-list li + li { border-top: 1px solid var(--line); }
.ep-list a { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr); gap: 0.25rem 0.85rem; align-items: center; padding: 0.6rem 0.9rem; color: var(--text); }
.ep-list a:hover { background: var(--surface); text-decoration: none; }
.ep-list code { font-size: 0.82rem; color: var(--text-strong); background: none; border: 0; padding: 0; direction: ltr; text-align: start; }
.ep-list .sum { grid-column: 2; font-size: 0.85rem; color: var(--muted); line-height: 1.4; }
.params { margin: 0 0 1.5rem; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.params > li { padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
.p-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; direction: ltr; }
.p-name { font: 600 0.86rem/1.4 var(--mono); color: var(--text-strong); }
.p-type { font: 400 0.78rem/1.4 var(--mono); color: var(--muted); }
.p-req { font: 600 0.68rem/1.4 var(--mono); color: var(--danger); text-transform: uppercase; letter-spacing: 0.05em; }
.p-in { font: 400 0.72rem/1.4 var(--mono); color: var(--faint); }
.p-desc { margin-top: 0.3rem; font-size: 0.9rem; line-height: 1.65; }
.p-desc > :last-child { margin-bottom: 0; }
.p-desc p { margin: 0 0 0.5rem; }
.p-enum { margin-top: 0.35rem; font-size: 0.8rem; color: var(--muted); }
.p-enum code { font-size: 0.78rem; }
.params details { margin-top: 0.55rem; }
.params summary { cursor: pointer; font-size: 0.8rem; color: var(--accent-text); width: fit-content; }
.params details > .params { margin: 0.5rem 0 0; padding-inline-start: 1rem; border-inline-start: 1px solid var(--line); border-top: 0; }
.params details > .params > li:last-child { border-bottom: 0; }
.resp { margin: 0 0 1rem; border: 1px solid var(--line); border-radius: var(--radius); }
.resp > summary { display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem 0.95rem; cursor: pointer; list-style: none; }
.resp > summary::-webkit-details-marker { display: none; }
.resp > summary::after { content: '+'; margin-inline-start: auto; color: var(--faint); font-family: var(--mono); }
.resp[open] > summary::after { content: '−'; }
.resp[open] > summary { border-bottom: 1px solid var(--line); }
.resp > div { padding: 0.25rem 0.95rem 0.5rem; }
.status { font: 600 0.8rem/1 var(--mono); padding: 0.25rem 0.45rem; border-radius: 5px; background: var(--surface-2); color: var(--text-strong); }
.status.ok { color: var(--get); } .status.warn { color: var(--put); } .status.err { color: var(--delete); }
.resp .rdesc { font-size: 0.9rem; color: var(--muted); }
.rail .ep-mini a { display: flex; gap: 0.5rem; align-items: baseline; }
.rail .ep-mini .m { min-width: 2.9rem; font-size: 0.6rem; padding: 0 0.25rem; }

/* ---------- search dialog ---------- */
.search {
  width: min(40rem, calc(100vw - 2rem)); max-height: min(36rem, calc(100vh - 6rem));
  margin: 5rem auto auto; padding: 0; border: 1px solid var(--line-strong); border-radius: 14px;
  background: var(--bg-soft); color: var(--text); box-shadow: var(--shadow); overflow: hidden;
}
.search::backdrop { background: rgba(4, 8, 12, 0.6); backdrop-filter: blur(3px); }
.search-head { display: flex; align-items: center; gap: 0.7rem; padding: 0.9rem 1rem; border-bottom: 1px solid var(--line); color: var(--muted); }
.search-head input { flex: 1; background: none; border: 0; outline: none; color: var(--text-strong); font: inherit; font-size: 1.02rem; }
.search-head kbd { font: 500 0.68rem/1 var(--mono); color: var(--faint); border: 1px solid var(--line-strong); border-radius: 5px; padding: 0.25rem 0.4rem; cursor: pointer; }
.search-results { list-style: none; margin: 0; padding: 0.5rem; max-height: calc(min(36rem, 100vh - 6rem) - 3.5rem); overflow-y: auto; }
.search-results a { display: block; padding: 0.6rem 0.75rem; border-radius: 8px; color: var(--text); }
.search-results a:hover, .search-results a.sel { background: var(--accent-soft); text-decoration: none; }
.search-results .r-sec { display: block; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--faint); }
.search-results .r-t { display: block; color: var(--text-strong); font-weight: 500; }
.search-results .r-x { display: block; font-size: 0.82rem; color: var(--muted); line-height: 1.45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results mark { background: none; color: var(--accent-text); font-weight: 600; }
.search-empty { padding: 2rem 1rem; text-align: center; color: var(--faint); font-size: 0.9rem; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); margin-top: 2rem; }
.foot-in { max-width: 90rem; margin: 0 auto; padding: 2rem 1.25rem 2.5rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.75rem; font-size: 0.85rem; }
.foot-brand { display: flex; align-items: center; gap: 0.45rem; color: var(--text-strong); font-weight: 600; }
.foot-brand img { width: 20px; height: 20px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; }
.foot nav a { color: var(--muted); }
.foot nav a:hover { color: var(--text-strong); }
.foot p { margin: 0; margin-inline-start: auto; color: var(--faint); font-size: 0.8rem; }

/* ---------- responsive ---------- */
@media (max-width: 80rem) {
  .shell { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .rail { display: none; }
  .toc-inline { display: block; margin: 0 0 2rem; padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-soft); }
  .toc-inline summary { cursor: pointer; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-strong); }
  .toc-inline ul { margin: 0.6rem 0 0; padding-inline-start: 1.1rem; font-size: 0.9rem; line-height: 1.6; }
  .toc-inline ul ul { margin: 0; }
}
@media (max-width: 56rem) {
  :root { --header-h: 3.5rem; }
  .shell, .shell.wide { display: block; padding-inline: 1rem; }
  .top-in { padding-inline: 1rem; gap: 0.5rem; }
  .menu-btn { display: grid; }
  .brand span, .top-link, .login { display: none; }
  .search-btn { max-width: none; }
  .search-btn kbd { display: none; }
  .side {
    position: fixed; inset: var(--header-h) 0 0 0; z-index: 30; height: auto;
    padding: 1.25rem 1rem 3rem !important; background: var(--bg);
    transform: translateX(-100%); visibility: hidden; transition: transform 0.2s, visibility 0.2s;
  }
  [dir='rtl'] .side { transform: translateX(100%); }
  body.nav-open .side { transform: none; visibility: visible; }
  body.nav-open { overflow: hidden; }
  main { padding-top: 1.5rem; }
  .prose .anchor { display: none; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
  .foot p { margin-inline-start: 0; }
}
@media (max-width: 30rem) {
  .lang { display: none; }
  .search-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
/* Without JS the drawer cannot open, so the sidebar falls back to a plain
   list above the article — every page stays reachable. */
@media (max-width: 56rem) {
  html:not(.js) .side { position: static; transform: none; visibility: visible; height: auto; border-bottom: 1px solid var(--line); }
  html:not(.js) .menu-btn { display: none; }
}
@media print {
  .top, .side, .rail, .foot, .page-foot, .copy { display: none !important; }
  .shell { display: block; }
  body { background: #fff; color: #000; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
