/* Appearance shared with the model and playground pages. */
html.dark, html.dark body.gallery { color-scheme: dark; --ink: #eae8ef; --paper: #1c1c22; --line: #33313d; --muted: #aaa5b4; --wash: #222229; --portal-console-bg: #17171c; --ui-text:#eae8ef; --ui-secondary:#d1ced8; --ui-success:#91d5b6; --ui-info:#9ccaf1; --ui-warning:#edc582; --ui-danger:#f4b2c0; --ui-muted: #aaa5b4; --ui-accent: #b09bdc; --product-ink: #eae8ef; --product-muted: #aaa5b4; --product-line: #33313d; --product-soft:#222229; --product-accent:#b09bdc; }
html.dark body.gallery { background: #17171c!important; color: #eae8ef; }
html.dark body.gallery :is(.q-header,.q-dropdown,.quick-widget,.widget-tabs,.widget-content,.widget-sample,.q-app-preview,.preview-sidebar,.preview-input,.q-function,.q-model-tile,.q-footer,.console-sidebar,.account-popover,.account-summary,dialog) { background: #1c1c22; color: #eae8ef; border-color: #33313d; }
html.dark body.gallery :is(.q-nav>a,.q-drop>button,.account-popover a,.account-popover button,.q-hero-actions>.text,.q-footer a) { color: #eae8ef; }
html.dark body.gallery :is(.q-dropdown a:hover,.q-dropdown button:hover,.account-popover a:hover,.account-popover button:hover) { background: #322a43; }
html.dark body.gallery :is(.q-header,.quick-widget,.q-app-preview,.q-function,.q-model-tile) { box-shadow: none; }
html.dark body.gallery :is(input,textarea,select) { background: #222229; color: #eae8ef; border-color: #484252; }

.portal-theme-control { width: 2.25rem; height: 2.25rem; position: relative; display: inline-grid; place-items: center; flex: none; color: inherit; cursor: pointer; }
.portal-theme-control svg { width: 1.2rem; height: 1.2rem; }
.portal-theme-control select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.portal-theme-control:focus-within { outline: .125rem solid #8b80d7; outline-offset: .125rem; border-radius: var(--radius-md); }
html.dark body.gallery :is(.q-brand,.q-nav > a,.q-drop > button,.q-header-actions > a:not(.q-pill),.q-header-actions > button:not(.q-account),.q-hero-actions > .text,.widget-tabs button,.widget-sample code,.q-model-tile h3,.q-function h3,.preview-body h3) { color: #eae8ef !important; }
html.dark body.gallery .widget-tabs button[aria-selected="true"] { color: #25252c !important; }
html.dark body.gallery :is(.widget-links span,.widget-links button,.widget-sample button) { color: #c7b8ed; }
html.dark body.gallery :is(.visual-caption strong,.visual-caption span) { color: #272b38; }

html.dark body.gallery .q-header { background: #17171c; }

/* Legacy portal surfaces share the saved theme; layout and light colors stay intact. */
html.dark body.gallery :is(.workspace-header,.workspace-sidebar,.management-header,.management-sidebar,.docs-sidebar) { background:#1c1c22!important; border-color:#33313d; }
html.dark body.gallery :is(.workspace-main,.management-main,.docs-main) { background:transparent!important; }
html.dark body.gallery :is(.console-surface,.console-metric-grid article,.portal-wallet,.portal-plan,.portal-media-surface,.portal-media-task,.management-surface,.management-metric,.management-shortcuts,.management-savebar,.management-drawer,.management-dialog,.management-editor-preview,.management-live-card,.management-mini-auth,.management-checklist label,.docs-search-results,.docs-estimator,.docs-formula,.docs-cache-example,.docs-history-flow) { background:#1c1c22; color:#eae8ef; border-color:#33313d; }
html.dark body.gallery :is(.workspace-brand,.workspace-header-title,.workspace-link,.workspace-nav-group>summary,.workspace-return,.workspace-management-label,.management-heading h1,.console-page-heading h1,.management-surface-header h2,.management-metric strong,.management-field label,.management-drawer h2,.management-dialog h2,.management-live-card h3,.management-mini-auth h3,.docs-article,.docs-article h1,.docs-article h2,.docs-article h3,.docs-article strong,.docs-article td,.docs-breadcrumb strong,.docs-definition-grid strong,.docs-history-flow strong,.docs-sidebar .sidebar-toolbar>span,.docs-mobile-toc summary) { color:#eae8ef!important; }
html.dark body.gallery :is(.docs-nav-group>h2,.docs-nav-group a,.docs-breadcrumb,.docs-lead,.docs-toc,.docs-toc a,.docs-search-field svg,.docs-search-field kbd,.docs-search-results p,.docs-search-results small,.docs-estimator label,.docs-price-line,.docs-estimate-breakdown,.docs-formula span,.docs-cache-example p,.docs-cache-example>div>span,.docs-history-flow span,.docs-catalog-count,.docs-pagination small,.docs-empty,.management-plan-price,.management-setting-copy label) { color:#aaa5b4; }
html.dark body.gallery :is(.docs-article a,.docs-toc a[aria-current],.docs-mobile-toc a,.docs-estimate-result output) { color:#c7b8ed; }
html.dark body.gallery :is(.workspace-link.active,.workspace-link:hover,.workspace-nav-group>summary:hover,.management-filter-tabs button[aria-pressed=true],.docs-nav-group a[aria-current],.docs-nav-group a:hover,.docs-search-results a:hover,.docs-search-results a[aria-selected=true]) { background:#322a43; color:#d1bff1; }
html.dark body.gallery :is(.docs-search-field,.docs-code,.docs-code-header,.docs-callout,.docs-article :not(pre)>code,.management-note,.management-tag,.management-table th,.portal-table th) { background:#222229; color:#d1ced8; border-color:#33313d; }
html.dark body.gallery :is(.docs-code pre,.docs-code button,.docs-search-results a,.docs-pagination a,.docs-search-field input,.docs-search-field input::placeholder) { color:#d1ced8; }
html.dark body.gallery :is(.docs-table-wrap,.docs-table :is(th,td),.docs-code,.docs-code-header,.docs-estimator,.docs-pagination a,.workspace-sidebar,.management-table :is(th,td),.portal-table :is(th,td)) { border-color:#33313d; }
html.dark body.gallery :is(.docs-table th,.docs-code-tabs button[aria-selected=true],.q-pill:not(.black)) { background:#222229; color:#eae8ef; border-color:#484252; }
html.dark body.gallery .q-pill.black { background:#eae8ef; color:#25252c; }
html.dark body.gallery :is(.docs-callout.error,.management-errors) { background:#351f28; color:#f4b2c0; border-color:#704451; }
html.dark body.gallery .docs-article [role=alert] { color:#f4b2c0; }

html.dark body.workspace-active { --workspace-bg:#17171c; --workspace-line:#33313d; --workspace-ink:#eae8ef; --workspace-muted:#aaa5b4; }
html.dark body.gallery :is(.portal-shortcuts,.workbench-card,.workbench-section,.workbench-doc,.workbench-model) { background:#1c1c22; color:#eae8ef; border-color:#33313d; }
html.dark body.gallery :is(.sidebar-bottom-controls,.workbench-model-family) { background:#222229; color:#d1bff1; }
html.dark body.gallery .workspace-platform-divider { background:#33313d; }
html.dark body.gallery .workspace-sidebar nav .workspace-link:is(.active,:hover) { background:#322a43; color:#d1bff1!important; }

html.dark body.gallery .portal-shortcuts :is(a,button) { color:var(--ink); }
html.dark body.gallery :is(.portal-shortcuts a:hover,.portal-shortcuts button:hover,.workbench-doc:hover,.workbench-model:hover,.management-table tbody tr:hover,.portal-table tbody tr:hover) { background:#322a43; }

/* Media surfaces and management rows use the shared dark palette. */
html.dark body.gallery :is(.refined-try .try-main,.refined-try .try-sidebar) { background:#1c1c22; color:#eae8ef; border-color:#33313d; }
html.dark body.gallery .portal-kind-nav button[aria-pressed=true] { background:#322a43; color:#d1bff1; }
html.dark body.gallery #portal-media-error { color:#f4b2c0; }
html.dark body.gallery .management-table td strong { color:#eae8ef; }
html.dark body.gallery .management-table td button[data-edit] { color:#c7b8ed; }

html.dark body.gallery :is(.refined-try .sidebar-content .chat-sidebar-top h2, .portal-media-results .surface-heading h2, .docs-toc > strong) { color: var(--ink); }
html.dark body.gallery .sidebar-bottom-controls :is(.sidebar-toggle, .sidebar-reset) { color: var(--ui-secondary); }
html.dark body.gallery .sidebar-bottom-controls :is(.sidebar-toggle, .sidebar-reset):is(:hover, :focus-visible) { background: var(--line); color: var(--ink); }

/* Channel model pickers share the management dark palette. */
html.dark body.gallery :is(.management-model-picker legend,.management-picker-list strong) { color:var(--ink); }
html.dark body.gallery :is(.management-picker-toolbar,.management-picker-list small,#editor-picker-empty) { color:var(--ui-secondary); }
html.dark body.gallery .management-picker-toolbar button { color:var(--ui-accent); }
html.dark body.gallery :is(.management-model-picker>input,.management-picker-list) { background:var(--paper); color:var(--ink); border-color:var(--line); }
html.dark body.gallery .management-picker-list label { border-color:var(--line); }
html.dark body.gallery .management-picker-list label:has(input:checked) { background:#322a43; }

/* Embedded console frames, probe telemetry, and operational surfaces in dark mode. */
html.dark body.gallery .console-content-frame { background:#17171c; color-scheme:dark; }
html.dark body.gallery :is(.console-info-strip,.portal-endpoint-item,.settings-onboarding) { background:#1c1c22; color:#d1ced8; border-color:#33313d; }
html.dark body.gallery .portal-endpoints code { color:#eae8ef; }
html.dark body.gallery .portal-plan.featured { background:#201d2b; border-color:#534578; }
html.dark body.gallery .portal-status-pill { background:#2b253a; color:#d1bff1; }
html.dark body.gallery .live-key-scope { background:#2b253a; color:#d1bff1; }
html.dark body.gallery .live-status-pill { background:#272730; color:#aaa5b4; border-color:#3a3846; }
html.dark body.gallery .live-status-pill.healthy { background:#182d26; color:#91d5b6; border-color:#264b3e; }
html.dark body.gallery .live-status-pill.warning { background:#312618; color:#edc582; border-color:#544024; }
html.dark body.gallery .live-status-pill.danger { background:#351f28; color:#f4b2c0; border-color:#613545; }
html.dark body.gallery :is(.console-data-table th,.management-table th) { background:#222229!important; color:#aaa5b4!important; border-color:#33313d!important; }
html.dark body.gallery :is(.console-data-table td,.management-table td) { color:#d1ced8!important; border-color:#2b2935!important; }
html.dark body.gallery :is(.console-data-table td strong,.management-table td strong) { color:#eae8ef!important; }
html.dark body.gallery :is(.console-data-table td small,.management-table td small,.console-data-table code,.management-table code) { color:#aaa5b4!important; }
html.dark body.gallery :is(.console-data-table tbody tr:hover,.management-table tbody tr:hover) { background:#252330!important; }
html.dark body.gallery .management-row-actions button { color:#c7b8ed; }
html.dark body.gallery .management-row-actions button:hover { background:#322a43; color:#eae8ef; }
html.dark body.gallery .management-tag.enabled { background:#182d26; color:#91d5b6; }
html.dark body.gallery .management-tag.warning { background:#312618; color:#edc582; }
html.dark body.gallery .management-tag.danger { background:#351f28; color:#f4b2c0; }
html.dark body.gallery .management-tag.muted { background:#272730; color:#aaa5b4; }
html.dark body.gallery :is(#workbench-subscription strong,.workbench-usage dd,.workbench-card h2,.workbench-section h2,.surface-heading h2) { color:#eae8ef; }
html.dark body.gallery .workbench-usage dl { border-color:#33313d; }
html.dark body.gallery .workbench-chart svg path[stroke="#e5e7ef"] { stroke:#33313d; }
html.dark body.gallery .wb-sync-pill { background:#282338; color:#d1bff1; border-color:#3e3556; }
html.dark body.gallery .wb-top-progress { background:#262333; }
html.dark body.gallery .wb-skeleton { background:linear-gradient(90deg,#252430 0%,#332e44 48%,#252430 100%); background-size:220% 100%; }
html.dark body.gallery .wb-chart-bars { border-color:#33313d; }
html.dark body.gallery .wb-chart-bars i { background:linear-gradient(180deg,rgba(176,155,220,0.3) 0%,rgba(176,155,220,0.08) 100%); }
html.dark body.gallery .wb-chart-axis span { background:#272633; }
html.dark body.gallery .wb-table-row { background:#202028; border-color:#2e2c3a; }
html.dark body.gallery :is(.probe-service-summary article,.probe-status-surface,.probe-detail-trend,.probe-records-wrap) { background:#1c1c22; border-color:#33313d; }
html.dark body.gallery :is(.probe-detail-metrics>div,.probe-records th,.probe-window) { background:#222229; border-color:#33313d; }
html.dark body.gallery .probe-window button[aria-pressed=true] { background:#322a43; color:#eae8ef; box-shadow:none; }
html.dark body.gallery :is(.probe-service-summary strong,.probe-service-model h3,.probe-detail-metrics strong,.probe-service-latency strong,.probe-detail-top h3) { color:#eae8ef; }
html.dark body.gallery :is(.probe-status-filters,.probe-service-row,.probe-records td) { border-color:#2d2b37; }
html.dark body.gallery .probe-service-model .model-avatar { background:#282536; color:#d1bff1; border-color:#3a354d; }
html.dark body.gallery :is(.probe-baseline,.probe-gridline) { stroke:#33313d; }
html.dark body.gallery .probe-chart.empty { background:#202028; border-color:#363442; }
html.dark body.gallery .probe-tooltip { background:#24242cf5; border-color:#3a3846; color:#d1ced8; box-shadow:0 .5rem 1.5rem #0006; }
html.dark body.gallery .probe-badge { background:#272730; color:#aaa5b4; }
html.dark body.gallery .probe-badge.healthy { background:#192a3b; color:#9ccaf1; }
html.dark body.gallery .probe-badge.degraded { background:#312618; color:#edc582; }
html.dark body.gallery .probe-badge.unavailable { background:#351f28; color:#f4b2c0; }
html.dark body.gallery :is(.operations-metrics,.operations-connection) { background:#1c1c22; border-color:#33313d; }
html.dark body.gallery .operations-metrics>div+div { border-color:#33313d; }
html.dark body.gallery :is(.operations-metrics strong,.operations-connection h3,.operations-user-heading h3,.operations-mail-use strong) { color:#eae8ef; }
html.dark body.gallery :is(.operations-search,.operations-toolbar select,.operations-role,.operations-currency,.operations-mail-use>span:first-child,.operations-person>span) { background:#222229; color:#d1ced8; border-color:#3a3846; }
html.dark body.gallery .operations-mail-use { border-color:#2d2b37; }
html.dark body.gallery .q-promo { background:#232034; color:#eae8ef; }
html.dark body.gallery .q-promo button { color:#aaa5b4; }
html.dark body.gallery :is(.featured-inner,.highlight-inner) { background:rgba(24,24,32,0.88); border:0.0625rem solid rgba(255,255,255,0.1); backdrop-filter:blur(0.625rem); color:#eae8ef; }
html.dark body.gallery :is(.featured-inner h3,.highlight-inner h3) { color:#eae8ef; }
html.dark body.gallery .q-mobile-links { background:#1c1c22; border-color:#33313d; color:#eae8ef; box-shadow:0 0.75rem 2.25rem #0008; }
html.dark body.gallery .q-mobile-links :is(a,button) { color:#eae8ef; }
html.dark body.gallery .model-glyph { background:#292736; color:#d1ced8; }
html.dark body.gallery .model-glyph.q { background:#2e2647; color:#c7b8ed; }
html.dark body.gallery .model-glyph.d { background:#1d2c42; color:#9ccaf1; }
html.dark body.gallery .model-glyph.k { background:#262936; color:#d1ced8; }
html.dark body.gallery .model-glyph.g { background:#18312c; color:#91d5b6; }
html.dark body.gallery .model-glyph.m { background:#35241c; color:#f3b896; }
html.dark body.gallery .portal-support-row { background:#222229; border-color:#33313d; }
html.dark body.gallery .portal-support-row a { color:#c7b8ed; }
