/* Shared theme layer. Photos deliberately keep a neutral light canvas and true colors. */
:root { color-scheme: light; --theme-surface:#fff; --theme-text:#111; --theme-border:#e4e4e1; }
html[data-theme="dark"] {
  color-scheme:dark;
  --bg:#101214; --fg:#f2f2ef; --muted:#abb1ba; --line:#363c44; --accent:#f2f2ef;
  --theme-surface:#191c20; --theme-raised:#24282d; --theme-text:#f2f2ef;
  --theme-border:#363c44; --theme-red:#ff8296; --theme-green:#75dfa3;
}
.theme-toggle {
  display:inline-flex; align-items:center; justify-content:center; flex:0 0 40px;
  width:40px; height:40px; padding:0; margin:0; border:1px solid var(--theme-border);
  border-radius:50%; background:var(--theme-surface); color:var(--theme-text);
  cursor:pointer; vertical-align:middle; touch-action:manipulation;
}
.theme-toggle[hidden] { display:none; }
.theme-toggle svg { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.theme-toggle:hover { border-color:currentColor; }
.theme-toggle:focus-visible { outline:2px solid currentColor; outline-offset:4px; }
.theme-toggle .theme-sun, html[data-theme="dark"] .theme-toggle .theme-moon { display:none; }
html[data-theme="dark"] .theme-toggle .theme-sun { display:block; }
.theme-standalone { position:fixed; inset-block-start:16px; inset-inline-end:16px; z-index:25; }
@media(max-width:820px) { .head > .theme-toggle { margin-inline-start:auto; } }

html[data-theme="dark"] body { background:var(--bg); color:var(--fg); }
html[data-theme="dark"] :is(.topbar,.headwrap,.head,footer,.side,.card,.card-surface,.prod,.about,.prv,.rvhero,.rvcard,.modal,.cartdrawer,.page,.szchart,.box,.sim,.ss-sznote,table) {
  background:var(--theme-surface); color:var(--fg); border-color:var(--line);
}
html[data-theme="dark"] :is(.card:hover,.pill,.facetmore,.addr,.hubs,.szchart th) { background:var(--theme-raised); }
html[data-theme="dark"] :is(input,select,textarea) { background:var(--theme-raised); color:var(--fg); border-color:var(--line); accent-color:#ff8296; }
html[data-theme="dark"] :is(.acct input,.acct select,.acct textarea) { background:var(--theme-raised); color:var(--fg); border-color:var(--line); }
html[data-theme="dark"] :is(label,.acct label) { color:var(--muted); }
html[data-theme="dark"] :is(.acct button,.box form button) { background:var(--fg); color:#101214; border-color:var(--fg); }
html[data-theme="dark"] .acct button.alt { background:var(--theme-raised); color:var(--fg); border-color:var(--line); }
html[data-theme="dark"] :is(input,select,textarea)::placeholder { color:var(--muted); opacity:1; }
html[data-theme="dark"] :is(.search input,.searchf input):focus { background:var(--theme-raised); border-color:var(--fg); }
html[data-theme="dark"] :is(.logo b,.szgh,.ship b,.opt:hover,.fgroup a:hover,.flinks a:hover,.hubcol a:hover,.crumb a:hover,.pback:hover,.prvmore,.trustline a) { color:var(--fg); }
html[data-theme="dark"] :is(.fgroup a,.fgroup h5,.fbase,.fbase a,.fnote,.hubcol a,.hubcol b,.crumb,.crumb a,.skuline,.meta,.pol,.pol a,.prvsub,.prvmeta,.rvsub,.rvmeta,.rvitem,.simb,.pmuted,.d,.hint,.szchart-btn,.szchart .src,.szchart .x,.close,.ss-sznx span,.ss-sznclose,.card .szlbl,.card .fromlbl,.sz .szp,.sz .szsub,.trustline,.box label,details.specs summary,th) { color:var(--muted); }
html[data-theme="dark"] :is(.about p,.box a:not(.btn)) { color:var(--fg); }
html[data-theme="dark"] :is(.topbar,.headwrap,footer,.fbase,.hubs,.prvcard,.spect td,.spect th,.szchart td,.szchart th,td,th) { border-color:var(--line); }
html[data-theme="dark"] :is(.cartbtn,.backlink,.sz,.chip,.facetmore,.ss-sznchip,.more button,.addbtn) { background:var(--theme-raised); color:var(--fg); border-color:var(--line); }
html[data-theme="dark"] :is(.sz:hover,.chip:hover,.cartbtn:hover,.backlink:hover,.ss-sznchip:hover,.facetmore:hover,.more button:hover) { border-color:var(--fg); }
html[data-theme="dark"] :is(.chip.on,.sz.sel,.buy,.cco,.mfilt,a.btn) { background:var(--fg); color:#101214; border-color:var(--fg); }
html[data-theme="dark"] :is(.sz.sel .szp,.sz.sel .szsub) { color:#424850; }
html[data-theme="dark"] :is(.buy:disabled,.cco:disabled,.addbtn:disabled) { background:#30353b; color:#9ca3ad; border-color:#424850; cursor:not-allowed; }
html[data-theme="dark"] .sz.oos { background:var(--theme-surface); }
html[data-theme="dark"] .facetbody.clipped::after { background:linear-gradient(to bottom,transparent 0%,var(--theme-surface) 82%); }
html[data-theme="dark"] :is(.nowp,.rvstars,.prvstars,.citem .cx,.err,.pol-body a) { color:var(--theme-red); }
html[data-theme="dark"] .pol-body a:hover { background:#482631; }
html[data-theme="dark"] :is(.card .tag,.cship) { color:var(--theme-green); }
html[data-theme="dark"] .trustline svg { stroke:var(--theme-green); }
html[data-theme="dark"] :is(.rvebay,.prvtag) { background:#223047; color:#a8c9ff; }
html[data-theme="dark"] :is(.rvsite,.prvtag.site) { background:#1e3a2b; color:#9de1b5; }
html[data-theme="dark"] .prvtag.this { background:#482631; color:var(--theme-red); }
html[data-theme="dark"] :is(.card .imgwrap,.simimg,.gal .main,.modal .gal,.modal .gal .main,.th,.citem img) { background:#f4f4f1; }
html[data-theme="dark"] :is(.card img,.simimg img,.gal .main) { mix-blend-mode:normal; }

/* Existing server-rendered and dynamic panels carry inline neutral colors.
   Match complete declarations so white doesn't accidentally match pale error colors. */
html[data-theme="dark"] :is([style*="background:#fff;"],[style$="background:#fff"],[style*="background: #fff;"],[style$="background: #fff"]) { background:var(--theme-surface)!important; }
html[data-theme="dark"] :is([style*="background:#fafafa"],[style*="background:#f8f8f6"],[style*="background:#f6f6f4"],[style*="background:#f7f7f7"],[style*="background:#f0f0ee"],[style*="background:#f4f4f2"],[style*="background:#f2f2f2"]) { background:var(--theme-raised)!important; }
html[data-theme="dark"] :is([style*="background:#eee;"],[style$="background:#eee"]) { background:var(--theme-raised)!important; }
html[data-theme="dark"] [style*="background:#fdf2f2"] { background:#482631!important; }
html[data-theme="dark"] [style*="background:#eef7ee"] { background:#1e3a2b!important; }
html[data-theme="dark"] :is([style*="color:#111;"],[style$="color:#111"],[style*="color:#333"],[style*="color:#444"],[style*="color:#555"]) { color:var(--fg)!important; }
html[data-theme="dark"] :is([style*="color:#666"],[style*="color:#777"],[style*="color:#888"],[style*="color:#999"],[style*="color:#aaa"]) { color:var(--muted)!important; }
html[data-theme="dark"] :is([style*="color:#c0122b"],[style*="color:#b00020"]) { color:var(--theme-red)!important; }
html[data-theme="dark"] :is([style*="color:#0a7d2c"],[style*="color:#2f6b45"]) { color:var(--theme-green)!important; }
html[data-theme="dark"] :is([style*="border:1px solid #"],[style*="border-top:1px solid #"],[style*="border-bottom:1px solid #"]) { border-color:var(--line)!important; }
html[data-theme="dark"] :is(a,button)[style*="background:#111"] { background:var(--fg)!important; color:#101214!important; border-color:var(--fg)!important; }
html[data-theme="dark"] #addcart { background:var(--theme-raised)!important; color:var(--fg)!important; border-color:var(--line)!important; }
html[data-theme="dark"] #addcart:disabled { color:#9ca3ad!important; border-color:#424850!important; }
html[data-theme="dark"] :focus-visible { outline:2px solid #ff9daf; outline-offset:3px; }
