/* IPROAM Resource Center — documentation shell (v5). Replaces docs-v4.css. */

:root {
  --ink: #10261d;
  --ink-2: #274236;
  --muted: #4c6157;
  --soft: #6b7d74;
  --line: #dbe5df;
  --line-2: #eaf0ec;
  --surface: #ffffff;
  --alt: #f6f9f7;
  --teal: #12b886;
  --teal-strong: #0c9877;
  --teal-soft: #e6f7f0;
  --cyan: #0d7d94;
  --cyan-soft: #eaf6f9;
  --amber: #a96b08;
  --amber-soft: #fdf4e6;
  --code-bg: #f7faf8;
  --code-ink: #16321f;

  --sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --rail-w: 280px;
  --outline-w: 240px;
  --shell-max: 1560px;
  --read-max: 736px;

  --header-h: 78px;
  --bar-h: 0px;
  --sticky-top: calc(var(--header-h) + var(--bar-h));

  --r-sm: 4px;
  --r-md: 6px;
  --fast: 140ms ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--surface);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body { min-height: 100vh; display: flex; flex-direction: column; background: var(--surface); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; top: -100px; left: 16px; z-index: 200;
  border-radius: var(--r-sm); padding: 8px 14px;
  color: #fff; background: var(--teal-strong);
  font-size: 14px; font-weight: 700; text-decoration: none;
  transition: top var(--fast);
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--teal-strong); outline-offset: 2px; border-radius: 2px; }

/* ---------------- Shell ---------------- */

.docs-main { flex: 1 0 auto; min-width: 0; }

.docs-shell {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--outline-w);
  width: 100%;
  max-width: var(--shell-max);
  margin: 0 auto;
  align-items: start;
}

.docs-body { min-width: 0; padding: 40px 56px 96px; }
.docs-article { width: 100%; max-width: var(--read-max); margin: 0 auto; min-width: 0; }

/* ---------------- Left rail ---------------- */

.docs-rail {
  min-width: 0;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.docs-rail-inner {
  position: sticky;
  top: var(--header-h);
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 40px 18px 56px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.rail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.rail-head-title {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rail-close {
  display: none;
  width: 34px; height: 34px;
  align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); color: var(--muted);
  font-size: 20px; line-height: 1; cursor: pointer;
}
.rail-close:hover { color: var(--ink); background: var(--alt); }

.rail-group-label {
  color: var(--soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

/* Three resource sections: distinct, quiet, full-width rows */
.docs-parts { display: flex; flex-direction: column; gap: 2px; margin-top: -8px; }

.docs-part {
  --accent: var(--teal-strong);
  --accent-soft: var(--teal-soft);
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 12px;
  border-radius: var(--r-md);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
  transition: color var(--fast), background-color var(--fast);
}

.docs-part[data-part="tutorials"] { --accent: var(--cyan); --accent-soft: var(--cyan-soft); }
.docs-part[data-part="faq"] { --accent: var(--amber); --accent-soft: var(--amber-soft); }

.part-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}

.part-label { min-width: 0; overflow-wrap: break-word; }

.docs-part:hover { color: var(--ink); background: var(--alt); }

.docs-part.active,
.docs-part[aria-current="page"] {
  color: var(--ink);
  background: var(--accent-soft);
}

.docs-part.active::before,
.docs-part[aria-current="page"]::before {
  content: "";
  position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 2px; border-radius: 1px;
  background: var(--accent);
}

.docs-part.active .part-glyph,
.docs-part[aria-current="page"] .part-glyph {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--surface);
}

/* Rail section list */
.docs-nav { display: flex; flex-direction: column; gap: 18px; }
.rail-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rail-list { list-style: none; display: flex; flex-direction: column; gap: 1px; }

.rail-group a {
  display: block;
  border-left: 2px solid transparent;
  padding: 6px 8px 6px 12px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
  text-decoration: none;
  overflow-wrap: break-word;
  transition: color var(--fast), background-color var(--fast), border-color var(--fast);
}

.rail-group a:hover { color: var(--ink); background: var(--alt); }

.rail-group a.active,
.rail-group a[aria-current="location"] {
  border-left-color: var(--teal);
  color: var(--teal-strong);
  background: var(--teal-soft);
  font-weight: 700;
}

/* FAQ category nav in rail (never questions) */
.rail-cats { display: flex; flex-direction: column; gap: 1px; }

.rail-cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 7px 8px 7px 12px;
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition: color var(--fast), background-color var(--fast), border-color var(--fast);
}

.rail-cat:hover { color: var(--ink); background: var(--alt); }

.rail-cat.active,
.rail-cat[aria-pressed="true"] {
  border-left-color: var(--amber);
  color: var(--ink);
  background: var(--amber-soft);
  font-weight: 700;
}

.fcat-label { min-width: 0; overflow-wrap: break-word; }

.fcat-count {
  flex: 0 0 auto;
  min-width: 22px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--line-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.rail-cat.active .fcat-count { background: rgba(169, 107, 8, 0.14); color: var(--amber); }

/* ---------------- Search ---------------- */

.docs-search-wrapper { position: relative; min-width: 0; }

.docs-search {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 6px 10px 6px 32px;
  color: var(--ink);
  background: var(--alt);
  font-family: var(--sans);
  font-size: 14px;
  transition: border-color var(--fast), background-color var(--fast), box-shadow var(--fast);
}

.docs-search::placeholder { color: var(--soft); }
.docs-search:hover { border-color: #c9d6ce; }
.docs-search:focus, .docs-search:focus-visible {
  outline: none;
  border-color: var(--teal-strong);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--teal-soft);
}

.docs-search-wrapper::before {
  content: "";
  position: absolute; left: 11px; top: 50%;
  width: 11px; height: 11px;
  margin-top: -7px;
  border: 1.5px solid var(--soft); border-radius: 50%;
  pointer-events: none;
}
.docs-search-wrapper::after {
  content: "";
  position: absolute; left: 20px; top: calc(50% + 3px);
  width: 6px; height: 1.5px;
  background: var(--soft);
  transform-origin: left center; transform: rotate(45deg);
  pointer-events: none;
}

.docs-search-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  z-index: 90;
  max-height: 340px; overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(16, 38, 29, 0.12);
}
.docs-search-results[hidden] { display: none; }

.docs-search-results-item {
  display: block; width: 100%;
  border: 0; border-bottom: 1px solid var(--line-2);
  padding: 9px 12px;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans); font-size: 13.5px; line-height: 1.45;
  text-align: left; cursor: pointer;
  transition: background-color var(--fast);
}
.docs-search-results-item:last-child { border-bottom: 0; }
.docs-search-results-item:hover,
.docs-search-results-item.focused,
.docs-search-results-item:focus-visible { background: var(--alt); outline: none; }

.docs-search-results-item .result-title { display: block; font-weight: 700; margin-bottom: 2px; }
.docs-search-results-item .result-path {
  display: block; color: var(--soft); font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.docs-search-results-empty, .docs-search-results-hint { padding: 12px; color: var(--soft); font-size: 13px; }

/* ---------------- Article header ---------------- */

.docs-header { margin-bottom: 28px; }

.docs-crumb {
  margin-bottom: 8px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.docs-title {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.25;
}

.docs-intro { color: var(--muted); font-size: 0.9375rem; line-height: 1.65; max-width: 62ch; }

/* ---------------- Content typography ---------------- */

.docs-section { scroll-margin-top: calc(var(--sticky-top) + 16px); padding: 4px 0 8px; }
.docs-section + .docs-section { margin-top: 36px; padding-top: 32px; border-top: 1px solid var(--line-2); }

.docs-section h2 {
  margin: 4px 0 12px;
  scroll-margin-top: calc(var(--sticky-top) + 16px);
  color: var(--ink); font-size: 1.3125rem; font-weight: 700; line-height: 1.35;
}
.docs-section h3, .faq-answer h3 {
  margin: 26px 0 8px;
  scroll-margin-top: calc(var(--sticky-top) + 16px);
  color: var(--ink); font-size: 1.0625rem; font-weight: 700; line-height: 1.4;
}
.docs-section h4, .docs-section h5, .docs-section h6,
.faq-answer h4, .faq-answer h5, .faq-answer h6 {
  margin: 20px 0 6px; color: var(--ink-2); font-size: 0.9375rem; font-weight: 700;
}

.docs-section p, .faq-answer p { margin-bottom: 14px; color: var(--ink-2); font-size: 0.9375rem; line-height: 1.75; }

.docs-section ul, .docs-section ol, .faq-answer ul, .faq-answer ol {
  margin: 8px 0 16px; padding-left: 22px;
  color: var(--ink-2); font-size: 0.9375rem; line-height: 1.75;
}
.docs-section li, .faq-answer li { margin-bottom: 6px; overflow-wrap: break-word; }
.docs-section li::marker, .faq-answer li::marker { color: var(--soft); }

.docs-section strong, .faq-answer strong { color: var(--ink); font-weight: 700; }

.docs-section a, .faq-answer a {
  color: var(--teal-strong);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  overflow-wrap: break-word;
}
.docs-section a:hover, .faq-answer a:hover { color: #0a7f63; }

.docs-section code, .faq-answer code {
  font-family: var(--mono); font-size: 0.855em;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--code-bg);
  color: var(--code-ink);
  word-break: break-word;
}

.docs-section blockquote, .faq-answer blockquote {
  margin: 16px 0; padding: 10px 14px;
  border-left: 2px solid var(--line);
  color: var(--muted);
}
.docs-section blockquote > :last-child, .faq-answer blockquote > :last-child { margin-bottom: 0; }

.docs-section hr, .faq-answer hr { margin: 24px 0; border: 0; border-top: 1px solid var(--line-2); }

.docs-section img, .faq-answer img { max-width: 100%; height: auto; }

/* Step list */
.step-list { counter-reset: step; list-style: none; padding-left: 0; margin: 12px 0 18px; display: flex; flex-direction: column; gap: 14px; }
.step-list li { position: relative; padding-left: 34px; counter-increment: step; }
.step-list li::before {
  content: counter(step);
  position: absolute; left: 0; top: 2px;
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--teal-strong);
  font-family: var(--mono); font-size: 12px; font-weight: 700;
}
.step-list li strong { display: block; margin-bottom: 2px; color: var(--ink); font-size: 0.9375rem; }
.step-list li p { margin: 0; color: var(--muted); font-size: 0.875rem; }

/* Callouts */
.callout {
  margin: 18px 0;
  border: 1px solid var(--line);
  border-left: 2px solid var(--teal);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 12px 14px;
  background: var(--alt);
  color: var(--ink-2);
  font-size: 0.875rem;
  line-height: 1.65;
}
.callout > :last-child { margin-bottom: 0; }
.callout.notice { border-left-color: var(--cyan); background: var(--cyan-soft); }
.callout.warning { border-left-color: var(--amber); background: var(--amber-soft); }

/* Code blocks */
.code-block {
  position: relative;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--code-bg);
  overflow: hidden;
}
.code-block pre {
  margin: 0; padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--mono); font-size: 0.8125rem; line-height: 1.65;
  color: var(--code-ink); white-space: pre;
}
.code-block code { font-family: var(--mono); font-size: inherit; padding: 0; border: 0; background: none; color: inherit; word-break: normal; }

.btn-copy {
  position: absolute; top: 8px; right: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 26px; padding: 3px 9px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--muted);
  font-family: var(--sans); font-size: 11.5px; font-weight: 700;
  cursor: pointer; opacity: 0;
  transition: opacity var(--fast), color var(--fast), border-color var(--fast), background-color var(--fast);
}
.code-block:hover .btn-copy, .btn-copy:focus-visible { opacity: 1; }
.btn-copy:hover { color: var(--ink); border-color: #c9d6ce; background: var(--alt); }
.btn-copy.copied { opacity: 1; color: var(--teal-strong); border-color: var(--teal); background: var(--teal-soft); }

/* Tables */
.table-responsive {
  margin: 18px 0; overflow-x: auto;
  border: 1px solid var(--line); border-radius: var(--r-md);
  -webkit-overflow-scrolling: touch;
}
.data-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 0.875rem; line-height: 1.55; }
.data-table thead th {
  padding: 9px 12px; text-align: left; white-space: nowrap;
  background: var(--alt); color: var(--ink); font-weight: 700;
  border-bottom: 1px solid var(--line);
}
.data-table tbody td { padding: 9px 12px; color: var(--ink-2); border-bottom: 1px solid var(--line-2); vertical-align: top; overflow-wrap: break-word; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table td:first-child { color: var(--ink); font-weight: 600; }

/* ---------------- FAQ ---------------- */

.faq-toolbar {
  position: sticky;
  top: var(--sticky-top);
  z-index: 40;
  margin: 0 0 18px;
  padding: 10px 0;
  background: var(--surface);
  border-bottom: 1px solid var(--line-2);
}

.faq-filters {
  display: flex; flex-wrap: wrap; gap: 6px;
  min-width: 0;
}

.faq-filter-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--muted);
  font-family: var(--sans); font-size: 12.5px; font-weight: 700;
  cursor: pointer;
  transition: color var(--fast), border-color var(--fast), background-color var(--fast);
}
.faq-filter-btn:hover { color: var(--ink); border-color: #c9d6ce; background: var(--alt); }
.faq-filter-btn.active, .faq-filter-btn[aria-pressed="true"] {
  border-color: var(--teal); color: var(--teal-strong); background: var(--teal-soft);
}
.faq-filter-btn .fcat-count { background: transparent; color: inherit; min-width: 0; padding: 0; font-size: 11.5px; opacity: 0.75; }

.faq-count { margin: -6px 0 14px; color: var(--soft); font-size: 12.5px; }

.faq-list { display: flex; flex-direction: column; }

.faq-item {
  border-bottom: 1px solid var(--line-2);
  scroll-margin-top: calc(var(--sticky-top) + 64px);
}
.faq-item:first-child { border-top: 1px solid var(--line-2); }
.faq-item[hidden] { display: none; }

.faq-item summary {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 14px 2px;
  color: var(--ink); font-size: 0.9375rem; font-weight: 600; line-height: 1.55;
  list-style: none; cursor: pointer;
  transition: color var(--fast);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: var(--teal-strong); }
.faq-item summary:focus-visible { outline: 2px solid var(--teal-strong); outline-offset: 2px; border-radius: 2px; }

.faq-item summary::after {
  content: ""; flex: 0 0 auto;
  width: 8px; height: 8px; margin-top: 7px;
  border-right: 1.5px solid var(--soft); border-bottom: 1.5px solid var(--soft);
  transform: rotate(45deg);
  transition: transform var(--fast);
}
.faq-item[open] summary::after { transform: rotate(-135deg); }
.faq-item[open] summary { color: var(--ink); }

.faq-answer { padding: 0 2px 18px; }
.faq-answer > :last-child { margin-bottom: 0; }

/* ---------------- Right outline ---------------- */

.docs-outline { min-width: 0; border-left: 1px solid var(--line); }
.docs-outline[hidden] { display: none; }

.docs-outline-inner {
  position: sticky;
  top: var(--header-h);
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 40px 20px 56px 20px;
}

.docs-toc-title {
  margin-bottom: 10px;
  color: var(--soft);
  font-size: 11px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase;
}

.docs-toc-nav { display: flex; flex-direction: column; }
.docs-toc-nav a {
  display: block;
  border-left: 2px solid var(--line-2);
  padding: 5px 0 5px 12px;
  color: var(--muted); font-size: 12.5px; line-height: 1.5;
  text-decoration: none; overflow-wrap: break-word;
  transition: color var(--fast), border-color var(--fast);
}
.docs-toc-nav a.lvl-3 { padding-left: 24px; }
.docs-toc-nav a:hover { color: var(--ink); border-left-color: #c9d6ce; }
.docs-toc-nav a.active, .docs-toc-nav a[aria-current="location"] {
  border-left-color: var(--teal); color: var(--teal-strong); font-weight: 700;
}

/* ---------------- Pager ---------------- */

.docs-pager { display: flex; gap: 12px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); }
.docs-pager[hidden], .docs-pager-link[hidden] { display: none; }

.docs-pager-link {
  flex: 1 1 0; min-width: 0; max-width: 50%;
  display: flex; flex-direction: column; gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  text-decoration: none;
  transition: border-color var(--fast), background-color var(--fast);
}
.docs-pager-link:hover { border-color: var(--teal); background: var(--teal-soft); }
.docs-pager-link.next { margin-left: auto; text-align: right; align-items: flex-end; }
.docs-pager-dir { color: var(--soft); font-size: 11px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.docs-pager-title { color: var(--ink); font-size: 0.875rem; font-weight: 600; line-height: 1.45; overflow-wrap: break-word; }

/* ---------------- States ---------------- */

.docs-state { padding: 8px 0; }
.docs-state-error, .docs-state-empty {
  padding: 40px 20px; text-align: center;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--alt);
}
.docs-state-error p, .docs-state-empty p { margin-bottom: 14px; color: var(--muted); font-size: 0.9375rem; }

.btn, .docs-state .btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 36px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink);
  font-family: var(--sans); font-size: 13.5px; font-weight: 700;
  text-decoration: none; cursor: pointer;
  transition: border-color var(--fast), background-color var(--fast);
}
.btn:hover { border-color: var(--teal); background: var(--teal-soft); }

.docs-skeleton { display: flex; flex-direction: column; gap: 14px; padding: 6px 0; }
.skel-line { height: 12px; border-radius: var(--r-sm); background: var(--line-2); animation: skel 1.6s ease-in-out infinite; }
.skel-line.skel-head { height: 22px; }
.w-40 { width: 40%; } .w-50 { width: 50%; } .w-60 { width: 60%; }
.w-80 { width: 80%; } .w-90 { width: 90%; }
@keyframes skel { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

/* ---------------- Mobile bar + drawer ---------------- */

.docs-mobilebar {
  display: none;
  position: sticky;
  top: var(--header-h);
  z-index: 55;
  align-items: center;
  gap: 8px;
  min-height: var(--bar-h);
  padding: 7px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.mb-browse {
  display: flex; align-items: center; gap: 10px;
  flex: 1 1 auto; min-width: 0;
  padding: 5px 10px 5px 8px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface);
  font-family: var(--sans); text-align: left; cursor: pointer;
}
.mb-glyph { position: relative; flex: 0 0 auto; width: 14px; height: 10px; }
.mb-glyph::before, .mb-glyph::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: var(--muted);
}
.mb-glyph::before { top: 0; box-shadow: 0 4px 0 var(--muted); }
.mb-glyph::after { bottom: 0; }
.mb-text { display: flex; flex-direction: column; min-width: 0; }
.mb-kicker { color: var(--soft); font-size: 10px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; line-height: 1.3; }
.mb-label { color: var(--ink); font-size: 13.5px; font-weight: 700; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-caret {
  flex: 0 0 auto; margin-left: auto; width: 7px; height: 7px;
  border-right: 1.5px solid var(--soft); border-bottom: 1.5px solid var(--soft);
  transform: rotate(45deg);
}

.mb-search {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); cursor: pointer;
}
.mb-search-glyph { position: relative; width: 13px; height: 13px; border: 1.5px solid var(--muted); border-radius: 50%; }
.mb-search-glyph::after {
  content: ""; position: absolute; right: -5px; bottom: -1px;
  width: 7px; height: 1.5px; background: var(--muted);
  transform: rotate(45deg); transform-origin: left center;
}

.docs-scrim {
  position: fixed; inset: 0; z-index: 95;
  background: rgba(16, 38, 29, 0.42);
  opacity: 0;
  transition: opacity 180ms ease;
}
.docs-scrim[hidden] { display: none; }
html.docs-nav-open .docs-scrim { opacity: 1; }
html.docs-nav-open, html.docs-nav-open body { overflow: hidden; }

/* ---------------- Responsive ---------------- */

@media (max-width: 1280px) {
  .docs-shell { grid-template-columns: 264px minmax(0, 1fr) 216px; }
  .docs-body { padding: 36px 40px 88px; }
}

@media (max-width: 1120px) {
  .docs-shell { grid-template-columns: 252px minmax(0, 1fr); }
  .docs-outline { display: none; }
  .docs-body { padding: 32px 36px 80px; }
}

@media (max-width: 1024px) {
  :root { --bar-h: 52px; }

  .docs-shell { display: block; }
  .docs-mobilebar { display: flex; }
  .docs-body { padding: 24px 20px 72px; }
  .docs-article { max-width: none; }
  .docs-title { font-size: 1.5rem; }

  .docs-rail {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 100;
    width: min(320px, 86vw);
    border-right: 1px solid var(--line);
    background: var(--surface);
    transform: translateX(-101%);
    visibility: hidden;
    transition: transform 200ms ease, visibility 200ms ease;
  }
  html.docs-nav-open .docs-rail { transform: translateX(0); visibility: visible; }

  .docs-rail-inner {
    position: static;
    top: auto;
    max-height: none;
    height: 100%;
    padding: 16px 16px 40px;
  }

  .rail-close { display: inline-flex; }
  .rail-head-title { font-size: 12px; }
  .faq-toolbar { top: var(--sticky-top); }
}

@media (max-width: 900px) {
  :root { --header-h: 68px; }
}

@media (max-width: 640px) {
  .docs-body { padding: 20px 16px 64px; }
  .docs-title { font-size: 1.375rem; }
  .docs-section h2 { font-size: 1.1875rem; }
  .docs-crumb { font-size: 11.5px; }
  .code-block pre { padding: 12px 13px; font-size: 0.78125rem; }
  .faq-item summary { padding: 12px 0; font-size: 0.9125rem; }
  .btn-copy { opacity: 1; }
  .docs-pager { flex-direction: column; }
  .docs-pager-link, .docs-pager-link.next { max-width: none; text-align: left; align-items: flex-start; margin-left: 0; }
}

@media (max-width: 400px) {
  .mb-kicker { display: none; }
  .docs-rail { width: 88vw; }
}

/* ---------------- Reduced motion ---------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .skel-line { animation: none; opacity: 0.7; }
  .docs-rail { transition: none; }
  .btn-copy { opacity: 1; }
}
