/* ==========================================================================
   Outra PropertyAPI — Documentation theme
   Brand: periwinkle #4b57f2 · lime #c6f24e · charcoal ink #26262f
   Architecture:  (1) tokens  →  (2) base  →  (3) components
   Everything below is driven by the token layer in :root. Light + dark are
   both first-class; all colour pairs target WCAG AA. No external requests.
   ========================================================================== */

/* ============================ 1 · TOKENS ================================= */
:root {
  /* --- Outra brand --- */
  --brand:            #4b57f2;   /* periwinkle — primary accent */
  --brand-600:        #3b46e0;
  --brand-700:        #313bce;   /* AA-safe link/text on white */
  --brand-300:        #8a92f8;
  --brand-200:        #b7bcfb;
  --brand-ink:        #26262f;   /* charcoal */
  --lime:             #c6f24e;   /* positive accent / GET */
  --lime-600:         #a9d92f;
  --lime-ink:         #3f4a0d;   /* readable text on lime */
  --violet:           #7b6cf6;

  /* --- neutral ramp (cool, faint indigo bias — chosen, not default grey) --- */
  --gray-50:  #f6f7fb;
  --gray-100: #eef0f6;
  --gray-150: #e8eaf3;
  --gray-200: #e2e4ef;
  --gray-300: #d0d3e2;
  --gray-400: #a7abbe;
  --gray-500: #7d8095;
  --gray-600: #5c5f72;
  --gray-700: #474a5c;
  --gray-800: #2f313f;
  --gray-900: #21222e;
  --gray-950: #16161d;

  /* --- state colours --- */
  --ok:      #1f9d57;  --ok-tint:   #e7f6ee;
  --warn:    #c47d10;  --warn-tint: #fbf1dd;
  --danger:  #d83a3f;  --danger-tint:#fbe6e6;
  --info:    var(--brand-700); --info-tint: #eceefe;

  /* --- HTTP method colours --- */
  --m-get:    var(--lime);     --m-get-ink:    var(--lime-ink);
  --m-post:   var(--brand);    --m-post-ink:   #ffffff;
  --m-put:    #f0a028;         --m-put-ink:    #3a2807;
  --m-patch:  #12b6a5;         --m-patch-ink:  #04302b;
  --m-delete: #e5484d;         --m-delete-ink: #ffffff;

  /* --- semantic surfaces / text / border (light) --- */
  --bg:            #ffffff;
  --bg-subtle:     #f6f7fb;
  --bg-raised:     #ffffff;
  --surface-2:     #eef0f6;
  --inline-code-bg:#eef0f7;

  --sidebar-bg:    #fbfbfe;
  --sidebar-fg:    #494c60;
  --sidebar-dim:   #83869b;

  --text:      #2b2d3a;   /* body — ~12:1 on white */
  --text-2:    #51546a;   /* secondary — ~6.6:1 */
  --text-3:    #66697f;   /* meta — ~5.2:1 (AA) */
  --heading:   #1b1c27;
  --border:    #e7e8f1;
  --border-2:  #d5d7e4;
  --link:      var(--brand-700);
  --link-hover:var(--brand-600);

  /* --- brand gradients (used sparingly: hero, focus glow, accents) --- */
  --grad-brand:  linear-gradient(135deg, #5a67f5 0%, #4b57f2 52%, #3b46e0 100%);
  --grad-violet: linear-gradient(120deg, var(--brand) 0%, var(--violet) 100%);
  --grad-lime:   linear-gradient(120deg, var(--brand) 0%, var(--lime-600) 120%);
  --grad-line:   linear-gradient(90deg, var(--brand), var(--lime));

  /* --- elevation (ambient + key) + focus ring --- */
  --shadow-1: 0 1px 2px rgba(24,26,42,.06), 0 1px 1px rgba(24,26,42,.04);
  --shadow-2: 0 2px 4px rgba(24,26,42,.05), 0 4px 12px rgba(24,26,42,.07);
  --shadow-3: 0 8px 24px rgba(24,26,42,.10), 0 2px 6px rgba(24,26,42,.06);
  --shadow-4: 0 18px 48px rgba(24,26,42,.16), 0 6px 16px rgba(24,26,42,.08);
  --ring:     0 0 0 3px color-mix(in srgb, var(--brand) 28%, transparent);
  --ring-lime:0 0 0 3px color-mix(in srgb, var(--lime) 45%, transparent);

  /* --- radii --- */
  --r-1: 6px; --r-2: 9px; --r-3: 13px; --r-4: 18px; --r-pill: 999px;

  /* --- spacing (8pt) --- */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;

  /* --- type scale (1.20) --- */
  --fs-xs: 12px; --fs-sm: 13px; --fs-base: 15.5px; --fs-md: 16px;
  --fs-lg: 18.5px; --fs-h4: 16px; --fs-h3: 20px; --fs-h2: 24px;
  --fs-h1: clamp(30px, 2.2vw + 20px, 40px);
  --fs-hero: clamp(32px, 3vw + 18px, 46px);
  --lh:      1.65;
  --measure: 72ch;

  /* --- motion --- */
  --dur-1: 120ms; --dur-2: 180ms; --dur-3: 240ms; --dur-4: 380ms;
  --ease:       cubic-bezier(.4, 0, .2, 1);
  --ease-out:   cubic-bezier(.16, 1, .3, 1);
  --ease-spring:cubic-bezier(.22, 1.2, .36, 1);

  /* --- layout --- */
  --sidebar-w: 290px;
  --toc-w:     232px;
  --content-max: 830px;
  --header-h:  64px;

  --font-sans: "Inter var", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, "SF Mono", Menlo,
               Consolas, "Liberation Mono", monospace;

  /* code console (dark in both themes) */
  --code-bg:   #191921;
  --code-bar:  #14141b;
  --code-edge: #2a2a37;
  --code-fg:   #d9d9e6;
}

/* --- dark theme --- */
[data-theme="dark"] {
  --bg:            #131319;
  --bg-subtle:     #1a1a22;
  --bg-raised:     #1c1c26;
  --surface-2:     #23232f;
  --inline-code-bg:#24242f;

  --sidebar-bg:    #0f0f15;
  --sidebar-fg:    #b6b8c8;
  --sidebar-dim:   #75788c;

  --text:      #d6d7e2;
  --text-2:    #a6a8ba;
  --text-3:    #8a8ca0;
  --heading:   #f3f3f8;
  --border:    #2a2a37;
  --border-2:  #3a3a49;
  --link:      #a3aaff;
  --link-hover:#c0c5ff;

  --brand-700: #a3aaff;         /* AA-safe brand on dark */
  --ok:  #45cf83; --ok-tint:  rgba(46,180,110,.15);
  --warn:#e6ad4b; --warn-tint:rgba(214,150,40,.15);
  --danger:#ff6b70; --danger-tint:rgba(220,70,75,.16);
  --info: #a3aaff; --info-tint: rgba(75,87,242,.18);
  --m-post-ink: #ffffff;

  --shadow-1: 0 1px 2px rgba(0,0,0,.5);
  --shadow-2: 0 2px 6px rgba(0,0,0,.5);
  --shadow-3: 0 10px 30px rgba(0,0,0,.55);
  --shadow-4: 0 22px 60px rgba(0,0,0,.62);
  --ring:     0 0 0 3px color-mix(in srgb, var(--brand-300) 40%, transparent);

  --code-bg:   #14141b;
  --code-bar:  #101017;
  --code-edge: #2a2a37;
  --code-fg:   #d4d5e4;
}

/* ============================ 2 · BASE ================================== */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}
body {
  margin: 0; font-family: var(--font-sans);
  font-size: var(--fs-md); line-height: var(--lh);
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-feature-settings: "cv02","cv03","cv04","ss01";
}
a { color: var(--link); text-decoration: none; transition: color var(--dur-1) var(--ease); }
a:hover { color: var(--link-hover); }
img { max-width: 100%; }
::selection { background: color-mix(in srgb, var(--brand) 28%, transparent); }
:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px; border-radius: var(--r-1);
}
[data-theme="dark"] :focus-visible { outline-color: var(--brand-300); }

/* accessible skip link */
.skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 200;
  transform: translateY(-160%); transition: transform var(--dur-2) var(--ease);
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: var(--r-2);
  font-weight: 600; font-size: var(--fs-sm); box-shadow: var(--shadow-3);
}
.skip-link:focus { transform: translateY(0); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}

/* reading-progress bar */
.progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: var(--grad-line); z-index: 90; border-radius: 0 2px 2px 0;
  transition: width var(--dur-1) linear; pointer-events: none;
}

/* ============================ layout =================================== */
.layout { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

/* ============================ header =================================== */
.header {
  position: sticky; top: 0; z-index: 40; height: var(--header-h);
  display: flex; align-items: center; gap: var(--s-3); padding: 0 var(--s-6);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border); grid-column: 2 / 3;
}
.header__spacer { flex: 1; }
.header__search {
  display: inline-flex; align-items: center; gap: var(--s-2); height: 38px;
  padding: 0 12px; min-width: 246px; background: var(--bg-subtle);
  border: 1px solid var(--border); border-radius: var(--r-2); color: var(--text-3);
  cursor: text; font-size: var(--fs-sm); font-family: inherit;
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease), background var(--dur-1) var(--ease);
}
.header__search:hover { border-color: var(--brand); box-shadow: var(--ring); color: var(--text-2); }
.header__search .placeholder { margin-right: 4px; }
.header__search kbd, .search-modal__input kbd {
  font-family: var(--font-mono); font-size: 11px; line-height: 1;
  background: var(--bg); border: 1px solid var(--border-2); border-radius: var(--r-1);
  padding: 3px 6px; color: var(--text-3);
}
.header__search kbd { margin-left: auto; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid var(--border); border-radius: var(--r-2); background: var(--bg-subtle);
  color: var(--text-2); cursor: pointer; transition: color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.icon-btn:hover { color: var(--heading); border-color: var(--border-2); background: var(--surface-2); }
.icon-btn:active { transform: translateY(1px); }
.header__menu { display: none; }

/* theme toggle — animated sun/moon crossfade */
#themeToggle .moon, #themeToggle .sun { grid-area: 1 / 1; transition: opacity var(--dur-2) var(--ease), transform var(--dur-3) var(--ease-spring); }
#themeToggle .moon { opacity: 0; transform: rotate(-40deg) scale(.6); }
#themeToggle .sun  { opacity: 1; transform: rotate(0) scale(1); }
[data-theme="dark"] #themeToggle .sun  { opacity: 0; transform: rotate(40deg) scale(.6); }
[data-theme="dark"] #themeToggle .moon { opacity: 1; transform: rotate(0) scale(1); }

/* version switcher (styled, non-functional placeholder) */
.version-switch {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 11px;
  background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--r-2);
  color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; cursor: pointer;
  font-family: var(--font-mono); transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.version-switch:hover { border-color: var(--border-2); background: var(--surface-2); }
.version-switch .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime-600); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lime) 30%, transparent); }
.version-switch svg { color: var(--text-3); }
@media (max-width: 720px){ .version-switch { display: none; } }

/* ============================ sidebar ================================== */
.sidebar {
  grid-row: 1 / 3; grid-column: 1 / 2; position: sticky; top: 0; align-self: start;
  height: 100vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--sidebar-bg); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; scrollbar-width: thin;
}
.brand {
  display: flex; align-items: center; gap: var(--s-3); padding: 0 var(--s-5); height: var(--header-h);
  flex: none; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--sidebar-bg); z-index: 2;
}
.brand:hover { color: inherit; }
.brand__logo { width: 30px; height: 30px; flex: none; border-radius: 8px; box-shadow: var(--shadow-1); }
.brand__word { font-size: 24px; font-weight: 800; letter-spacing: -0.035em; color: var(--brand-ink); line-height: 1; }
[data-theme="dark"] .brand__word { color: #f4f4f8; }
.brand__dot { color: var(--brand); }
.brand__sep { width: 1px; height: 22px; background: var(--border-2); }
.brand__name { color: var(--heading); font-weight: 700; font-size: 13px; letter-spacing: -0.01em; line-height: 1.15; }
.brand__name small { display: block; color: var(--text-3); font-weight: 600; font-size: 10.5px; letter-spacing: .02em; }

.nav { padding: var(--s-3) var(--s-3) var(--s-5); flex: 1; }
.nav__group { margin-top: var(--s-4); }
.nav__group:first-child { margin-top: var(--s-2); }
.nav__group-head {
  width: 100%; display: flex; align-items: center; gap: 6px; padding: 6px 12px;
  background: none; border: 0; cursor: pointer; color: var(--sidebar-dim);
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  font-family: inherit; text-align: left;
}
.nav__group-head:hover { color: var(--text-2); }
.nav__group-head .chev {
  margin-left: auto; width: 13px; height: 13px; color: var(--sidebar-dim);
  transition: transform var(--dur-2) var(--ease); flex: none;
}
.nav__group.is-collapsed .chev { transform: rotate(-90deg); }
.nav__list {
  display: grid; grid-template-rows: 1fr; transition: grid-template-rows var(--dur-3) var(--ease);
}
.nav__group.is-collapsed .nav__list { grid-template-rows: 0fr; }
.nav__list-inner { overflow: hidden; min-height: 0; }
.nav__link {
  position: relative; display: flex; align-items: center; gap: 9px; padding: 7px 12px; margin: 1px 0;
  border-radius: var(--r-2); color: var(--sidebar-fg); font-size: 14px; font-weight: 500;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.nav__link::before {
  content: ""; position: absolute; left: 3px; top: 50%; transform: translateY(-50%) scaleY(0);
  width: 3px; height: 17px; border-radius: 3px; background: var(--brand);
  transition: transform var(--dur-2) var(--ease-spring);
}
.nav__link:hover { background: color-mix(in srgb, var(--brand) 6%, transparent); color: var(--heading); }
.nav__link.is-active {
  background: color-mix(in srgb, var(--brand) 11%, transparent);
  color: var(--brand-700); font-weight: 650;
}
.nav__link.is-active::before { transform: translateY(-50%) scaleY(1); }
[data-theme="dark"] .nav__link.is-active { color: #c3c8ff; }
.nav__link > span:last-child { min-width: 0; }
.nav__link .method {
  font-size: 9px; font-weight: 800; letter-spacing: .03em; padding: 2px 5px;
  border-radius: 5px; flex: none; font-family: var(--font-mono);
}
.nav__link .method.get { color: var(--m-get-ink); background: var(--m-get); }

/* sidebar footer */
.sidebar__footer {
  flex: none; border-top: 1px solid var(--border); padding: 12px 18px;
  display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--text-3);
  position: sticky; bottom: 0; background: var(--sidebar-bg);
}
.sidebar__footer .ver { font-family: var(--font-mono); color: var(--text-2); font-weight: 600; }
.sidebar__footer .made { margin-left: auto; }
.sidebar__footer a { color: var(--text-3); text-decoration: underline; text-decoration-color: var(--border-2); text-underline-offset: 2px; }
.sidebar__footer a:hover { color: var(--link); }

/* scroll shadow cue */
.sidebar { --sh: 0; }
.nav { position: relative; }

/* ============================ main / article ========================== */
.main { grid-column: 2 / 3; display: block; }
.container {
  display: grid; grid-template-columns: minmax(0, 1fr) var(--toc-w); gap: var(--s-7);
  max-width: 1220px; margin: 0 auto; padding: var(--s-7) var(--s-6) var(--s-9);
}
.article { min-width: 0; max-width: var(--content-max); }
@media (prefers-reduced-motion: no-preference) {
  .article { animation: article-in var(--dur-4) var(--ease-out) both; }
  @keyframes article-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

.breadcrumb { display: flex; gap: 8px; align-items: center; font-size: var(--fs-sm); color: var(--text-3); margin-bottom: var(--s-4); flex-wrap: wrap; }
.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--link); }
.breadcrumb span { opacity: .45; }

.article h1 { font-size: var(--fs-h1); line-height: 1.1; letter-spacing: -0.022em; color: var(--heading); margin: var(--s-1) 0 var(--s-3); font-weight: 800; text-wrap: balance; }
.article h2 {
  font-size: var(--fs-h2); line-height: 1.25; letter-spacing: -0.017em; color: var(--heading);
  margin: var(--s-7) 0 var(--s-4); font-weight: 750; scroll-margin-top: 84px; text-wrap: balance;
}
.article h3 { font-size: var(--fs-h3); letter-spacing: -0.012em; color: var(--heading); margin: var(--s-6) 0 var(--s-2); font-weight: 700; scroll-margin-top: 84px; text-wrap: balance; }
.article h4 { font-size: var(--fs-h4); color: var(--heading); margin: var(--s-5) 0 var(--s-2); font-weight: 700; }
.anchor { color: var(--text-3); opacity: 0; margin-left: 8px; font-weight: 400; transition: opacity var(--dur-1) var(--ease), color var(--dur-1) var(--ease); }
.anchor:hover { color: var(--link); }
h2:hover .anchor, h3:hover .anchor, h2:focus-within .anchor, h3:focus-within .anchor { opacity: 1; }

.article p { margin: 0 0 var(--s-4); color: var(--text); max-width: var(--measure); }
.article > p, .article > ul, .article > ol { max-width: var(--measure); }
.article strong { color: var(--heading); font-weight: 650; }
.lead { font-size: var(--fs-lg); line-height: 1.6; color: var(--text-2); margin: var(--s-1) 0 var(--s-5); max-width: var(--measure); }
.lead p { margin: 0 0 10px; color: inherit; font-size: inherit; }
.lead p:last-child { margin-bottom: 0; }
.card p:last-child, .usecase p:last-child, .hero p:last-child { margin-bottom: 0; }

.article ul, .article ol { margin: 0 0 var(--s-4); padding-left: 22px; }
.article li { margin: 6px 0; }
.article li::marker { color: var(--brand); }

:not(pre) > code {
  font-family: var(--font-mono); font-size: 0.86em; background: var(--inline-code-bg);
  color: var(--heading); padding: 2px 6px; border-radius: var(--r-1);
  border: 1px solid color-mix(in srgb, var(--border) 65%, transparent); word-break: break-word;
}

/* ============================ code blocks ============================= */
.code-block { position: relative; margin: var(--s-4) 0 var(--s-5); border-radius: var(--r-3); overflow: hidden; border: 1px solid var(--code-edge); background: var(--code-bg); box-shadow: var(--shadow-2); }
.code-block__bar { display: flex; align-items: center; gap: 10px; padding: 9px 14px; background: var(--code-bar); border-bottom: 1px solid var(--code-edge); }
.code-block__lang { font-family: var(--font-mono); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: #8b8ca6; font-weight: 600; }
.code-block__dots { display: inline-flex; gap: 6px; margin-right: 2px; }
.code-block__dots i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.code-block__dots i:nth-child(1){ background:#ff5f57; } .code-block__dots i:nth-child(2){ background:#febc2e; } .code-block__dots i:nth-child(3){ background:#28c840; }
.code-block__copy, .console__copy {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  color: #adaecb; cursor: pointer; background: rgba(255,255,255,.05); border: 1px solid #34344a;
  border-radius: var(--r-1); padding: 4px 9px; font-family: inherit;
  transition: color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.code-block__copy:hover, .console__copy:hover { color: #fff; border-color: var(--brand); background: color-mix(in srgb, var(--brand) 22%, transparent); }
.code-block__copy.copied, .console__copy.copied { color: var(--lime); border-color: color-mix(in srgb, var(--lime) 55%, transparent); }
.code-block__copy .check, .console__copy .check { display: none; }
.code-block__copy.copied .check, .console__copy.copied .check { display: inline-flex; }
.code-block__copy.copied .ic, .console__copy.copied .ic { display: none; }
.code-block pre, .console pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-family: var(--font-mono); font-size: 13px; line-height: 1.72; box-shadow: inset 0 1px 0 rgba(255,255,255,.02); }
.code-block code, .console code { font-family: var(--font-mono); color: var(--code-fg); background: none; border: none; padding: 0; }
.code-block pre::-webkit-scrollbar, .console pre::-webkit-scrollbar { height: 9px; }
.code-block pre::-webkit-scrollbar-thumb, .console pre::-webkit-scrollbar-thumb { background: #3a3a4c; border-radius: 6px; }

/* syntax tokens — tuned for the dark console (both themes) */
.tok-key    { color: #99a0ff; }
.tok-key-mod{ color: #f0a6d8; }   /* $CONFIDENCE / $MODELLED companion keys */
.tok-string { color: #cbe86a; }
.tok-number { color: #ffcf8a; }
.tok-bool   { color: #ff9e73; font-weight: 600; }
.tok-null   { color: #ff8aa6; }
.tok-punct  { color: #7f8098; }
.tok-cmd    { color: #cbe86a; font-weight: 700; }
.tok-flag   { color: #99a0ff; }
.tok-url    { color: #7ee0d0; text-decoration: underline; text-decoration-color: rgba(126,224,208,.35); text-underline-offset: 2px; }
.tok-comment{ color: #6c6c82; font-style: italic; }

/* ---- tabbed API console (renderer groups Request + Response) ---- */
.console { margin: var(--s-4) 0 var(--s-6); border-radius: var(--r-3); overflow: hidden; border: 1px solid var(--code-edge); background: var(--code-bg); box-shadow: var(--shadow-3); }
.console__bar { display: flex; align-items: center; gap: 12px; padding: 0 12px 0 14px; background: var(--code-bar); border-bottom: 1px solid var(--code-edge); min-height: 44px; }
.console__dots { display: inline-flex; gap: 6px; flex: none; }
.console__dots i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.console__dots i:nth-child(1){ background:#ff5f57; } .console__dots i:nth-child(2){ background:#febc2e; } .console__dots i:nth-child(3){ background:#28c840; }
.console__tabs { display: inline-flex; align-self: stretch; gap: 2px; margin-left: 4px; }
.console__tab {
  position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 0 13px;
  background: none; border: 0; cursor: pointer; color: #9091ad; font-family: inherit;
  font-size: 12.5px; font-weight: 600; letter-spacing: .01em; transition: color var(--dur-1) var(--ease);
}
.console__tab .verb { font-family: var(--font-mono); font-size: 9.5px; font-weight: 800; padding: 1px 5px; border-radius: 4px; background: rgba(255,255,255,.08); color: #c3c4e0; }
.console__tab:hover { color: #e7e7f4; }
.console__tab.is-active { color: #fff; }
.console__tab::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 0; height: 2px; border-radius: 2px 2px 0 0; background: var(--brand); transform: scaleX(0); transition: transform var(--dur-2) var(--ease-spring); }
.console__tab.is-active::after { transform: scaleX(1); }
.console__lang { margin-left: auto; font-family: var(--font-mono); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: #8b8ca6; font-weight: 600; }
.console__copy { margin-left: 0; }
.console__panel { display: none; }
.console__panel.is-active { display: block; animation: panel-in var(--dur-2) var(--ease-out) both; }
@keyframes panel-in { from { opacity: 0; } to { opacity: 1; } }
.console__panel > p { margin: 0; padding: 13px 18px 0; color: #9ca0bd; font-size: 12.5px; font-family: var(--font-mono); line-height: 1.5; }
.console__panel > p code { color: #cbe86a; font-size: 12px; background: none; border: none; padding: 0; }
.console__panel > p strong { color: #d6d7e6; font-weight: 600; }

/* ============================ endpoint header ========================= */
.endpoint {
  position: relative; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: var(--s-2) 0 var(--s-6); padding: 16px 18px; border-radius: var(--r-3);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--brand) 5%, var(--bg-raised)), var(--bg-raised));
  border: 1px solid var(--border); box-shadow: var(--shadow-1);
}
.endpoint::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--grad-brand); border-radius: var(--r-3) 0 0 var(--r-3); }
.endpoint__req { display: flex; align-items: center; gap: 12px; flex-wrap: nowrap; min-width: 0; flex: 1 1 auto; }
.method-badge { font-family: var(--font-mono); font-weight: 800; font-size: 12px; letter-spacing: .04em; padding: 5px 11px; border-radius: var(--r-1); flex: none; box-shadow: var(--shadow-1); }
.method-badge.get    { background: var(--m-get);    color: var(--m-get-ink); }
.method-badge.post   { background: var(--m-post);   color: var(--m-post-ink); }
.method-badge.put    { background: var(--m-put);    color: var(--m-put-ink); }
.method-badge.patch  { background: var(--m-patch);  color: var(--m-patch-ink); }
.method-badge.delete { background: var(--m-delete); color: var(--m-delete-ink); }
.endpoint__path { flex: 1 1 auto; min-width: 0; font-family: var(--font-mono); font-size: 14px; color: var(--heading); font-weight: 600; word-break: break-all; }
.endpoint__base { color: var(--text-3); font-weight: 500; }
.endpoint__copy {
  display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none;
  border: 1px solid var(--border-2); border-radius: var(--r-2); background: var(--bg-subtle);
  color: var(--text-2); cursor: pointer; transition: color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.endpoint__copy:hover { color: var(--brand-700); border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, transparent); }
.endpoint__copy.copied { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 55%, transparent); }
.endpoint__copy .check { display: none; } .endpoint__copy.copied .check { display: inline-flex; } .endpoint__copy.copied .ic { display: none; }
.endpoint__chips { display: inline-flex; gap: 7px; flex-wrap: wrap; margin-left: auto; }
.endpoint__chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600;
  padding: 4px 10px; border-radius: var(--r-pill); border: 1px solid var(--border-2);
  background: var(--bg-subtle); color: var(--text-2);
}
.endpoint__chip svg { width: 13px; height: 13px; color: var(--text-3); }
.endpoint__chip.auth { color: var(--brand-700); border-color: color-mix(in srgb, var(--brand) 30%, transparent); background: color-mix(in srgb, var(--brand) 8%, transparent); }
.endpoint__chip.auth svg { color: var(--brand-700); }

/* ============================ callouts ================================ */
.callout { display: flex; gap: 13px; margin: var(--s-5) 0; padding: 15px 17px; border-radius: var(--r-3); border: 1px solid var(--border); background: var(--bg-subtle); border-left: 3px solid var(--brand); }
.callout__icon { flex: none; width: 20px; height: 20px; margin-top: 2px; color: var(--brand); }
.callout__body { min-width: 0; }
.callout__title { font-weight: 700; color: var(--heading); margin: 0 0 3px; font-size: 14.5px; letter-spacing: -.005em; }
.callout__body :last-child { margin-bottom: 0; }
.callout--note      { border-left-color: var(--brand); background: color-mix(in srgb, var(--brand) 5%, var(--bg-subtle)); } .callout--note .callout__icon { color: var(--brand-700); }
.callout--tip       { border-left-color: var(--lime-600); background: color-mix(in srgb, var(--lime) 13%, var(--bg-subtle)); } .callout--tip .callout__icon { color: var(--lime-ink); }
[data-theme="dark"] .callout--tip { background: color-mix(in srgb, var(--lime) 8%, var(--bg-subtle)); } [data-theme="dark"] .callout--tip .callout__icon { color: var(--lime); }
.callout--warning   { border-left-color: var(--warn); background: var(--warn-tint); } .callout--warning .callout__icon { color: var(--warn); }
.callout--important { border-left-color: var(--violet); background: color-mix(in srgb, var(--violet) 9%, var(--bg-subtle)); } .callout--important .callout__icon { color: var(--violet); }

/* ============================ tables ================================== */
.table-wrap { margin: var(--s-5) 0; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-3); box-shadow: var(--shadow-1); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
thead th {
  position: sticky; top: 0; text-align: left; font-weight: 700; color: var(--heading);
  background: var(--bg-subtle); padding: 11px 15px; border-bottom: 1px solid var(--border-2);
  white-space: nowrap; font-size: 12.5px; letter-spacing: .02em;
}
tbody td { padding: 12px 15px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: top; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--dur-1) var(--ease); }
tbody tr:hover td { background: color-mix(in srgb, var(--brand) 5%, transparent); }
td code, th code { white-space: nowrap; }
td:first-child code { color: var(--brand-700); }
[data-theme="dark"] td:first-child code { color: #b4baff; }
.req-yes, .req-no { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: var(--r-pill); letter-spacing: .01em; }
.req-yes { color: var(--brand-700); background: color-mix(in srgb, var(--brand) 12%, transparent); }
.req-yes::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--brand); }
.req-no { color: var(--text-3); background: var(--surface-2); }

/* pills */
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin: var(--s-3) 0 var(--s-5); }
.pill { font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--text-2); background: var(--bg-subtle); border: 1px solid var(--border-2); border-radius: var(--r-pill); padding: 4px 12px; }
.pill.is-primary { color: #fff; background: var(--grad-violet); border: none; box-shadow: var(--shadow-1); }
[data-theme="dark"] .pill.is-primary { color: #fff; }

/* ============================ field cards ============================= */
.fieldset { margin: var(--s-4) 0 var(--s-5); border: 1px solid var(--border); border-radius: var(--r-3); overflow: hidden; box-shadow: var(--shadow-1); background: var(--bg-raised); }
.fieldset__head { padding: 12px 16px; background: var(--bg-subtle); border-bottom: 1px solid var(--border); font-weight: 700; color: var(--heading); display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.fieldset__head .pill { margin-left: auto; }
.fieldset__body { padding: 2px 16px; }
.field { display: grid; grid-template-columns: 232px 1fr; gap: 18px; padding: 12px 0; border-bottom: 1px solid var(--border); align-items: baseline; }
.field:last-child { border-bottom: none; }
.field__name { font-family: var(--font-mono); font-size: 13px; color: var(--brand-700); font-weight: 600; word-break: break-word; }
[data-theme="dark"] .field__name { color: #b4baff; }
.field__desc { color: var(--text-2); font-size: 14px; }
.field__desc :last-child { margin-bottom: 0; }
@media (max-width: 620px){ .field { grid-template-columns: 1fr; gap: 3px; } }

/* ============================ use-case grid =========================== */
.usecases { display: grid; grid-template-columns: repeat(auto-fit, minmax(224px, 1fr)); gap: 14px; margin: var(--s-4) 0 var(--s-5); }
.usecase { padding: 16px 17px; border: 1px solid var(--border); border-radius: var(--r-3); background: var(--bg-raised); box-shadow: var(--shadow-1); transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease); }
.usecase:hover { transform: translateY(-2px); box-shadow: var(--shadow-3); border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); }
.usecase__title { font-weight: 700; color: var(--heading); margin: 0 0 5px; font-size: 14.5px; display: flex; align-items: center; gap: 9px; }
.usecase__title::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 2px; background: var(--grad-line); flex: none; }
.usecase p { margin: 0; font-size: 13.5px; color: var(--text-2); }

/* ============================ hero (home) ============================= */
.hero {
  margin: var(--s-1) 0 var(--s-6); padding: clamp(28px, 4vw, 44px); border-radius: var(--r-4);
  position: relative; overflow: hidden; color: #fff; isolation: isolate;
  background: var(--grad-brand);
}
.hero::before { /* soft grain/noise + depth */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5; mix-blend-mode: overlay;
  background-image: radial-gradient(rgba(255,255,255,.14) 1px, transparent 1px);
  background-size: 4px 4px;
}
.hero::after { content:""; position:absolute; right:-60px; top:-70px; width:300px; height:300px; z-index:-1; border-radius:50%; background: radial-gradient(circle, rgba(198,242,78,.34), transparent 62%); pointer-events:none; }
.hero h1 { color: #fff; margin: 0 0 12px; font-size: var(--fs-hero); line-height: 1.05; letter-spacing: -.02em; position: relative; text-wrap: balance; }
.hero p { color: #e9ebff; font-size: clamp(15px, 1vw + 12px, 17.5px); max-width: 60ch; position: relative; margin: 0; }
.hero__tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; position: relative; }
.hero__tags span { font-size: 12.5px; font-weight: 600; color: #fff; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.24); border-radius: var(--r-pill); padding: 5px 13px; backdrop-filter: blur(4px); }
.hero__tags span:first-child { background: var(--lime); color: var(--lime-ink); border-color: transparent; }

/* ============================ cards (home) =========================== */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(218px, 1fr)); gap: 14px; margin: var(--s-5) 0; }
.card { position: relative; display: block; padding: 19px; border: 1px solid var(--border); border-radius: var(--r-3); background: var(--bg-raised); box-shadow: var(--shadow-1); overflow: hidden; transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease); }
.card::after { /* directional sheen on hover */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(120deg, transparent 30%, color-mix(in srgb, var(--brand) 10%, transparent) 50%, transparent 70%);
  transition: opacity var(--dur-3) var(--ease); }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-3); border-color: color-mix(in srgb, var(--brand) 50%, var(--border)); }
.card:hover::after { opacity: 1; }
.card__title { font-weight: 700; color: var(--heading); font-size: 15.5px; margin: 0 0 5px; display: flex; align-items: center; gap: 8px; }
.card__title .method { font-family: var(--font-mono); font-size: 9.5px; font-weight: 800; padding: 2px 6px; border-radius: 5px; background: var(--m-get); color: var(--m-get-ink); margin-left: auto; }
.card p { margin: 0; color: var(--text-2); font-size: 13.5px; }

/* ============================ prev / next ============================= */
.pager { display: flex; gap: 14px; margin-top: var(--s-8); padding-top: var(--s-5); border-top: 1px solid var(--border); }
.pager a { flex: 1; padding: 15px 18px; border: 1px solid var(--border); border-radius: var(--r-3); background: var(--bg-raised); transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), transform var(--dur-2) var(--ease); }
.pager a:hover { border-color: color-mix(in srgb, var(--brand) 50%, var(--border)); box-shadow: var(--shadow-2); transform: translateY(-2px); }
.pager a.next { text-align: right; }
.pager small { color: var(--text-3); font-size: 12px; display: block; margin-bottom: 3px; }
.pager b { color: var(--heading); font-weight: 650; }

/* ============================ right TOC =============================== */
.toc { position: sticky; top: calc(var(--header-h) + 30px); align-self: start; height: fit-content; font-size: 13px; }
.toc__title { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin: 0 0 10px; padding-left: 14px; }
.toc__list { position: relative; list-style: none; margin: 0; padding: 0; }
.toc__list::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--border); border-radius: 2px; }
.toc__marker { position: absolute; left: 0; width: 2px; height: 0; background: var(--brand); border-radius: 2px; transition: top var(--dur-3) var(--ease), height var(--dur-3) var(--ease), opacity var(--dur-2) var(--ease); opacity: 0; }
.toc a { display: block; padding: 5px 14px; color: var(--text-3); line-height: 1.4; transition: color var(--dur-1) var(--ease); }
.toc a:hover { color: var(--text); }
.toc a.is-active { color: var(--link); font-weight: 600; }
.toc a.lvl-3 { padding-left: 26px; font-size: 12.5px; }
.toc__top { margin-top: 14px; margin-left: 14px; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); background: none; border: 0; cursor: pointer; font-family: inherit; opacity: 0; pointer-events: none; transition: opacity var(--dur-2) var(--ease), color var(--dur-1) var(--ease); }
.toc__top.show { opacity: 1; pointer-events: auto; }
.toc__top:hover { color: var(--link); }

/* ============================ search palette ========================= */
.search-overlay { position: fixed; inset: 0; z-index: 100; display: none; background: rgba(16,16,26,.5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.search-overlay.open { display: block; }
.search-modal { max-width: 640px; margin: 10vh auto 0; background: var(--bg-raised); border: 1px solid var(--border-2); border-radius: var(--r-4); box-shadow: var(--shadow-4); overflow: hidden; }
@media (prefers-reduced-motion: no-preference) { .search-overlay.open .search-modal { animation: modal-in var(--dur-3) var(--ease-spring) both; } @keyframes modal-in { from { opacity: 0; transform: translateY(-10px) scale(.98); } to { opacity: 1; transform: none; } } }
.search-modal__input { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.search-modal__input input { flex: 1; border: none; background: none; outline: none; font-size: 16px; color: var(--text); font-family: var(--font-sans); }
.search-modal__input input::placeholder { color: var(--text-3); }
.search-modal__input svg { color: var(--text-3); flex: none; }
.search-results { max-height: 54vh; overflow-y: auto; padding: 8px; }
.search-results:empty::after { content: "Type to search the documentation…"; display: block; padding: 30px; text-align: center; color: var(--text-3); font-size: 14px; }
.search-group__label { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--text-3); padding: 12px 14px 5px; }
.search-result { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--r-2); }
.search-result:hover, .search-result.is-active { background: color-mix(in srgb, var(--brand) 8%, var(--bg-subtle)); }
.search-result__ico { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: var(--r-2); background: var(--surface-2); color: var(--text-3); }
.search-result.is-active .search-result__ico { background: var(--brand); color: #fff; }
.search-result__main { min-width: 0; flex: 1; }
.search-result__title { color: var(--heading); font-weight: 650; font-size: 14.5px; }
.search-result__snippet { color: var(--text-3); font-size: 12.5px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result mark { background: color-mix(in srgb, var(--lime) 60%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; font-weight: 600; }
.search-result__enter { flex: none; opacity: 0; color: var(--text-3); font-size: 11px; }
.search-result.is-active .search-result__enter { opacity: 1; }
.search-foot { display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--border); color: var(--text-3); font-size: 11.5px; }
.search-foot kbd { font-family: var(--font-mono); font-size: 10.5px; background: var(--bg-subtle); border: 1px solid var(--border-2); border-radius: 5px; padding: 2px 6px; margin-right: 4px; }
.search-foot .spacer { flex: 1; }

/* ============================ misc =================================== */
hr { border: none; border-top: 1px solid var(--border); margin: var(--s-6) 0; }
.backdrop { display: none; }

/* ============================ responsive ============================= */
@media (max-width: 1120px) {
  .container { grid-template-columns: minmax(0,1fr); gap: 0; }
  .toc { display: none; }
}
@media (max-width: 860px) {
  :root { --sidebar-w: 0px; }
  .layout { grid-template-columns: 1fr; }
  .header, .main { grid-column: 1 / -1; }
  .header__menu { display: inline-grid; }
  .sidebar { position: fixed; top: 0; left: 0; width: 300px; z-index: 60; transform: translateX(-100%); transition: transform var(--dur-3) var(--ease); box-shadow: var(--shadow-4); }
  .sidebar.open { transform: translateX(0); }
  .backdrop.show { display: block; position: fixed; inset: 0; background: rgba(16,16,26,.55); z-index: 55; animation: fade-in var(--dur-2) var(--ease) both; }
  @keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
  .container { padding: var(--s-5) var(--s-4) var(--s-8); }
  .header__search { min-width: 0; width: 42px; padding: 0; justify-content: center; }
  .header__search .placeholder, .header__search kbd { display: none; }
  .endpoint { gap: 10px; }
}
@media (max-width: 520px) {
  .search-modal { margin: 0; max-width: 100%; height: 100%; border-radius: 0; border: 0; }
  .search-results { max-height: calc(100vh - 132px); }
  .field { grid-template-columns: 1fr; }
}
