:root,
[data-theme="light"] {
  --bg: #ffffff;
  --surface: #f4f4f5;
  --line: rgba(0, 0, 0, 0.08);
  --text: #111111;
  --muted: #6e6e73;
  --brand: #005aff;
  --header-bg: rgba(255, 255, 255, 0.92);
  --thumb-bg: #ebebef;
  --prose: #444444;
  --quote: #333333;
  --footer-grad: linear-gradient(180deg, rgba(0, 90, 255, 0.04) 0%, transparent 160px);
  --btn-primary-bg: #005aff;
  --btn-primary-fg: #ffffff;
  --focus-border: rgba(0, 90, 255, 0.35);
  --ghost-border: rgba(0, 0, 0, 0.12);
  --ghost-bg: rgba(0, 0, 0, 0.03);
  --ghost-hover-border: rgba(0, 90, 255, 0.35);
  --ghost-hover-bg: rgba(0, 90, 255, 0.06);
  --ghost-hover-shadow: 0 0 28px rgba(0, 90, 255, 0.12);
  --item-hover-border: rgba(0, 90, 255, 0.28);
  --item-hover-shadow: 0 16px 40px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 90, 255, 0.08);
  --item-hover-name: #005aff;
  --item-hover-price: rgba(0, 90, 255, 0.85);
  --item-hover-meta-bg: rgba(0, 90, 255, 0.04);
  --item-active-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
  --hero-grad-1: rgba(0, 90, 255, 0.12);
  --hero-grad-2: rgba(0, 90, 255, 0.05);
  --hero-grad-3: rgba(0, 90, 255, 0.04);
  --mesh-color: rgba(0, 90, 255, 0.045);
  --tab-hover-bg: rgba(0, 0, 0, 0.04);
  --tab-active-bg: rgba(0, 90, 255, 0.08);
  --meta-theme: #ffffff;
}

[data-theme="dark"] {
  --bg: #0a0a0a;
  --surface: #141414;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f2f2f2;
  --muted: #8a8a8a;
  --brand: #005aff;
  --header-bg: rgba(10, 10, 10, 0.9);
  --thumb-bg: #0e0e0e;
  --prose: #bbbbbb;
  --quote: #dddddd;
  --footer-grad: linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, transparent 160px);
  --btn-primary-bg: #005aff;
  --btn-primary-fg: #ffffff;
  --focus-border: rgba(0, 90, 255, 0.45);
  --ghost-border: rgba(255, 255, 255, 0.14);
  --ghost-bg: rgba(255, 255, 255, 0.04);
  --ghost-hover-border: rgba(0, 90, 255, 0.45);
  --ghost-hover-bg: rgba(0, 90, 255, 0.1);
  --ghost-hover-shadow: 0 0 28px rgba(0, 90, 255, 0.18);
  --item-hover-border: rgba(0, 90, 255, 0.35);
  --item-hover-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 90, 255, 0.12);
  --item-hover-name: #ffffff;
  --item-hover-price: rgba(0, 90, 255, 0.95);
  --item-hover-meta-bg: rgba(0, 90, 255, 0.08);
  --item-active-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  --hero-grad-1: rgba(0, 90, 255, 0.18);
  --hero-grad-2: rgba(0, 90, 255, 0.08);
  --hero-grad-3: rgba(0, 90, 255, 0.06);
  --mesh-color: rgba(255, 255, 255, 0.028);
  --tab-hover-bg: rgba(255, 255, 255, 0.04);
  --tab-active-bg: rgba(0, 90, 255, 0.12);
  --meta-theme: #0a0a0a;
}

.brand-mark {
  height: 28px;
  width: auto;
}

.brand-mark--dark { display: none; }
[data-theme="dark"] .brand-mark--light { display: none; }
[data-theme="dark"] .brand-mark--dark { display: block; }

.site-header { background: var(--header-bg) !important; }

.hero-bg {
  background:
    radial-gradient(ellipse 70% 55% at 50% 0%, var(--hero-grad-1), transparent 65%),
    radial-gradient(ellipse 45% 35% at 85% 45%, var(--hero-grad-2), transparent),
    radial-gradient(ellipse 40% 30% at 10% 55%, var(--hero-grad-3), transparent) !important;
}

.hero-mesh {
  background-image:
    linear-gradient(var(--mesh-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--mesh-color) 1px, transparent 1px) !important;
}

.item-thumb { background: var(--thumb-bg) !important; }

.item:hover {
  border-color: var(--item-hover-border) !important;
  box-shadow: var(--item-hover-shadow) !important;
}

.item:hover .item-thumb { border-color: var(--item-hover-border) !important; }
.item:hover .item-meta { background: var(--item-hover-meta-bg) !important; }
.item:hover .item-name { color: var(--item-hover-name) !important; }
.item:hover .item-price { color: var(--item-hover-price) !important; }

@media (hover: none) {
  .item:active {
    border-color: var(--item-hover-border) !important;
    box-shadow: var(--item-active-shadow) !important;
  }
  .item:active .item-meta { background: var(--item-hover-meta-bg) !important; }
  .item:active .item-name { color: var(--item-hover-name) !important; }
  .item:active .item-price { color: var(--item-hover-price) !important; }
}

.btn-ghost {
  border-color: var(--ghost-border) !important;
  background: var(--ghost-bg) !important;
}

.btn-ghost:hover {
  border-color: var(--ghost-hover-border) !important;
  background: var(--ghost-hover-bg) !important;
  box-shadow: var(--ghost-hover-shadow) !important;
}

.tab:hover { background: var(--tab-hover-bg) !important; }
.tab.active { background: var(--tab-active-bg) !important; }

.review q { color: var(--quote) !important; }

main p, main li,
.prose p,
.includes li { color: var(--prose) !important; }

.site-footer { background: var(--footer-grad) !important; }

.btn,
.cta-btn,
.buy {
  background: var(--btn-primary-bg) !important;
  color: var(--btn-primary-fg) !important;
}

input:focus,
select:focus,
textarea:focus,
.cta-form input:focus,
.cta-form textarea:focus {
  border-color: var(--focus-border) !important;
}

.reviews-nav button:hover,
.rel-arrow:hover:not(:disabled),
.cta-email a:hover {
  border-color: var(--focus-border) !important;
}

.rel-arrow:hover:not(:disabled) { background: var(--ghost-bg) !important; }

.link {
  border-color: var(--ghost-border) !important;
  background: var(--ghost-bg) !important;
}

.link:hover {
  border-color: var(--ghost-hover-border) !important;
  background: var(--ghost-hover-bg) !important;
  box-shadow: var(--ghost-hover-shadow) !important;
}

.theme-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.theme-switch-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.theme-switch-btn:hover { color: var(--text); }

.theme-switch-btn.is-active {
  background: var(--brand);
  color: #ffffff;
}

.auth-theme {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  padding: 12px max(24px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom, 0px)) max(24px, env(safe-area-inset-left));
  display: flex;
  justify-content: center;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

@media (max-width: 768px) {
  .footer-bottom.theme-bar {
    justify-content: center;
    padding-top: 24px;
  }
}
