/*
 * ShopAccount dark theme repair v12.
 * Final dark-scheme layer for storefront, account and admin surfaces.
 */

html[data-color-scheme="dark"] {
    background: #080d14;
    color-scheme: dark;
}

html[data-color-scheme="dark"] body.marketplace-surface,
html[data-color-scheme="dark"] body.customer-surface {
    --store-bg: #080d14;
    --store-bg-soft: #0c131e;
    --store-surface: #121b28;
    --store-surface-raised: #172233;
    --store-ink: #f7f9fc;
    --store-muted: #aeb8c8;
    --store-line: #2a3749;
    --store-line-strong: #3b4a60;
    --store-accent: #ff5b70;
    --store-accent-hover: #ff7587;
    --store-accent-soft: #30151d;
    --store-success: #36d399;
    --paper: var(--store-surface);
    --ink: var(--store-ink);
    --muted: var(--store-muted);
    --line: var(--store-line);
    background: var(--store-bg) !important;
    color: var(--store-ink);
}

html[data-color-scheme="dark"] body.marketplace-surface :is(.market-shell, .market-main) {
    background: var(--store-bg) !important;
    color: var(--store-ink);
}

/* Header account controls */
html[data-color-scheme="dark"] body.marketplace-surface :is(
    .market-account-avatar,
    .market-account-admin-link,
    .market-language-switch button.is-active,
    .market-theme-switch button.is-active
) {
    border-color: #793344 !important;
    background: var(--store-accent-soft) !important;
    color: #ff91a0 !important;
}

html[data-color-scheme="dark"] body.marketplace-surface :is(
    .market-language-switch,
    .market-theme-switch button,
    .market-account-user-card
) {
    border-color: var(--store-line) !important;
    background: #141e2a !important;
    color: var(--store-ink) !important;
}

/* Shared storefront and footer surfaces */
html[data-color-scheme="dark"] body.marketplace-surface .market-trust-strip {
    border-color: var(--store-line) !important;
    background: #0c131e !important;
    color: var(--store-ink);
}

html[data-color-scheme="dark"] body.marketplace-surface .market-trust-strip :is(b, strong) {
    color: var(--store-ink) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .market-trust-strip :is(small, p) {
    color: var(--store-muted) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .market-trust-strip > div > span {
    border-color: var(--store-line) !important;
    background: transparent !important;
    color: var(--store-ink) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .market-footer :is(.market-footer-payments span, .market-footer-badges span) {
    border-color: var(--store-line) !important;
    background: var(--store-surface) !important;
    color: var(--store-muted) !important;
}

/* Catalog, product and store */
html[data-color-scheme="dark"] body.marketplace-surface :is(
    .market-product-gallery,
    .market-store-avatar,
    .market-results-count,
    .market-view-switch a,
    .market-sort-tabs a
) {
    border-color: var(--store-line) !important;
    background: var(--store-surface) !important;
    color: var(--store-ink) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface :is(.market-sort-tabs a.active, .market-view-switch a.active) {
    border-color: #793344 !important;
    background: var(--store-accent-soft) !important;
    color: var(--store-accent) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .market-store-avatar {
    box-shadow: 0 0 0 4px #0c131e;
}

/* Orders, wallet and data rows */
html[data-color-scheme="dark"] body.customer-surface .orders-workspace :is(
    .toolbar-search,
    .order-status-tabs > span,
    .credential-actions button,
    .credential-actions a
) {
    border-color: var(--store-line) !important;
    background: #0b1119 !important;
    color: var(--store-ink) !important;
}

html[data-color-scheme="dark"] body.customer-surface .orders-workspace .order-status-tabs > span.active {
    border-color: #793344 !important;
    background: var(--store-accent-soft) !important;
    color: var(--store-accent) !important;
}

html[data-color-scheme="dark"] body.customer-surface .orders-workspace .order-status-tabs b {
    background: var(--store-surface-raised) !important;
    color: var(--store-ink) !important;
}

html[data-color-scheme="dark"] body.customer-surface .wallet-deposit-v4 :is(
    .qr-placeholder,
    .deposit-amount-input > span,
    .promo-item,
    .transaction-state > div
) {
    border-color: var(--store-line) !important;
    background: var(--store-surface-raised) !important;
    color: var(--store-ink) !important;
}

html[data-color-scheme="dark"] body.customer-surface :is(.data-row, .ledger-row, .ctv-seller-row) {
    border-color: var(--store-line) !important;
    background: var(--store-surface) !important;
    color: var(--store-ink) !important;
}

html[data-color-scheme="dark"] body.customer-surface :is(.data-head, .ledger-row.data-head) {
    background: var(--store-surface-raised) !important;
    color: var(--store-muted) !important;
}

html[data-color-scheme="dark"] body.customer-surface :is(.empty-state, .empty-inline, .market-empty-state) {
    border-color: var(--store-line) !important;
    background: var(--store-surface) !important;
    color: var(--store-ink) !important;
}

/* Account settings */
html[data-color-scheme="dark"] body.account-workspace-surface :is(
    .account-mini-profile,
    .account-settings-nav,
    .security-guidance,
    .account-settings-panel code
) {
    border-color: var(--store-line) !important;
    background: var(--store-surface) !important;
    color: var(--store-ink) !important;
    box-shadow: none;
}

html[data-color-scheme="dark"] body.account-workspace-surface .account-settings-nav > a {
    border-color: transparent !important;
    background: transparent !important;
    color: var(--store-muted) !important;
}

html[data-color-scheme="dark"] body.account-workspace-surface .account-settings-nav > a:is(:hover, :focus-visible, .active) {
    border-color: #793344 !important;
    background: var(--store-accent-soft) !important;
    color: var(--store-ink) !important;
}

html[data-color-scheme="dark"] body.account-workspace-surface .security-guidance {
    background: #10231f !important;
}

html[data-color-scheme="dark"] body.account-workspace-surface :is(
    .account-mini-profile,
    .account-settings-nav,
    .security-guidance,
    .account-settings-panel
) :is(h1, h2, h3, strong, b, code) {
    color: var(--store-ink) !important;
}

html[data-color-scheme="dark"] body.account-workspace-surface :is(
    .account-mini-profile,
    .account-settings-nav,
    .security-guidance,
    .account-settings-panel
) :is(p, small, em) {
    color: var(--store-muted) !important;
}

/* Affiliate and reseller workspaces */
html[data-color-scheme="dark"] body.customer-surface .affiliate-page :is(
    .affiliate-surface,
    .affiliate-metric-strip,
    .affiliate-copy-field,
    .affiliate-performance-card,
    .commission-history,
    .withdraw-card,
    input,
    select,
    textarea
) {
    border-color: var(--store-line) !important;
    background: var(--store-surface) !important;
    color: var(--store-ink) !important;
    box-shadow: none;
}

html[data-color-scheme="dark"] body.customer-surface .affiliate-page :is(
    .affiliate-metric-strip > *,
    .affiliate-copy-field,
    .performance-funnel > *,
    .commission-history .empty-inline
) {
    border-color: var(--store-line) !important;
    background: var(--store-surface-raised) !important;
}

html[data-color-scheme="dark"] body.customer-surface .affiliate-page :is(h1, h2, h3, strong, b, label) {
    color: var(--store-ink) !important;
}

html[data-color-scheme="dark"] body.customer-surface .affiliate-page :is(p, small, span, em) {
    color: var(--store-muted);
}

/* API documentation */
html[data-color-scheme="dark"] body.customer-surface .developer-docs-page {
    background: var(--store-bg) !important;
    color: var(--store-ink);
}

html[data-color-scheme="dark"] body.customer-surface .developer-docs-page :is(
    .developer-docs-nav,
    .developer-docs-layout > *,
    .endpoint-directory-tools,
    .api-endpoint-nav-item,
    .api-url-field,
    .api-copy-request,
    .api-no-parameters,
    .api-response-metrics > *,
    .api-security-warning,
    aside
) {
    border-color: var(--store-line) !important;
    background: var(--store-surface) !important;
    color: var(--store-ink) !important;
}

html[data-color-scheme="dark"] body.customer-surface .developer-docs-page :is(
    .api-endpoint-nav-item.active,
    .developer-docs-nav a.active
) {
    border-color: #793344 !important;
    background: var(--store-accent-soft) !important;
    color: var(--store-accent) !important;
}

html[data-color-scheme="dark"] body.customer-surface .developer-docs-page .api-no-parameters {
    border-color: #285a58 !important;
    background: #10231f !important;
}

html[data-color-scheme="dark"] body.customer-surface .developer-docs-page :is(.api-security-warning, aside) {
    border-color: #5d4924 !important;
    background: #241d12 !important;
}

html[data-color-scheme="dark"] body.customer-surface .developer-docs-page :is(h1, h2, h3, strong, b, code) {
    color: var(--store-ink) !important;
}

html[data-color-scheme="dark"] body.customer-surface .developer-docs-page :is(p, small, span) {
    color: var(--store-muted);
}

/* Login and registration */
html[data-color-scheme="dark"] body.marketplace-surface .auth-marketplace {
    --auth-text: var(--store-ink);
    --auth-muted: var(--store-muted);
    --auth-line: var(--store-line);
}

html[data-color-scheme="dark"] body.marketplace-surface .auth-card {
    border-color: var(--store-line-strong);
    background: var(--store-surface) !important;
    color: var(--store-ink);
    box-shadow: 0 28px 70px rgb(0 0 0 / 56%);
}

html[data-color-scheme="dark"] body.marketplace-surface .auth-card :is(.auth-field, input:not([type="checkbox"])) {
    border-color: var(--store-line) !important;
    background: #0b1119 !important;
    color: var(--store-ink) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .auth-card :is(.auth-control, .auth-options label, .auth-terms) {
    color: #d6deea !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .auth-card :is(.auth-card-header h2, .auth-security-note b) {
    color: var(--store-ink) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .auth-security-note {
    border-color: #285a58;
    background: #10231f !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .auth-password-toggle:is(:hover, :focus-visible) {
    background: var(--store-accent-soft);
}

/* Admin design tokens */
html[data-color-scheme="dark"] body.admin-surface {
    --admin-dark-bg: #080d14;
    --admin-dark-surface: #121b28;
    --admin-dark-raised: #172233;
    --admin-dark-ink: #f7f9fc;
    --admin-dark-muted: #aeb8c8;
    --admin-dark-line: #2a3749;
    --admin-dark-line-strong: #3b4a60;
    --admin-dark-accent-soft: #30151d;
    --paper: var(--admin-dark-surface);
    --ink: var(--admin-dark-ink);
    --muted: var(--admin-dark-muted);
    --line: var(--admin-dark-line);
    --aw-bg: var(--admin-dark-bg);
    --aw-surface: var(--admin-dark-surface);
    --aw-surface-subtle: var(--admin-dark-raised);
    --aw-text: var(--admin-dark-ink);
    --aw-heading: #ffffff;
    --aw-muted: var(--admin-dark-muted);
    --aw-line: var(--admin-dark-line);
    --aw-line-strong: var(--admin-dark-line-strong);
    --admin-v2-canvas: var(--admin-dark-bg);
    --admin-v2-surface: var(--admin-dark-surface);
    --admin-v2-subtle: var(--admin-dark-raised);
    --admin-v2-line: var(--admin-dark-line);
    --admin-v2-line-strong: var(--admin-dark-line-strong);
    --admin-v2-ink: var(--admin-dark-ink);
    --admin-v2-muted: var(--admin-dark-muted);
    --admin-v2-brand-soft: var(--admin-dark-accent-soft);
    background: var(--admin-dark-bg) !important;
    color: var(--admin-dark-ink);
    color-scheme: dark;
}

html[data-color-scheme="dark"] body.admin-surface :is(.workspace, .app-shell, .workspace-main, .admin-page) {
    background: var(--admin-dark-bg) !important;
    color: var(--admin-dark-ink);
}

/* Admin navigation */
html[data-color-scheme="dark"] body.admin-surface :is(
    .rail-nav-group,
    .rail-nav-store,
    .side-rail .skip-link,
    .rail-nav-group > summary
) {
    border-color: var(--admin-dark-line) !important;
    background: #0c131e !important;
    color: var(--admin-dark-muted) !important;
}

html[data-color-scheme="dark"] body.admin-surface :is(
    .rail-nav > a.active,
    .rail-nav-group > summary:hover,
    .rail-nav-group-links > a.active,
    .system-side-nav a.active
) {
    border-color: #793344 !important;
    background: var(--admin-dark-accent-soft) !important;
    color: #ff8292 !important;
}

/* Admin cards, panels and tables */
html[data-color-scheme="dark"] body.admin-surface .admin-page :is(
    .admin-form,
    .admin-panel,
    .mock-panel,
    .mock-kpi,
    .data-table,
    .mock-table,
    .config-card,
    .environment-card,
    .maintenance-card,
    .bank-list-card,
    .bank-global-settings,
    .bank-account-editor,
    .bulk-action-popover,
    .settings-toggle-list,
    .warehouse-filter-bar,
    .warehouse-tool-drawer,
    .warehouse-selected-card,
    .ticket-thread,
    .system-savebar-v6,
    .growth-panel-v8,
    .traffic-panel-v9
) {
    border-color: var(--admin-dark-line) !important;
    background: var(--admin-dark-surface) !important;
    color: var(--admin-dark-ink) !important;
    box-shadow: 0 16px 38px rgb(0 0 0 / 24%);
}

html[data-color-scheme="dark"] body.admin-surface .admin-page :is(
    .data-head,
    .mock-th,
    .data-table thead,
    .mock-table thead,
    .panel-heading,
    .admin-panel > header,
    .admin-form > header,
    .form-actions,
    .table-command-bar
) {
    border-color: var(--admin-dark-line) !important;
    background: var(--admin-dark-raised) !important;
    color: var(--admin-dark-muted) !important;
}

html[data-color-scheme="dark"] body.admin-surface .admin-page :is(.data-row, .mock-tr, tbody tr) {
    border-color: var(--admin-dark-line) !important;
    background: var(--admin-dark-surface) !important;
    color: var(--admin-dark-ink) !important;
}

html[data-color-scheme="dark"] body.admin-surface .admin-page :is(.data-row, .mock-tr, tbody tr):hover {
    background: #1d1820 !important;
}

/* Admin forms and search fields */
html[data-color-scheme="dark"] body.admin-surface .admin-page :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
    select,
    textarea,
    .unified-search-field,
    .system-search-field-v6,
    .toolbar-search,
    .copy-input,
    .page-tabs,
    .traffic-range-tabs-v9
) {
    border-color: var(--admin-dark-line) !important;
    background: #0b1119 !important;
    color: var(--admin-dark-ink) !important;
}

html[data-color-scheme="dark"] body.admin-surface .admin-page :is(input, textarea)::placeholder {
    color: #8390a3 !important;
}

html[data-color-scheme="dark"] body.admin-surface .admin-page :is(label, h1, h2, h3, h4, strong, b, code) {
    color: var(--admin-dark-ink);
}

html[data-color-scheme="dark"] body.admin-surface .admin-page :is(p, small, em, dt, dd) {
    color: var(--admin-dark-muted);
}

/* Admin page-specific white overrides */
html[data-color-scheme="dark"] body.admin-surface .admin-suppliers-page :is(
    .supplier-config-section,
    .supplier-config-section > header,
    .supplier-sync-advanced,
    .supplier-saved-config,
    .supplier-sync-option,
    .supplier-editor,
    .form-actions
) {
    border-color: var(--admin-dark-line) !important;
    background: var(--admin-dark-surface) !important;
    color: var(--admin-dark-ink) !important;
}

html[data-color-scheme="dark"] body.admin-surface .admin-suppliers-page :is(
    .supplier-config-section > header,
    .supplier-sync-advanced,
    .supplier-saved-config
) {
    background: var(--admin-dark-raised) !important;
}

html[data-color-scheme="dark"] body.admin-surface .warehouse-browser-page :is(
    .warehouse-product-link,
    .warehouse-filter-bar,
    .settings-toggle-list,
    .warehouse-tool-drawer label
) {
    border-color: var(--admin-dark-line) !important;
    background: var(--admin-dark-surface) !important;
    color: var(--admin-dark-ink) !important;
}

html[data-color-scheme="dark"] body.admin-surface .warehouse-browser-page .warehouse-product-link.active {
    border-color: #793344 !important;
    background: var(--admin-dark-accent-soft) !important;
}

html[data-color-scheme="dark"] body.admin-surface .admin-ticket-thread .ticket-message.customer-message {
    border-color: var(--admin-dark-line) !important;
    background: var(--admin-dark-raised) !important;
}

html[data-color-scheme="dark"] body.admin-surface .admin-ticket-thread .ticket-message.admin-message {
    border-color: #285a58 !important;
    background: #10231f !important;
}

html[data-color-scheme="dark"] body.admin-surface :is(.system-warning-v6, .taxonomy-help) {
    border-color: #5d4924 !important;
    background: #241d12 !important;
    color: #f4c878 !important;
}

html[data-color-scheme="dark"] body.admin-surface .admin-page :is(.status-pill, .badge, .kpi-icon) {
    box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
    html[data-color-scheme="dark"] body :is(.auth-card, .affiliate-surface, .admin-page *) {
        transition: none !important;
    }
}

/* Rendered QA pass 2 */
html[data-color-scheme="dark"] body.customer-surface .affiliate-page .affiliate-funnel > div {
    border-color: var(--store-line) !important;
    background: var(--store-surface-raised) !important;
    color: var(--store-ink) !important;
}

html[data-color-scheme="dark"] body.customer-surface .developer-docs-page :is(
    .api-endpoint-directory > header,
    .api-request-facts > div
) {
    border-color: var(--store-line) !important;
    background: var(--store-surface-raised) !important;
    color: var(--store-ink) !important;
}

html[data-color-scheme="dark"] body.admin-surface .admin-suppliers-page .supplier-saved-config > span {
    border-color: var(--admin-dark-line) !important;
    background: var(--admin-dark-surface) !important;
    color: var(--admin-dark-ink) !important;
}

/* Payment operations and bank settings */
html[data-color-scheme="dark"] body.admin-surface :is(.payment-ops-v4, .bank-settings-v4) :is(
    .payment-v4-secondary,
    .payment-health-strip,
    .payment-channel-rail,
    .payment-settings-card,
    .payment-reconcile-card,
    .bank-list-card-v4,
    .bank-settings-card-v4,
    .payment-section-nav,
    .payment-reconcile-toolbar,
    .payment-search-field,
    .payment-sticky-actions,
    .payment-toggle
) {
    border-color: var(--admin-dark-line) !important;
    background: var(--admin-dark-surface) !important;
    color: var(--admin-dark-ink) !important;
    box-shadow: 0 16px 38px rgb(0 0 0 / 24%);
}

html[data-color-scheme="dark"] body.admin-surface :is(.payment-ops-v4, .bank-settings-v4) :is(
    .payment-channel-option.active,
    .payment-section-nav a.active,
    .payment-toggle:has(input:checked)
) {
    border-color: #793344 !important;
    background: var(--admin-dark-accent-soft) !important;
    color: #ff8292 !important;
}

html[data-color-scheme="dark"] body.admin-surface :is(.payment-ops-v4, .bank-settings-v4) :is(
    .payment-webhook-box,
    .bank-connection-banner
) {
    border-color: #285a58 !important;
    background: #10231f !important;
    color: var(--admin-dark-ink) !important;
}

html[data-color-scheme="dark"] body.admin-surface :is(.payment-ops-v4, .bank-settings-v4) :is(
    input:not([type="checkbox"]):not([type="radio"]),
    select,
    textarea
) {
    border-color: var(--admin-dark-line) !important;
    background: #0b1119 !important;
    color: var(--admin-dark-ink) !important;
}

html[data-color-scheme="dark"] body.admin-surface :is(.payment-ops-v4, .bank-settings-v4) :is(h1, h2, h3, strong, b, label) {
    color: var(--admin-dark-ink);
}

html[data-color-scheme="dark"] body.admin-surface :is(.payment-ops-v4, .bank-settings-v4) :is(p, small, span) {
    color: var(--admin-dark-muted);
}

/* System navigation and filters */
html[data-color-scheme="dark"] body.admin-surface .system-suite-v6 a.active {
    border-color: #793344 !important;
    background: var(--admin-dark-accent-soft) !important;
    color: #ff8292 !important;
}

html[data-color-scheme="dark"] body.admin-surface .system-suite-v6 .system-filter-bar-v6 > label {
    border-color: var(--admin-dark-line) !important;
    background: #0b1119 !important;
    color: var(--admin-dark-ink) !important;
}

/* Theme preview follows the selected scheme without changing its content. */
html[data-color-scheme="dark"] body.admin-surface .theme-form :is(.theme-preview, #Input_Accent) {
    border-color: var(--admin-dark-line) !important;
    background-color: var(--admin-dark-surface) !important;
    color: var(--admin-dark-ink) !important;
}

/* Rendered QA pass 3 */
html[data-color-scheme="dark"] body.admin-surface .product-editor-page :is(
    .editor-savebar,
    .seo-preview,
    .product-media-editor,
    .discount-tier-editor,
    .variant-editor-drawer,
    .mock-secondary
) {
    border-color: var(--admin-dark-line) !important;
    background: var(--admin-dark-surface) !important;
    color: var(--admin-dark-ink) !important;
}

html[data-color-scheme="dark"] body.admin-surface .product-editor-page :is(
    .editor-savebar,
    .seo-preview,
    .product-media-editor > summary,
    .discount-tier-editor > summary,
    .variant-editor-drawer > summary
) {
    background: var(--admin-dark-raised) !important;
}

/* Rendered QA pass 4 */
html[data-color-scheme="dark"] body.customer-surface .affiliate-page .affiliate-copy-field code {
    color: var(--store-ink) !important;
}

html[data-color-scheme="dark"] body.customer-surface .affiliate-page :is(
    .affiliate-code-card > button,
    .affiliate-share-row > a,
    .affiliate-share-row > button
) {
    border-color: var(--store-line) !important;
    background: var(--store-surface-raised) !important;
    color: var(--store-ink) !important;
}

html[data-color-scheme="dark"] body.admin-surface :is(.admin-store-link, .topbar kbd) {
    border-color: var(--admin-dark-line) !important;
    background: var(--admin-dark-surface) !important;
    color: var(--admin-dark-ink) !important;
}

html[data-color-scheme="dark"] body.admin-surface .admin-page .table-pager nav :is(a, span, strong) {
    border-color: var(--admin-dark-line) !important;
    background: var(--admin-dark-surface) !important;
    color: var(--admin-dark-muted) !important;
}

/* Theme-specific weekly offer artwork */
body.marketplace-surface .market-catalog-page .market-weekly-offer-art-dark {
    display: none !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .market-catalog-page .market-weekly-offer {
    border-color: var(--store-line) !important;
    background:
        radial-gradient(circle at 48% 18%, rgb(255 91 112 / 10%), transparent 26%),
        linear-gradient(105deg, var(--store-surface) 0%, #111b29 58%, #0a1018 100%) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .market-catalog-page .market-weekly-offer-art {
    border-left-color: var(--store-line) !important;
    background:
        radial-gradient(circle at 74% 34%, rgb(255 91 112 / 13%), transparent 36%),
        #080d14 !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .market-catalog-page .market-weekly-offer-art::before {
    background: linear-gradient(90deg, #111b29 0%, rgb(17 27 41 / 72%) 8%, transparent 34%) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .market-catalog-page .market-weekly-offer-art-light {
    display: none !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .market-catalog-page .market-weekly-offer-art-dark {
    display: block !important;
    object-position: 58% 52%;
    filter: saturate(.94) contrast(1.04) brightness(.96);
}

html[data-color-scheme="dark"] body.marketplace-surface .market-catalog-page .market-weekly-offer:hover .market-weekly-offer-art-dark {
    filter: saturate(1.02) contrast(1.06) brightness(1);
}

/* Homepage outer canvas and theme-specific hero artwork */
body.marketplace-surface .market-home-showcase-dark {
    display: none !important;
}

html[data-color-scheme="dark"] body.marketplace-surface :is(
    .market-home,
    .market-home-hero,
    .market-home-products
) {
    background: var(--store-bg) !important;
    color: var(--store-ink);
}

html[data-color-scheme="dark"] body.marketplace-surface .market-home-showcase {
    border-color: var(--store-line) !important;
    background:
        radial-gradient(circle at 70% 40%, rgb(255 91 112 / 10%), transparent 42%),
        #080d14 !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .market-home-showcase-light {
    display: none !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .market-home-showcase-dark {
    width: 100%;
    height: 100%;
    max-height: 375px;
    display: block !important;
    border-radius: 16px;
    object-fit: cover;
    object-position: 58% 52%;
    filter: saturate(.94) contrast(1.04) brightness(.96) drop-shadow(0 26px 34px rgb(0 0 0 / 34%));
}

html[data-color-scheme="dark"] body.marketplace-surface .market-home-products > header > a {
    border-color: var(--store-line) !important;
    background: var(--store-surface) !important;
    color: var(--store-ink) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .market-home-products .shop-product-art {
    background: #0b1119 !important;
}

/* Compact desktop header: prevent search and primary navigation overlap. */
@media (min-width: 1181px) and (max-width: 1399px) {
    body.marketplace-surface .market-header-main {
        grid-template-columns: auto minmax(210px, 230px) minmax(400px, 1fr) auto;
        gap: 10px;
    }

    body.marketplace-surface .market-primary-nav {
        justify-content: flex-start;
        gap: 2px;
    }

    body.marketplace-surface .market-primary-nav a {
        gap: 5px;
        padding-inline: 5px;
        font-size: 12px;
    }

    body.marketplace-surface .market-actions {
        gap: 4px;
    }

    body.marketplace-surface :is(.market-wallet-shortcut, .market-login, .market-register) {
        padding-inline: 10px;
        font-size: 11.5px;
    }

    body.marketplace-surface .market-account-menu > .market-account {
        min-width: 44px;
        width: 44px;
        justify-content: center;
        padding: 4px;
        border-radius: 50%;
    }

    body.marketplace-surface :is(.market-account-trigger-name, .market-account-chevron) {
        display: none;
    }
}

/* Compact authenticated account trigger keeps the navigation clear. */
body.marketplace-surface .market-account-menu > .market-account {
    min-width: 44px;
    width: 44px;
    justify-content: center;
    padding: 4px;
    border-radius: 50%;
}

body.marketplace-surface .market-account > .market-account-trigger-name,
body.marketplace-surface .market-account-chevron {
    display: none !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .market-home-flow h2 {
    color: #ffffff !important;
}

/* Keep the primary navigation visually continuous with the dark header. */
html[data-color-scheme="dark"] body.marketplace-surface .market-navigation {
    background: transparent !important;
}

/* Keep authentication icons, inputs and password actions inside one surface. */
body.marketplace-surface .auth-card .auth-field {
    --auth-field-fill: #ffffff;
    overflow: hidden;
}

body.marketplace-surface .auth-card .auth-field input:not([type="checkbox"]) {
    border-radius: 0 !important;
    background: transparent !important;
    background-image: none !important;
    -webkit-text-fill-color: var(--auth-text) !important;
    caret-color: var(--auth-text);
    -webkit-box-shadow: 0 0 0 1000px var(--auth-field-fill) inset !important;
    box-shadow: 0 0 0 1000px var(--auth-field-fill) inset !important;
}

body.marketplace-surface .auth-card .auth-field input::-ms-reveal,
body.marketplace-surface .auth-card .auth-field input::-ms-clear {
    display: none;
}


body.marketplace-surface .auth-card .auth-field input:-webkit-autofill,
body.marketplace-surface .auth-card .auth-field input:-webkit-autofill:hover,
body.marketplace-surface .auth-card .auth-field input:-webkit-autofill:focus {
    border-radius: 0 !important;
    -webkit-text-fill-color: var(--auth-text) !important;
    caret-color: var(--auth-text);
    -webkit-box-shadow: 0 0 0 1000px var(--auth-field-fill) inset !important;
    box-shadow: 0 0 0 1000px var(--auth-field-fill) inset !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .auth-card .auth-field {
    --auth-field-fill: #0b1119;
    background: var(--auth-field-fill) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .auth-card .auth-field input:not([type="checkbox"]) {
    background: transparent !important;
}


/* Keep both Catalog price-range controls transparent so neither input hides
   the shared track or the other thumb in dark mode. */
html[data-color-scheme="dark"] body.marketplace-surface .market-catalog-page
    .market-price-filter .market-price-slider > input[type="range"] {
    min-height: 0;
    height: 22px;
    padding: 0;
    border: 0 !important;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
    color: inherit !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .market-catalog-page
    .market-price-filter .market-price-slider > input[type="range"]:is(:focus, :focus-visible) {
    border: 0 !important;
    outline: 0;
    background: transparent !important;
    box-shadow: none !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .market-catalog-page
    .market-price-slider-track {
    height: 4px;
    background: #475467;
    box-shadow: inset 0 1px 1px rgb(0 0 0 / 24%);
}

html[data-color-scheme="dark"] body.marketplace-surface .market-catalog-page
    .market-price-slider-track > i {
    background: var(--store-accent);
}

html[data-color-scheme="dark"] body.marketplace-surface .market-catalog-page
    .market-price-slider input[type="range"]::-webkit-slider-thumb {
    border-color: var(--store-accent);
    background: #ffffff;
    box-shadow: 0 1px 4px rgb(0 0 0 / 48%);
}

html[data-color-scheme="dark"] body.marketplace-surface .market-catalog-page
    .market-price-slider input[type="range"]::-moz-range-thumb {
    border-color: var(--store-accent);
    background: #ffffff;
    box-shadow: 0 1px 4px rgb(0 0 0 / 48%);
}


/* Dark-mode readability: product data, wallet guidance and order progress. */
html[data-color-scheme="dark"] body.marketplace-surface .market-product-page
    .market-product-tabs button {
    color: var(--store-muted) !important;
    font-size: 14px;
}

html[data-color-scheme="dark"] body.marketplace-surface .market-product-page
    .market-product-tabs button.active {
    color: var(--store-accent) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .market-product-page :is(
    .market-product-tab-panel h2,
    .market-seller-card > h2,
    .market-related-products h2
) {
    color: var(--store-ink) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .market-product-page
    .market-product-tab-panel h2 {
    font-size: 16px;
}

html[data-color-scheme="dark"] body.marketplace-surface .market-product-page
    .market-product-tab-panel dl {
    border-color: var(--store-line) !important;
    background: #0d141f;
}

html[data-color-scheme="dark"] body.marketplace-surface .market-product-page
    .market-product-tab-panel dl div {
    padding: 12px;
    border-color: var(--store-line) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .market-product-page
    .market-product-tab-panel dt,
html[data-color-scheme="dark"] body.marketplace-surface .market-product-page
    .market-product-tab-panel dd {
    font-size: 12px;
    line-height: 1.5;
}

html[data-color-scheme="dark"] body.marketplace-surface .market-product-page
    .market-product-tab-panel dt {
    color: var(--store-muted) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .market-product-page
    .market-product-tab-panel dd {
    color: var(--store-ink) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .market-product-page
    .market-seller-card > div strong {
    color: var(--store-ink) !important;
    font-size: 12px;
}

html[data-color-scheme="dark"] body.marketplace-surface .market-product-page
    .market-seller-card > div small {
    color: var(--store-muted) !important;
    font-size: 10px;
}

html[data-color-scheme="dark"] body.marketplace-surface .market-product-page
    .market-seller-card :is(dt, dd) {
    font-size: 11px;
    line-height: 1.45;
}

html[data-color-scheme="dark"] body.marketplace-surface .market-product-page
    .market-seller-card dt {
    color: var(--store-muted) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .market-product-page
    .market-seller-card dd {
    color: var(--store-ink) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .market-product-page
    .market-seller-card > a {
    font-size: 11px;
}

html[data-color-scheme="dark"] body.marketplace-surface .market-product-page
    .market-related-products header > a {
    color: var(--store-muted) !important;
    font-size: 12px;
}

html[data-color-scheme="dark"] body.customer-surface .wallet-deposit-v4
    .wallet-aside :is(.promo-list, .wallet-help, .safety-card) h2 {
    color: var(--store-ink) !important;
    font-size: 15px;
}

html[data-color-scheme="dark"] body.customer-surface .wallet-deposit-v4
    .promo-item b {
    color: var(--store-ink) !important;
    font-size: 12px;
}

html[data-color-scheme="dark"] body.customer-surface .wallet-deposit-v4
    .promo-item small {
    color: var(--store-muted) !important;
    font-size: 10px;
    line-height: 1.45;
}

html[data-color-scheme="dark"] body.customer-surface .wallet-deposit-v4
    .wallet-help a {
    color: var(--store-ink) !important;
    font-size: 11px;
    line-height: 1.5;
}

html[data-color-scheme="dark"] body.customer-surface .wallet-deposit-v4
    .wallet-help a:hover {
    color: var(--store-accent) !important;
}

html[data-color-scheme="dark"] body.customer-surface .wallet-deposit-v4
    .safety-card p {
    color: var(--store-muted) !important;
    font-size: 11px;
    line-height: 1.5;
}

html[data-color-scheme="dark"] body.customer-surface .orders-workspace
    .order-timeline h3 {
    color: var(--store-ink) !important;
    font-size: 13px;
}

html[data-color-scheme="dark"] body.customer-surface .orders-workspace
    .order-timeline li,
html[data-color-scheme="dark"] body.customer-surface .orders-workspace
    .order-timeline li b {
    color: var(--store-ink) !important;
    font-size: 11px;
}

html[data-color-scheme="dark"] body.customer-surface .orders-workspace
    .order-timeline small {
    color: var(--store-muted) !important;
    font-size: 9px;
    line-height: 1.45;
}

html[data-color-scheme="dark"] body.customer-surface .orders-workspace
    .detail-note label,
html[data-color-scheme="dark"] body.customer-surface .orders-workspace
    .detail-note label > span {
    color: var(--store-muted) !important;
    font-size: 11px;
}

html[data-color-scheme="dark"] body.customer-surface .orders-workspace
    .detail-note input::placeholder {
    color: var(--store-muted) !important;
    opacity: 1;
}

/* API documentation: complete contrast pass for the dark workspace. */
html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page {
    --api-dark-bg: #0a111b;
    --api-dark-surface: #141f2e;
    --api-dark-surface-raised: #192638;
    --api-dark-surface-soft: #0f1926;
    --api-dark-line: #34445a;
    --api-dark-line-strong: #465a75;
    --api-dark-ink: #f4f7fb;
    --api-dark-muted: #b8c4d6;
    --api-dark-subtle: #94a3b8;
    --api-dark-accent: #ff667a;
    --api-dark-success: #70e2b8;
    --api-border: var(--api-dark-line);
    --api-blue: var(--api-dark-accent);
    --api-cyan: var(--api-dark-success);
    color: var(--api-dark-ink) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page :is(
    .developer-docs-heading,
    .developer-docs-nav,
    .api-access-overview,
    .api-endpoint-directory,
    .api-reference-content,
    .api-guide-card
) {
    border-color: var(--api-dark-line) !important;
    background: var(--api-dark-surface) !important;
    color: var(--api-dark-ink) !important;
    box-shadow: none;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page :is(h1, h2, h3, strong, b) {
    color: var(--api-dark-ink) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page :is(
    .developer-docs-heading > div:first-child > p:last-child,
    .api-access-intro p,
    .api-access-stat > span,
    .api-reference-header p,
    .api-guide-card > p,
    .api-endpoint-errors small,
    .api-error-summary small,
    .api-auth-guide li small
) {
    color: var(--api-dark-muted) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .developer-docs-heading {
    background: linear-gradient(112deg, #162334, #101a28) !important;
    border-left-color: var(--api-dark-accent) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .developer-eyebrow,
html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-endpoint-directory > header p,
html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-guide-card header p {
    color: var(--api-dark-success) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .developer-heading-badges > span {
    border-color: var(--api-dark-line-strong) !important;
    background: var(--api-dark-surface-soft) !important;
    color: #d9e2ef !important;
    font-size: 10px;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .developer-heading-badges > span:first-child {
    border-color: #2d6d5a !important;
    background: #102a24 !important;
    color: var(--api-dark-success) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .developer-docs-nav a {
    color: #b8c4d6 !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .developer-docs-nav a:is(:hover, :focus-visible, .active) {
    background: #2a202d !important;
    color: #ff8b9a !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-access-overview > * {
    border-color: var(--api-dark-line) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-access-icon {
    background: #12352d !important;
    color: var(--api-dark-success) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page :is(.api-access-intro small, .api-access-stat > small) {
    color: var(--api-dark-subtle) !important;
    font-size: 10px;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-access-intro p,
html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-access-stat > span {
    font-size: 11px;
    line-height: 1.55;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-access-stat > code {
    color: #e4edf8 !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-access-stat > button {
    color: #ff7f90 !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-key-secret {
    border-color: var(--api-dark-line-strong) !important;
    background: var(--api-dark-surface-soft) !important;
    color: #eef5ff !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-key-secret-actions button {
    border-color: var(--api-dark-line-strong) !important;
    background: #17263a !important;
    color: #a9c7ff !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-key-secret-actions button:hover {
    border-color: #719df0 !important;
    background: #203756 !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-key-unavailable {
    color: #f4c772 !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-key-actions .table-action {
    border-color: var(--api-dark-line-strong) !important;
    background: var(--api-dark-surface-soft) !important;
    color: #e8eef7 !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-endpoint-directory {
    background: var(--api-dark-surface) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-endpoint-directory > header {
    border-color: var(--api-dark-line) !important;
    background: rgba(25, 38, 56, .97) !important;
    color: var(--api-dark-ink) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-endpoint-directory > header > span {
    color: var(--api-dark-muted) !important;
    font-size: 11px;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .endpoint-directory-tools {
    border-color: var(--api-dark-line) !important;
    background: var(--api-dark-surface-soft) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .endpoint-directory-tools :is(input, select) {
    color-scheme: dark;
    border-color: var(--api-dark-line-strong) !important;
    background: #0b1521 !important;
    color: #edf2f8 !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .endpoint-directory-tools input::placeholder {
    color: #9cabbe !important;
    opacity: 1;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-endpoint-group > header {
    color: #c7d1df !important;
    font-size: 10px;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-endpoint-group > header small {
    background: #263448 !important;
    color: #bec9d8 !important;
    font-size: 9px;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-endpoint-nav-item {
    border-color: var(--api-dark-line) !important;
    background: #142235 !important;
    color: var(--api-dark-ink) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-endpoint-nav-item:is(:hover, :focus-visible) {
    border-color: #65758d !important;
    background: #1d2d43 !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-endpoint-nav-item.active {
    border-color: #a44255 !important;
    background: #34202a !important;
    box-shadow: inset 3px 0 0 var(--api-dark-accent);
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-endpoint-nav-item code {
    color: #b6c4d7 !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-endpoint-nav-item > i {
    color: #aab8ca !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-reference-header {
    border-color: var(--api-dark-line) !important;
    background: linear-gradient(112deg, #1b293c, #131f2e) !important;
    color: var(--api-dark-ink) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-reference-tags > :is(span, code) {
    border-color: var(--api-dark-line-strong) !important;
    background: #101b29 !important;
    color: #c5d0df !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-copy-request {
    border-color: var(--api-dark-line-strong) !important;
    background: #101a28 !important;
    color: #eef3f9 !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-copy-request:is(:hover, :focus-visible) {
    border-color: #b44b5d !important;
    background: #34202a !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-reference-jump {
    border-color: var(--api-dark-line) !important;
    background: #121d2b !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-reference-jump a {
    color: #aebbd0 !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-reference-jump a:is(:hover, :focus-visible) {
    border-color: var(--api-dark-accent) !important;
    color: #ff8b9a !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-reference-section {
    border-color: var(--api-dark-line) !important;
    background: var(--api-dark-surface) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-section-heading > span {
    background: #29384c !important;
    color: #dce5f1 !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-section-heading p {
    color: var(--api-dark-subtle) !important;
    font-size: 10px;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-section-heading h3 {
    color: var(--api-dark-ink) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-url-field {
    border-color: var(--api-dark-line-strong) !important;
    background: #0f1a28 !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-url-field > code {
    color: #e5edf7 !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-url-field > button {
    color: #ff8191 !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-request-facts > div {
    border-color: var(--api-dark-line) !important;
    background: var(--api-dark-surface-raised) !important;
    color: var(--api-dark-ink) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-request-facts small {
    color: var(--api-dark-subtle) !important;
    font-size: 9px;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-request-facts strong {
    color: var(--api-dark-ink) !important;
    font-size: 11px;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-no-parameters {
    border-color: #2f725f !important;
    background: #102a24 !important;
    color: #c7f5e4 !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-no-parameters span {
    color: #b9e7d7 !important;
    font-size: 11px;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-no-parameters b {
    color: #e4fff5 !important;
    font-size: 12px;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-parameter-table,
html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-endpoint-errors {
    border-color: var(--api-dark-line) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-parameter-row,
html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-endpoint-errors > div {
    border-color: var(--api-dark-line) !important;
    background: var(--api-dark-surface) !important;
    color: #dbe3ee !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-parameter-row.heading {
    background: var(--api-dark-surface-soft) !important;
    color: #aebbd0 !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-parameter-row :is(p, code) {
    color: #c8d4e4 !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-errors-and-notes > aside {
    border-color: #405878 !important;
    background: #17263a !important;
    color: #e5edf8 !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-errors-and-notes > aside :is(strong, li) {
    color: #cbd8e8 !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-error-summary > div {
    border-color: var(--api-dark-line) !important;
    background: var(--api-dark-surface-raised) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-error-summary b {
    font-size: 10px;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-error-summary small,
html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-auth-guide li small {
    font-size: 9px;
    line-height: 1.5;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-guide-card > header > span,
html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-auth-guide li > b {
    background: #29384c !important;
    color: #e0e8f3 !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-whitelist-card label {
    color: #c4cfde !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-whitelist-card textarea {
    color-scheme: dark;
    border-color: var(--api-dark-line-strong) !important;
    background: #0b1521 !important;
    color: #edf3f9 !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-security-warning {
    border-color: #70582b !important;
    background: #2b2112 !important;
    color: #f3d69a !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page .api-security-warning :is(span, b) {
    color: #f3d69a !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page :is(button, a, input, select, textarea):focus-visible {
    outline: 3px solid rgba(255, 102, 122, .38) !important;
    outline-offset: 2px;
    box-shadow: none !important;
}

/* Full-source contrast sweep: native controls, legacy cards and nested states. */
html[data-color-scheme="dark"] body :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
    select,
    textarea
) {
    color-scheme: dark;
}

html[data-color-scheme="dark"] body :is(select, datalist) option {
    background: #121b28;
    color: #f7f9fc;
}

html[data-color-scheme="dark"] body :is(input, textarea)::placeholder {
    color: #9aa9bc !important;
    opacity: 1;
}

html[data-color-scheme="dark"] body :is(a, button, input, select, textarea, summary):focus-visible {
    outline: 2px solid #ff8b9a !important;
    outline-offset: 2px;
}

/* Admin: normalize every shared card, drawer, toolbar and table surface. */
html[data-color-scheme="dark"] body.admin-surface .admin-page :is(
    .admin-subnav,
    .admin-command-results,
    .admin-create-drawer,
    .admin-filter-bar,
    .admin-order-filter,
    .bulk-action-popover,
    .category-tree-item[open],
    .pagination,
    .settings-toggle-list,
    .warehouse-bulk-bar,
    .warehouse-filter-search,
    .warehouse-selector-search,
    .warehouse-status-tabs,
    .warehouse-metric-grid > article,
    .warehouse-sales-list,
    .system-card-v6,
    .system-filter-bar-v6,
    .system-search-field-v6,
    .system-suite-v6 .table-pager,
    .table-page-size-toolbar,
    .traffic-panel-v9,
    .traffic-filter-v9,
    .traffic-search-v9,
    .traffic-live-state-v9,
    .traffic-window-rail-v9
) {
    border-color: var(--admin-dark-line) !important;
    background: var(--admin-dark-surface) !important;
    color: var(--admin-dark-ink) !important;
    box-shadow: none;
}

html[data-color-scheme="dark"] body.admin-surface .admin-page :is(
    .admin-create-drawer > summary,
    .admin-create-drawer[open] > summary,
    .admin-panel > header,
    .admin-form > header,
    .mock-panel > header,
    .category-tree-item > summary,
    .product-media-editor > summary,
    .discount-tier-editor > summary,
    .editor-collapsible > summary,
    .variant-editor-drawer > summary,
    .warehouse-tool-drawer > summary,
    .system-card-head-v6,
    .system-card-foot-v6,
    .system-form-actions-v6,
    .system-inline-editor-v6 > footer,
    .system-table-v6 th,
    .table-page-size-toolbar,
    .traffic-panel-head-v9
) {
    border-color: var(--admin-dark-line) !important;
    background: var(--admin-dark-raised) !important;
    color: var(--admin-dark-ink) !important;
}

html[data-color-scheme="dark"] body.admin-surface .admin-page :is(
    h1,
    h2,
    h3,
    h4,
    legend,
    summary,
    label,
    strong,
    b,
    code,
    dt,
    dd
) {
    color: var(--admin-dark-ink);
}

html[data-color-scheme="dark"] body.admin-surface .admin-page :is(p, small, em) {
    color: var(--admin-dark-muted);
}

html[data-color-scheme="dark"] body.admin-surface .admin-page :is(
    .mock-tr:not(.mock-th),
    .data-row:not(.data-head),
    .system-table-v6 tbody tr
) {
    border-color: var(--admin-dark-line) !important;
    background: var(--admin-dark-surface) !important;
    color: #dce5f1 !important;
}

html[data-color-scheme="dark"] body.admin-surface .admin-page :is(
    .mock-tr:not(.mock-th),
    .data-row:not(.data-head),
    .system-table-v6 tbody tr
):hover {
    background: #1d2a3d !important;
    color: #ffffff !important;
}

html[data-color-scheme="dark"] body.admin-surface .admin-page :is(
    .mock-tr > span,
    .data-row > span,
    .system-table-v6 td
) {
    border-color: var(--admin-dark-line) !important;
    color: #dce5f1;
}

html[data-color-scheme="dark"] body.admin-surface .admin-page :is(
    .mock-tr > span,
    .data-row > span,
    .system-table-v6 td
) small {
    color: #aebbd0 !important;
}

html[data-color-scheme="dark"] body.admin-surface .admin-page :is(
    .table-action,
    .mock-secondary,
    .system-secondary-button-v6,
    .system-icon-button-v6,
    .payment-v4-secondary,
    .traffic-reset-button-v9,
    .top-icon,
    .admin-command-header > .table-action,
    .table-actions > a,
    .table-actions > button
) {
    border-color: var(--admin-dark-line-strong) !important;
    background: var(--admin-dark-raised) !important;
    color: #e8eef7 !important;
}

html[data-color-scheme="dark"] body.admin-surface .admin-page :is(
    .table-action,
    .mock-secondary,
    .system-secondary-button-v6,
    .system-icon-button-v6,
    .payment-v4-secondary,
    .traffic-reset-button-v9,
    .top-icon,
    .table-actions > a,
    .table-actions > button
):is(:hover, :focus-visible) {
    border-color: #667891 !important;
    background: #24334a !important;
    color: #ffffff !important;
}

html[data-color-scheme="dark"] body.admin-surface .admin-page :is(.danger-action, .traffic-action-button-v9.danger) {
    border-color: #7e3a47 !important;
    background: #3b2028 !important;
    color: #ffacb6 !important;
}

/* Admin Bank, Payment and reconciliation: repair nested light-only elements. */
html[data-color-scheme="dark"] body.admin-surface :is(.payment-ops-v4, .bank-settings-v4) :is(
    .payment-settings-heading,
    .payment-settings-section,
    .bank-form-section,
    .bank-advanced-section,
    .bank-mbank-connection,
    .payment-reconcile-toolbar,
    .payment-bank-summary,
    .payment-network-list > span,
    .bank-webhook-url,
    .copy-input-v4,
    .bank-empty-row
) {
    border-color: var(--admin-dark-line) !important;
    background: var(--admin-dark-surface) !important;
    color: var(--admin-dark-ink) !important;
}

html[data-color-scheme="dark"] body.admin-surface :is(.payment-ops-v4, .bank-settings-v4) :is(
    .payment-settings-section > summary,
    .bank-advanced-section > summary,
    .bank-mbank-connection > summary,
    .payment-settings-section > summary:hover,
    .bank-advanced-section > summary:hover,
    .bank-mbank-connection > summary:hover,
    .payment-sticky-actions,
    .payment-reconcile-toolbar
) {
    border-color: var(--admin-dark-line) !important;
    background: var(--admin-dark-raised) !important;
    color: var(--admin-dark-ink) !important;
}

html[data-color-scheme="dark"] body.admin-surface :is(.payment-ops-v4, .bank-settings-v4) :is(
    .bank-connection-banner > span,
    .payment-webhook-box > span,
    .payment-settings-icon,
    .bank-webhook-url,
    .copy-input-v4 button,
    .bank-settings-v4 .table-actions a,
    .bank-settings-v4 .table-actions button
) {
    border-color: var(--admin-dark-line-strong) !important;
    background: #0f1926 !important;
    color: #e7edf7 !important;
}

html[data-color-scheme="dark"] body.admin-surface :is(.payment-ops-v4, .bank-settings-v4) :is(
    .payment-field-grid label,
    .payment-settings-section summary,
    .bank-advanced-section summary,
    .bank-mbank-connection summary,
    .payment-toggle b,
    .bank-identity-cell b,
    .bank-empty-row b
) {
    color: var(--admin-dark-ink) !important;
}

html[data-color-scheme="dark"] body.admin-surface :is(.payment-ops-v4, .bank-settings-v4) :is(
    .payment-field-grid label > small,
    .payment-settings-section summary small,
    .bank-advanced-section summary small,
    .payment-toggle small,
    .bank-identity-cell small,
    .payment-sticky-actions > span
) {
    color: var(--admin-dark-muted) !important;
}

html[data-color-scheme="dark"] body.admin-surface .bank-settings-v4 .bank-auto-rule-strip {
    border-color: var(--admin-dark-line) !important;
    background: var(--admin-dark-line) !important;
}

html[data-color-scheme="dark"] body.admin-surface .bank-settings-v4 .bank-auto-rule-strip > span {
    background: var(--admin-dark-surface) !important;
}

html[data-color-scheme="dark"] body.admin-surface .bank-settings-v4 .bank-auto-rule-strip b {
    color: var(--admin-dark-ink) !important;
}

html[data-color-scheme="dark"] body.admin-surface .bank-settings-v4 .bank-auto-rule-strip small,
html[data-color-scheme="dark"] body.admin-surface .bank-settings-v4 .bank-auto-health code {
    color: var(--admin-dark-muted) !important;
}

/* Storefront checkout: all nested totals and protection cards follow dark tokens. */
html[data-color-scheme="dark"] body.marketplace-surface .market-checkout-page {
    background: var(--store-bg) !important;
    color: var(--store-ink);
}

html[data-color-scheme="dark"] body.marketplace-surface .market-checkout-page :is(
    .checkout-product-row,
    .checkout-product-image,
    .checkout-note,
    .checkout-protection-row,
    .checkout-payable,
    .checkout-coupon,
    .checkout-wallet,
    .checkout-price-lines,
    .checkout-currency select
) {
    border-color: var(--store-line) !important;
    background: var(--store-surface-raised) !important;
    color: var(--store-ink) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .market-checkout-page :is(
    .checkout-page-heading h1,
    .checkout-product-copy h2,
    .checkout-product-total strong,
    .checkout-payable strong,
    .checkout-price-lines b,
    .checkout-price-lines strong,
    .checkout-note b,
    .checkout-protection-row b,
    .checkout-wallet b,
    .checkout-wallet strong,
    .checkout-coupon b
) {
    color: var(--store-ink) !important;
}

html[data-color-scheme="dark"] body.marketplace-surface .market-checkout-page :is(
    .checkout-page-heading p,
    .checkout-product-copy p,
    .checkout-product-copy small,
    .checkout-product-total span,
    .checkout-product-total small,
    .checkout-note small,
    .checkout-protection-row small,
    .checkout-wallet small,
    .checkout-price-lines span,
    .checkout-confirm-note
) {
    color: var(--store-muted) !important;
}

/* Legacy public, recovery, favorites, tools, seller and contact pages. */
html[data-color-scheme="dark"] body:is(.marketplace-surface, .customer-surface) :is(
    .legal-page,
    .error-page,
    .article-page,
    .narrow-form > form,
    .contact-layout > *,
    .contact-grid > div,
    .favorite-grid > article,
    .tool-grid > *,
    .table-shell,
    .table-shell .admin-form,
    .table-shell .admin-panel,
    .ticket-center,
    .random-face-preview,
    .icon-palette
) {
    border-color: var(--store-line) !important;
    background: var(--store-surface) !important;
    color: var(--store-ink) !important;
    box-shadow: none;
}

html[data-color-scheme="dark"] body:is(.marketplace-surface, .customer-surface) :is(
    .legal-page,
    .error-page,
    .article-page,
    .narrow-form,
    .contact-layout,
    .favorite-grid,
    .tool-grid,
    .table-shell
) :is(h1, h2, h3, h4, label, strong, b, code, dt, dd) {
    color: var(--store-ink) !important;
}

html[data-color-scheme="dark"] body:is(.marketplace-surface, .customer-surface) :is(
    .legal-page,
    .error-page,
    .article-page,
    .narrow-form,
    .contact-layout,
    .favorite-grid,
    .tool-grid,
    .table-shell
) :is(p, small, li) {
    color: var(--store-muted) !important;
}

html[data-color-scheme="dark"] body:is(.marketplace-surface, .customer-surface) :is(
    .narrow-form,
    .contact-layout,
    .tool-grid,
    .table-shell
) :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    border-color: var(--store-line-strong) !important;
    background: #0b1119 !important;
    color: var(--store-ink) !important;
}

/* Semantic states remain recognizable without using pale light-theme fills. */
html[data-color-scheme="dark"] body :is(.notice-success, .status-pill.success, .system-status-v6.success) {
    border-color: #2f725f !important;
    background: #12352d !important;
    color: #a9f3d8 !important;
}

html[data-color-scheme="dark"] body :is(.notice-error, .status-pill.danger, .system-status-v6.danger) {
    border-color: #7e3a47 !important;
    background: #3b2028 !important;
    color: #ffacb6 !important;
}

html[data-color-scheme="dark"] body :is(.notice-warning, .status-pill.warning, .system-status-v6.warning) {
    border-color: #765a2a !important;
    background: #382a17 !important;
    color: #ffd58a !important;
}

html[data-color-scheme="dark"] body :is(.status-pill.info, .system-status-v6.info) {
    border-color: #3e6389 !important;
    background: #172f4c !important;
    color: #a9d4ff !important;
}

html[data-color-scheme="dark"] body .validation {
    color: #ffacb6 !important;
}

/* API helper copy was technically visible but still too small on dense panels. */
html[data-color-scheme="dark"] body.marketplace-surface .developer-docs-page :is(
    .api-request-facts small,
    .api-error-summary small,
    .api-auth-guide li small,
    .api-endpoint-group > header small
) {
    font-size: 10px;
    line-height: 1.5;
}
