html { color-scheme:light; }
.theme-switcher { position:relative; flex-shrink:0; display:flex; align-items:center; justify-content:center; width:44px; height:44px; padding:0; cursor:pointer; border:1px solid #5d7090; border-radius:8px; background:transparent; color:#fff; }
.theme-switcher[hidden] { display:none; }
.theme-switcher:hover { background:#253957; }
.theme-switcher .theme-icon { width:22px; height:22px; display:none; }
html[data-theme=light] .theme-icon-light,html[data-theme=dark] .theme-icon-dark { display:block; }
@media(max-width:720px) { .header-inner .theme-switcher { margin-left:0; }.header-inner .header-cart { margin-left:0; } }
html[data-theme=dark] {
    color-scheme:dark;
    --ink:#edf2fa; --muted:#b0bed1; --blue:#9abcff; --blue-dark:#c4d7ff;
    --line:#38465a; --surface:#192332; --background:#101722;
    --shadow:0 12px 40px rgb(0 0 0 / 25%); --theme-highlight:#263a57;
}
html[data-theme=dark] :is(.skip-link,.empty-state,.hero,.category-card,.product-card,.filter-panel,.search-toolbar,.product-detail,.specifications,.product-description,.search-category-card,.cart-items,.checkout-panel,.order-summary,.success-panel,.login-panel,.admin-stat,.admin-panel,.admin-quick-card,.admin-save-bar,.admin-form,.search-suggestions,.email-suggestions,.analytics-banner,.icon-button,.button-secondary,.card-size-button,.filter-toggle,.gallery-controls button) { background-color:var(--surface); color:var(--ink); border-color:var(--line); }
html[data-theme=dark] :is(input,select,textarea) { background-color:#111c2a; color:var(--ink); border-color:#56677e; }
html[data-theme=dark] :is(input,textarea)::placeholder { color:#a4b4ca; }
html[data-theme=dark] :is(.field input,.field select,.field textarea,.admin-search input,.admin-order-filters input,.admin-order-filters select,.admin-fields select,.form-group input,.form-group select,.form-group textarea) { background-color:#111c2a; color:var(--ink); border-color:#56677e; }
html[data-theme=dark] .header-search button { background:#111c2a; color:var(--muted); }
html[data-theme=dark] :is(.home-banners,.home-banner,.banner-controls,.admin-tip,.admin-table th,.receipt-reference,.success-contacts,.quantity-step,.admin-mail-note) { background-color:#202e42; border-color:var(--line); color:var(--ink); }
html[data-theme=dark] .banner-business { background:#1c3432; }
html[data-theme=dark] .banner-connect { background:#352e27; }
html[data-theme=dark] .home-banner img { mix-blend-mode:normal; background:#fff; border-radius:10px; }
html[data-theme=dark] :is(.category-card-image,.search-category-card img) { background:#fff; border-radius:8px; }
html[data-theme=dark] :is(.category-card-icon,.add-button,.step-number,.admin-count,.admin-badge,.filter-active-count,.cart-product-symbol) { background:var(--theme-highlight); color:var(--blue); }
html[data-theme=dark] :is(.card-size-button[aria-pressed=true],.filter-toggle[aria-expanded=true],.button-secondary:hover,.search-suggestion:hover,.search-suggestion[aria-selected=true],.search-suggestions-all:hover,.search-suggestions-all[aria-selected=true],.email-suggestions [role=option]:hover,.email-suggestions [aria-selected=true]) { background:var(--theme-highlight); color:var(--blue); }
html[data-theme=dark] :is(.button-primary,.catalog-button,.admin-form .btn-submit,.admin-form .btn-add) { background:#245cdb; color:#fff; }
html[data-theme=dark] :is(.button-primary:hover,.catalog-button:hover,.add-button:hover,.admin-form .btn-submit:hover) { background:#1748b4; color:#fff; }
html[data-theme=dark] :is(.banner-controls button,.gallery-controls button,.gallery-close) { background:var(--surface); color:var(--ink); border-color:var(--line); }
html[data-theme=dark] .banner-dots button { background:transparent; }
html[data-theme=dark] .banner-dots button::after { background:#a4b4ca; }
html[data-theme=dark] .banner-dots button[aria-current=true]::after { background:var(--blue); }
html[data-theme=dark] :is(.breadcrumb,.optional,.admin-tree-marker,.admin-photo-label,.diagram-label,.diagram-footer) { color:var(--muted); }
html[data-theme=dark] :is(.notice-error,.admin-errors) { color:#ffb4bc; background:#3a202a; border-color:#80505b; }
html[data-theme=dark] :is(.notice-warning,.unavailable-row,.success-panel .notice) { color:#f4d58c; background:#362e20; border-color:#75623e; }
html[data-theme=dark] :is(.admin-success,.success-icon,.admin-badge[data-status=COMPLETED]) { color:#a1dfb7; background:#193c2b; border-color:#456d55; }
html[data-theme=dark] .admin-badge[data-status=PROCESSING] { color:#f4d58c; background:#362e20; }
html[data-theme=dark] .admin-badge[data-status=CANCELLED] { color:var(--muted); background:#293342; }
html[data-theme=dark] :is(.admin-danger,.quantity-status.is-error) { color:#ffb4bc; }
html[data-theme=dark] .delete-button:hover { background:#3a202a; color:#ffb4bc; }
html[data-theme=dark] .button-danger:disabled { background:#303c4d; color:#acb9cc; }
html[data-theme=dark] .admin-photo-preview { background:#202e42; border-color:#56677e; }
html[data-theme=dark] .admin-photo-preview img { background:#fff; border-radius:8px; }
html[data-theme=dark] .admin-photo-controls input::file-selector-button { background:var(--theme-highlight); color:var(--blue); }
html[data-theme=dark] .admin-category-row:hover { background:#202e42; }
html[data-theme=dark] :is(.admin-category-row,.product-card-body,.admin-delete-panel) { border-color:var(--line); }
html[data-theme=dark] :is(.admin-body main>form:not([class]),.admin-body main>section:not([class]),.admin-body main>ul:not([class]),main.container>table) { background:var(--surface); color:var(--ink); }
html[data-theme=dark] .analytics-banner a { color:var(--blue); }
/* Product photographs retain their original colours and a neutral light canvas. */
html[data-theme=dark] :is(.product-media,.detail-media,.gallery-thumbnails a,.gallery-dialog,.cart-product-media,.admin-thumb,.search-suggestion img) { background:#fff; color:#142238; }

/* Paint the root as well: WebKit otherwise treats transparent page areas as a light canvas. */
html[data-theme=dark],html[data-theme=dark] body { background-color:var(--background); color:var(--ink); }
.admin-form .form-group select { appearance:none; -webkit-appearance:none; min-height:44px; padding:10px 38px 10px 12px; background-image:url('/images/select-chevron-3a247df977288d677b654842ec720cb4.svg'); background-repeat:no-repeat; background-position:right 12px center; background-size:12px; }

/* WebKit native form labels can retain the light-mode system text colour. */
html[data-theme=dark] :is(label,select,option) { color:#edf2fa!important; -webkit-text-fill-color:#edf2fa!important; -webkit-text-stroke-color:#edf2fa; }
