/* SvaraCall documentation — styles.
   Tokens mirror the product's brand (green on near-white); dark mode follows the
   system unless the reader picks a theme. */

:root {
  --brand: #3f7a1c;
  --brand-hover: #356817;
  --brand-deep: #2d5814;
  --brand-soft: #f1f7ea;
  --brand-border: #c5d9b3;
  --lime: #9fe76f;
  --lime-hover: #88e14c;
  --on-lime: #121212;

  --bg: #fafafa;
  --bg-side: #f5f6f4;
  --card: #ffffff;
  --hover: #f1f3ef;
  --border: #e6e8e4;
  --border-strong: #d5d9d2;

  --heading: #18181b;
  --text: #27272a;
  --text-2: #52525b;
  --muted: #71717a;

  --code-bg: #0f1410;
  --code-head: #161d17;
  --code-text: #e6efe3;
  --code-muted: #8b9a88;
  --inline-code-bg: #eef2ea;
  --inline-code-text: #2d5814;

  --info-bg: #eff6ff;
  --info-border: #bfdbfe;
  --info-text: #1d4ed8;
  --warn-bg: #fef6dc;
  --warn-border: #f3d98b;
  --warn-text: #92580a;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --danger-text: #b91c1c;
  --ok-bg: #eef8e6;
  --ok-border: #cbe5b6;
  --ok-text: #3f7a1c;

  --hero-from: #1d3a12;
  --hero-to: #3f7a1c;

  --shadow-sm: 0 1px 2px rgba(16, 24, 12, 0.05);
  --shadow-md: 0 6px 20px -8px rgba(16, 24, 12, 0.18);
  --radius: 14px;
  --radius-sm: 9px;

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Manrope", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --topbar-h: 62px;
  --side-w: 276px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --brand: #8fd45f;
  --brand-hover: #a5e277;
  --brand-deep: #b6ec8c;
  --brand-soft: #172016;
  --brand-border: #2c4224;

  --bg: #0c0e0c;
  --bg-side: #0f120f;
  --card: #141814;
  --hover: #1b201b;
  --border: #232923;
  --border-strong: #323a32;

  --heading: #f4f6f3;
  --text: #dfe4de;
  --text-2: #a6afa5;
  --muted: #858f84;

  --inline-code-bg: #1b231a;
  --inline-code-text: #b6ec8c;

  --info-bg: #11192a;
  --info-border: #1f3358;
  --info-text: #8db4ff;
  --warn-bg: #261f0d;
  --warn-border: #4a3b14;
  --warn-text: #f0c35a;
  --danger-bg: #2a1212;
  --danger-border: #5a2222;
  --danger-text: #ff9b9b;
  --ok-bg: #152114;
  --ok-border: #2a4224;
  --ok-text: #9fe76f;

  --hero-from: #0f1c0b;
  --hero-to: #2a5413;
  --shadow-sm: none;
  --shadow-md: 0 8px 24px -10px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #8fd45f;
    --brand-hover: #a5e277;
    --brand-deep: #b6ec8c;
    --brand-soft: #172016;
    --brand-border: #2c4224;
    --bg: #0c0e0c;
    --bg-side: #0f120f;
    --card: #141814;
    --hover: #1b201b;
    --border: #232923;
    --border-strong: #323a32;
    --heading: #f4f6f3;
    --text: #dfe4de;
    --text-2: #a6afa5;
    --muted: #858f84;
    --inline-code-bg: #1b231a;
    --inline-code-text: #b6ec8c;
    --info-bg: #11192a;
    --info-border: #1f3358;
    --info-text: #8db4ff;
    --warn-bg: #261f0d;
    --warn-border: #4a3b14;
    --warn-text: #f0c35a;
    --danger-bg: #2a1212;
    --danger-border: #5a2222;
    --danger-text: #ff9b9b;
    --ok-bg: #152114;
    --ok-border: #2a4224;
    --ok-text: #9fe76f;
    --hero-from: #0f1c0b;
    --hero-to: #2a5413;
    --shadow-sm: none;
    --shadow-md: 0 8px 24px -10px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

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

.icon {
  width: 1em;
  height: 1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ───────── Top bar ───────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--heading);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.brand:hover {
  text-decoration: none;
}
.brand img {
  height: 30px;
  width: auto;
  display: block;
}
:root[data-theme="dark"] .brand img {
  filter: brightness(1.8) saturate(0.9);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand img {
    filter: brightness(1.8) saturate(0.9);
  }
}

.brand-tag {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  padding: 2px 9px;
  border-radius: 999px;
}

.modes {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}
.mode {
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
}
.mode:hover {
  background: var(--hover);
  text-decoration: none;
  color: var(--heading);
}
.mode.active {
  background: var(--brand-soft);
  color: var(--brand);
}

.topbar-spacer {
  flex: 1;
}

.search {
  position: relative;
  width: min(380px, 38vw);
}
.search input {
  width: 100%;
  height: 40px;
  padding: 0 44px 0 38px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--card);
  color: var(--heading);
  font: inherit;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
}
.search input::placeholder {
  color: var(--muted);
}
.search input:focus {
  outline: 2px solid var(--brand);
  outline-offset: 0;
  border-color: transparent;
}
.search .icon {
  position: absolute;
  left: 13px;
  top: 12px;
  font-size: 16px;
  color: var(--muted);
  pointer-events: none;
}
.kbd {
  position: absolute;
  right: 10px;
  top: 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 1px 7px;
  background: var(--bg);
  pointer-events: none;
}

.results {
  position: absolute;
  top: 48px;
  left: 0;
  right: 0;
  max-height: min(70vh, 520px);
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  padding: 6px;
  display: none;
}
.results.open {
  display: block;
}
.result {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
}
.result:hover,
.result.sel {
  background: var(--hover);
  text-decoration: none;
}
.result .r-title {
  font-weight: 600;
  color: var(--heading);
  font-size: 14px;
}
.result .r-sec {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand);
  font-weight: 600;
  margin-bottom: 1px;
}
.result .r-snip {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.5;
  margin-top: 2px;
}
.result mark {
  background: color-mix(in srgb, var(--lime) 55%, transparent);
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}
.results .empty {
  padding: 18px 14px;
  color: var(--muted);
  font-size: 14px;
}

.btn {
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--heading);
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.btn:hover {
  background: var(--hover);
  text-decoration: none;
}
.btn-cta {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--on-lime);
}
.btn-cta:hover {
  background: var(--lime-hover);
}
.icon-btn {
  width: 38px;
  padding: 0;
  justify-content: center;
  font-size: 17px;
}
.menu-btn {
  display: none;
}

/* ───────── Shell ───────── */

.shell {
  display: flex;
  align-items: flex-start;
  min-height: calc(100vh - var(--topbar-h));
}

.sidebar {
  position: sticky;
  top: var(--topbar-h);
  width: var(--side-w);
  flex: none;
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 20px 14px 28px;
  background: var(--bg-side);
  border-right: 1px solid var(--border);
}
.sidebar::-webkit-scrollbar {
  width: 8px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 8px;
}

.start-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 10px 8px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.start-card .label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
}
.start-card a {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 9px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}
.start-card a:hover {
  background: var(--hover);
  text-decoration: none;
}
.start-card a.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}
.start-card .num {
  flex: none;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid var(--brand-border);
  font-size: 11.5px;
  font-weight: 700;
  margin-top: 0;
}

.nav-group {
  margin-bottom: 18px;
}
.nav-title {
  padding: 0 10px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.35;
}
.nav-link .icon {
  font-size: 15px;
  color: var(--muted);
}
.nav-link:hover {
  background: var(--hover);
  color: var(--heading);
  text-decoration: none;
}
.nav-link.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}
.nav-link.active .icon {
  color: var(--brand);
}
.nav-link.ext .ext-icon {
  margin-left: auto;
  font-size: 12px;
  opacity: 0.6;
}

.nav-group-legal {
  margin-top: 18px;
}

.fallback {
  padding: 32px;
  font-family: system-ui, sans-serif;
}

.side-foot {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ───────── Article ───────── */

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: center;
  gap: 56px;
  padding: 44px 36px 40px;
}
.article {
  width: 100%;
  max-width: 740px;
  min-width: 0;
}

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 10px;
}
.article h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 38px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--heading);
  margin: 0 0 14px;
}
.lede {
  font-size: 18px;
  line-height: 1.55;
  color: var(--text-2);
  margin: 0 0 14px;
}
.updated {
  font-size: 13px;
  color: var(--muted);
  padding-bottom: 22px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--border);
}

.body > :first-child {
  margin-top: 0;
}
.body h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 23px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--heading);
  margin: 44px 0 14px;
}
.body h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--heading);
  margin: 30px 0 10px;
}
.body h4 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
  margin: 24px 0 8px;
}
.body p {
  margin: 0 0 16px;
}
.body ul,
.body ol {
  margin: 0 0 18px;
  padding-left: 22px;
}
.body li {
  margin: 6px 0;
}
.body li::marker {
  color: var(--brand);
}
.body li > ul,
.body li > ol {
  margin: 6px 0 0;
}
.body .steps,
.body .pills {
  padding-left: 0;
}
.body .steps > li,
.body .pills > li {
  margin: 0;
}
.body hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}
.body strong {
  color: var(--heading);
  font-weight: 650;
}

.body code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--inline-code-bg);
  color: var(--inline-code-text);
  padding: 2px 6px;
  border-radius: 6px;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin: 0 0 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}
.body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.body th {
  text-align: left;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  padding: 11px 16px;
  background: var(--bg-side);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.body td {
  padding: 11px 16px;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  line-height: 1.55;
}
.body tr:last-child td {
  border-bottom: 0;
}
.body td:first-child {
  color: var(--heading);
}

/* Code */
.code {
  margin: 0 0 22px;
  background: var(--code-bg);
  border: 1px solid #1f2a1f;
  border-radius: var(--radius);
  overflow: hidden;
}
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 8px 16px;
  background: var(--code-head);
  border-bottom: 1px solid #1f2a1f;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--code-muted);
  text-transform: lowercase;
}
.copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid #2a372a;
  color: var(--code-muted);
  border-radius: 7px;
  padding: 3px 9px;
  font-size: 12px;
  font-family: var(--font-body);
}
.copy:hover {
  color: #fff;
  border-color: #3a4c3a;
}
.copy.done {
  color: var(--lime);
  border-color: var(--lime);
}
.code pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  color: var(--code-text);
}
.code pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
  border-radius: 0;
}
.tok-k {
  color: #9fe76f;
}
.tok-s {
  color: #f0c987;
}
.tok-n {
  color: #8fc7ff;
}
.tok-c {
  color: #6c7d69;
}
.tok-p {
  color: #c9a6ff;
}

/* Tabs */
.tabs {
  margin: 0 0 22px;
}
.tab-list {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}
.tab {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 5px 13px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.tab:hover {
  background: var(--hover);
}
.tab[aria-selected="true"] {
  background: var(--brand-soft);
  border-color: var(--brand-border);
  color: var(--brand);
}
.tab-panel[hidden] {
  display: none;
}
.tab-panel .code {
  margin-bottom: 0;
}

/* Callouts */
.callout {
  display: flex;
  gap: 12px;
  margin: 0 0 22px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--info-border);
  background: var(--info-bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.6;
}
.callout > .icon {
  margin-top: 3px;
  font-size: 17px;
  color: var(--info-text);
}
.callout .c-title {
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 2px;
}
.callout .c-body > :last-child {
  margin-bottom: 0;
}
.callout .c-body p {
  margin: 0 0 8px;
}
.callout-tip {
  background: var(--ok-bg);
  border-color: var(--ok-border);
}
.callout-tip > .icon {
  color: var(--ok-text);
}
.callout-warning {
  background: var(--warn-bg);
  border-color: var(--warn-border);
}
.callout-warning > .icon {
  color: var(--warn-text);
}
.callout-danger {
  background: var(--danger-bg);
  border-color: var(--danger-border);
}
.callout-danger > .icon {
  color: var(--danger-text);
}

.example {
  margin: 0 0 22px;
  padding: 16px 18px 14px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--lime);
  box-shadow: var(--shadow-sm);
}
.example .e-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--brand);
  margin-bottom: 6px;
}
.example .e-body > :last-child {
  margin-bottom: 0;
}

/* Steps */
.steps {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
.step {
  min-width: 0;
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.step .n {
  flex: none;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
:root[data-theme="dark"] .step .n {
  color: #0c0e0c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .step .n {
    color: #0c0e0c;
  }
}
.step .s-title {
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 2px;
  line-height: 1.4;
  padding-top: 2px;
}
.step .s-body {
  min-width: 0;
  flex: 1;
  font-size: 14.5px;
}
.step .s-body > :last-child {
  margin-bottom: 0;
}
.step .s-body p {
  margin: 0 0 10px;
}
.step .s-body .code {
  margin-top: 10px;
}

/* Cards */
.cards {
  display: grid;
  gap: 14px;
  margin: 0 0 24px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.cards.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}
.cards.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}
.card {
  display: block;
  padding: 18px 18px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
a.card:hover {
  text-decoration: none;
  border-color: var(--brand-border);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.card .c-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid var(--brand-border);
  font-size: 18px;
  margin-bottom: 12px;
}
.card .c-title {
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 4px;
  font-size: 15.5px;
}
.card .c-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-2);
}

/* Stats / facts */
.facts {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin: 0 0 24px;
}
.fact {
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.fact .f-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.fact .f-value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--heading);
  margin: 4px 0 2px;
}
.fact .f-note {
  font-size: 13px;
  color: var(--text-2);
}

/* Definition rows */
.defs {
  margin: 0 0 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.def {
  display: grid;
  grid-template-columns: minmax(130px, 200px) 1fr;
  gap: 18px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
}
.def:last-child {
  border-bottom: 0;
}
.def .d-term {
  font-weight: 700;
  color: var(--heading);
  font-size: 14.5px;
}
.def .d-text {
  color: var(--text-2);
  font-size: 14.5px;
}
.def .d-text p {
  margin: 0;
}

/* Pills / flow */
.pills {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 22px;
  padding: 0;
}
.pill {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  color: var(--brand);
  font-size: 13.5px;
  font-weight: 600;
}
.pill-sep {
  color: var(--muted);
  font-size: 14px;
}

/* Endpoint */
.endpoint {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 30px 0 12px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.method {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 7px;
  color: #fff;
  background: #3f7a1c;
}
.method.post {
  background: #2563eb;
}
.method.put,
.method.patch {
  background: #b45309;
}
.method.delete {
  background: #dc2626;
}
.endpoint code.path {
  background: none;
  padding: 0;
  font-size: 14.5px;
  color: var(--heading);
  font-weight: 500;
}
.endpoint .scope {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}
.endpoint .scope code {
  font-size: 11.5px;
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  margin: 0 0 32px;
  padding: 34px 32px 28px;
  border-radius: 22px;
  color: #fff;
  background:
    radial-gradient(900px 300px at 85% -10%, rgba(159, 231, 111, 0.28), transparent 60%),
    linear-gradient(135deg, var(--hero-from), var(--hero-to));
  box-shadow: var(--shadow-md);
}
.hero .h-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lime);
  margin-bottom: 14px;
}
.hero h1 {
  color: #fff;
  font-size: 36px;
  margin: 0 0 12px;
}
.hero .lede {
  color: rgba(255, 255, 255, 0.82);
  font-size: 17px;
  max-width: 560px;
  margin-bottom: 26px;
}
.hero .stats {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.hero .stat {
  padding: 14px 14px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(4px);
}
.hero .stat b {
  display: block;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
}
.hero .stat span {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.35;
  display: block;
  margin-top: 2px;
}

/* Prev / next */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 52px 0 0;
}
.pager a {
  display: block;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  color: var(--heading);
  font-weight: 600;
}
.pager a:hover {
  border-color: var(--brand-border);
  text-decoration: none;
  box-shadow: var(--shadow-md);
}
.pager small {
  display: block;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}
.pager .next {
  text-align: right;
  grid-column: 2;
}
.pager .prev:only-child {
  grid-column: 1;
}

.help-foot {
  margin-top: 40px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-2);
}
.help-foot b {
  color: var(--heading);
}

.site-foot {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 13px;
  color: var(--muted);
}
.site-foot a {
  color: var(--text-2);
}

/* TOC */
.toc {
  position: sticky;
  top: calc(var(--topbar-h) + 32px);
  align-self: flex-start;
  width: 210px;
  flex: none;
  max-height: calc(100vh - var(--topbar-h) - 64px);
  overflow: auto;
}
.toc .t-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.toc a {
  display: block;
  padding: 4px 0 4px 14px;
  margin-left: -1px;
  border-left: 2px solid var(--border);
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--text-2);
}
.toc a:hover {
  color: var(--heading);
  text-decoration: none;
}
.toc a.active {
  color: var(--brand);
  border-left-color: var(--brand);
  font-weight: 600;
}

.not-found {
  padding: 40px 0;
}

/* ───────── Responsive ───────── */

@media (max-width: 1260px) {
  .toc {
    display: none;
  }
}

@media (max-width: 1023px) {
  .menu-btn {
    display: inline-flex;
  }
  .sidebar {
    position: fixed;
    z-index: 60;
    top: var(--topbar-h);
    left: 0;
    height: calc(100vh - var(--topbar-h));
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow-md);
  }
  body.nav-open .sidebar {
    transform: none;
  }
  body.nav-open::after {
    content: "";
    position: fixed;
    inset: var(--topbar-h) 0 0 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 50;
  }
  .main {
    padding: 32px 20px 32px;
  }
  .modes {
    display: none;
  }
  .btn-label {
    display: none;
  }
  .search {
    width: auto;
    flex: 1;
    max-width: none;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }
  .article h1,
  .hero h1 {
    font-size: 29px;
  }
  .lede {
    font-size: 16.5px;
  }
  .hero {
    padding: 26px 20px 20px;
    border-radius: 18px;
  }
  .hero .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .cards.cols-2,
  .cards.cols-3 {
    grid-template-columns: 1fr;
  }
  .def {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .pager {
    grid-template-columns: 1fr;
  }
  .pager .next {
    grid-column: 1;
  }
  .brand-tag,
  .kbd {
    display: none;
  }
  .topbar {
    padding: 0 12px;
    gap: 8px;
  }
  .endpoint .scope {
    margin-left: 0;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
  }
}

@media print {
  .topbar,
  .sidebar,
  .toc,
  .pager,
  .help-foot,
  .site-foot {
    display: none !important;
  }
  .main {
    padding: 0;
  }
  body {
    background: #fff;
  }
}
