/* Opt-in user-site theme; never loaded by admin and never changes print/PDF. */
.header-theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: 0 0 44px; padding: 0; border: 1px solid var(--color-border); border-radius: 50%; background: var(--color-surface); color: var(--color-text); cursor: pointer; }
.header-theme-toggle svg { width: 21px; height: 21px; }
.header-theme-toggle .theme-icon-sun, :root[data-theme="dark"] .header-theme-toggle .theme-icon-moon { display: none; }
:root[data-theme="dark"] .header-theme-toggle .theme-icon-sun { display: block; }
.header-theme-toggle:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

@media screen {
  :root[data-theme="light"] { color-scheme: light; }
  :root[data-theme="dark"] {
    color-scheme: dark;
    --color-bg: #14181e;
    --color-surface: #20262f;
    --color-surface-muted: #282f39;
    --color-text: #f0f2f5;
    --color-text-primary: #f0f2f5;
    --color-text-secondary: #bdc5d0;
    --color-text-muted: #a7b1bf;
    --color-border: #3d4653;
    --color-border-strong: #697586;
    --color-accent: #ff893e;
    --color-accent-dark: #ffad73;
    --color-accent-action: #a83e00;
    --color-accent-light: #39291f;
    --color-success: #6ee7b7;
    --color-danger: #ff9c9c;
    --line: #3d4653;
    --shadow-sm: 0 1px 3px #0004;
    --shadow-md: 0 4px 16px #0005;
    --shadow-lg: 0 12px 32px #0006;
  }
  [data-theme="dark"] .site-header,
  [data-theme="dark"] .profile-header,
  [data-theme="dark"] .catalog-drawer-header { background: #20262ff5; }
  [data-theme="dark"] :is(.brand-logo, .profile-brand img) {
    background: transparent;
    border-radius: 0;
    filter: brightness(0) invert(1);
  }
  [data-theme="dark"] :is(input, select, textarea) { background-color: var(--color-surface); color: var(--color-text); }
  [data-theme="dark"] input::placeholder,
  [data-theme="dark"] textarea::placeholder { color: var(--color-text-muted); }
  [data-theme="dark"] .auth-tab.active { background: var(--color-surface); }
  [data-theme="dark"] dialog { background-color: var(--color-surface); color: var(--color-text); }
  [data-theme="dark"] .gallery-nav { background: #20262fe6; }
  [data-theme="dark"] .gallery-nav:hover { background: #20262f; }
  [data-theme="dark"] .language-switcher button.active { background: #465260; color: #fff; }
  [data-theme="dark"] .btn-danger { background: #b42335; border-color: #b42335; color: #fff; }
  [data-theme="dark"] .btn-danger:hover { background: #8f1c2a; }
  [data-theme="dark"] .cart-badge:not(.is-empty) { color: #14181e; }
  [data-theme="dark"] .tab-btn.active { background: #465260; color: #fff; }
  [data-theme="dark"] :is(.btn-primary:hover, .catalog-model-check) { background: #873500; color: #fff; }
  [data-theme="dark"] :is(.cart-operation-status, .customer-share-note) { background: #392f1d; color: #f5d28c; border-color: #806738; }
  [data-theme="dark"] :is(.auth-error, .cart-operation-status.error, .customer-share-item.is-unavailable,
    .customer-share-device.is-unavailable, .catalog-cart-dialog-row.marked-for-delete, .profile-detail-row.is-unavailable) {
    background: #3a242a; color: #ffb0b0; border-color: #945861;
  }
  [data-theme="dark"] :is(.customer-share-status.is-success, .customer-share-availability, .profile-form-status.is-success) { color: #6ee7b7; }
  [data-theme="dark"] .profile-status-badge { background: #193b32; color: #6ee7b7; }
  [data-theme="dark"] :is(.profile-sign-out:hover, .profile-danger-action:hover) { background: #3a242a; }
  [data-theme="dark"] :is(.share-code:hover, .share-code:active) { background: #503521; }
  [data-theme="dark"] :is(.btn, .gallery-viewport, .cart-category-preview):focus-visible { outline-color: #ffb781; }
  [data-theme="dark"] :is(#sales-contact-open, #cart-inquiry):focus-visible { outline-color: #a9caff; }
  /* Keep product pixels unchanged, including their light photographic backgrounds. */
  [data-theme="dark"] .option-card-color .option-name { color: var(--color-text) !important; }
  [data-theme="dark"] .option-card-color.color-red .option-name { color: #ff9d9d !important; }
  [data-theme="dark"] .option-card-color.color-green .option-name { color: #80dbab !important; }
}

@media screen {
  @supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    :root[data-theme="dark"] .site-header { background: rgba(32, 38, 47, .76); }
  }
}
