/* Theme preference is applied before the page is painted. */
:root { color-scheme: light; }
.theme-toggle {
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  flex-shrink:0; min-width:76px; min-height:40px; padding:7px 10px;
  border:1px solid #535b62; border-radius:6px; background:#24282c;
  color:#e6edf2; cursor:pointer;
}
.theme-toggle[hidden] { display:none; }
.theme-toggle:hover { background:#30383e; border-color:#80909c; color:#fff; }
.theme-toggle:focus-visible { outline:3px solid #ce91ff; outline-offset:3px; }
.theme-toggle svg { display:block; width:18px; height:18px; flex-shrink:0; }
.theme-toggle .theme-track {
  display:block; position:relative; width:28px; height:16px; padding:0;
  border:1px solid #8a97a1; border-radius:999px; background:#46515a;
}
.theme-toggle .theme-knob {
  display:block; position:absolute; top:2px; left:2px; width:10px; height:10px;
  padding:0; border-radius:50%; background:#f4f6f8;
}
.theme-toggle[aria-checked="true"] .theme-track { background:#9E00F9; border-color:#ce91ff; }
.theme-toggle[aria-checked="true"] .theme-knob { transform:translateX(12px); background:#fff; }
@media (prefers-reduced-motion:no-preference) {
  .theme-toggle .theme-knob { transition:transform .15s ease; }
}
@media(max-width:760px) {
  .main-nav .nav-meta { gap:10px; }
}
html[data-theme="dark"] {
  color-scheme:dark; --ink:#eff3f6; --muted:#aab6c2; --accent:#9E00F9;
  --orange:#9E00F9; --line:#34414c; --page:#101418; --white:#1a2026;
}
html[data-theme="dark"] body { background:var(--page); color:var(--ink); }
html[data-theme="dark"] .skip-link,
html[data-theme="dark"] .launch-label,
html[data-theme="dark"] .category-card,
html[data-theme="dark"] .product-card,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .buy-panel,
html[data-theme="dark"] .detail-panel,
html[data-theme="dark"] .related-card,
html[data-theme="dark"] .view-switch,
html[data-theme="dark"] .footer,
html[data-theme="dark"] dialog { background:#1a2026; color:var(--ink); border-color:var(--line); }
html[data-theme="dark"] .launch-label > span,
html[data-theme="dark"] .related-card > span { background:#30203f; color:#ce91ff; }
html[data-theme="dark"] .category-field legend,
html[data-theme="dark"] .filter-group > label,
html[data-theme="dark"] .card-number,
html[data-theme="dark"] .footer .brand-domain { color:var(--muted); }
html[data-theme="dark"] .category-option,
html[data-theme="dark"] .product-description,
html[data-theme="dark"] .compatibility,
html[data-theme="dark"] .footer button,
html[data-theme="dark"] .footer-main>div>a,
html[data-theme="dark"] #dialog-content p,
html[data-theme="dark"] .back-catalog,
html[data-theme="dark"] .detail-intro,
html[data-theme="dark"] .detail-panel p,
html[data-theme="dark"] .product-highlights,
html[data-theme="dark"] .amazon-features { color:#c3cdd5; }
html[data-theme="dark"] .category-option:hover,
html[data-theme="dark"] .view-switch button:hover { background:#28323b; color:var(--ink); }
html[data-theme="dark"] .category-option:has(input:checked),
html[data-theme="dark"] .view-switch button[aria-pressed="true"] { background:#30203f; color:#ce91ff; }
html[data-theme="dark"] .category-option .category-count { background:#313d46; color:#c3cdd5; }
html[data-theme="dark"] .filter-group select { background:#1a2026; border-color:#465460; color:var(--ink); }
html[data-theme="dark"] .catalog-notice { background:#30203f; border-color:#744495; color:#ce91ff; }
html[data-theme="dark"] .category-cover { background:#20282f; border-color:var(--line); }
html[data-theme="dark"] .category-symbol { background:#27323a; border-color:#46545e; color:#bdc9d2; box-shadow:4px 4px 0 #141a1f; }
html[data-theme="dark"] .soon-badge { background:#29343e; border-color:#47545f; color:#c0cbd4; }
html[data-theme="dark"] .category-card button,
html[data-theme="dark"] .specifications > div,
html[data-theme="dark"] .detail-nav,
html[data-theme="dark"] .product-coupon { border-color:var(--line); }
html[data-theme="dark"] .category-card:hover,
html[data-theme="dark"] .product-card:hover,
html[data-theme="dark"] .related-card:hover { border-color:#9E00F9; box-shadow:0 6px 20px #0004; }
html[data-theme="dark"] .primary-button { background:#7900c0; color:#fff; }
html[data-theme="dark"] .primary-button:hover { background:#7900c0; }
html[data-theme="dark"] .product-photo,
html[data-theme="dark"] .gallery-stage,
html[data-theme="dark"] .gallery-thumbnails button { background:#e1e5e8; border-color:#62717d; }
html[data-theme="dark"] .product-photo.without-photo,
html[data-theme="dark"] .gallery-placeholder { background:linear-gradient(135deg,#20282f,#30203f); }
html[data-theme="dark"] .product-symbol,
html[data-theme="dark"] .gallery-placeholder .eyebrow { color:#ce91ff; }
html[data-theme="dark"] .photo-category { color:#c3cdd5; }
html[data-theme="dark"] .gallery-symbol { background:#30203f; color:#ce91ff; }
html[data-theme="dark"] .product-photo .discount { background:#7900c0; color:#fff; }
html[data-theme="dark"] .compatibility summary,
html[data-theme="dark"] .view-product,
html[data-theme="dark"] .product-summary .eyebrow,
html[data-theme="dark"] .panel-icon { color:#ce91ff; }
html[data-theme="dark"] .detail-platforms { background:#2b3943; color:#dae3e9; }
html[data-theme="dark"] .specifications dd { color:#e0e8ee; }
html[data-theme="dark"] .compatibility-panel { background:#30203f; border-color:#744495; }
html[data-theme="dark"] .history-empty { background:#222b33; }
html[data-theme="dark"] .history-empty > span { color:#aab6c2; }
html[data-theme="dark"] .gallery-thumbnails button[aria-pressed="true"] { border-color:#ce91ff; }
html[data-theme="dark"] dialog::backdrop { background:#080c10cc; }
html[data-theme="dark"] .offer-grid[data-view="list"] .product-photo,
html[data-theme="dark"] .offer-grid[data-view="list"] .category-cover,
html[data-theme="dark"] .offer-grid[data-view="list"] .product-purchase { border-color:var(--line); }

html[data-theme="dark"] .category-option { background:#1a2026; }
