/* Shared semantic colours: marketing, account, partner workspace and developer docs. */
:root[data-theme=dark] {
  color-scheme:dark;
  --ink:#e7eaf3;--muted:#a8b3c9;--bg:#101522;--line:#303b52;
  --theme-ink:#e7eaf3;--theme-muted:#a8b3c9;
  --surface:#171e2e;--surface-soft:#1d273c;--accent-surface:#292442;
  --success-surface:#18332f;--danger-surface:#3c2330;--warm-surface:#312b24;
  --accent-text:#b5b4ff;--success-text:#86d5c2;--danger-text:#ffa6b7;--warm-text:#ddc58f;
  --border-color:#3a4760;--purple:#b4a1ff;
  --byoh:#85d4c4;--byoh-bg:#18332f;--byoh-line:#3a665d;--byoh-hover:#b2e9dc;
}
.theme-switch{position:relative;order:5;flex:0 0 auto;display:flex;align-items:center}
.theme-toggle{width:32px;min-width:32px;height:32px;min-height:32px;padding:6px;border:0;border-radius:50%;background:transparent;color:var(--muted)}
.theme-toggle:hover,.theme-toggle[aria-expanded=true]{background:var(--surface-soft,#f0f2f8);color:var(--ink)}
.theme-menu{position:absolute;right:0;top:calc(100% + 10px);min-width:150px;padding:5px;border:1px solid var(--line);border-radius:12px;background:var(--surface,#fff);box-shadow:0 10px 28px #0003;z-index:40}
.theme-menu[hidden]{display:none}
.theme-menu button{display:flex;justify-content:flex-start;gap:8px;width:100%;min-height:36px;padding:8px 10px;border:0;border-radius:8px;color:var(--ink);background:transparent;font-size:.85rem;font-weight:500;line-height:1.3}
.theme-menu button::before{content:'';width:12px}
.theme-menu button[aria-checked=true]::before{content:'✓'}
.theme-menu button:hover,.theme-menu button:focus-visible{background:var(--accent-surface,#f1efff);outline:none}
:root[data-theme=dark] :is(input,textarea,select){color:var(--ink);background-color:var(--surface);border-color:var(--border-color)}
:root[data-theme=dark] :is(input,textarea)::placeholder{color:#93a1bb;opacity:1}
:root[data-theme=dark] :is(.eyebrow,nav.main a[aria-current=page],.docs-nav a[aria-current=page],.usage-chart){color:var(--accent-text)}
:root[data-theme=dark] .hero .eyebrow{color:#b7adff}
:root[data-theme=dark] .docs-wordmark{color:var(--ink)}
:root[data-theme=dark] .header-tools{--header-control-line:var(--line)}
:root[data-theme=dark] :is(.language-trigger,.header-account,.ai-account-link,.cart-trigger){border-color:var(--line);box-shadow:none}
:root[data-theme=dark] :is(.header-account[data-state="signed-in"],.ai-account-link){background:linear-gradient(140deg,#29263f,#211e34);color:#c1b8ff}
:root[data-theme=dark] .language-switch{color:var(--ink)}
:root[data-theme=dark] :is(.btn-b,.btn-t,.partner-contact){color:#fff}
:root[data-theme=dark] .btn-a:hover{color:var(--accent-text);border-color:var(--accent-text)}
:root[data-theme=dark] .shinrai-recorded-demo{color:var(--ink);background:var(--surface);border-color:var(--line)}
:root[data-theme=dark] .shinrai-recorded-demo pre{background:#20283c;color:#dce2f2}
:root[data-theme=dark] .shinrai-recorded-demo article:last-child pre{background:#19312d;color:#d1eee5}
:root[data-theme=dark] .shinrai-recorded-demo pre mark{background:#47386b;color:#e1d8ff}
:root[data-theme=dark] .shinrai-recorded-demo article:last-child pre mark{background:#28564b;color:#c6f4e4}
:root[data-theme=dark] .shinrai-recorded-demo :is(.sr-demo-model,.sr-demo-note){color:var(--muted)}
:root[data-theme=dark] .shinrai-recorded-demo .sr-demo-badge{background:var(--surface-soft);color:var(--accent-text)}
:root[data-theme=dark] .shinrai-recorded-demo .sr-demo-controls button{background:var(--surface);color:var(--ink);border-color:var(--line)}
:root[data-theme=dark] .partner-logo{background:#fff;border-radius:8px;padding:10px;width:200px;max-width:100%;align-self:flex-start}
:root[data-theme=dark] .partner-logo img{max-width:100%;max-height:44px}
:root[data-theme=dark] .partner-technology .partner-logo{height:66px}
:root[data-theme=dark] .partner-technology .card{box-shadow:none}
:root[data-theme=dark] :is(dialog,.dialog){color:var(--ink)}
:root[data-theme=dark] .docs-article pre,:root[data-theme=dark] pre{background:#0c1120}
:root[data-theme=dark] .docs-card-featured{background:linear-gradient(145deg,#202b58,#35479a);color:#fff}
:root[data-theme=dark] ::selection{background:#6054a3;color:#fff}
/* A compact theme action must fit alongside the existing controls at phone widths. */
@media(max-width:640px){.header-tools{gap:6px}.theme-toggle{width:30px;min-width:30px;height:30px;min-height:30px}.theme-menu{right:0}}

:root[data-theme=dark] .docs-search input{border:1px solid var(--line)}
:root[data-theme=dark] :is(.byoh-zone .btn-b,.byoh-panel .btn-b){background:#17675f;color:#fff}

:root[data-theme=dark] :is(.header-tools .cart-trigger:hover,.header-account:hover){color:var(--accent-text)}

.theme-toggle{position:relative;display:flex;align-items:center;justify-content:center;gap:3px}.theme-auto{font-size:9px;line-height:1;opacity:.75}
.theme-toggle:has(.theme-auto){width:46px;min-width:46px;border-radius:16px}.theme-toggle svg{flex:none}:root[data-theme=dark] .partner-services-card[data-partner=elba] .partner-logo{background:transparent}:root[data-theme=dark] .partner-services-card .partner-logo img{max-height:80px}.partner-services-card .partner-logo img{max-height:80px}
