/* Shared semantic colours. Loaded after each page's layout styles.
   Surfaces: page < surface < raised; sidebar-surface for the admin rail.
   Ink: ink > ink-2 > muted > faint. Lines: line (dividers), line-strong (controls).
   Status: ok / warning / danger, each with a -soft tint for pills and notices. */
:root {
    color-scheme: light;
    --surface: #fff;
    --raised: #f7f7f8;
    --line-strong: #d0d4db;
    --ok-soft: #ecfdf3;
    --page: #fcfcfc;
    --sidebar-surface: #fafafa;
    --chat-page: #f6f6f7;
    --bubble: #f3f4f6;
    --ink: #111827;
    --ink-2: #344054;
    --muted: #6b7280;
    --faint: #9ca3af;
    --line: #e5e7eb;
    --soft: #f9fafb;
    --hover: #f0f0f2;
    --selected: #e9e9ec;
    --button-hover: #374151;
    --on-action: #fff;
    --white: #fff;
    --danger: #b91c1c;
    --danger-solid: #b91c1c;
    --danger-hover: #991b1b;
    --danger-soft: #fef3f2;
    --warning: #92400e;
    --warning-soft: #fffbeb;
    --ok: #15803d;
    --focus: #2563eb;
    --link: #1d4ed8;
    --scrollbar: #c4c8cf;
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --surface: #101112;
    --raised: #17191c;
    --line-strong: #3b3f46;
    --ok-soft: #13291c;
    --page: #090a0b;
    --sidebar-surface: #0b0c0d;
    --chat-page: #090a0b;
    --bubble: #1a1c1f;
    --ink: #f3f4f6;
    --ink-2: #d4d6dc;
    --muted: #aaaeb7;
    --faint: #8d929c;
    --line: #2b2e33;
    --soft: #17191c;
    --hover: #202328;
    --selected: #26292e;
    --button-hover: #d4d6dc;
    --on-action: #101112;
    --danger: #fda4af;
    --danger-solid: #a52e40;
    --danger-hover: #862536;
    --danger-soft: #3a202a;
    --warning: #f9d58b;
    --warning-soft: #362c1c;
    --ok: #86efac;
    --focus: #93b4ff;
    --link: #93b4ff;
    --scrollbar: #484d56;
}
html { background: var(--page); scrollbar-color: var(--scrollbar) transparent; }
/* The dark logo tile needs an outline to stay visible on dark surfaces. */
html[data-theme="dark"] :is(.brand img, body[data-page="login"] .card > img, body[data-page="index"] .masthead img, .logo-link svg) { border-radius: 25%; box-shadow: 0 0 0 1px var(--line); }
.theme-picker { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font: 12px/1.4 Inter, "Inter Variable", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; white-space: nowrap; }
.theme-options { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--sidebar-surface); }
.theme-picker .theme-option { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 30px; min-width: 0; height: 28px; margin: 0; padding: 0; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); font: inherit; cursor: pointer; box-shadow: none; }
.theme-picker .theme-option svg { width: 16px; height: 16px; }
.theme-picker .theme-option:hover { background: var(--hover); color: var(--ink); }
.theme-picker .theme-option[aria-checked="true"] { background: var(--selected); border-color: var(--line); color: var(--ink); }
.theme-picker .theme-option:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.theme-corner { position: absolute; top: 16px; right: 20px; }
.theme-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.sidebar-footer [data-theme-control] { flex-basis: 100%; margin-bottom: 4px; }
.mobile-bar [data-theme-control] { margin-left: auto; }
.mobile-bar .theme-picker > span { display: none; }
.preview-bar .theme-picker > span, .header .theme-picker > span { display: none; }
.preview-bar > [data-theme-control] { margin-left: auto; }
.preview-bar { flex-wrap: wrap; }
body[data-page="preview"] { --brand-link: var(--brand-text); }
html[data-theme="dark"] body[data-page="preview"] { --brand-link: color-mix(in srgb, var(--brand-text) 35%, white); }
/* Swagger keeps its method colours; neutral panels and text follow the site. */
body[data-page="docs"] { margin: 0; background: var(--surface); color: var(--ink); }
.docs-theme-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); font: 13px Inter, "Inter Variable", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
.docs-theme-bar a { color: var(--muted); text-decoration: none; }
html[data-theme="dark"] .swagger-ui { color: var(--ink); }
html[data-theme="dark"] .swagger-ui :is(.info .title, .info p, .info li, .info h1, .info h2, .info h3, .info h4, .info h5, .opblock-tag, .opblock-tag small, .opblock-summary-path, .opblock-summary-description, .opblock-description-wrapper p, .opblock-title_normal, .opblock-external-docs-wrapper, .parameter__name, .parameter__type, .parameter__in, .parameter__extension, .response-col_status, .response-col_description, .response-col_links, .responses-inner h4, .responses-inner h5, .tab li, .model, .model-title, .model-toggle, .model-box, .prop-type, .prop-format, .property-row, .btn, label, th, td, p) { color: var(--ink); }
html[data-theme="dark"] .swagger-ui :is(.info a, .opblock-description-wrapper a, .response-col_description a) { color: var(--link); }
html[data-theme="dark"] .swagger-ui :is(input, select, textarea) { color: var(--ink); background: var(--surface); border-color: var(--line); }
html[data-theme="dark"] .swagger-ui :is(.scheme-container, .opblock .opblock-section-header, section.models, .model-box, .model-container, .dialog-ux .modal-ux) { background: var(--soft); border-color: var(--line); box-shadow: none; }
html[data-theme="dark"] .swagger-ui :is(.opblock-tag, section.models, section.models h4, table thead tr th, table tbody tr td, .responses-inner) { border-color: var(--line); }
html[data-theme="dark"] .swagger-ui .model-container:hover { background: var(--hover); }
html[data-theme="dark"] .swagger-ui :is(.model-toggle, .opblock-control-arrow, .expand-operation, .authorization__btn, .models-control) svg { fill: var(--ink); }
html[data-theme="dark"] .swagger-ui .model-toggle::after { filter: invert(1); }
html[data-theme="dark"] .swagger-ui :is(.markdown code, .renderedMarkdown code) { color: var(--ink); background: var(--bubble); }
html[data-theme="dark"] .swagger-ui :is(section.models h4, .models-control, .opblock-control-arrow, .expand-operation, .authorization__btn) { color: var(--ink); }
html[data-theme="dark"] .swagger-ui [class*="json-schema-2020-12"] { color: var(--ink); }
html[data-theme="dark"] .swagger-ui :is(.json-schema-2020-12-accordion, .json-schema-2020-12-expand-deep-button) { background: transparent; }
html[data-theme="dark"] .swagger-ui :is(.json-schema-2020-12__attribute, .json-schema-2020-12-keyword__name) { color: var(--link); }
html[data-theme="dark"] .swagger-ui .opblock .opblock-section-header h4 { color: var(--ink); }
