/* ===================================================================
   Intelligence API — Shared Documentation Styles
   Single source of truth for all docs pages.
   =================================================================== */

/* ----- Custom Properties (Light) ----- */
:root {
  --bg: #eef1ff;
  --ink: #10202b;
  --ink-soft: #486071;
  --accent: #5b6cff;
  --accent-strong: #4454dc;
  --accent-soft: rgba(91, 108, 255, 0.14);
  --warm: #8c7cff;
  --warm-soft: rgba(140, 124, 255, 0.14);
  --sidebar-width: 286px;
  --topbar-height: 72px;
  --border: rgba(16, 32, 43, 0.1);
  --panel: rgba(255, 255, 255, 0.84);
  --panel-muted: rgba(16, 32, 43, 0.04);
  --code-block-bg: #12202d;
  --code-block-text: #e2ece7;
  --tag-bg: rgba(91, 108, 255, 0.14);
  --tag-text: #5b6cff;
  --pro-bg: rgba(140, 124, 255, 0.16);
  --pro-text: #5f52d5;
  --green: #5b6cff;
  --red: #c2410c;
  --shadow: 0 24px 64px rgba(16, 32, 43, 0.12);
  --font-sans: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
  --page-glow-a: rgba(91, 108, 255, 0.18);
  --page-glow-b: rgba(140, 124, 255, 0.16);
  --page-grad-start: #f7f8ff;
  --page-grad-mid: #eef0ff;
  --page-grad-end: #e8ebff;
  --grid-line: rgba(16, 32, 43, 0.03);
  --grid-mask: rgba(0, 0, 0, 0.12);
  --topbar-border: rgba(16, 32, 43, 0.08);
  --topbar-bg: rgba(247, 250, 248, 0.84);
  --nav-bg: rgba(255, 255, 255, 0.72);
  --nav-shadow: 0 14px 28px rgba(16, 32, 43, 0.08);
  --nav-hover-bg: rgba(91, 108, 255, 0.12);
  --sidebar-toggle-bg: rgba(255, 255, 255, 0.88);
  --sidebar-toggle-border: rgba(16, 32, 43, 0.08);
  --sidebar-toggle-shadow: 0 18px 36px rgba(16, 32, 43, 0.14);
  --sidebar-backdrop: rgba(16, 32, 43, 0.36);
  --sidebar-bg: rgba(16, 32, 43, 0.92);
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --sidebar-heading: #f6fbf9;
  --sidebar-copy: rgba(226, 236, 231, 0.7);
  --sidebar-section-ink: rgba(226, 236, 231, 0.44);
  --sidebar-link: rgba(226, 236, 231, 0.74);
  --sidebar-link-active: #f7fbf9;
  --sidebar-link-bg: rgba(91, 108, 255, 0.18);
  --control-bg: rgba(255, 255, 255, 0.88);
  --control-soft-bg: rgba(255, 255, 255, 0.72);
  --control-shadow: 0 16px 28px rgba(16, 32, 43, 0.08);
  --hero-glow: rgba(91, 108, 255, 0.22);
  --hero-spot: rgba(140, 124, 255, 0.18);
  --hero-bg-start: rgba(91, 108, 255, 0.1);
  --hero-bg-end: rgba(255, 255, 255, 0.88);
  --hero-panel-bg-start: rgba(91, 108, 255, 0.1);
  --hero-panel-bg-end: rgba(255, 255, 255, 0.92);
  --hero-panel-border: rgba(16, 32, 43, 0.08);
  --metric-bg: rgba(255, 255, 255, 0.82);
  --card-hover-border: rgba(91, 108, 255, 0.24);
  --card-hover-shadow: 0 28px 56px rgba(16, 32, 43, 0.14);
  --section-accent-line: rgba(140, 124, 255, 0.45);
  --accent-line: rgba(91, 108, 255, 0.45);
  --code-inline-border: rgba(91, 108, 255, 0.16);
  --code-block-border: rgba(91, 108, 255, 0.12);
  --code-block-start: #152532;
  --code-block-end: #0f1b26;
  --code-block-inset: rgba(255, 255, 255, 0.04);
  --tag-required-bg: rgba(194, 65, 12, 0.12);
  --tag-required-text: #9a3412;
  --tag-optional-bg: rgba(91, 108, 255, 0.12);
  --tag-optional-text: #5b6cff;
  --endpoint-border: rgba(91, 108, 255, 0.14);
  --endpoint-bg: rgba(255, 255, 255, 0.82);
  --endpoint-shadow: 0 16px 28px rgba(16, 32, 43, 0.08);
  --table-head-bg: rgba(91, 108, 255, 0.08);
  --table-cell-bg: rgba(255, 255, 255, 0.88);
  --note-border: rgba(91, 108, 255, 0.16);
  --note-bg-start: rgba(91, 108, 255, 0.1);
  --note-bg-end: rgba(255, 255, 255, 0.84);
  --note-warn-border: rgba(140, 124, 255, 0.2);
  --note-warn-start: rgba(140, 124, 255, 0.1);
  --note-warn-end: rgba(255, 255, 255, 0.84);
  --lang-tab-border: rgba(16, 32, 43, 0.08);
  --lang-tab-bg: rgba(255, 255, 255, 0.74);
  --lang-tab-hover-border: rgba(91, 108, 255, 0.18);
  --lang-tab-hover-bg: rgba(91, 108, 255, 0.12);
  --divider: rgba(16, 32, 43, 0.08);
  --on-accent: #f5fbf9;
  --theme-toggle-bg: rgba(255, 255, 255, 0.72);
  --theme-toggle-border: rgba(16, 32, 43, 0.08);
  --theme-toggle-shadow: 0 14px 28px rgba(16, 32, 43, 0.08);
  --theme-toggle-label: var(--ink);
  --theme-icon-dark: #0b1220;
  --theme-icon-light: #f8fbff;
  --theme-icon-ring: rgba(125, 140, 168, 0.46);
  --theme-icon-divider: rgba(125, 140, 168, 0.58);
}

/* ----- Custom Properties (Dark) ----- */
html[data-theme="dark"] {
  --bg: #09121b;
  --ink: #f3f7ff;
  --ink-soft: #a9bbcf;
  --accent: #8d9cff;
  --accent-strong: #bcc7ff;
  --accent-soft: rgba(141, 156, 255, 0.18);
  --warm: #b094ff;
  --warm-soft: rgba(176, 148, 255, 0.18);
  --border: rgba(169, 187, 207, 0.16);
  --panel: rgba(10, 18, 28, 0.84);
  --panel-muted: rgba(169, 187, 207, 0.08);
  --code-block-bg: #08111a;
  --code-block-text: #e6eef8;
  --tag-bg: rgba(141, 156, 255, 0.2);
  --tag-text: #d4dcff;
  --pro-bg: rgba(176, 148, 255, 0.22);
  --pro-text: #e0d2ff;
  --green: #8d9cff;
  --red: #ff9f6b;
  --shadow: 0 28px 72px rgba(0, 0, 0, 0.4);
  --page-glow-a: rgba(91, 108, 255, 0.26);
  --page-glow-b: rgba(140, 124, 255, 0.2);
  --page-grad-start: #0b1220;
  --page-grad-mid: #0a1320;
  --page-grad-end: #081018;
  --grid-line: rgba(169, 187, 207, 0.06);
  --grid-mask: rgba(0, 0, 0, 0.4);
  --topbar-border: rgba(169, 187, 207, 0.12);
  --topbar-bg: rgba(8, 14, 22, 0.84);
  --nav-bg: rgba(15, 24, 37, 0.82);
  --nav-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
  --nav-hover-bg: rgba(141, 156, 255, 0.16);
  --sidebar-toggle-bg: rgba(15, 24, 37, 0.9);
  --sidebar-toggle-border: rgba(169, 187, 207, 0.12);
  --sidebar-toggle-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
  --sidebar-backdrop: rgba(0, 0, 0, 0.56);
  --sidebar-bg: rgba(6, 11, 18, 0.96);
  --sidebar-border: rgba(169, 187, 207, 0.1);
  --sidebar-heading: #f3f7ff;
  --sidebar-copy: rgba(169, 187, 207, 0.76);
  --sidebar-section-ink: rgba(169, 187, 207, 0.52);
  --sidebar-link: rgba(196, 209, 223, 0.78);
  --sidebar-link-active: #f3f7ff;
  --sidebar-link-bg: rgba(141, 156, 255, 0.18);
  --control-bg: rgba(15, 24, 37, 0.88);
  --control-soft-bg: rgba(15, 24, 37, 0.78);
  --control-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
  --hero-glow: rgba(141, 156, 255, 0.24);
  --hero-spot: rgba(176, 148, 255, 0.18);
  --hero-bg-start: rgba(91, 108, 255, 0.18);
  --hero-bg-end: rgba(12, 22, 35, 0.96);
  --hero-panel-bg-start: rgba(91, 108, 255, 0.18);
  --hero-panel-bg-end: rgba(12, 22, 35, 0.96);
  --hero-panel-border: rgba(169, 187, 207, 0.1);
  --metric-bg: rgba(18, 29, 44, 0.86);
  --card-hover-border: rgba(141, 156, 255, 0.34);
  --card-hover-shadow: 0 30px 64px rgba(0, 0, 0, 0.34);
  --section-accent-line: rgba(176, 148, 255, 0.5);
  --accent-line: rgba(141, 156, 255, 0.55);
  --code-inline-border: rgba(141, 156, 255, 0.24);
  --code-block-border: rgba(141, 156, 255, 0.16);
  --code-block-start: #0b1723;
  --code-block-end: #08111a;
  --code-block-inset: rgba(255, 255, 255, 0.03);
  --tag-required-bg: rgba(255, 159, 107, 0.16);
  --tag-required-text: #ffd2b8;
  --tag-optional-bg: rgba(141, 156, 255, 0.16);
  --tag-optional-text: #d4dcff;
  --endpoint-border: rgba(141, 156, 255, 0.2);
  --endpoint-bg: rgba(14, 24, 37, 0.88);
  --endpoint-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
  --table-head-bg: rgba(141, 156, 255, 0.12);
  --table-cell-bg: rgba(13, 23, 35, 0.88);
  --note-border: rgba(141, 156, 255, 0.22);
  --note-bg-start: rgba(141, 156, 255, 0.12);
  --note-bg-end: rgba(14, 25, 38, 0.92);
  --note-warn-border: rgba(176, 148, 255, 0.24);
  --note-warn-start: rgba(176, 148, 255, 0.12);
  --note-warn-end: rgba(14, 25, 38, 0.92);
  --lang-tab-border: rgba(169, 187, 207, 0.12);
  --lang-tab-bg: rgba(15, 24, 37, 0.78);
  --lang-tab-hover-border: rgba(141, 156, 255, 0.2);
  --lang-tab-hover-bg: rgba(141, 156, 255, 0.16);
  --divider: rgba(169, 187, 207, 0.14);
  --on-accent: #f4f7ff;
  --theme-toggle-bg: rgba(15, 24, 37, 0.82);
  --theme-toggle-border: rgba(169, 187, 207, 0.12);
  --theme-toggle-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
  --theme-toggle-label: #f3f7ff;
  --theme-icon-ring: rgba(196, 209, 223, 0.54);
  --theme-icon-divider: rgba(196, 209, 223, 0.62);
}

/* ----- Reset & Base ----- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 112px;
  color-scheme: light;
}

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.72;
  color: var(--ink-soft);
  background:
    radial-gradient(circle at 0 0, var(--page-glow-a), transparent 28rem),
    radial-gradient(circle at 100% 0, var(--page-glow-b), transparent 24rem),
    linear-gradient(180deg, var(--page-grad-start) 0%, var(--page-grad-mid) 54%, var(--page-grad-end) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, var(--grid-mask), transparent 70%);
}

body.shell-open { overflow: hidden; }

/* ----- Links ----- */
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }

/* ----- Topbar ----- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 160;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 32px;
  border-bottom: 1px solid var(--topbar-border);
  background: var(--topbar-bg);
  backdrop-filter: blur(14px);
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.topbar-brand::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--warm) 100%);
  box-shadow: 0 0 0 6px rgba(91, 108, 255, 0.14);
}

.topbar-brand span { color: var(--accent); }

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.topbar-nav {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border: 1px solid var(--topbar-border);
  border-radius: 999px;
  background: var(--nav-bg);
  box-shadow: var(--nav-shadow);
}

.topbar-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.topbar-nav a.active,
.topbar-nav a:hover {
  color: var(--ink);
  background: var(--nav-hover-bg);
}

/* ----- Theme Toggle ----- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--theme-toggle-border);
  border-radius: 999px;
  background: var(--theme-toggle-bg);
  box-shadow: var(--theme-toggle-shadow);
  color: var(--theme-toggle-label);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.theme-toggle:hover {
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent-soft), var(--theme-toggle-shadow);
}

.theme-toggle-glyph {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px var(--accent-soft);
  border-radius: 999px;
}

.theme-toggle-glyph svg {
  display: block;
  width: 100%;
  height: 100%;
}

.theme-toggle-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ----- Sidebar (subpages) ----- */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 18px;
  z-index: 190;
  width: 42px;
  height: 42px;
  border: 1px solid var(--sidebar-toggle-border);
  border-radius: 14px;
  background: var(--sidebar-toggle-bg);
  color: var(--ink);
  font-size: 20px;
  cursor: pointer;
  box-shadow: var(--sidebar-toggle-shadow);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 145;
  background: var(--sidebar-backdrop);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.sidebar {
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  padding: 24px 14px 28px;
  overflow-y: auto;
  z-index: 150;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  backdrop-filter: blur(18px);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.sidebar-brand {
  padding: 0 10px 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand h2 {
  color: var(--sidebar-heading);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.sidebar-brand span {
  display: block;
  margin-top: 4px;
  color: var(--sidebar-copy);
  font-size: 13px;
}

.sidebar-section { margin-bottom: 14px; }

.sidebar-section-title {
  padding: 8px 10px 6px;
  color: var(--sidebar-section-ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.sidebar a {
  display: block;
  padding: 8px 10px;
  border-radius: 12px;
  color: var(--sidebar-link);
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.sidebar a:hover,
.sidebar a.active {
  color: var(--sidebar-link-active);
  background: var(--sidebar-link-bg);
  transform: translateX(2px);
}

.sidebar a.indent {
  padding-left: 24px;
  font-size: 13px;
}

.sidebar-overview {
  margin-bottom: 18px;
  padding: 0 10px 18px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-overview a {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-footer {
  margin-top: 14px;
  padding: 14px 10px 0;
  border-top: 1px solid var(--sidebar-border);
  display: grid;
  gap: 10px;
  justify-items: stretch;
}

.sidebar-footer-copy {
  color: var(--sidebar-copy);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
}

.sidebar-footer-link,
.sidebar-footer-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--sidebar-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--sidebar-link);
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.sidebar-footer-link {
  padding: 9px 12px;
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
}

.sidebar-footer-icon {
  width: 38px;
  justify-self: center;
  padding: 0;
}

.sidebar-footer-link:hover,
.sidebar-footer-icon:hover {
  color: var(--sidebar-link-active);
  background: var(--sidebar-link-bg);
  transform: translateY(-1px);
}

.sidebar-footer-icon svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

/* ----- Layout: Main (sidebar pages) ----- */
.main {
  margin-left: var(--sidebar-width);
  max-width: 1040px;
  padding: calc(var(--topbar-height) + 34px) 42px 96px;
}

/* ----- Layout: Page Shell (overview) ----- */
.page-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 32px 32px;
}

/* ----- Hero (subpage single-column) ----- */
.hero {
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: 30px;
  background:
    radial-gradient(circle at top right, var(--hero-spot), transparent 38%),
    linear-gradient(180deg, var(--hero-bg-start) 0%, var(--hero-bg-end) 100%);
  box-shadow: var(--shadow);
}

.hero h1 {
  max-width: 10ch;
  color: var(--ink);
  font-size: clamp(2.4rem, 4vw, 3.5rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
}

.hero p {
  max-width: 68ch;
  margin-top: 14px;
  font-size: 17px;
  color: var(--ink-soft);
}

/* ----- Eyebrow ----- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--accent-line);
}

/* ----- Hero Actions ----- */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 22px;
}

/* ----- Base URL, Version Pill, Support Link ----- */
.base-url {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border: 1px solid var(--code-inline-border);
  border-radius: 18px;
  background: var(--control-bg);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 14px;
  box-shadow: var(--control-shadow);
}

.version-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.support-link {
  display: inline-flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--control-soft-bg);
  color: var(--ink);
  font-weight: 600;
}

/* ----- Typography ----- */
h2 {
  margin: 46px 0 16px;
  padding-top: 6px;
  color: var(--ink);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

h2:first-of-type { margin-top: 0; }

h3 {
  margin: 32px 0 12px;
  color: var(--ink);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
}

h4 {
  margin: 24px 0 8px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

p { margin-bottom: 12px; }
strong { color: var(--ink); }
ul { margin-top: 12px; padding-left: 20px; }
li + li { margin-top: 8px; }

/* ----- Code ----- */
code {
  padding: 2px 6px;
  border: 1px solid var(--code-inline-border);
  border-radius: 8px;
  background: var(--panel-muted);
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 13px;
}

pre {
  margin: 16px 0 22px;
  padding: 18px 20px;
  overflow-x: auto;
  border: 1px solid var(--code-block-border);
  border-radius: 20px;
  background: linear-gradient(180deg, var(--code-block-start) 0%, var(--code-block-end) 100%);
  box-shadow: inset 0 1px 0 var(--code-block-inset);
  line-height: 1.58;
}

pre code {
  padding: 0;
  border: none;
  background: transparent;
  color: var(--code-block-text);
  font-size: 13px;
}

.kw { color: #b9a6ff; }
.str { color: #c7e9b0; }
.num { color: #f4a261; }
.cmt { color: #6f8492; }
.url { color: #7dd3fc; }
.hdr { color: #8ee6d7; }
.flag { color: #f28482; }

/* ----- Tables ----- */
table {
  width: 100%;
  margin: 16px 0 24px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

th {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--table-head-bg);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

th:first-child,
td:first-child { border-left: 1px solid var(--border); }

th:last-child,
td:last-child { border-right: 1px solid var(--border); }

th:first-child { border-top-left-radius: 16px; }
th:last-child { border-top-right-radius: 16px; }

td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--table-cell-bg);
  vertical-align: top;
}

tbody tr:last-child td:first-child { border-bottom-left-radius: 16px; }
tbody tr:last-child td:last-child { border-bottom-right-radius: 16px; }

/* ----- Tags ----- */
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
}

.tag-pro { background: var(--pro-bg); color: var(--pro-text); }
.tag-post { background: var(--tag-bg); color: var(--tag-text); }
.tag-required { background: var(--tag-required-bg); color: var(--tag-required-text); }
.tag-optional { background: var(--tag-optional-bg); color: var(--tag-optional-text); }

/* ----- Endpoint ----- */
.endpoint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 12px 0 22px;
  padding: 14px 16px;
  border: 1px solid var(--endpoint-border);
  border-radius: 18px;
  background: var(--endpoint-bg);
  font-family: var(--font-mono);
  font-size: 15px;
  box-shadow: var(--endpoint-shadow);
}

.endpoint .method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 6px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: var(--on-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.endpoint .path { color: var(--ink); }

/* ----- Notes ----- */
.note {
  margin: 18px 0;
  padding: 16px 18px;
  border: 1px solid var(--note-border);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--note-bg-start) 0%, var(--note-bg-end) 100%);
  color: var(--ink);
}

.note-warn {
  border-color: var(--note-warn-border);
  background: linear-gradient(180deg, var(--note-warn-start) 0%, var(--note-warn-end) 100%);
}

/* ----- Risk Colors ----- */
.risk-clean { color: var(--green); font-weight: 700; }
.risk-low { color: #5b6cff; font-weight: 700; }
.risk-medium { color: #8c7cff; font-weight: 700; }
.risk-high { color: var(--red); font-weight: 700; }

/* ----- Lang Tabs ----- */
.lang-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 12px;
}

.lang-tab {
  padding: 9px 14px;
  border: 1px solid var(--lang-tab-border);
  border-radius: 999px;
  background: var(--lang-tab-bg);
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.lang-tab:hover,
.lang-tab.active {
  color: var(--ink);
  border-color: var(--lang-tab-hover-border);
  background: var(--lang-tab-hover-bg);
}

.lang-panel { display: none; }
.lang-panel.active { display: block; }

/* ----- Checklist ----- */
.checklist {
  margin: 10px 0 18px 20px;
  font-size: 14px;
}

.checklist li + li { margin-top: 6px; }

/* ----- Plan CTA, Portal Link ----- */
.plan-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: var(--on-accent);
  font-size: 13px;
  font-weight: 700;
}

.portal-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--ink);
  font-weight: 700;
}

.portal-link::after {
  content: "\2192";
  color: var(--accent);
}

/* ----- Changelog ----- */
.changelog-entry + .changelog-entry {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--divider);
}

.changelog-entry h3 {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
}

.changelog-entry-meta {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ----- Focus ----- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle:focus-visible {
  outline-offset: 3px;
}

.sidebar a:focus-visible {
  outline-color: var(--sidebar-link-active);
}

/* ----- Docs Footer ----- */
.docs-footer {
  padding: 0 32px 32px;
}

.docs-footer-shell {
  max-width: 1180px;
  margin: 0 auto;
}

.docs-footer.docs-footer-overview .docs-footer-shell {
  max-width: 1116px;
}

.docs-footer-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--panel) 0%, var(--control-soft-bg) 100%);
  box-shadow: var(--control-shadow);
  backdrop-filter: blur(12px);
}

.docs-footer-copy {
  justify-self: start;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.docs-footer-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 14px;
  border: 1px solid var(--code-inline-border);
  border-radius: 999px;
  background: var(--control-bg);
  box-shadow: var(--control-shadow);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.docs-footer-link:hover {
  color: var(--ink);
  border-color: var(--accent-soft);
  background: var(--nav-hover-bg);
  transform: translateY(-1px);
}

.docs-footer-link-icon {
  justify-self: center;
  width: 40px;
  padding: 0;
}

.docs-footer-link-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.docs-footer-support {
  justify-self: end;
}

@media (max-width: 860px) {
  .docs-footer {
    padding: 0 18px 24px;
  }

  .docs-footer-panel {
    grid-template-columns: 1fr;
    padding: 18px;
    justify-items: center;
    text-align: center;
  }

  .docs-footer-link {
    justify-self: center;
  }
}

/* ----- Print ----- */
@media print {
  body::before,
  .topbar,
  .sidebar,
  .sidebar-toggle,
  .sidebar-backdrop,
  .theme-toggle { display: none !important; }

  body {
    background: #fff;
    color: #1a1a1a;
    font-size: 12px;
  }

  .main {
    margin-left: 0;
    padding: 0;
    max-width: none;
  }

  .page-shell {
    padding: 0;
    max-width: none;
  }

  .hero,
  .hero-card,
  .section-card,
  .service-card {
    border: 1px solid #ddd;
    box-shadow: none;
    background: #fff;
    break-inside: avoid;
  }

  pre {
    background: #f5f5f5;
    border: 1px solid #ddd;
    box-shadow: none;
  }

  pre code { color: #1a1a1a; }

  a { color: inherit; text-decoration: underline; }

  .docs-footer {
    padding: 0;
  }

  .docs-footer-panel {
    border: 1px solid #ddd;
    box-shadow: none;
    background: #fff;
  }
}

/* ----- Responsive: sidebar pages ----- */
@media (max-width: 1100px) {
  .main {
    padding-left: 28px;
    padding-right: 28px;
  }

}

@media (max-width: 860px) {
  .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .topbar { padding: 16px 18px 16px 70px; }
  .topbar-nav { display: none; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    width: min(86vw, 320px);
  }

  body.shell-open .sidebar { transform: translateX(0); }
  body.shell-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }

  .main {
    margin-left: 0;
    padding: calc(var(--topbar-height) + 18px) 18px 64px;
  }

  .hero {
    padding: 24px;
    border-radius: 24px;
  }

  .hero h1 { max-width: none; }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .base-url,
  .support-link {
    width: 100%;
    justify-content: center;
  }
}
