/* ============================================================
   Openprovider Developer Portal — theme
   Brand tokens mirror openprovider.com:
   red #D90D32 (hover #B50B2B, bright #F81B39) + navy #1B2331
   ============================================================ */

:root {
  /* Brand */
  --op-red: #D90D32;
  --op-red-bright: #F81B39;
  --op-red-dark: #B50B2B;
  --op-navy: #1B2331;
  --op-navy-2: #232A3B;
  --op-navy-deep: #0B1C32;

  /* Neutrals */
  --ink: #1B2331;
  --gray-800: #2B313F;
  --gray-700: #344054;
  --gray-600: #4B5565;
  --gray-500: #667085;
  --gray-400: #98A2B3;
  --gray-300: #D0D5DD;
  --gray-200: #E4E7EC;
  --gray-100: #F2F4F7;
  --gray-50:  #F8FAFC;
  --white: #ffffff;

  /* Accents */
  --green: #09B257;
  --blue: #1468B8;
  --blue-dark: #0B448A;
  --amber: #C77700;

  /* --- Semantic surfaces (flipped wholesale in dark mode) --- */
  --bg: #ffffff;
  --bg-alt: #F8FAFC;
  --surface: #ffffff;
  --surface-2: #F2F4F7;
  --surface-sunken: #F8FAFC;
  --border: #E4E7EC;
  --border-strong: #D0D5DD;
  --text: #344054;
  --text-muted: #667085;
  --text-faint: #98A2B3;
  --heading: #1B2331;
  --link: #D90D32;
  --link-hover: #B50B2B;
  --header-bg: rgba(255,255,255,.92);
  --footer-bg: #0B1C32;
  --code-bg: #11151F;
  --code-border: transparent;
  --code-text: #E6E9F0;
  --tint: rgba(217,13,50,.08);
  --solid-bg: #1B2331;        /* filled navy surfaces (CTA band, API buttons) */
  --solid-bg-2: #2A3346;

  /* Layout */
  --header-h: 64px;
  --maxw: 1200px;
  --radius: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.10);
  --shadow-md: 0 4px 6px -1px rgba(16,24,40,.10), 0 2px 4px -2px rgba(16,24,40,.10);
  --shadow-lg: 0 10px 15px -3px rgba(16,24,40,.10), 0 4px 6px -4px rgba(16,24,40,.10);
  --shadow-card: 0 2px 16px rgba(0,0,0,.06);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-heading: "Instrument Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;

  color-scheme: light;
}

/* Dark palette — applied from the OS preference unless the visitor pinned
   light, and always when they pinned dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B0D10;
    --bg-alt: #101317;
    --surface: #16191E;
    --surface-2: #1E2228;
    --surface-sunken: #0D0F13;
    --border: #262B32;
    --border-strong: #383F49;
    --text: #C8CCD2;
    --text-muted: #949AA3;
    --text-faint: #6E757E;
    --heading: #E8EAED;
    --link: #FF4D69;
    --link-hover: #FF8095;
    --header-bg: rgba(11,13,16,.92);
    --footer-bg: #08090B;
    --code-bg: #0E1114;
    --code-border: #2C323A;
    --code-text: #D7DBE1;
    --tint: rgba(248,27,57,.14);
    --solid-bg: #191D23;
    --solid-bg-2: #23272E;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.40);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.45);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.55);
    --shadow-card: 0 2px 16px rgba(0,0,0,.45);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0B0D10;
  --bg-alt: #101317;
  --surface: #16191E;
  --surface-2: #1E2228;
  --surface-sunken: #0D0F13;
  --border: #262B32;
  --border-strong: #383F49;
  --text: #C8CCD2;
  --text-muted: #949AA3;
  --text-faint: #6E757E;
  --heading: #E8EAED;
  --link: #FF4D69;
  --link-hover: #FF8095;
  --header-bg: rgba(11,13,16,.92);
  --footer-bg: #08090B;
  --code-bg: #0E1114;
  --code-border: #2C323A;
  --code-text: #D7DBE1;
  --tint: rgba(248,27,57,.14);
  --solid-bg: #191D23;
  --solid-bg-2: #23272E;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.40);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.45);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.55);
  --shadow-card: 0 2px 16px rgba(0,0,0,.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }

img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--heading); line-height: 1.2; margin: 0 0 .5em;
  font-weight: 600; letter-spacing: -.02em;
}

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

:where(a, button, summary, input):focus-visible {
  outline: 2px solid var(--op-red);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------------- Buttons ----------------
   Primary/secondary CTAs mirror openprovider.com: a brighter fill wipes in
   from the left on a clip-path transition while the arrow slides forward.
   The ::before sits at z-index:-1 so it paints over the button's own
   background but under the label, with no wrapper element needed. */
.btn {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 500; font-size: 15px; line-height: 1;
  padding: 12px 20px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer;
  transition: background-color .3s cubic-bezier(.4,0,.2,1), border-color .3s ease, color .3s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
  transition: clip-path .5s ease-out;
  will-change: clip-path;
}
.btn:hover::before, .btn:focus-visible::before {
  clip-path: polygon(-15% 0, 115% 0, 100% 100%, -15% 100%);
}
.btn:active { transform: translateY(.5px) scale(.99); }

/* Trailing arrow — rendered by CSS so labels stay plain text */
.btn-primary::after, .btn-secondary::after {
  content: "→";
  font-size: 1.05em; line-height: 1;
  opacity: .55; transform: translateX(-2px);
  transition: opacity .3s ease-out, transform .3s ease-out;
}
.btn-primary:hover::after, .btn-primary:focus-visible::after,
.btn-secondary:hover::after, .btn-secondary:focus-visible::after {
  opacity: 1; transform: translateX(3px);
}
.btn-noarrow::after { content: none; }

.btn-primary { background: var(--op-red); color: #fff; }
.btn-primary::before { background: var(--op-red-bright); }
.btn-primary:hover { color: #fff; }

.btn-secondary { background: var(--surface); color: var(--heading); border-color: var(--border-strong); }
.btn-secondary::before { background: var(--surface-2); }
.btn-secondary:hover { color: var(--heading); border-color: var(--text-faint); }

.btn-ghost { background: transparent; color: var(--heading); }
.btn-ghost::before { background: var(--surface-2); }
.btn-ghost:hover { color: var(--heading); }

.btn-lg { padding: 15px 28px; font-size: 16px; }

@media (prefers-reduced-motion: reduce) {
  .btn::before { transition: none; }
  .btn-primary::after, .btn-secondary::after { transition: none; }
}

/* ---------------- Header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}
.site-header .inner {
  max-width: var(--maxw); margin: 0 auto; height: 100%;
  padding: 0 24px; display: flex; align-items: center; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-logo { height: 26px; width: auto; }
.brand-logo-dark { display: none; }
.brand .divider { width: 1px; height: 22px; background: var(--border-strong); }
.brand .brand-text { font-family: var(--font-heading); font-size: 14.5px; font-weight: 600; color: var(--heading); letter-spacing: -.01em; }

:root[data-theme="dark"] .brand-logo-light { display: none; }
:root[data-theme="dark"] .brand-logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-logo-light { display: none; }
  :root:not([data-theme="light"]) .brand-logo-dark { display: block; }
}

.nav { display: flex; align-items: center; gap: 2px; margin-left: 4px; }
.nav a {
  color: var(--text-muted); font-weight: 500; font-size: 13.5px; white-space: nowrap;
  padding: 7px 10px; border-radius: 8px; transition: all .15s ease;
}
.nav a:hover { color: var(--heading); background: var(--surface-2); }
.nav a.active { color: var(--op-red); font-weight: 600; }

/* ---- Grouped nav item (API dropdown) ---- */
.nav-item { position: relative; }
.nav-trigger {
  display: inline-flex; align-items: center; gap: 4px;
  font: inherit; font-weight: 500; font-size: 13.5px; white-space: nowrap;
  color: var(--text-muted); background: none; border: 0; cursor: pointer;
  padding: 7px 10px; border-radius: 8px; transition: all .15s ease;
}
.nav-trigger:hover { color: var(--heading); background: var(--surface-2); }
.nav-trigger.active { color: var(--op-red); font-weight: 600; }
.nav-chev { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .18s ease; }
.nav-item.open .nav-chev { transform: rotate(180deg); }

.nav-menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 120;
  min-width: 250px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.nav-item.open .nav-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-menu a {
  display: block; padding: 9px 12px; border-radius: 8px;
  color: var(--text); font-size: 14px; font-weight: 500;
}
.nav-menu a .t { display: block; color: var(--heading); }
.nav-menu a .d { display: block; font-size: 12.5px; font-weight: 400; color: var(--text-muted); margin-top: 1px; }
.nav-menu a:hover { background: var(--surface-2); }
.nav-menu a:hover .t { color: var(--op-red); }
.nav-menu a.active .t { color: var(--op-red); font-weight: 600; }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.header-actions .btn { font-size: 13.5px; padding: 9px 16px; }

/* Language picker */
.lang-picker { position: relative; flex-shrink: 0; }
.lang-trigger {
  display: inline-flex; align-items: center; gap: 5px;
  height: 36px; padding: 0 9px;
  font: inherit; font-size: 12.5px; font-weight: 600; letter-spacing: .02em;
  background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-muted); cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.lang-trigger:hover { color: var(--heading); border-color: var(--border-strong); background: var(--surface-2); }
.lang-trigger .nav-chev { width: 13px; height: 13px; }
.lp-flag { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; display: block; }
.lang-picker.open .nav-chev { transform: rotate(180deg); }

.lang-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 120;
  min-width: 178px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.lang-picker.open .lang-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  color: var(--text); font-size: 14px; font-weight: 500;
}
.lang-menu a:hover { background: var(--surface-2); color: var(--heading); }
.lang-menu a.active { color: var(--op-red); font-weight: 600; }
.lang-menu .lp-flag { width: 22px; height: 22px; }

/* Theme toggle */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex-shrink: 0;
  background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-muted); cursor: pointer; padding: 0;
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.theme-toggle:hover { color: var(--heading); border-color: var(--border-strong); background: var(--surface-2); }
.theme-toggle svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle svg { width: 24px; height: 24px; stroke: var(--heading); fill: none; stroke-width: 2; stroke-linecap: round; }

@media (max-width: 1080px) {
  .nav, .header-actions .btn-secondary { display: none; }
  .site-header .inner { gap: 12px; }
  .header-actions { margin-left: auto; }
  .nav-toggle { display: block; margin-left: 4px; }
  .nav.open {
    display: flex; flex-direction: column; align-items: stretch;
    position: absolute; top: var(--header-h); left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 12px; gap: 2px; box-shadow: var(--shadow-lg);
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  }
  .nav.open a { padding: 13px 14px; font-size: 16px; display: flex; align-items: center; min-height: 44px; }

  /* The grouped item is flattened into a labelled section on mobile */
  .nav.open .nav-item { position: static; }
  .nav.open .nav-trigger {
    width: 100%; justify-content: flex-start; pointer-events: none;
    padding: 16px 14px 6px; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint);
  }
  .nav.open .nav-trigger.active { color: var(--text-faint); }
  .nav.open .nav-chev { display: none; }
  .nav.open .nav-menu {
    position: static; opacity: 1; visibility: visible; transform: none;
    min-width: 0; padding: 0; border: 0; border-radius: 0;
    background: none; box-shadow: none;
  }
  .nav.open .nav-menu a { display: block; min-height: 0; padding: 11px 14px; }
  .nav.open .nav-menu a .d { display: none; }
}

/* ---------------- Hero ---------------- */
.hero {
  background:
    radial-gradient(900px 380px at 88% -10%, var(--tint), transparent 60%),
    linear-gradient(180deg, var(--bg-alt), var(--bg));
  border-bottom: 1px solid var(--border);
  padding: 84px 0 72px;
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--op-red); background: var(--tint);
  padding: 6px 12px; border-radius: 999px; margin-bottom: 18px;
}
.hero h1 { font-size: 52px; font-weight: 600; letter-spacing: -.025em; margin-bottom: 18px; }
.hero h1 .accent { color: var(--op-red); }
.hero p.lead { font-size: 19px; color: var(--text-muted); max-width: 540px; margin-bottom: 30px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

@media (max-width: 880px) {
  .hero { padding: 56px 0 48px; }
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero h1 { font-size: 38px; }
}
.hero-grid > * { min-width: 0; }  /* let the code card shrink instead of overflowing */

/* Phones: drop the header CTA so brand + menu always fit (no h-scroll) */
@media (max-width: 480px) {
  .header-actions .btn-primary { display: none; }
  .hero h1 { font-size: 32px; }
}

/* ---------------- Code card ---------------- */
.code-card {
  background: var(--code-bg); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); overflow: hidden; border: 1px solid var(--code-border);
}
.code-card .bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; background: rgba(255,255,255,.04); border-bottom: 1px solid rgba(255,255,255,.08);
}
.code-card .bar .dot { width: 11px; height: 11px; border-radius: 50%; }
.code-card .bar .dot.r { background: #FF5F57; }
.code-card .bar .dot.y { background: #FEBC2E; }
.code-card .bar .dot.g { background: #28C840; }
.code-card .bar .label { margin-left: 8px; color: #8A94A6; font-size: 12px; font-family: var(--mono); }
.code-card pre {
  margin: 0; padding: 20px; overflow-x: auto;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.7; color: #E6E9F0;
}
.code-card .tok-method { color: #7EE787; font-weight: 700; }
.code-card .tok-url { color: #79C0FF; }
.code-card .tok-key { color: #FF7B95; }
.code-card .tok-str { color: #FFD9A0; }
.code-card .tok-cmt { color: #6B7689; }
.code-card .tok-num { color: #D2A8FF; }
.code-card .tok-ok { color: #C5F96A; }

/* Animated hero terminal: fixed height so the hero never reflows, with the
   transcript scrolling like a real session. */
#hero-terminal {
  height: 328px; overflow: hidden; white-space: pre-wrap; word-break: break-word;
}
.term-cursor {
  display: inline-block; width: 8px; height: 1em; margin-left: 1px;
  background: #7EE787; vertical-align: text-bottom;
  animation: term-blink 1.1s steps(1) infinite;
}
@keyframes term-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .term-cursor { animation: none; }
  #hero-terminal { height: auto; }
}
@media (max-width: 880px) { #hero-terminal { height: 280px; } }

/* ---------------- Sections ---------------- */
.section { padding: 76px 0; }
.section.alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section-head h2 { font-size: 34px; margin-bottom: 12px; }
.section-head p { font-size: 17px; color: var(--text-muted); margin: 0; }

/* ---------------- Cards grid ---------------- */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 900px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .card-grid { grid-template-columns: 1fr; } }

.api-card {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; transition: all .18s ease; height: 100%;
}
.api-card:hover { border-color: var(--op-red); box-shadow: var(--shadow-card); transform: translateY(-2px); }
.api-card .ic {
  width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: var(--tint); margin-bottom: 16px;
}
.api-card .ic svg { width: 24px; height: 24px; stroke: var(--op-red); fill: none; stroke-width: 2; }
.api-card h3 { font-size: 18px; margin-bottom: 6px; }
.api-card p { margin: 0 0 14px; color: var(--text-muted); font-size: 14.5px; }
.api-card .endpoints { display: flex; flex-wrap: wrap; gap: 6px; }
.api-card .ep {
  font-family: var(--mono); font-size: 11.5px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 3px 8px; border-radius: 6px;
}
.api-card .more { color: var(--op-red); font-weight: 600; font-size: 14px; }

/* ---------------- Steps ---------------- */
.steps { display: grid; gap: 20px; counter-reset: step; max-width: 820px; margin: 0 auto; }
.step {
  display: grid; grid-template-columns: 48px 1fr; gap: 20px; align-items: start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px;
}
.step .num {
  width: 40px; height: 40px; border-radius: 50%; background: var(--op-red); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px;
}
.step h3 { margin: 4px 0 6px; font-size: 18px; }
.step p { margin: 0 0 12px; color: var(--text-muted); }
.step strong { color: var(--heading); font-weight: 600; }


/* Small supporting note under a paragraph */
.note {
  font-size: 13.5px; color: var(--text-muted);
  border-left: 2px solid var(--border-strong); padding-left: 12px; margin: 0 0 14px;
}

/* ---------------- Feature list ---------------- */
.feature-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 22px; }
@media (max-width:900px){ .feature-row{ grid-template-columns:1fr; } }
.feature { padding: 4px; }
.feature .ic { width: 40px; height:40px; border-radius:10px; background: var(--tint); display:flex; align-items:center; justify-content:center; margin-bottom:14px; }
.feature .ic svg { width:22px;height:22px;stroke:var(--op-red);fill:none;stroke-width:2; }
.feature h3 { font-size:17px; margin-bottom:6px; }
.feature p { margin:0; color: var(--text-muted); font-size:15px; }

/* ---------------- Generic page ---------------- */
.page { padding: 56px 0 72px; }
.page-head { max-width: 760px; margin: 0 auto 40px; text-align: center; }
.page-head .eyebrow { margin-bottom: 14px; }
.page-head h1 { font-size: 40px; margin-bottom: 14px; }
.page-head p { font-size: 18px; color: var(--text-muted); margin: 0; }
.prose { max-width: 820px; margin: 0 auto; }
.prose h2 { font-size: 26px; margin: 40px 0 14px; }
.prose h3 { font-size: 19px; margin: 28px 0 10px; letter-spacing: -.03em; }
.prose p, .prose li { color: var(--text); font-size: 16px; }
.prose strong { color: var(--heading); font-weight: 600; }
.prose ul { padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose code {
  font-family: var(--mono); font-size: 13.5px; background: var(--surface-2);
  border: 1px solid var(--border); padding: 2px 6px; border-radius: 5px; color: var(--heading);
}
.prose pre, .step pre {
  background: var(--code-bg); color: var(--code-text);
  padding: 20px 22px; border-radius: var(--radius-sm);
  border: 1px solid var(--code-border);
  overflow-x: auto; font-family: var(--mono); font-size: 13.5px; line-height: 1.75; margin: 16px 0;
}
.prose pre code, .step pre code {
  background: none; border: 0; padding: 0; color: inherit; font-size: inherit;
}

.callout {
  display: flex; gap: 14px; padding: 18px 20px; border-radius: var(--radius-sm);
  background: rgba(20,104,184,.06); border: 1px solid rgba(20,104,184,.20); margin: 20px 0;
}
.callout.warn { background: var(--tint); border-color: rgba(217,13,50,.22); }
.callout .ic { flex-shrink: 0; display: flex; color: var(--blue); }
.callout .ic svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.callout.warn .ic { color: var(--op-red); }
.callout p { margin: 0; font-size: 15px; color: var(--text); }

.table-wrap { overflow-x: auto; margin: 18px 0; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.tbl th, table.tbl td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text); }
table.tbl th { background: var(--surface-2); color: var(--heading); font-weight: 600; }
table.tbl td code { font-size: 12.5px; }

/* ---------------- FAQ accordion ---------------- */
.faq { display: flex; flex-direction: column; gap: 10px; margin: 20px 0 0; }
.faq-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.faq-item[open] { border-color: var(--border-strong); box-shadow: var(--shadow-card); }
.faq-item summary {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; cursor: pointer; list-style: none;
  font-family: var(--font-heading); font-weight: 600; font-size: 16px; color: var(--heading);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: ""; margin-left: auto; flex-shrink: 0;
  width: 18px; height: 18px;
  background: currentColor;
  -webkit-mask: var(--chevron) center / contain no-repeat;
  mask: var(--chevron) center / contain no-repeat;
  color: var(--text-faint);
  transition: transform .2s ease;
}
.faq-item[open] summary::after { transform: rotate(180deg); }
.faq-item summary:hover { background: var(--surface-2); }
.faq-body { padding: 0 18px 18px; }
.faq-body p { margin: 0; color: var(--text); font-size: 15.5px; }
.faq-body p + p { margin-top: 10px; }

:root {
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6l6 -6'/%3E%3C/svg%3E");
}

/* ---------------- Sandbox band ---------------- */
.sandbox-section { padding-top: 0; }
.sandbox-band {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-card);
  padding: 44px 48px;
  position: relative; overflow: hidden;
}
.sandbox-band::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 4px;
  background: linear-gradient(180deg, var(--op-red), var(--op-red-bright));
}
.sandbox-copy h2 { font-size: 30px; margin-bottom: 12px; }
.sandbox-copy p { color: var(--text-muted); font-size: 16.5px; margin: 0 0 24px; max-width: 54ch; }
.sandbox-cta { display: flex; gap: 12px; flex-wrap: wrap; }

.sandbox-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.sandbox-points li { display: flex; gap: 12px; align-items: flex-start; }
.sandbox-points svg {
  width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px;
  stroke: var(--op-red); fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
}
.sandbox-points strong { display: block; color: var(--heading); font-size: 15px; font-weight: 600; }
.sandbox-points span { display: block; color: var(--text-muted); font-size: 14px; margin-top: 2px; }

@media (max-width: 900px) {
  .sandbox-band { grid-template-columns: 1fr; gap: 32px; padding: 32px 26px; }
  .sandbox-copy h2 { font-size: 25px; }
}

/* ---------------- CTA band ---------------- */
.cta-band {
  background: linear-gradient(120deg, var(--solid-bg), var(--solid-bg-2));
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 48px; text-align: center; color: #fff; margin: 8px 0;
}
.cta-band h2 { color: #fff; font-size: 30px; margin-bottom: 12px; }
.cta-band p { color: #C7CDD9; font-size: 17px; max-width: 560px; margin: 0 auto 26px; }
.cta-band .btn-secondary { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.cta-band .btn-secondary::before { background: rgba(255,255,255,.12); }
.cta-band .btn-secondary:hover { color: #fff; border-color: rgba(255,255,255,.6); }

/* ---------------- Footer ---------------- */
.site-footer { background: var(--footer-bg); color: #C7CDD9; padding: 56px 0 28px; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 36px; }
.footer-brand .brand-text { color: #fff; }
.footer-brand .brand .divider { background: rgba(255,255,255,.25); }
.footer-brand p { font-size: 14px; color: #94A0B4; max-width: 280px; margin: 14px 0 0; }
.footer-col h4 { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 14px; }
.footer-col a { display: block; color: #AEB7C7; font-size: 14.5px; padding: 5px 0; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid #2C3344; margin-top: 40px; padding-top: 22px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 13.5px; color: #8A94A6;
}
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------------- Documentation (Redoc) ---------------- */
.doc-shell { height: calc(100vh - var(--header-h)); overflow: hidden; }
#redoc { height: 100%; overflow: auto; }
/* Hide Redoc's own loading flash background */
redoc { display: block; }

/* ============================================================
   Touch devices (iPad & other tablets/phones) — comfortable
   tap targets (WCAG / Apple HIG ≈ 44px) and no hover-stuck UI.
   ============================================================ */
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .btn-lg { min-height: 48px; }
  .nav-toggle { min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
  .theme-toggle { min-width: 44px; min-height: 44px; }
  .api-button { min-height: 52px; }
  .api-card { padding: 22px; }
  .ds-search input { min-height: 44px; }
  .ds-group a { padding-top: 12px; padding-bottom: 12px; min-height: 44px; display: flex; align-items: center; }
  .code-tabs button { min-height: 44px; }
  .xml-cmd-head { min-height: 52px; }
  .src-link { min-height: 40px; }
  .faq-item summary { min-height: 52px; }
  /* Swagger UI operation rows — larger touch area */
  .swagger-ui .opblock-summary { min-height: 48px; }
  .swagger-ui .btn { min-height: 44px; }
  /* Disable sticky translucency repaint jank & hover lifts on touch */
  .api-card:hover { transform: none; }
  .api-button:hover { transform: none; }
}

/* iPad landscape / small laptops: keep the code card from overflowing the hero */
@media (max-width: 1024px) {
  .code-card pre { font-size: 12.5px; }
}
