/* Store themes. "nova" is the original purple design and needs no overrides.
   Every other theme sets the tokens below; the shared rules map them onto the site. */
html[data-site-theme="light"]{--scheme:light;--bg:#f5f7fb;--surface:#fff;--surface-2:#eef2f7;--line-c:#e2e8f0;--text:#0f172a;--text-muted:#64748b;--accent:#2563eb;--accent-2:#4f46e5;--on-accent:#fff;--header:#fff;--topbar:#0f172a;--hero-bg:linear-gradient(135deg,#eaf1ff 0%,#fff 55%,#eef2ff 100%);--soft:#eff6ff;--glow:#2563eb22}
html[data-site-theme="midnight"]{--scheme:dark;--bg:#0a0f1c;--surface:#111a2c;--surface-2:#18233a;--line-c:#26334d;--text:#f6f1e3;--text-muted:#a7adbd;--accent:#d4af37;--accent-2:#f1d27a;--on-accent:#1b1505;--header:#0d1424;--topbar:#070b14;--hero-bg:radial-gradient(ellipse at 80% 10%,#d4af3722,transparent 55%),linear-gradient(135deg,#0d1526,#141f36);--soft:#d4af371a;--glow:#d4af3726}
html[data-site-theme="ocean"]{--scheme:dark;--bg:#06111c;--surface:#0c1b2b;--surface-2:#11263b;--line-c:#1d3a56;--text:#e8f3ff;--text-muted:#8fa8c2;--accent:#0ea5e9;--accent-2:#22d3ee;--on-accent:#fff;--header:#081626;--topbar:#030a12;--hero-bg:radial-gradient(ellipse at 80% 0%,#22d3ee26,transparent 55%),linear-gradient(135deg,#071a2c,#0b2540);--soft:#0ea5e91f;--glow:#0ea5e933}
html[data-site-theme="gaming"]{--scheme:dark;--bg:#09090b;--surface:#141417;--surface-2:#1c1c21;--line-c:#2b2b32;--text:#f4f4f5;--text-muted:#a1a1aa;--accent:#e11d48;--accent-2:#f43f5e;--on-accent:#fff;--header:#0f0f12;--topbar:#000;--hero-bg:radial-gradient(ellipse at 85% 0%,#e11d4830,transparent 55%),linear-gradient(135deg,#111114,#1a0d12);--soft:#e11d481c;--glow:#e11d4833}
html[data-site-theme="sand"]{--scheme:light;--bg:#faf7f2;--surface:#fff;--surface-2:#f4eee5;--line-c:#e8dece;--text:#2a2017;--text-muted:#7c6d5d;--accent:#a16207;--accent-2:#c2410c;--on-accent:#fff;--header:#fffdf9;--topbar:#2a2017;--hero-bg:linear-gradient(135deg,#f7efe2,#fffaf3 60%,#f3e8d8);--soft:#a162071a;--glow:#a1620722}

html.themed{color-scheme:var(--scheme);--purple:var(--accent);--ink:var(--text);--muted:var(--text-muted);--line:var(--line-c)}
html.themed body{background:var(--bg);color:var(--text)}
html.themed .top{background:var(--topbar);color:#fff}
html.themed .top span{color:#ffffffb3}
html.themed header,html.themed nav,html.themed nav#storeNavigation{background:var(--header);color:var(--text)}
html.themed header{border-bottom:1px solid var(--line-c)}
html.themed nav{border-bottom:1px solid var(--line-c)}
html.themed nav a:hover{color:var(--accent)}
html.themed .logo i{color:var(--accent);text-shadow:none}
html.themed header form{background:var(--surface-2);border:1px solid var(--line-c)}
html.themed header input,html.themed header button{color:var(--text);background:transparent}
html.themed input,html.themed select,html.themed textarea{background:var(--surface);color:var(--text);border-color:var(--line-c)}
html.themed input::placeholder,html.themed textarea::placeholder{color:var(--text-muted)}
html.themed .btn,html.themed .buy-row button{background:var(--accent);color:var(--on-accent);box-shadow:none}
html.themed .btn.dark{background:linear-gradient(110deg,var(--accent),var(--accent-2));color:var(--on-accent);box-shadow:0 8px 22px var(--glow)}
html.themed .btn.light{background:var(--surface);color:var(--text);border:1px solid var(--line-c)}
html.themed .category,html.themed .product,html.themed .panel,html.themed .filters,html.themed .stats>div{background:var(--surface);border:1px solid var(--line-c)}
html.themed .product .info{background:var(--surface)}
html.themed .category:hover,html.themed .product:hover{border-color:var(--accent);box-shadow:0 10px 30px var(--glow)}
html.themed .category i,html.themed .benefits i{color:var(--accent)}
html.themed .product .price{color:var(--text)}
html.themed .product .rating span,html.themed .section-head p,html.themed .collection-note,html.themed .source-price-note,html.themed .benefits small,html.themed .badge small,html.themed .empty{color:var(--text-muted)}
html.themed .tag,html.themed .imported .tag,html.themed .heart{background:var(--soft);color:var(--accent);border:1px solid var(--line-c)}
html.themed .notice{background:var(--soft);color:var(--text);border:1px solid var(--line-c)}
html.themed .hero,html.themed .promo,html.themed .ezviz-collection{background:var(--hero-bg);border:1px solid var(--line-c);box-shadow:none;animation:none}
html.themed .hero p,html.themed .promo p{color:var(--text-muted)}
html.themed .hero h1 em{color:var(--accent);text-shadow:none}
html.themed .hero:before,html.themed .hero:after{background:var(--accent);opacity:.14}
html.themed .hero-visual{background:none}
html.themed .hero-visual .badge{background:var(--surface);border:1px solid var(--line-c);box-shadow:0 12px 34px var(--glow)}
html.themed .benefits{border-color:var(--line-c)}
html.themed footer{background:var(--topbar);color:#ffffffb8;border-top:1px solid var(--line-c)}
html.themed footer .logo,html.themed footer h3{color:#fff}
html.themed footer input{background:#ffffff14;color:#fff;border-color:#ffffff2e}
html.themed #suggestions{background:var(--surface);border:1px solid var(--line-c)}
html.themed #suggestions a:hover{background:var(--soft)}
html.themed .spec-table>div:nth-child(odd){background:var(--surface-2)}
html.themed .spec-table>div:nth-child(even){background:var(--surface)}
html.themed .nova-motion-toggle{background:var(--surface);color:var(--text);border-color:var(--line-c);box-shadow:0 4px 18px var(--glow)}
html.themed dialog{background:var(--surface);color:var(--text);border:1px solid var(--line-c)}
html.themed table{color:var(--text)}
html.themed th{background:var(--surface-2)}
html.themed td{border-color:var(--line-c)}
html.themed .admin-tabs button{background:var(--surface-2);color:var(--text-muted)}
html.themed .admin-tabs button.active{background:var(--accent);color:var(--on-accent)}
html.themed .gallery-thumbs button.selected{border-color:var(--accent)}
html.themed a:focus-visible,html.themed button:focus-visible{outline-color:var(--accent)}

/* Homepage showcase */
html.themed .showcase-hero,html.themed .showcase-support{background:var(--hero-bg);border-color:var(--line-c)}
html.themed .showcase-intro .eyebrow i{background:var(--accent-2);box-shadow:0 0 14px var(--accent-2)}
html.themed .showcase-intro h1 em{color:var(--accent)}
html.themed .showcase-intro>p,html.themed .showcase-promises,html.themed .showcase-support p,html.themed .stage-caption span,html.themed .showcase-counter{color:var(--text-muted)}
html.themed .stage-category{border-color:var(--line-c);color:var(--text-muted)}
html.themed .stage-photo{box-shadow:0 24px 60px var(--glow)}
html.themed .stage-caption p{color:var(--accent)}
html.themed .stage-link{background:var(--soft);border-color:var(--line-c);color:var(--accent)}
html.themed .showcase-dots button{background:var(--line-c)}
html.themed .showcase-dots button.is-active{background:var(--accent)}
html.themed .showcase-controls>button{color:var(--text);border-color:var(--line-c)}
html.themed .showcase-orbit{border-color:var(--glow)}
html.themed .showcase-orbit:after{background:var(--accent);box-shadow:0 0 18px var(--accent)}
html.themed .showcase-ticker{border-color:var(--line-c);color:var(--text-muted)}
html.themed .product-rail{scrollbar-color:var(--line-c) transparent}
html.themed .rail-actions>button{background:var(--surface);color:var(--text);border:1px solid var(--line-c)}
html.themed .home-category-setting{border-color:var(--line-c)}
html.themed .home-category-setting button{background:var(--surface-2);color:var(--text);border-color:var(--line-c)}

/* Mobile menu and filters */
html.themed #mobileMenuToggle{background:var(--surface-2);color:var(--text);border-color:var(--line-c)}
html.themed nav#storeNavigation>a{color:var(--text)}
@media(max-width:700px){html.themed nav#storeNavigation>a{background:var(--surface-2)}}
html.themed #mobileFiltersToggle{color:var(--text)}

/* Product assistant */
html.themed .product-assistant{background:var(--hero-bg);border-color:var(--line-c)}
html.themed .assistant-head p,html.themed .assistant-note,html.themed .assistant-specs dt{color:var(--text-muted)}
html.themed .assistant-badge{color:var(--accent);border-color:var(--line-c);background:var(--soft)}
html.themed .assistant-topics button{background:var(--surface);color:var(--text);border-color:var(--line-c)}
html.themed .assistant-topics button.selected{background:var(--accent);color:var(--on-accent);border-color:var(--accent)}
html.themed .assistant-search label,html.themed .assistant-answer p{color:var(--text)}
html.themed .assistant-search input{background:var(--surface);color:var(--text);border-color:var(--line-c)}
html.themed .assistant-answer{background:var(--surface);border-color:var(--line-c)}
html.themed .assistant-specs>div{border-color:var(--line-c)}
html.themed .assistant-contact{color:var(--accent)}

/* Page backgrounds. Patterns are drawn from the active theme's accent colors,
   so every background matches whichever theme is live. */
html:not(.themed){--bg:#0c0b13;--accent:#8153db;--accent-2:#79edf2}
html[data-site-bg="glow"] body,[data-bg-pattern="glow"]{background-image:radial-gradient(900px 620px at 100% 0%,color-mix(in srgb,var(--accent) 17%,transparent),transparent 62%),radial-gradient(820px 620px at 0% 100%,color-mix(in srgb,var(--accent-2) 13%,transparent),transparent 62%);background-attachment:fixed}
html[data-site-bg="grid"] body,[data-bg-pattern="grid"]{background-image:linear-gradient(color-mix(in srgb,var(--accent) 10%,transparent) 1px,transparent 1px),linear-gradient(90deg,color-mix(in srgb,var(--accent) 10%,transparent) 1px,transparent 1px);background-size:44px 44px;background-attachment:fixed}
html[data-site-bg="dots"] body,[data-bg-pattern="dots"]{background-image:radial-gradient(color-mix(in srgb,var(--accent) 26%,transparent) 1.3px,transparent 1.8px);background-size:22px 22px;background-attachment:fixed}
html[data-site-bg="lines"] body,[data-bg-pattern="lines"]{background-image:repeating-linear-gradient(135deg,color-mix(in srgb,var(--accent) 8%,transparent) 0 1px,transparent 1px 16px);background-attachment:fixed}
html[data-site-bg="aurora"] body,[data-bg-pattern="aurora"]{background-image:radial-gradient(ellipse 60% 50% at 15% 10%,color-mix(in srgb,var(--accent) 18%,transparent),transparent 70%),radial-gradient(ellipse 55% 45% at 85% 35%,color-mix(in srgb,var(--accent-2) 15%,transparent),transparent 70%),radial-gradient(ellipse 70% 50% at 50% 100%,color-mix(in srgb,var(--accent) 12%,transparent),transparent 70%);background-attachment:fixed}
html[data-site-bg="techglow"] body,[data-bg-pattern="techglow"]{background-image:radial-gradient(800px 560px at 100% 0%,color-mix(in srgb,var(--accent) 18%,transparent),transparent 62%),radial-gradient(700px 520px at 0% 100%,color-mix(in srgb,var(--accent-2) 12%,transparent),transparent 62%),linear-gradient(color-mix(in srgb,var(--accent) 8%,transparent) 1px,transparent 1px),linear-gradient(90deg,color-mix(in srgb,var(--accent) 8%,transparent) 1px,transparent 1px);background-size:auto,auto,44px 44px,44px 44px;background-attachment:fixed}
.bg-swatch{height:96px;border-radius:10px;margin-bottom:12px;background-color:var(--bg);border:1px solid var(--line);background-attachment:scroll!important}

/* Theme picker in the control panel */
.theme-picker{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:16px;margin:20px 0}
.theme-card{border:2px solid var(--line);border-radius:16px;padding:14px;background:transparent;color:inherit;text-align:right}
.theme-card.is-live{border-color:var(--purple)}
.theme-card.is-preview{outline:2px dashed var(--purple);outline-offset:3px}
.theme-swatch{display:grid;grid-template-columns:2fr 1fr;grid-template-rows:54px 30px;gap:6px;border-radius:10px;overflow:hidden;margin-bottom:12px}
.theme-swatch i{display:block;border-radius:6px}
.theme-swatch i:first-child{grid-row:1/3}
.theme-card h3{margin:0 0 4px;font-size:16px}
.theme-card p{margin:0 0 12px;font-size:12px;color:var(--muted);min-height:36px}
.theme-card .theme-actions{display:flex;gap:8px;flex-wrap:wrap}
.theme-card .theme-actions button{padding:8px 12px;border-radius:8px;font-size:12px}
.theme-live-badge{display:inline-block;font-size:11px;padding:3px 9px;border-radius:20px;background:var(--purple);color:#fff;margin-inline-start:6px;vertical-align:middle}

/* Bespoke NOVA electronics line art: no external images or downloads. */
html[data-site-bg="nova-circuit"],[data-bg-pattern="nova-circuit"]{--nova-tech-pattern:url('/backgrounds/nova-circuit.svg')}
html[data-site-bg="nova-devices"],[data-bg-pattern="nova-devices"]{--nova-tech-pattern:url('/backgrounds/nova-devices.svg')}
html[data-site-bg="nova-security"],[data-bg-pattern="nova-security"]{--nova-tech-pattern:url('/backgrounds/nova-security.svg')}
html[data-site-bg="nova-gaming"],[data-bg-pattern="nova-gaming"]{--nova-tech-pattern:url('/backgrounds/nova-gaming.svg')}
html[data-site-bg^="nova-"] body{isolation:isolate;background-image:radial-gradient(ellipse at 0% 15%,color-mix(in srgb,var(--accent) 12%,transparent),transparent 55%),radial-gradient(ellipse at 100% 75%,color-mix(in srgb,var(--accent-2) 10%,transparent),transparent 60%);background-attachment:fixed}
html[data-site-bg^="nova-"] body::before{content:"";position:fixed;inset:0;z-index:-1;pointer-events:none;background:var(--accent);opacity:.16;mask-image:var(--nova-tech-pattern);mask-size:720px 480px;mask-repeat:repeat;animation:novaTechDrift 55s ease-in-out infinite alternate}
.bg-swatch[data-bg-pattern^="nova-"]{position:relative;isolation:isolate;background-image:radial-gradient(ellipse at top right,color-mix(in srgb,var(--accent) 18%,transparent),transparent 75%)}
.bg-swatch[data-bg-pattern^="nova-"]::before{content:"";position:absolute;inset:0;pointer-events:none;background:var(--accent);opacity:.65;mask-image:var(--nova-tech-pattern);mask-size:310px 207px;mask-repeat:repeat}
@keyframes novaTechDrift{from{mask-position:0 0}to{mask-position:36px 24px}}
@media(max-width:700px){html[data-site-bg^="nova-"] body{background-attachment:scroll}html[data-site-bg^="nova-"] body::before{opacity:.11;mask-size:540px 360px;animation:none}}
@media(prefers-reduced-motion:reduce){html[data-site-bg^="nova-"] body::before{animation:none}}
html[data-site-theme="nova" i] {
  --scheme: light;
  --bg: #edf3fc;
  --surface: #ffffff;
  --surface-2: #f0f5fd;
  --line-c: #d6e2f5;
  --text: #101d3e;
  --text-muted: #485c7c;
  --accent: #244fd6;
  --accent-2: #19399f;
  --on-accent: #fff;
  --header: #fff;
  --topbar: #101d3e;
  --hero-bg: radial-gradient(ellipse at 82% 12%, #b9d3ff 0, transparent 62%), linear-gradient(130deg, #e6efff, #f8faff 65%, #dceaff);
  --soft: #eaf1ff;
  --glow: #244fd625;
}
a.logo.nova-brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 0.4rem;
  padding: 0.42rem 0.6rem;
  border-radius: 0.75rem;
  background: #f5f8fd;
  border: 1px solid #dbe6f8;
  line-height: 1;
  width: max-content;
  max-width: 100%;
}
.nova-brand-mark { width: clamp(1.9rem, 3.4vw, 3rem); height: auto; }
.nova-brand-word { width: clamp(4.4rem, 8vw, 7.5rem); height: auto; }
.nova-brand svg { display: block; mix-blend-mode: multiply; }
html[data-site-theme="nova"] .notice.price-public-notice {
  border: 1px solid #adc6f7;
  border-inline-start: 4px solid #244fd6;
  background: #edf4ff;
  color: #101d3e;
}
html[data-site-theme="nova"] .price-notice-title { color: #19399f; }
html[data-site-theme="nova"] .showcase-hero {
  box-shadow: 0 16px 45px #183c9616;
}

/* Alternative storefront layouts */
html[data-site-theme="studio"] {
  --scheme: light; --bg: #f6f8fc; --surface: #fff; --surface-2: #f2f5fa;
  --line-c: #dce5f3; --text: #101d3e; --text-muted: #475b76;
  --accent: #244fd6; --accent-2: #19399f; --on-accent: #fff;
  --header: #fff; --topbar: #101d3e; --soft: #edf3ff; --glow: #244fd620;
  --hero-bg: linear-gradient(128deg, #fff 25%, #ebf3ff 100%);
}
html[data-site-theme="studio"] .showcase-hero { border-radius: 2rem; }
html[data-site-theme="studio"] .product { border-radius: 1.125rem; }
html[data-site-theme="studio"] .product .photo { background: #f8faff; }
html[data-site-theme="market"] {
  --scheme: light; --bg: #eaf1fb; --surface: #fff; --surface-2: #eff4fc;
  --line-c: #cddaf0; --text: #0b1b39; --text-muted: #465b7d;
  --accent: #173ead; --accent-2: #19399f; --on-accent: #fff;
  --header: #f7faff; --topbar: #0b1b39; --soft: #e5edff; --glow: #173ead26;
  --hero-bg: linear-gradient(115deg, #f6f9ff, #cadbfa);
}
html[data-site-theme="market"] .product { border-radius: 0.65rem; }
html[data-site-theme="market"] .grid { gap: 0.75rem; }
@media (min-width: 1001px) {
  html[data-site-theme="market"] .catalog .grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  html[data-site-theme="market"] .showcase-hero { padding-block: 2rem; }
}

/* The shop accent is independent of the selected template. */
html.themed[data-site-accent="blue"] { --chosen-accent: #244fd6; --chosen-hover: #3247c0; }
html.themed[data-site-accent="purple"] { --chosen-accent: #7138c7; --chosen-hover: #6331aa; }
html.themed[data-site-accent="red"] { --chosen-accent: #be2448; --chosen-hover: #9f2043; }
html.themed[data-site-accent="amber"] { --chosen-accent: #966207; --chosen-hover: #795005; }
html.themed[data-site-accent]:not([data-site-accent="default"]) {
  --accent: var(--chosen-accent);
  --accent-2: var(--chosen-hover);
  --on-accent: #fff;
  --soft: color-mix(in srgb, var(--accent) 12%, var(--surface));
  --glow: color-mix(in srgb, var(--accent) 21%, transparent);
}
.theme-accent-form { margin-block: 0 24px; padding: 16px; border: 1px solid var(--line-c); border-radius: 12px; }
.theme-accent-form h2 { margin: 0; }
.theme-accent-form label { display: block; margin-block: 0 8px; }
.theme-accent-form div { display: flex; flex-wrap: wrap; gap: 8px; }
.theme-accent-form select { min-height: 44px; padding: 8px 12px; border-radius: 8px; }
