/* Omnivery Documentation */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
    --bg:           #162228;
    --bg-elevated:  #1d2d35;
    --bg-hover:     #1a2830;
    --bg-border:    #243540;
    --highlight:    #fbb040;
    --highlight-dk: #e09a2a;
    --highlight-bg: rgba(251,176,64,0.12);
    --text:         #e2e7e9;
    --text-muted:   #8fa3ad;
    --text-dim:     #5e7a87;
    /* Emphasised copy ON THE PAGE BACKGROUND — headings, card titles, table
       headers, .endpoint-path. White only because this palette is dark; a
       light theme MUST redefine it to a dark ink. */
    --text-strong:  #ffffff;
    /* Text and glyphs on the header bar and the mobile-nav overlay. Those two
       surfaces are painted by the theme, so a theme that repaints them has to
       redefine this. Together these two replace --white, which conflated the
       roles and so rendered white-on-white in any light theme. */
    --text-on-dark: #ffffff;
    /* Text on a --highlight (amber) fill. Amber is a LIGHT accent — 1.84:1 on
       white — so this is always dark. Never #fff at the call site, and never
       var(--bg), which inverts to white the moment a theme goes light. */
    --text-on-accent: #162228;
    /* The accent used AS TEXT — links, active nav labels, inline code glyphs,
       meta pills, .error-code — drawn on --bg, --bg-elevated or the --highlight-bg
       tint. Amber reaches 8.80:1 on this dark background, so here it is simply
       --highlight; a LIGHT theme MUST redefine it to a darker shade, because the
       same amber is 1.84:1 on white (2.95:1 on the amber tint). --highlight
       itself stays the fill/border accent, which a light theme wants to keep
       amber. Use this token for every `color:` that wants the accent; use
       --highlight for `background:` and `border-color:`. */
    --accent-text:  var(--highlight);
    /* Consumed by .nav-subtree and .lang-btn. Undeclared until 1.7.2, which
       made `border: 1px solid var(--border)` invalid at computed-value time,
       so no border drew at all. */
    --border:       var(--bg-border);
    /* Consumed by .ai-prompt-section. Same bug class: that panel had no
       background at all. */
    --bg-secondary: var(--bg-elevated);
    --font:         'Poppins', ui-sans-serif, system-ui, sans-serif;
    --font-mono:    'Fira Code', 'Cascadia Code', Consolas, 'Courier New', monospace;
    --radius:       8px;
    /* Header bar height. The marketing header is auto-height from 14px of
       vertical padding around a 50.8px nav row; this is that measured 79px,
       pinned because the sticky sidebar has to offset itself by exactly the
       same amount. Change it here, not at the three call sites. */
    --header-h:     79px;
    --shadow:       0 1px 3px rgba(0,0,0,0.4);
    --shadow-md:    0 4px 12px rgba(0,0,0,0.4);
    /* HTTP method colours (kept readable on dark bg) */
    --get:    #22c55e;
    --post:   #3b82f6;
    --put:    #f59e0b;
    --patch:  #a78bfa;
    --delete: #f87171;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; scrollbar-gutter: stable; }

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* ===== HEADER ===== */
.site-header {
    background: var(--bg);
    border-bottom: 1px solid var(--bg-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
    gap: 2rem;
}

.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.logo-img {
    height: 26px;   /* matches the marketing header's logo svg */
    width: auto;
    display: block;
}

.logo-docs {
    font-size: 0.75rem;
    color: var(--accent-text);
    font-weight: 600;
    background: var(--highlight-bg);
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    border: 1px solid rgba(251,176,64,0.3);
}

.main-nav {
    display: flex;
    gap: 0.125rem;
    align-items: center;
}

/* Vertical padding only. The horizontal rhythm is the flex `gap` on the <ul>
   below; padding here would double-count it, and a hover/active plate drawn
   around a link with no side padding hugs the glyphs. Top-level links
   therefore change colour on hover, they do not gain a background — same as
   the marketing header. */
.main-nav a {
    color: var(--text-on-dark);
    text-decoration: none;
    padding: 7px 0;
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: all 0.15s;
}

/* Tint, not a plate. --text-on-dark cannot brighten further on a dark theme,
   so the fallback affordance is the accent; ov2026 overrides this to white,
   which is what the marketing header does. */
.main-nav a:hover {
    color: var(--accent-text);
}

.main-nav a.active {
    color: var(--accent-text);
}

/* ===== MEGA-NAV (one level of dropdowns) =====
   Structure only — every colour lives in the theme layer. A theme that ships
   no colours of its own still gets a working, keyboard-reachable mega-nav. */

/* NOTE the `> ul` child combinator: this rule must NOT reach the nested <ul>
   of a dropdown, or the panel is laid out as a horizontal row instead of a
   stacked list. */
/* Spacing comes from gap, not from horizontal padding on each link — the
   marketing header uses a 22px gap with zero side padding, and padding-based
   spacing puts the hover target in the wrong place relative to the panel. */
.main-nav > ul {
    display: flex;
    align-items: center;
    gap: 22px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Padding sits on the <li>, not the <a>: it is the hover bridge, so the
   pointer never crosses dead space between the link and the panel below. */
.main-nav > ul > li {
    position: relative;
    padding: 8px 0;
}

/* Caret marks a dropdown parent. Sits to the LEFT of the label text,
   matching the reference nav. The <a> gets left padding to make room;
   the caret is absolute so it never shifts the label when gap changes. */
.main-nav > ul > li.has-children > a {
    position: relative;
    padding-left: 16px;
}
.main-nav > ul > li.has-children > a::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 0.33em;
    height: 0.33em;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    transform: translateY(-70%) rotate(45deg);
    opacity: 0.6;
}

/* The panel. display:block is load-bearing: `.main-nav > ul` above is the
   flex row, and any theme rule that reaches a nested <ul> without a child
   combinator would otherwise turn the :focus-within path into a row. */
.main-nav > ul > li > ul {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 15rem;
    z-index: 200;
    margin: 0;
    padding: 0.5rem 0;
    list-style: none;
    border: 1px solid var(--bg-border);
    border-radius: 10px;          /* panels are rounder than --radius cards */
    background: var(--bg-elevated);
    box-shadow: var(--shadow-md);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}
/* :focus-within is what makes the panel keyboard-reachable — focusing the
   parent link reveals it, after which its own links enter the tab order
   (visibility:hidden had kept them out of it). No JS on desktop. */
.main-nav > ul > li:hover > ul,
.main-nav > ul > li:focus-within > ul {
    visibility: visible;
    opacity: 1;
    transform: none;
}
.main-nav > ul > li > ul > li {
    display: block;
}
.main-nav > ul > li > ul > li > a {
    display: block;
    padding: 8px 18px;
    border-radius: 0;
    white-space: nowrap;
}
/* Rows inside the panel DO take a hover plate — unlike the top-level links,
   they are full-width blocks, so the plate reads as a row highlight. */
.main-nav > ul > li > ul > li > a:hover,
.main-nav > ul > li > ul > li > a:focus {
    background: var(--bg-hover);
}
/* Group label inside a panel: a `heading` nav entry, not a link. The first one
   drops most of its top padding so the panel's own 8px is not doubled. */
.main-nav .menu-heading > span {
    display: block;
    padding: 12px 18px 5px;
}
.main-nav .menu-heading:first-child > span {
    padding-top: 4px;
}

/* Same 22px rhythm as the nav row, because "Log in" is now a nav link rather
   than a button and 8px would crowd it against the CTA pill. */
.header-actions {
    display: flex;
    align-items: center;
    gap: 22px;
    flex-shrink: 0;
}

.header-login-btn,
.header-cta-btn {
    flex-shrink: 0;
    color: var(--text-on-dark);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s;
    white-space: nowrap;
}

/* "Log in" is an ordinary nav link — no border, no fill, no pill padding — so
   the header carries exactly one filled button. It stays in the markup
   regardless of `nav` config because login_url also drives the auth-failure
   redirect, so it must remain the fallback affordance. */
.header-login-btn {
    padding: 7px 0;
    background: none;
    border: none;
}
.header-login-btn:hover {
    color: var(--accent-text);
}

/* The single CTA pill. No border: the fill is the shape. The fill lives here
   rather than in the theme layer so a theme that ships no colours of its own
   still gets a real button — and --text-on-accent keeps its label dark on the
   light amber instead of the near-invisible white it would inherit. */
.header-cta-btn {
    padding: 9px 18px;
    line-height: 20.8px;
    border: none;
    border-radius: var(--radius);
    background: var(--highlight);
    color: var(--text-on-accent);
}
.header-cta-btn:hover {
    background: var(--highlight-dk);
    color: var(--text-on-accent);
}

/* ===== HAMBURGER / MOBILE NAV ===== */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 6px;
    background: none;
    border: 1px solid var(--bg-border);
    border-radius: var(--radius);
    cursor: pointer;
    flex-shrink: 0;
}
.nav-toggle span {
    display: block;
    height: 2px;
    background: var(--text-on-dark);
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
    transform-origin: center;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.mobile-nav {
    display: none;
    flex-direction: column;
    background: var(--bg);
    border-top: 1px solid var(--bg-border);
    padding: 0.5rem 1.5rem 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.mobile-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.mobile-nav a {
    display: block;
    color: var(--text-on-dark);
    text-decoration: none;
    padding: 0.7rem 0;
    font-size: 0.9375rem;
    border-bottom: 1px solid var(--bg-border);
    transition: color 0.15s;
}
/* Dividers rule off the top-level rows only. The anchors now live inside
   <li>s, so the old `.mobile-nav a:last-child` matched EVERY anchor (each one
   is the last child of its own <li>) and would have erased all the rules. */
.mobile-nav > ul > li:last-child > a,
.mobile-nav > ul > li:last-child > .nav-group {
    border-bottom: none;
}
.mobile-nav a:hover,
.mobile-nav a.active {
    color: var(--accent-text);
}

/* ---- mobile dropdown groups (statically rendered, JS only flips .open) ----
   The row is a flex pair: the parent link keeps navigating, the +/- button
   next to it expands the group. Groups are independent, not an accordion. */
.mobile-nav .nav-group {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--bg-border);
}
.mobile-nav .nav-group > a {
    flex: 1 1 auto;
    border-bottom: none;
}
.mobile-nav .nav-group-toggle {
    flex: 0 0 auto;
    width: 2.25rem;
    height: 2.25rem;
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    line-height: 1;
    color: inherit;
}
.mobile-nav .nav-group-toggle::before {
    content: "+";
    font-weight: 600;
}
.mobile-nav li.has-children.open > .nav-group .nav-group-toggle::before {
    content: "\2212";
}
.mobile-nav li.has-children > ul {
    display: none;
    margin: 0.25rem 0 0.5rem 1rem;   /* indent the group under its parent */
}
.mobile-nav li.has-children.open > ul {
    display: block;
}
.mobile-nav li.has-children > ul a {
    padding: 0.5rem 0;
    font-size: 0.875rem;
    border-bottom: none;
}
.mobile-nav .menu-heading > span {
    display: block;
    padding: 0.6rem 0 0.1rem;
}

.mobile-nav-login,
.mobile-nav-cta {
    margin-top: 0.5rem;
    text-align: center;
    border: 1px solid var(--bg-border) !important;
    border-radius: var(--radius);
    padding: 0.5rem !important;
}

/* ===== LAYOUT ===== */
.page-layout {
    display: flex;
    align-items: stretch;
    width: 100%;        /* prevents content-driven width changes from shifting the sidebar */
    flex: 1;            /* fill remaining body height so footer stays at bottom */
}

/* ===== SIDEBAR ===== */
.sidebar-col {
    width: 256px;
    flex-shrink: 0;   /* never yields space to content */
    border-right: 1px solid var(--bg-border);
    background: var(--bg);
}

.sidebar {
    padding: 1.5rem 0;
    position: sticky;
    top: var(--header-h);
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
}

.sidebar-section { padding: 0 0.75rem 1.5rem; }

.sidebar-section h3 {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
    padding: 0 0.5rem;
}

/* sidebar section groups */
.sidebar-group { margin: 0; }
.sidebar-group-title {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
    padding: 0 0.5rem;
}

.nav-tree { list-style: none; }
.nav-subtree { list-style: none; padding-left: 0.75rem; margin-top: 0.125rem; margin-bottom: 0.125rem; border-left: 1px solid var(--border); }

/* collapsible <details>/<summary> nav groups */
.nav-group details { margin: 0; }
.nav-group details > summary {
    list-style: none;         /* hide default marker */
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    padding: 0;
    user-select: none;
}
.nav-group details > summary::-webkit-details-marker { display: none; }
.nav-group details > summary::before {
    content: '▶';
    font-size: 0.5rem;
    color: var(--text-dim);
    flex-shrink: 0;
    width: 0.75rem;
    text-align: center;
    transition: transform 0.15s;
}
.nav-group details[open] > summary::before { transform: rotate(90deg); }
.nav-summary a {
    flex: 1;
}
.nav-summary.active a {
    color: var(--accent-text);
    font-weight: 600;
}

.nav-item a {
    display: block;
    padding: 0.375rem 0.625rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 400;
    border-radius: var(--radius);
    transition: all 0.12s;
}

.nav-item a:hover {
    color: var(--text-strong);
    background: var(--bg-hover);
}

.nav-item a.active {
    color: var(--accent-text);
    background: var(--highlight-bg);
    font-weight: 600;
}

/* ===== CONTENT ===== */
.content {
    flex: 1;
    min-width: 0;        /* prevents wide tables/code from blowing out the flex column */
    overflow-x: hidden;
    padding: 2rem 2.5rem;
}

/* ===== LANGUAGE SWITCHER ===== */
.lang-switcher {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}
.lang-btn {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.12s;
}
.lang-btn:hover { border-color: var(--highlight); color: var(--accent-text); }
.lang-btn.active { border-color: var(--highlight); background: var(--highlight); color: var(--text-on-accent); }

/* ===== HOME PAGE ===== */
.hero {
    padding: 2.5rem 0 2rem;
    border-bottom: 1px solid var(--bg-border);
    margin-bottom: 2.5rem;
}

.hero h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-strong);
    margin-bottom: 0.75rem;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.hero p {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 560px;
    font-weight: 400;
}

.ai-prompt-section {
    margin-top: 1rem;
    margin-bottom: 2.5rem;
    padding: 1.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--bg-border);
    border-radius: var(--radius);
}

.ai-prompt-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-strong);
    margin-bottom: 0.875rem;
}

.ai-prompt-box {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ai-prompt-box textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--bg-border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    resize: none;
    line-height: 1.5;
    outline: none;
    transition: border-color 0.15s;
}

.ai-prompt-box textarea:focus {
    border-color: var(--highlight);
}

.ai-prompt-btn {
    align-self: flex-end;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--highlight);
    color: var(--text-on-accent);
    border: none;
    border-radius: var(--radius);
    padding: 0.55rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.ai-prompt-btn:hover { background: #e09a2a; }

.card-grid { margin-bottom: 2.5rem; }

.card-grid h2 {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.cards.cards-2col {
    grid-template-columns: repeat(2, 1fr);
}

.card {
    display: block;
    text-decoration: none;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--bg-border);
    border-radius: var(--radius);
    transition: all 0.15s;
    background: var(--bg-elevated);
    box-shadow: var(--shadow);
}

.card:hover {
    border-color: var(--highlight);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-strong);
    margin-bottom: 0.25rem;
}

.card p {
    font-size: 0.825rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.card-api { border-top: 3px solid var(--highlight); }

.card-desc { font-size: 0.825rem; color: var(--text-muted); margin-top: 0.4rem; line-height: 1.5; }
.card-desc p { margin: 0; }
.card-desc p + p { margin-top: 0.3rem; }

.badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    background: var(--highlight-bg);
    color: var(--accent-text);
    border: 1px solid rgba(251,176,64,0.3);
    border-radius: 20px;
    font-weight: 600;
    margin-top: 0.5rem;
}

/* ===== MARKDOWN CONTENT ===== */
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
    color: var(--text-strong);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.015em;
}

.markdown-body h1 { font-size: 1.875rem; margin: 0 0 1rem; }
.markdown-body h2 { font-size: 1.375rem; margin: 2rem 0 0.75rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--bg-border); }
.markdown-body h3 { font-size: 1.125rem; margin: 1.5rem 0 0.5rem; }
.markdown-body h4 { font-size: 1rem; margin: 1.25rem 0 0.5rem; }

p { padding-bottom: 0.5rem; }
.mermaid { color: #000 !important; background-color: #ffffff; margin: 1.5em 0; }
.mermaid svg text { fill: #000 !important; }
.mermaid p { color: #000 !important; padding-bottom: 0 !important; }
.markdown-body p { margin-bottom: 1rem; padding-bottom: 0.5rem; color: var(--text); line-height: 1.7; }
.markdown-body img { max-width: 100%; height: auto; }

.markdown-body ul,
.markdown-body ol { margin-bottom: 1rem; padding-left: 1.5rem; color: var(--text); }
.markdown-body li { margin-bottom: 0.35rem; }

.markdown-body a { color: var(--accent-text); text-decoration: none; font-weight: 500; }
.content a:not(.card):not(.btn):not(.lang-btn) { color: var(--accent-text); }
.markdown-body a:hover { text-decoration: underline; }

.markdown-body code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: rgba(0,0,0,0.06);
    border: 1px solid var(--bg-border);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    color: var(--accent-text);
}

.markdown-body pre {
    background: #f5f7f9;
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border: 1px solid var(--bg-border);
}

.markdown-body pre code {
    background: none;
    border: none;
    padding: 0;
    color: #24292e;
    font-size: 0.875rem;
    line-height: 1.65;
}

.markdown-body blockquote {
    border-left: 4px solid var(--text-dim);
    padding: 0.75rem 1rem;
    margin: 1.25rem 0;
    background: rgba(0,0,0,0.04);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--text-muted);
}
.markdown-body blockquote.callout-warning {
    border-left-color: #d97706;
    background: rgba(217,119,6,0.07);
    color: #92400e;
}
.markdown-body blockquote.callout-notice {
    border-left-color: #2563eb;
    background: rgba(37,99,235,0.07);
    color: #1e3a8a;
}
.markdown-body blockquote.callout-success {
    border-left-color: #16a34a;
    background: rgba(22,163,74,0.07);
    color: #14532d;
}
.markdown-body blockquote.callout-danger {
    border-left-color: #dc2626;
    background: rgba(220,38,38,0.07);
    color: #7f1d1d;
}

.markdown-body table { width: 100%; border-collapse: collapse; margin-bottom: 1.25rem; }
.markdown-body th,
.markdown-body td { border: 1px solid var(--bg-border); padding: 0.6rem 0.875rem; text-align: left; font-size: 0.875rem; }
.markdown-body th { background: rgba(0,0,0,0.04); font-weight: 600; color: var(--text-strong); }
.markdown-body td { color: var(--text); }
.markdown-body tr:hover td { background: rgba(0,0,0,0.03); }

.markdown-body hr { border: none; border-top: 1px solid var(--bg-border); margin: 1.5rem 0; }

/* ===== API REF HEADER ===== */
.api-ref-content { padding-bottom: 4rem; }

.api-header {
    border-bottom: 1px solid var(--bg-border);
    padding-bottom: 2rem;
    margin-bottom: 2.5rem;
}

.api-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-strong);
    margin-bottom: 0.75rem;
    letter-spacing: -0.025em;
}

.api-meta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.version-badge {
    background: var(--highlight);
    color: var(--text-on-accent);
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.base-url { color: var(--text-muted); font-size: 0.875rem; }

.server-select {
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--bg-border);
    border-radius: 4px;
    padding: 0.15em 0.35em;
    margin: 0 0.15rem;
    cursor: pointer;
}

.base-url code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: rgba(0,0,0,0.06);
    border: 1px solid var(--bg-border);
    padding: 0.15em 0.45em;
    border-radius: 4px;
    color: var(--text);
}

.api-description { color: var(--text); margin-top: 0.75rem; font-size: 0.925rem; line-height: 1.7; }

.auth-section {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    background: var(--highlight-bg);
    border-radius: var(--radius);
    border: 1px solid rgba(251,176,64,0.25);
}

.auth-section h3 {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-text);
    margin-bottom: 0.5rem;
}

.auth-list { list-style: none; font-size: 0.875rem; color: var(--text-muted); }
.auth-list li { margin-bottom: 0.25rem; }
.auth-list code {
    font-family: var(--font-mono);
    font-size: 0.83em;
    background: rgba(0,0,0,0.06);
    border: 1px solid var(--bg-border);
    padding: 0.1em 0.35em;
    border-radius: 3px;
    color: var(--accent-text);
}

/* ===== ENDPOINT GROUP ===== */
.endpoint-group { margin-bottom: 3rem; }

.group-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-strong);
    padding-bottom: 0.625rem;
    border-bottom: 2px solid var(--highlight);
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

/* ===== ENDPOINT ===== */
.endpoint {
    border: 1px solid var(--bg-border);
    border-radius: var(--radius);
    margin-bottom: 0.625rem;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.endpoint:hover { border-color: rgba(251,176,64,0.35); box-shadow: 0 2px 8px rgba(0,0,0,0.3); }

.endpoint-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1.125rem;
    cursor: pointer;
    background: var(--bg-elevated);
    transition: background 0.12s;
    user-select: none;
}

.endpoint-header:hover { background: var(--bg-hover); }

.method-badge {
    display: inline-block;
    min-width: 68px;
    text-align: center;
    padding: 0.2rem 0.5rem;
    border-radius: 5px;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.method-badge.get     { background: rgba(22,163,74,0.1);   color: #15803d; border: 1px solid rgba(22,163,74,0.3); }
.method-badge.post    { background: rgba(37,99,235,0.1);   color: #1d4ed8; border: 1px solid rgba(37,99,235,0.3); }
.method-badge.put     { background: rgba(217,119,6,0.1);   color: #b45309; border: 1px solid rgba(217,119,6,0.3); }
.method-badge.patch   { background: rgba(124,58,237,0.1);  color: #6d28d9; border: 1px solid rgba(124,58,237,0.3); }
.method-badge.delete  { background: rgba(220,38,38,0.1);   color: #b91c1c; border: 1px solid rgba(220,38,38,0.3); }
.method-badge.head,
.method-badge.options { background: rgba(0,0,0,0.05);color: var(--text-muted); border: 1px solid var(--bg-border); }

.endpoint-path {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-strong);
    font-weight: 500;
    flex-shrink: 0;
}

.endpoint-summary {
    color: var(--text-muted);
    font-size: 0.85rem;
    flex: 1;
}

.toggle-icon {
    color: var(--text-dim);
    font-size: 0.7rem;
    transition: transform 0.2s;
    margin-left: auto;
    flex-shrink: 0;
}

.endpoint-header.open .toggle-icon { transform: rotate(180deg); }

.endpoint-body {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--bg-border);
    background: var(--bg);
}

.endpoint-description {
    color: var(--text);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    line-height: 1.65;
}

/* ===== PARAMS TABLE ===== */
.params-section,
.request-body-section,
.responses-section { margin-bottom: 1.5rem; }

.params-section h4,
.request-body-section h4,
.responses-section h4,
.code-samples h4 {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-dim);
    margin-bottom: 0.625rem;
}

.content-type {
    font-family: var(--font-mono);
    font-size: 0.78em;
    background: rgba(0,0,0,0.05);
    border: 1px solid var(--bg-border);
    padding: 0.1em 0.4em;
    border-radius: 3px;
    font-weight: 400;
    margin-left: 0.5rem;
    color: var(--text-muted);
}

.params-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }

.params-table th {
    text-align: left;
    padding: 0.5rem 0.875rem;
    background: rgba(0,0,0,0.04);
    border: 1px solid var(--bg-border);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.params-table td {
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--bg-border);
    color: var(--text);
    vertical-align: top;
}

.params-table tr:hover td { background: rgba(0,0,0,0.03); }

.params-table code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: rgba(0,0,0,0.06);
    border: 1px solid var(--bg-border);
    padding: 0.1em 0.35em;
    border-radius: 3px;
    color: var(--accent-text);
}

/* Nested schema tables — span type+required+description columns */
.schema-nested-row:hover td { background: transparent; }
.schema-nested-row .schema-nested-spacer {
    padding: 0;
    border-top: none;
    border-right: none;
    width: 1.5rem;
}
.schema-nested-row > td:last-child {
    padding: 0 0 0.5rem 0;
    border-top: none;
}
.schema-nested-row .params-table {
    border-left: 2px solid var(--bg-border);
    font-size: 0.93em;
}
.schema-nested-row .params-table th {
    background: rgba(0,0,0,0.02);
}

.param-in {
    display: inline-block;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    background: rgba(0,0,0,0.05);
    font-size: 0.78em;
    color: var(--text-muted);
    font-family: var(--font-mono);
    border: 1px solid var(--bg-border);
}

.required { color: #b91c1c; font-weight: 600; }

/* ===== RESPONSES ===== */
.response-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--bg-border);
    font-size: 0.875rem;
}

.response-item-header {
    display: flex;
    align-items: baseline;
    gap: 0.875rem;
}

.status-code {
    display: inline-block;
    min-width: 54px;
    padding: 0.15rem 0.45rem;
    border-radius: 5px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
    flex-shrink: 0;
    background: rgba(0,0,0,0.05);
    color: var(--text-muted);
}

.status-code[data-status^="2"] { background: rgba(22,163,74,0.1);  color: #15803d; }
.status-code[data-status^="4"] { background: rgba(220,38,38,0.1);  color: #b91c1c; }
.status-code[data-status^="5"] { background: rgba(217,119,6,0.1);  color: #b45309; }

.response-desc { color: var(--text-muted); line-height: 1.5; }

.response-example {
    margin: 0;
    padding: 0.75rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text-muted);
    overflow-x: auto;
    white-space: pre;
}

/* ===== CODE SAMPLES ===== */
.code-samples { margin-bottom: 1.5rem; }

.code-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--bg-border);
}

.tab-btn {
    padding: 0.45rem 0.875rem;
    font-size: 0.8rem;
    font-weight: 600;
    border: none;
    background: none;
    color: var(--text-dim);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.12s;
    font-family: var(--font);
}

.tab-btn:hover { color: var(--text); }

.tab-btn.active {
    color: var(--accent-text);
    border-bottom-color: var(--highlight);
}

.code-tab-contents { position: relative; }

.code-block {
    display: none;
    margin: 0;
    background: #f5f7f9;
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 1.125rem 1.375rem;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.65;
    border: 1px solid var(--bg-border);
    border-top: none;
}

.code-block.active { display: block; }

.code-block code {
    color: #24292e;
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
}

/* ===== TRY IT ===== */
.try-it-section { margin-top: 1rem; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1.125rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
    text-decoration: none;
    font-family: var(--font);
}

.btn-primary { background: var(--highlight); color: var(--text-on-accent); }
.btn-primary:hover { background: var(--highlight-dk); }

.btn-outline {
    background: none;
    color: var(--accent-text);
    border: 1.5px solid var(--highlight);
}
.btn-outline:hover { background: var(--highlight-bg); }

.try-it-pane {
    margin-top: 0.875rem;
    padding: 1.125rem;
    background: var(--bg-elevated);
    border-radius: var(--radius);
    border: 1px solid var(--bg-border);
}

.form-group { margin-bottom: 0.875rem; }

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--bg-border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--highlight);
    box-shadow: 0 0 0 3px rgba(251,176,64,0.15);
}

.form-group textarea {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    resize: vertical;
}

.try-it-response {
    margin-top: 1rem;
    border-top: 1px solid var(--bg-border);
    padding-top: 0.875rem;
}

.try-it-response h5 {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}

.response-status { font-size: 0.875rem; font-weight: 600; margin-bottom: 0.5rem; }
.response-status.ok  { color: #15803d; }
.response-status.err { color: #b91c1c; }

.response-body {
    background: #f5f7f9;
    color: #24292e;
    padding: 0.875rem 1rem;
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    border: 1px solid var(--bg-border);
}

/* ===== FOOTER ===== */
.site-footer {
    background: var(--bg);
    border-top: 1px solid var(--bg-border);
    color: var(--text-dim);
    padding: 1.25rem 0;
    font-size: 0.825rem;
    margin-top: auto;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.footer-nav {
    display: flex;
    gap: 1.5rem;
}

.footer-copy { margin: 0; }

.site-footer a { color: var(--text-muted); text-decoration: none; transition: color 0.12s; }
.site-footer a:hover { color: var(--accent-text); }

/* ===== ERROR PAGES ===== */
.error-page {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 3rem 0 2rem;
}

.error-code {
    font-size: 6rem;
    font-weight: 800;
    line-height: 1;
    color: var(--accent-text);
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
}

.error-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.75rem;
}

.error-message {
    font-size: 1rem;
    color: var(--text-muted);
    margin: 0 0 2rem;
    max-width: 480px;
    line-height: 1.6;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .sidebar-col { width: 220px; }
    .content { padding: 1.75rem 2rem; }
}

@media (max-width: 768px) {
    .sidebar-col { display: none; }
    .content { padding: 1.5rem 1rem; }
    .hero h1 { font-size: 1.625rem; }
    .cards, .cards.cards-2col { grid-template-columns: 1fr; }
    .endpoint-path { display: none; }
    .header-inner { height: 56px; }
    .main-nav { display: none; }
    .header-actions { display: none; }   /* login + CTA move into the overlay */
    .nav-toggle { display: flex; }
    .mobile-nav.open { display: flex; }
}

/* ===== TAGS ===== */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 1.25rem;
}
.tag-pill {
    display: inline-block;
    background: var(--highlight-bg);
    color: var(--accent-text);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(251,176,64,0.25);
    text-decoration: none;
    white-space: nowrap;
}

/* ===== COMMENTS ===== */
.comment-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--bg-border);
}
.comment-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--text);
}
.comment-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}
.comment-item {
    background: var(--bg-elevated);
    border: 1px solid var(--bg-border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}
.comment-meta {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.comment-author {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}
.comment-date {
    font-size: 0.75rem;
    color: var(--text-dim);
}
.comment-body {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
}
.comment-empty {
    color: var(--text-dim);
    font-size: 0.875rem;
    font-style: italic;
}
.comment-form-wrap {
    background: var(--bg-elevated);
    border: 1px solid var(--bg-border);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.comment-form-heading {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text);
}
.comment-form {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}
.comment-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.875rem;
}
.comment-form-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.comment-form-field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}
.comment-required { color: var(--accent-text); }
.comment-hint { font-weight: 400; color: var(--text-dim); }
.comment-form-field input,
.comment-form-field textarea {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--bg-border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    resize: vertical;
    transition: border-color 0.15s;
}
.comment-form-field input:focus,
.comment-form-field textarea:focus {
    outline: none;
    border-color: var(--highlight);
}
/* An error, so it reads red — not amber. Amber text on this #fef2f2 box was
   1.69:1, and the wrong semantic hue besides. #b91c1c is the same red already
   used by .required, .method-badge.delete and .response-status.err. */
.comment-error {
    background: #fef2f2;
    border: 1px solid rgba(185,28,28,0.30);
    border-radius: var(--radius);
    color: #b91c1c;
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
}
.btn-comment-submit {
    align-self: flex-start;
    background: var(--highlight);
    color: var(--text-on-accent);
    border: none;
    border-radius: var(--radius);
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: background 0.15s;
}
.btn-comment-submit:hover { background: var(--highlight-dk); }
.btn-comment-submit:disabled { opacity: 0.6; cursor: not-allowed; }
@media (max-width: 640px) {
    .comment-form-row { grid-template-columns: 1fr; }
}

/* ===== AI CHAT WIDGET =====
   These rules used to live inside chat.js, which built a <style> element and
   appended it to document.head at runtime. Two defects came with that:
   the colours were hardcoded hex from the dark default palette, so the widget
   stayed a dark island on a light theme no matter what the theme layer said;
   and a script-inserted <style> is governed by style-src, which no longer
   permits 'unsafe-inline' — the block carried no nonce, so the browser dropped
   the whole sheet. Living here, it inherits the theme tokens and is served from
   'self'. Every colour below is a role token; the geometry is unchanged. */
#chat-btn {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--highlight);
    color: var(--text-on-accent);   /* the icon strokes/fills inherit this */
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: transform 0.15s;
}
#chat-btn:hover { transform: scale(1.08); }
#chat-btn svg { width: 28px; height: 28px; fill: none; stroke: currentColor; }

#chat-panel {
    position: fixed;
    bottom: 5.5rem;
    right: 1.5rem;
    width: 440px;
    max-width: calc(100vw - 2rem);
    height: 600px;
    max-height: calc(100vh - 6rem);
    background: var(--bg);
    border: 1px solid var(--bg-border);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    display: none;
    flex-direction: column;
    z-index: 9998;
    overflow: hidden;
}
#chat-panel.open { display: flex; }

#chat-header {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--bg-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
#chat-header span { font-size: 0.9rem; font-weight: 600; color: var(--text-strong); }
#chat-header button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.25rem;
    line-height: 1;
    padding: 0;
}
#chat-header button:hover { color: var(--text); }

#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
#chat-messages::-webkit-scrollbar { width: 4px; }
#chat-messages::-webkit-scrollbar-track { background: transparent; }
#chat-messages::-webkit-scrollbar-thumb { background: var(--bg-border); border-radius: 2px; }

.chat-msg {
    max-width: 85%;
    padding: 0.6rem 0.85rem;
    border-radius: 10px;
    font-size: 0.85rem;
    line-height: 1.55;
    word-break: break-word;
}
.chat-msg.user {
    align-self: flex-end;
    background: var(--highlight);
    color: var(--text-on-accent);
    border-bottom-right-radius: 3px;
}
.chat-msg.assistant {
    align-self: flex-start;
    background: var(--bg-elevated);
    color: var(--text);
    border-bottom-left-radius: 3px;
}
.chat-msg.assistant p { margin: 0.3rem 0; }
.chat-msg.assistant p:first-child { margin-top: 0; }
.chat-msg.assistant p:last-child { margin-bottom: 0; }
.chat-msg.assistant h1,
.chat-msg.assistant h2,
.chat-msg.assistant h3 { font-size: 0.9rem; font-weight: 700; margin: 0.5rem 0 0.2rem; }
.chat-msg.assistant ul { margin: 0.3rem 0; padding-left: 1.2rem; }
.chat-msg.assistant li { margin: 0.15rem 0; }
/* A step down from the bubble surface, not a fixed near-black: on a light
   theme --bg is the page white, which reads correctly inside the bubble. */
.chat-msg.assistant pre {
    background: var(--bg);
    padding: 0.5rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 0.4rem 0;
    font-size: 0.8rem;
}
.chat-msg.assistant code {
    background: var(--bg);
    padding: 0.1em 0.3em;
    border-radius: 3px;
    font-size: 0.82rem;
}
.chat-msg.assistant pre code { background: none; padding: 0; }
.chat-msg.assistant a { color: var(--accent-text); }
/* Deliberately palette-independent: a red error box has to read as an error in
   every theme, and #991b1b on #fee2e2 is 7.0:1 either way. */
.chat-msg.error { align-self: flex-start; background: #fee2e2; color: #991b1b; }

.chat-msg-notice {
    margin-top: 0.5rem;
    padding-top: 0.4rem;
    border-top: 1px solid var(--bg-border);
    font-size: 0.75rem;
    font-style: italic;
    color: var(--text-muted);
}
.chat-msg-notice .chat-retry {
    color: var(--accent-text);
    text-decoration: underline;
    margin-left: 0.25rem;
    font-style: normal;
}
.chat-msg-notice .chat-retry:hover { color: var(--highlight-dk); }

.chat-typing {
    align-self: flex-start;
    padding: 0.5rem 0.85rem;
    background: var(--bg-elevated);
    border-radius: 10px;
    border-bottom-left-radius: 3px;
}
.chat-typing span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--text-dim);
    border-radius: 50%;
    animation: chatdot 1.2s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes chatdot {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40%           { transform: scale(1);   opacity: 1; }
}

#chat-input-row {
    padding: 0.75rem;
    border-top: 1px solid var(--bg-border);
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}
#chat-input {
    flex: 1;
    background: var(--bg-elevated);
    border: 1px solid var(--bg-border);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    color: var(--text);
    font-size: 0.85rem;
    font-family: inherit;
    resize: none;
    height: 40px;
    line-height: 1.4;
    outline: none;
}
#chat-input:focus { border-color: var(--highlight); }
#chat-send {
    background: var(--highlight);
    color: var(--text-on-accent);
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
}
#chat-send:hover { background: var(--highlight-dk); }
#chat-send:disabled { opacity: 0.5; cursor: not-allowed; }
#chat-send svg { width: 18px; height: 18px; fill: currentColor; }

/* ===== UTILITY ===== */
/* Used in place of style="" attributes so the CSP style-src can omit 'unsafe-inline'. */
.d-none { display: none; }
.gtm-noscript { display: none; visibility: hidden; }
.api-key-hint { font-weight: 400; opacity: 0.7; }
