/* The palette is shared with the initial HTML and native browser controls. */
body[data-theme] {
  --green: var(--shop-accent); --muted: var(--shop-muted); --line: var(--shop-line);
  background: var(--shop-canvas); color: var(--shop-ink);
  accent-color: var(--shop-accent); caret-color: var(--shop-accent);
  scrollbar-color: var(--shop-muted) var(--shop-surface); color-scheme: light;
}
body[data-color-mode=dark] { color-scheme: dark; }
body[data-theme] ::selection { background: var(--shop-accent); color: var(--shop-buttonInk); }
body[data-theme] :is(a, button, input, select, textarea):focus-visible { outline-color: var(--shop-accent); }
body[data-theme] :is(.site, .category-card, .product-detail, #checkout-form > select, .delivery-address textarea) { background: var(--shop-surface); color: var(--shop-ink); }
body[data-theme] :is(.search-field, .view-switch, .no-photo, .product-detail-visual, .owner-bar) { background: var(--shop-field); color: var(--shop-muted); border-color: var(--shop-line); }
body[data-theme] :is(.search-field input, #navigation > a[aria-current]) { color: var(--shop-ink); }
body[data-theme] .search-field:focus-within { border-color: var(--shop-accent); box-shadow: none; }
body[data-theme] :is(.brand-mark i, .view-switch button[aria-pressed=true], .floating-cart) { background: var(--shop-accent); color: var(--shop-buttonInk); }
body[data-theme] :is(.category-label svg, .icon-button) { color: var(--shop-accent); }
body[data-theme] .view-switch button { color: var(--shop-muted); }
body[data-theme] :is(.text-button, .catalog-quantity, .personal-context) { background: var(--shop-soft); color: var(--shop-accent); }
body[data-theme] :is(.text-button:hover, .catalog-quantity button:hover, .product-detail-close:hover, .banner-controls button:hover) { background: var(--shop-field); color: var(--shop-accent); }
body[data-theme] .category-card:hover { border-color: var(--shop-accent); }
body[data-theme] .floating-cart:hover { background: var(--shop-accent); filter: brightness(.94); }
body[data-theme] .floating-cart-count { background: var(--shop-surface); color: var(--shop-accent); }
body[data-theme] :is(.product-detail-unavailable, .product-detail-visual .no-photo, .product-detail-info .missing-price) { color: var(--shop-muted); }
body[data-color-mode=dark] :is(.checkout-error, .checkout-notice) { color: #f2b2a5; }
.theme-picker { min-height: 44px; max-width: 156px; padding: 8px; border: 1px solid var(--shop-line); border-radius: 8px; background: var(--shop-field); color: var(--shop-ink); font: inherit; font-size: 12px; }
@media(max-width:600px) {
  body:has(.theme-picker) .header { gap: 8px; padding-top: 8px; padding-bottom: 8px; }
  body:has(.theme-picker) .header .brand { max-width: calc(100% - 60px); flex: 1 1 calc(100% - 60px); }
  .theme-picker { order: 2; max-width: 100%; width: 100%; }
  body:has(.theme-picker) #navigation { order: 3; }
}
