/* ============================================================
   QwikLive API Documentation
   Design System — Enterprise, inspired by MuleSoft CloudHub 2.0
   ============================================================ */

:root {
  --color-primary:        #003366;
  --color-primary-light:  #0055AA;
  --color-accent:         #0066CC;
  --color-accent-hover:   #0052A3;
  --color-highlight:      #E8F0F8;
  --color-bg:             #F5F7FA;
  --color-surface:        #FFFFFF;
  --color-border:         #D0D7DE;
  --color-text:           #24292F;
  --color-text-muted:     #6E7781;
  --color-code-bg:        #F6F8FA;
  --color-code-dark-bg:   #161B22;
  --color-code-dark-text: #E6EDF3;

  --color-get:      #1A7F37;  --color-get-bg:      #DAFBE1;
  --color-post:     #0550AE;  --color-post-bg:     #DFF0FF;
  --color-put:      #9A6700;  --color-put-bg:      #FFF8C5;
  --color-patch:    #6639BA;  --color-patch-bg:    #FBEFFF;
  --color-delete:   #CF222E;  --color-delete-bg:   #FFEBE9;

  --color-note-border:      #0066CC; --color-note-bg:      #EBF4FF;
  --color-warning-border:   #D97706; --color-warning-bg:   #FFFBEB;
  --color-important-border: #CF222E; --color-important-bg: #FFF5F5;
  --color-tip-border:       #1A7F37; --color-tip-bg:       #F0FFF4;

  --sidebar-width:  268px;
  --toc-width:      220px;
  --header-height:  60px;

  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;

  --shadow-sm: 0 1px 2px rgba(16,42,67,0.06), 0 1px 1px rgba(16,42,67,0.04);
  --shadow-md: 0 4px 14px rgba(16,42,67,0.10), 0 2px 4px rgba(16,42,67,0.06);
  --shadow-lg: 0 12px 32px rgba(16,42,67,0.13), 0 4px 10px rgba(16,42,67,0.07);
  --shadow-glow: 0 8px 28px rgba(0,102,204,0.18);
  --radius-sm: 4px; --radius-md: 8px; --radius-lg: 12px; --radius-xl: 16px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans); font-size: 15px; line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  background-image:
    radial-gradient(900px circle at 100% -5%, rgba(0,102,204,0.05), transparent 45%),
    radial-gradient(700px circle at 0% 8%, rgba(0,51,102,0.045), transparent 40%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: var(--color-accent); text-decoration: none; transition: color 0.15s var(--ease); }
a:hover { text-decoration: underline; color: var(--color-accent-hover); }

/* Accessible focus ring */
a:focus-visible, button:focus-visible, input:focus-visible, .api-tab:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
::selection { background: rgba(0,102,204,0.18); }

/* --- Top Header --- */
.top-bar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: linear-gradient(100deg, #002A55 0%, var(--color-primary) 45%, #004C8F 100%);
  color: white;
  display: flex; align-items: center; padding: 0 20px;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, var(--shadow-md);
  border-bottom: 1px solid rgba(0,0,0,0.18);
  gap: 12px;
}
.top-bar .logo {
  font-size: 17px; font-weight: 700; color: white; text-decoration: none;
  display: flex; align-items: center; gap: 9px; flex-shrink: 0;
  white-space: nowrap;
}
.logo-icon {
  width: 30px; height: 30px;
  background: linear-gradient(140deg, #2E8FFF 0%, var(--color-accent) 55%, #0052A3 100%);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 900; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,102,204,0.45), 0 0 0 1px rgba(255,255,255,0.12) inset;
  letter-spacing: 0.02em;
}
.search-wrap { flex: 1; max-width: 380px; margin: 0 16px; position: relative; }
.search-input {
  width: 100%; padding: 7px 12px 7px 32px;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.25);
  border-radius: 20px; color: white; font-size: 13px; outline: none;
  transition: background 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.65)' stroke-width='2.5'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 10px center;
}
.search-input::placeholder { color: rgba(255,255,255,0.55); }
.search-input:focus { background-color: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.5); }
.top-bar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.top-bar-actions a { color: rgba(255,255,255,0.8); font-size: 13px; }
.top-bar-actions a:hover { color: white; text-decoration: none; }
.badge-version {
  background: rgba(255,255,255,0.15); color: rgba(255,255,255,0.9);
  font-size: 11.5px; padding: 3px 9px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.3);
}
.hamburger { display: none; background: none; border: none; color: white; cursor: pointer; padding: 4px; }

/* --- Search Overlay --- */
.search-overlay {
  position: fixed; top: calc(var(--header-height) + 8px); left: 50%; transform: translateX(-50%);
  width: 520px; max-width: 90vw;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  z-index: 200; max-height: 420px; overflow-y: auto; display: none;
}
.search-overlay.visible { display: block; }
.search-result-item { padding: 12px 16px; border-bottom: 1px solid var(--color-border); cursor: pointer; transition: background 0.12s; }
.search-result-item:hover { background: var(--color-highlight); }
.search-result-item:last-child { border-bottom: none; }
.search-result-title { font-weight: 600; font-size: 13.5px; color: var(--color-text); }
.search-result-desc { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; }
.search-result-section { font-size: 11px; color: var(--color-accent); margin-top: 2px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }

/* --- Layout --- */
.docs-layout { display: flex; margin-top: var(--header-height); min-height: calc(100vh - var(--header-height)); }

/* --- Sidebar --- */
.docs-sidebar {
  width: var(--sidebar-width); background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  position: fixed; top: var(--header-height); bottom: 0; left: 0;
  z-index: 90;
  display: flex; flex-direction: column;
  transition: transform 0.26s var(--ease), width 0.26s var(--ease);
}
.nav-scroll {
  flex: 1; overflow-y: auto; padding: 12px 0 16px;
  scrollbar-width: thin; scrollbar-color: var(--color-border) transparent;
}
.nav-scroll::-webkit-scrollbar { width: 5px; }
.nav-scroll::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 4px; }

/* Collapsible Group */
.nav-group { border-bottom: 1px solid #EEF1F4; }
.nav-group:last-of-type { border-bottom: none; }
.nav-group-header {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 11px 18px 10px; background: none; border: none; cursor: pointer;
  font-family: var(--font-sans); text-align: left;
}
.nav-group-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--color-text-muted);
  transition: color 0.15s var(--ease);
}
.nav-group-header:hover .nav-group-label { color: var(--color-primary); }
.nav-caret {
  color: var(--color-text-muted); flex-shrink: 0;
  transform: rotate(90deg); transition: transform 0.22s var(--ease);
}
.nav-group.collapsed > .nav-group-header .nav-caret { transform: rotate(0deg); }

/* Smooth collapse via grid-rows trick */
.nav-group-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows 0.24s var(--ease); }
.nav-group.collapsed > .nav-group-body { grid-template-rows: 0fr; }
.nav-group-inner { overflow: hidden; padding-bottom: 6px; }

/* Nav links */
.nav-item {
  display: flex; align-items: center; padding: 6px 18px; font-size: 13.5px; color: var(--color-text);
  text-decoration: none; transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
  border-left: 2px solid transparent; line-height: 1.4;
}
.nav-item:hover { background: var(--color-highlight); color: var(--color-accent); text-decoration: none; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(0,102,204,0.12) 0%, rgba(0,102,204,0.03) 100%);
  color: var(--color-accent); border-left-color: var(--color-accent); font-weight: 600;
}

/* Resource sub-group (parent + children) */
.nav-parent-row { display: flex; align-items: stretch; }
.nav-item-lead { flex: 1; min-width: 0; }
.nav-subtoggle {
  background: none; border: none; cursor: pointer; padding: 0 14px 0 6px;
  color: var(--color-text-muted); display: flex; align-items: center; flex-shrink: 0;
}
.nav-subtoggle:hover { color: var(--color-accent); }
.nav-subtoggle .nav-caret { transform: rotate(90deg); }
.nav-parent.collapsed .nav-subtoggle .nav-caret { transform: rotate(0deg); }
.nav-children { display: grid; grid-template-rows: 1fr; transition: grid-template-rows 0.22s var(--ease); }
.nav-parent.collapsed .nav-children { grid-template-rows: 0fr; }
.nav-children-inner { overflow: hidden; }
.nav-item.sub { padding-left: 38px; font-size: 12.75px; color: var(--color-text-muted); }
.nav-item.sub:hover { color: var(--color-accent); }
.nav-item.sub.active { color: var(--color-accent); }

.nav-method {
  font-size: 9.5px; font-weight: 700; padding: 1px 5px; border-radius: 3px;
  margin-right: 6px; vertical-align: middle; text-transform: uppercase; flex-shrink: 0;
}
.nav-method.get { background: var(--color-get-bg); color: var(--color-get); }
.nav-method.post { background: var(--color-post-bg); color: var(--color-post); }
.nav-divider { height: 1px; background: var(--color-border); margin: 6px 20px; }

/* Sidebar collapse control (pinned at bottom) */
.sidebar-collapse-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 11px 18px; flex-shrink: 0;
  background: var(--color-surface); border: none; border-top: 1px solid var(--color-border);
  color: var(--color-text-muted); font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: var(--font-sans); transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.sidebar-collapse-btn:hover { color: var(--color-accent); background: var(--color-highlight); }

/* Floating reopen button (visible only when minimized) */
.nav-reopen-btn {
  position: fixed; left: 0; top: calc(var(--header-height) + 18px);
  z-index: 95; display: none; align-items: center; justify-content: center;
  width: 30px; height: 44px; padding: 0;
  background: var(--color-surface); color: var(--color-accent);
  border: 1px solid var(--color-border); border-left: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  box-shadow: var(--shadow-md); cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.nav-reopen-btn:hover { background: var(--color-highlight); }

/* Minimized layout state (desktop) */
.docs-layout.nav-collapsed .docs-sidebar { transform: translateX(-100%); }
.docs-layout.nav-collapsed .docs-main { margin-left: 0; }
.docs-layout.nav-collapsed ~ .docs-footer { margin-left: 0; }
body.sidebar-min .nav-reopen-btn { display: flex; }

/* ── Iframe content shell (persistent sidebar, swap-only content) ── */
.docs-main.frame-host { padding: 0; max-width: none; margin-right: 0; }
.content-frame {
  width: 100%;
  height: calc(100vh - var(--header-height));
  border: 0; display: block; background: var(--color-bg);
}

/* Embedded (content-only) render — when a page runs inside the shell iframe */
body.embedded .top-bar,
body.embedded .docs-sidebar,
body.embedded .hamburger,
body.embedded .nav-reopen-btn,
body.embedded #search-overlay { display: none !important; }
body.embedded .docs-layout { margin-top: 0; }
body.embedded .docs-main { margin-left: 0; }
body.embedded .docs-footer { margin-left: 0; }
body.embedded .docs-toc { top: 24px; max-height: calc(100vh - 48px); }

/* Avoid a double footer: the top window is a persistent shell that hosts the
   page inside a content iframe, and the same page renders again (embedded)
   in that iframe. The footer belongs with the scrolling content, so show it
   only in the embedded copy and hide the shell's own footer. */
body:not(.embedded) .docs-footer { display: none; }

/* --- Main Content --- */
.docs-main {
  flex: 1; margin-left: var(--sidebar-width); margin-right: var(--toc-width);
  min-width: 0; padding: 44px 56px; max-width: 1080px;
}

/* --- Page Header --- */
.page-header { padding-bottom: 22px; border-bottom: 1px solid var(--color-border); margin-bottom: 32px; }
.breadcrumb { font-size: 12px; color: var(--color-text-muted); margin-bottom: 10px; }
.breadcrumb a { color: var(--color-text-muted); }
.breadcrumb a:hover { color: var(--color-accent); }
.breadcrumb span { margin: 0 5px; }
.page-header h1 { font-size: 29px; font-weight: 800; color: var(--color-primary); line-height: 1.22; margin-bottom: 8px; letter-spacing: -0.02em; }
.page-desc { font-size: 15px; color: var(--color-text-muted); line-height: 1.6; }

/* --- Typography --- */
h2 { font-size: 20px; font-weight: 700; color: var(--color-primary); margin: 38px 0 12px; scroll-margin-top: 80px; letter-spacing: -0.01em; }
h3 { font-size: 16px; font-weight: 600; color: var(--color-text); margin: 24px 0 10px; scroll-margin-top: 80px; }
h4 { font-size: 14px; font-weight: 600; color: var(--color-text); margin: 16px 0 8px; }
p { margin-bottom: 14px; }
ul, ol { margin: 0 0 14px 0; padding-left: 24px; }
li { margin-bottom: 5px; }
strong { font-weight: 600; }
hr { border: none; border-top: 1px solid var(--color-border); margin: 32px 0; }

/* --- Method Badge --- */
.method-badge {
  font-size: 11px; font-weight: 700; padding: 3px 9px;
  border-radius: var(--radius-sm); text-transform: uppercase;
  letter-spacing: 0.04em; flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(16,42,67,0.06) inset;
}
.method-get { background: var(--color-get-bg); color: var(--color-get); }
.method-post { background: var(--color-post-bg); color: var(--color-post); }
.method-put { background: var(--color-put-bg); color: var(--color-put); }
.method-patch { background: var(--color-patch-bg); color: var(--color-patch); }
.method-delete { background: var(--color-delete-bg); color: var(--color-delete); }

/* --- Endpoint Block --- */
.endpoint-block {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(180deg, #FFFFFF 0%, var(--color-code-bg) 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: 13px 16px; margin: 12px 0 24px;
  box-shadow: var(--shadow-sm);
}
.endpoint-path { font-family: var(--font-mono); font-size: 14px; color: var(--color-text); word-break: break-all; }

/* --- Tables --- */
.table-wrap {
  overflow-x: auto; margin: 16px 0 24px;
  border-radius: var(--radius-md); border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead tr { background: linear-gradient(180deg, #F4F7FB 0%, #EAF0F6 100%); }
thead th {
  padding: 10px 14px; text-align: left; font-weight: 600;
  font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--color-text-muted); border-bottom: 1px solid var(--color-border); white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--color-border); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #FAFBFC; }
tbody td { padding: 10px 14px; vertical-align: top; line-height: 1.5; }
.field-name { font-family: var(--font-mono); font-size: 13px; color: #6639BA; font-weight: 500; }
.field-type {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--color-text-muted);
  background: var(--color-code-bg); padding: 1px 6px; border-radius: 3px;
  border: 1px solid var(--color-border);
}
.req-yes { color: var(--color-get); font-weight: 600; font-size: 12px; }
.req-no { color: var(--color-text-muted); font-size: 12px; }
.req-ctx { color: #9A6700; font-weight: 600; font-size: 12px; }

/* --- Code Blocks --- */
.code-block-wrap { position: relative; margin: 12px 0 20px; border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-md); }
.code-block-header {
  display: flex; align-items: center; justify-content: space-between;
  background: #1C2128; padding: 8px 14px; font-size: 12px;
}
.code-block-lang {
  font-family: var(--font-mono); text-transform: uppercase;
  letter-spacing: 0.07em; font-size: 11px; color: rgba(255,255,255,0.7);
}
.copy-btn {
  background: rgba(255,255,255,0.09); border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.65); border-radius: 4px; padding: 3px 10px;
  font-size: 11px; cursor: pointer; transition: all 0.15s; font-family: var(--font-sans);
}
.copy-btn:hover { background: rgba(255,255,255,0.18); color: white; }
.copy-btn.copied { color: #3FB950; border-color: #3FB950; background: rgba(63,185,80,0.1); }
pre {
  background: var(--color-code-dark-bg); color: var(--color-code-dark-text);
  padding: 16px; overflow-x: auto; font-family: var(--font-mono);
  font-size: 13px; line-height: 1.65; margin: 0;
}
code:not(pre code) {
  background: var(--color-code-bg); color: #6639BA; padding: 2px 5px;
  border-radius: 4px; font-family: var(--font-mono); font-size: 13px;
  border: 1px solid var(--color-border);
}

/* --- Tabs --- */
.tabs { margin: 16px 0; border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; }
.tab-list { display: flex; background: #F0F4F8; border-bottom: 1px solid var(--color-border); }
.tab-btn {
  padding: 9px 18px; background: none; border: none; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--color-text-muted);
  border-bottom: 2px solid transparent; transition: color 0.15s; font-family: var(--font-sans);
}
.tab-btn:hover { color: var(--color-text); }
.tab-btn.active { color: var(--color-accent); border-bottom-color: var(--color-accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.tab-panel pre { border-radius: 0; }

/* --- Callouts --- */
.callout {
  padding: 14px 16px; border-radius: var(--radius-md); margin: 18px 0;
  border-left: 4px solid; display: flex; gap: 10px; align-items: flex-start;
}
.callout-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.callout-body { flex: 1; }
.callout-title { font-weight: 700; font-size: 12px; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.callout-body p { margin-bottom: 0; font-size: 14px; }
.callout-note { background: var(--color-note-bg); border-color: var(--color-note-border); }
.callout-note .callout-title { color: var(--color-note-border); }
.callout-warning { background: var(--color-warning-bg); border-color: var(--color-warning-border); }
.callout-warning .callout-title { color: var(--color-warning-border); }
.callout-important { background: var(--color-important-bg); border-color: var(--color-important-border); }
.callout-important .callout-title { color: var(--color-important-border); }
.callout-tip { background: var(--color-tip-bg); border-color: var(--color-tip-border); }
.callout-tip .callout-title { color: var(--color-tip-border); }

/* --- Collapsible Schema --- */
.schema-section { border: 1px solid var(--color-border); border-radius: var(--radius-md); margin: 12px 0; overflow: hidden; }
.schema-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: #F8FAFB; cursor: pointer; border: none;
  font-size: 13.5px; font-weight: 600; color: var(--color-text); font-family: var(--font-sans);
  transition: background 0.15s; text-align: left;
}
.schema-toggle:hover { background: var(--color-highlight); }
.schema-toggle .arrow { transition: transform 0.2s; flex-shrink: 0; color: var(--color-text-muted); }
.schema-toggle.open .arrow { transform: rotate(180deg); }
.schema-content { display: none; }
.schema-content.open { display: block; }

/* --- ToC (right) --- */
.docs-toc {
  width: var(--toc-width); position: fixed;
  top: calc(var(--header-height) + 24px); right: 0;
  padding: 0 20px 0 16px;
  max-height: calc(100vh - var(--header-height) - 48px);
  overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--color-border) transparent;
}
.toc-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: var(--color-text-muted); margin-bottom: 10px; }
.toc-list { list-style: none; padding: 0; }
.toc-list li { margin-bottom: 1px; }
.toc-list a {
  font-size: 12.5px; color: var(--color-text-muted); text-decoration: none;
  display: block; padding: 3px 0 3px 8px; border-left: 2px solid transparent;
  transition: color 0.12s; line-height: 1.4;
}
.toc-list a:hover { color: var(--color-accent); border-left-color: var(--color-border); text-decoration: none; }
.toc-list a.active { color: var(--color-accent); border-left-color: var(--color-accent); font-weight: 600; }
.toc-list .toc-h3 a { padding-left: 18px; font-size: 12px; }

/* --- Hero --- */
.hero {
  position: relative;
  background: linear-gradient(135deg, #002A55 0%, var(--color-primary) 42%, #005FAF 100%);
  color: white; padding: 52px 48px 48px;
  border-radius: var(--radius-xl); margin-bottom: 40px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(560px circle at 88% -20%, rgba(46,143,255,0.40), transparent 60%),
    radial-gradient(420px circle at 6% 120%, rgba(0,102,204,0.30), transparent 55%);
}
.hero > * { position: relative; z-index: 1; }
.hero h1 { color: white; font-size: 32px; margin-bottom: 12px; line-height: 1.18; font-weight: 800; letter-spacing: -0.025em; }
.hero p { color: rgba(255,255,255,0.88); font-size: 16px; max-width: 580px; margin-bottom: 0; }
.hero-actions { margin-top: 24px; display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 6px; font-size: 14px;
  font-weight: 600; cursor: pointer; border: none; text-decoration: none;
  transition: all 0.15s; font-family: var(--font-sans);
}
.btn-primary { background: white; color: var(--color-primary); box-shadow: 0 4px 14px rgba(0,0,0,0.18); }
.btn-primary:hover { background: #E8F0F8; text-decoration: none; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,0.22); }
.btn-ghost { background: rgba(255,255,255,0.12); color: white; border: 1px solid rgba(255,255,255,0.35); }
.btn-ghost:hover { background: rgba(255,255,255,0.22); text-decoration: none; color: white; }

/* --- Cards --- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; margin: 20px 0; }
.card {
  position: relative;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: 20px;
  transition: box-shadow 0.22s var(--ease), border-color 0.22s var(--ease), transform 0.22s var(--ease);
  text-decoration: none; display: block; color: var(--color-text);
  overflow: hidden;
}
.card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--color-accent), #2E8FFF);
  opacity: 0; transition: opacity 0.22s var(--ease);
}
.card:hover { box-shadow: var(--shadow-lg); border-color: var(--color-accent); text-decoration: none; transform: translateY(-3px); }
.card:hover::before { opacity: 1; }
.card-icon { font-size: 22px; margin-bottom: 10px; }
.card-title { font-size: 14px; font-weight: 700; color: var(--color-primary); margin-bottom: 5px; }
.card-desc { font-size: 13px; color: var(--color-text-muted); line-height: 1.5; }

/* --- Steps --- */
.steps { margin: 24px 0; }
.step { display: flex; gap: 16px; margin-bottom: 22px; }
.step-num {
  width: 28px; height: 28px; min-width: 28px;
  background: var(--color-accent); color: white;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; margin-top: 2px;
}
.step-body h4 { margin-top: 0; font-size: 15px; margin-bottom: 6px; }
.step-body p { font-size: 14px; color: var(--color-text-muted); margin-bottom: 8px; }

/* --- Domain Table Summary --- */
.domain-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin: 20px 0; }
.domain-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: 15px 16px; display: flex; align-items: flex-start; gap: 12px;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), transform 0.18s var(--ease);
}
.domain-card:hover { border-color: var(--color-accent); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.domain-count {
  min-width: 34px; height: 34px;
  background: linear-gradient(140deg, var(--color-accent), #2E8FFF);
  color: #fff; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(0,102,204,0.35);
}
.domain-name { font-weight: 600; font-size: 13.5px; margin-bottom: 3px; }
.domain-desc { font-size: 12.5px; color: var(--color-text-muted); line-height: 1.45; }

/* --- Status Code Items --- */
.status-row { display: flex; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--color-border); align-items: flex-start; }
.status-row:last-child { border-bottom: none; }
.status-row:hover { background: #FAFBFC; }
.status-code-badge { font-family: var(--font-mono); font-weight: 700; font-size: 14px; min-width: 42px; }
.s2xx { color: var(--color-get); }
.s4xx { color: var(--color-delete); }
.s5xx { color: #D97706; }
.status-reason { font-family: var(--font-mono); font-size: 12px; color: #6639BA; min-width: 200px; }
.status-desc { font-size: 13px; color: var(--color-text-muted); flex: 1; }
.retryable { font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 3px; white-space: nowrap; }
.retry-yes { background: var(--color-tip-bg); color: var(--color-tip-border); }
.retry-no { background: #F0F4F8; color: var(--color-text-muted); }

/* --- Tags --- */
.tag { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.tag-new { background: var(--color-tip-bg); color: var(--color-tip-border); }
.tag-deprecated { background: var(--color-important-bg); color: var(--color-important-border); }
.tag-breaking { background: var(--color-important-bg); color: var(--color-important-border); }

/* --- Endpoint Summary Card (API Ref Index) --- */
.endpoint-list { display: flex; flex-direction: column; gap: 6px; margin: 16px 0; }
.endpoint-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: 12px 16px;
  text-decoration: none; color: var(--color-text);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), transform 0.18s var(--ease);
}
.endpoint-card:hover { border-color: var(--color-accent); box-shadow: var(--shadow-md); text-decoration: none; transform: translateX(3px); }
.endpoint-card .ep-path { font-family: var(--font-mono); font-size: 13.5px; flex: 1; }
.endpoint-card .ep-desc { font-size: 13px; color: var(--color-text-muted); }

/* --- Section Divider --- */
.section-divider { height: 1px; background: var(--color-border); margin: 40px 0 36px; }

/* --- Footer --- */
.docs-footer {
  margin-left: var(--sidebar-width); margin-right: var(--toc-width);
  padding: 20px 52px; border-top: 1px solid var(--color-border);
  color: var(--color-text-muted); font-size: 12.5px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px;
}
.docs-footer a { color: var(--color-text-muted); }
.docs-footer a:hover { color: var(--color-accent); }

/* --- Responsive --- */
@media (max-width: 1200px) {
  .docs-toc { display: none; }
  .docs-main { margin-right: 0; }
  .docs-footer { margin-right: 0; }
}
@media (max-width: 900px) {
  .docs-sidebar { transform: translateX(-100%); transition: transform 0.25s; box-shadow: none; }
  .docs-sidebar.open { transform: translateX(0); box-shadow: var(--shadow-md); }
  /* On mobile the hamburger owns the drawer — neutralise the desktop minimize state */
  .docs-layout.nav-collapsed .docs-sidebar { transform: translateX(-100%); }
  .docs-layout.nav-collapsed .docs-sidebar.open { transform: translateX(0); }
  .docs-main { margin-left: 0; padding: 24px 20px; }
  .docs-footer { margin-left: 0; }
  .hamburger { display: block; }
  .sidebar-collapse-btn, .nav-reopen-btn, body.sidebar-min .nav-reopen-btn { display: none; }
  .hero { padding: 28px 20px; }
  .hero h1 { font-size: 24px; }
  .card-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .card-grid { grid-template-columns: 1fr; }
  .domain-grid { grid-template-columns: 1fr; }
  .docs-main { padding: 20px 16px; }
  .top-bar .search-wrap { display: none; }
  .hero { padding: 24px 16px; }
}
@media print {
  .docs-sidebar, .docs-toc, .top-bar, .hamburger { display: none; }
  .docs-main { margin: 0; padding: 0; }
  .docs-footer { margin: 0; }
}

/* ── API Panel (Request / Response toggle) ─────────────── */
.api-panel {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 20px 0 36px;
  box-shadow: var(--shadow-md);
}
.api-panel-tabs {
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, #F4F7FB 0%, #EAF0F6 100%);
  border-bottom: 1px solid var(--color-border);
  padding: 0 6px;
}
.api-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
  font-family: var(--font-sans);
  letter-spacing: 0.01em;
}
.api-tab:hover { color: var(--color-text); }
.api-tab.active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}
.api-pane { display: none; }
.api-pane.active { display: block; }
.api-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 160px;
}
.api-fields {
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
}
/* Field List — vertical card-style rows (replaces table) */
.field-list { margin: 0; padding: 0; }
.field-item {
  padding: 11px 16px;
  border-bottom: 1px solid #ECEEF0;
}
.field-item:last-child { border-bottom: none; }
.field-item:hover { background: #FAFBFC; }
.field-item-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 5px;
}
.field-item-desc {
  font-size: 12.5px;
  color: var(--color-text-muted);
  line-height: 1.55;
}
.field-item-desc code {
  font-size: 11.5px;
  padding: 1px 4px;
}
.api-example {
  background: var(--color-code-dark-bg);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.api-example pre {
  color: var(--color-code-dark-text);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.65;
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  flex: 1;
}
.api-example-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1C2128;
  padding: 7px 12px;
  font-size: 11px;
}
.api-example-label {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 10.5px;
  color: rgba(255,255,255,0.7);
}

/* "Try it out" placeholder — disabled until interactive testing ships. */
.tryit-btn {
  margin-left: auto;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted, #5b6b7b);
  background: #eef1f5;
  border: 1px solid var(--color-border, #cfd8e3);
  border-radius: 6px;
  padding: 4px 12px;
  cursor: not-allowed;
  opacity: .75;
}
.tryit-btn[disabled] { cursor: not-allowed; }

/* ---- Endpoint content tabs: Parameters (pills) + schema tree ---- */
.param-list { border: 1px solid var(--color-border, #e3e8ef); border-radius: 8px; overflow: hidden; }
.param-item { padding: 12px 14px; border-bottom: 1px solid var(--color-border, #eef1f5); }
.param-item:last-child { border-bottom: none; }
.param-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.param-name { font-family: var(--font-mono, monospace); font-weight: 700; font-size: 14px; color: var(--color-text, #1b2733); }
.param-desc { margin-top: 6px; font-size: 14px; color: var(--color-text-muted, #5b6b7b); }
.param-desc code, .st-desc code, .st-enum code { font-size: 12.5px; }

.pill { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .02em; border-radius: 4px; padding: 1px 8px; text-transform: uppercase; }
.pill-req  { color: #c0392b; background: #fdeceb; border: 1px solid #f3c6c1; }
.pill-cond { color: #8a6d1b; background: #fdf6ec; border: 1px solid #f0d9a8; }
.pill-opt  { color: var(--color-text-muted, #5b6b7b); background: #eef1f5; border: 1px solid var(--color-border, #cfd8e3); }
.pill-type { color: #0b66c3; background: #eaf2fb; border: 1px solid #cfe0f4; font-family: var(--font-mono, monospace); text-transform: none; }
.pill-loc  { color: var(--color-text-muted, #5b6b7b); background: #eef1f5; border: 1px solid var(--color-border, #cfd8e3); }

.schema-tree { font-family: var(--font-mono, monospace); font-size: 13px; border: 1px solid var(--color-border, #e3e8ef); border-radius: 8px; overflow: hidden; }
.st-node > .st-row { display: flex; align-items: flex-start; gap: 8px; padding: 7px 12px; border-bottom: 1px solid #eef1f5; }
.st-node:last-child > .st-row { border-bottom: none; }
.st-row:hover { background: #fafbfc; }
.st-toggle { width: 14px; flex-shrink: 0; cursor: pointer; color: var(--color-text-muted, #5b6b7b); user-select: none; text-align: center; }
.st-toggle.leaf { visibility: hidden; cursor: default; }
.st-name { font-weight: 700; color: var(--color-text, #1b2733); }
.st-type { color: #0b66c3; }
.st-req  { color: #c0392b; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.st-req.st-ctx { color: #8a6d1b; }
.st-enum { color: var(--color-text-muted, #5b6b7b); }
.st-desc { color: var(--color-text-muted, #5b6b7b); font-family: var(--font-sans, sans-serif); margin-left: auto; max-width: 46%; text-align: right; }
.st-children { margin-left: 18px; border-left: 1px solid var(--color-border, #e3e8ef); }
.st-node.collapsed > .st-children { display: none; }

/* ---- Shared content utilities ---- */
.docs-main .lead { font-size: 18px; line-height: 1.55; color: var(--color-text-muted, #5b6b7b); margin: 2px 0 18px; }
.tbc { display: inline-block; font-size: 11px; font-weight: 700; color: #8a6d1b; background: #fdf6ec; border: 1px solid #f0d9a8; border-radius: 4px; padding: 0 6px; vertical-align: middle; }
.req { color: #c0392b; font-weight: 700; }
.opt { color: var(--color-text-muted, #5b6b7b); }

/* ---- Legacy content compatibility (pages not yet fully re-authored) ---- */
/* Old callouts have no .callout-icon/.callout-body — render them as block, not flex. */
.callout:not(:has(> .callout-icon)) { display: block; }
.callout:not(:has(> .callout-icon)) > .callout-title { display: block; margin-bottom: 6px; text-transform: none; font-size: 14px; }
.callout:not(:has(> .callout-icon)) > p:last-child { margin-bottom: 0; }
/* Bare tables (not wrapped in .table-wrap). */
.docs-main table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 14px; }
.docs-main th, .docs-main td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--color-border, #e3e8ef); vertical-align: top; }
.docs-main thead th { background: #f4f6f9; font-weight: 700; }
/* Old tabsets: show panes stacked, each labelled by its data-title. */
.tabset { margin: 16px 0; }
.tabset .tab-pane { display: block; margin: 0 0 12px; }
.tabset .tab-pane[data-title]::before { content: attr(data-title); display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--color-text-muted, #5b6b7b); font-weight: 700; margin-bottom: 4px; }
.api-example .copy-btn {
  font-size: 11px;
  padding: 3px 10px;
}
/* No-body placeholder */
.api-no-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  color: var(--color-text-muted);
  font-size: 13px;
  padding: 24px;
  font-style: italic;
}
/* Nav Cards (Recipes index) */
.nav-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  text-decoration: none;
  color: var(--color-text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.nav-card { transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), transform 0.18s var(--ease); }
.nav-card:hover { border-color: var(--color-accent); box-shadow: var(--shadow-md); text-decoration: none; color: var(--color-text); transform: translateY(-3px); }
.nav-card-icon { font-size: 24px; flex-shrink: 0; line-height: 1; }
.nav-card-body { flex: 1; }
.nav-card-title { font-size: 14px; font-weight: 700; color: var(--color-primary); margin-bottom: 5px; }
.nav-card-desc { font-size: 13px; color: var(--color-text-muted); line-height: 1.5; margin-bottom: 6px; }
.nav-card-meta { font-size: 11.5px; color: var(--color-accent); font-weight: 600; }

@media (max-width: 860px) {
  .api-split { grid-template-columns: 1fr; }
  .api-fields { border-right: none; border-bottom: 1px solid var(--color-border); }
}
