:root[data-store-theme="dark"] {
 color-scheme:dark;
 --ink:#fcf4ec;
 --muted:#c2b6ae;
 --paper:#181615;
 --line:#443832;
 --dark:#111010;
 color:#fcf4ec;
 background:#181615;
}
[data-store-theme="dark"] body { background:#181615; color:#fcf4ec; }
[data-store-theme="dark"] :is(.header,.header .nav,.drawer,.modal-inner,.account-menu,.account-profile,
 #customer-login-dialog,.store-mobile-nav,.support-panel,.login-card,.topbar,.order,.empty,.contact,.notice) {
 background:#26211e !important; color:#fcf4ec; border-color:#514239;
}
[data-store-theme="dark"] :is(.starwork-original-hero,.reseller-section,.shopping-guide,.faq-section,.products-section,.popular-section) {
 background:#1c1917; color:#fcf4ec;
}
[data-store-theme="dark"] :is(.product-card,.product-content,.popular-card,.reseller-card,.reseller-form-panel,.step-copy,.faq-item,.unit,.identity,.filters button,.action,.quiet,.back-store) {
 background:#2b2521; color:#fcf4ec; border-color:#514239;
}
[data-store-theme="dark"] :is(input,textarea,select,.searchbox) { background:#35302c; color:#fcf4ec; border-color:#67574d; }
[data-store-theme="dark"] :is(.hero-description,.subheading,.detail-description,#intro,.panel header,.panel footer,.status-note,.muted,.delivery-availability) {
 color:#cfc0b6;
}
[data-store-theme="dark"] .marquee { background:#101010;color:#fff; }
[data-store-theme="dark"] .store-mobile-nav > :is(a,button) { color:#e6d8cc; }
[data-store-theme="dark"] .store-mobile-nav > [aria-current] { background:#533026; color:#ffdbc6; }
[data-store-theme="dark"] .panel button:not(.primary),[data-store-theme="dark"] .account-menu :is(a,button) { color:#ffc3a5; }
[data-store-theme="dark"] #store-theme-toggle { color:#ffbb94; }
[data-store-theme="dark"] .login-card .art { color:#23211f; }
[data-store-theme="dark"] .embedded-login,.embedded-login[data-store-theme="dark"] body { background:#26211e; }
[data-store-theme="dark"] :is(.detail-panel,.support-view,.support-result,.support-option) { background:#2b2521;color:#fcf4ec;border-color:#514239; }
[data-store-theme="dark"] :is(.layout > div > section,.identity,.order pre,.unit pre,.hero:has(.identity)) { background:#26211e;color:#fcf4ec; }
[data-store-theme="dark"] .filters button[aria-pressed="true"] { background:#70402d;color:#fff4ec; }
[data-store-theme="dark"] :is(.notice,.contact) { color:#ead6c6; }

[data-store-theme="dark"] .header :is(.customer-button,.cart-button,.menu-button,.icon-button) { color:#fcf4ec; }
[data-store-theme="dark"] .header .cart-button { border-color:#a28c7f; }
[data-store-theme="dark"] .header #store-theme-toggle { color:#ffbb94; }
[data-store-theme="dark"] .starwork-original-hero .hero-kicker { color:#d6c7bd!important; }
[data-store-theme="dark"] .starwork-original-hero :is(.hero-ghost,.hero-availability) { color:#e8d8cb; }
[data-store-theme="dark"] .starwork-original-hero .hero-ghost:hover { color:#ffc5a7; }
[data-store-theme="dark"] :is(.detail-disclaimer,.product-type,.from,.lead-product p,.runner-content p,.checkout-intro,.order-description,.format-hint) { color:#d0c0b4; }
[data-store-theme="dark"] :is(.cart-total,.drawer-foot,.drawer-head,.modal-inner label,.faq-item summary,.shopping-step h3) { color:#fcf4ec; }

body:has(.modal:not([hidden]), dialog[open], .support-overlay:not([hidden])) .floating-support,
body.cart-is-open .floating-support { visibility:hidden; pointer-events:none; }

@media(max-width:820px) {
 .floating-support {
  inset: auto max(14px,env(safe-area-inset-right)) calc(var(--store-mobile-nav-height,env(safe-area-inset-bottom)) + 14px) auto;
  display:grid; place-items:center; width:48px; height:48px; min-height:0; padding:0;
  font-size:0; gap:0; touch-action:none; user-select:none;
 }
 .floating-support[data-side="left"] { left:max(14px,env(safe-area-inset-left)); right:auto; }
 .floating-support[data-dragging] { left:var(--support-drag-x); right:auto; cursor:grabbing; }
}

[data-store-theme="dark"] {
 --store-dark-raised:#302823;
 --store-dark-accent:#ffc19f;
 --store-dark-accent-bg:#4b2d21;
}
[data-store-theme="dark"] :is(.reseller-panel,.detail-add,.cart-adjust button,.support-options>button,
 .support-order-summary,#support-wa-message,.help-modal-inner,.topbar .back-store) {
 color:var(--ink); background:var(--store-dark-raised); border-color:#68564b;
}
[data-store-theme="dark"] :is(.popular-lead .lead-product p,.popular-runner .runner-info p,.lead-bottom small,
 .runner-price small,.popular-note,.product-content p,.reseller-intro>p:not(.section-kicker),.reseller-benefits p,
 .reseller-panel>p,.reseller-panel>small,#reseller-form label,#reseller-state,.guide-heading>p:last-child,
 .step-copy p,.shopping-status,.faq-answer p,.faq-toggle,.detail-meta,.detail-unavailable,#product-modal .detail-description,
 .support-options small,.option-chevron,.support-intro,.support-intro strong,.support-content label,
 .support-state,.support-reference-note,#support-wa-preview>small,.support-order-summary :is(dt,p,span),
 .layout section :is(p,li),.contact>span,.divider) { color:var(--muted); }
[data-store-theme="dark"] :is(.section-kicker,.step-number,.runner-number,.popular-runner:first-child .runner-number,
 .detail-eyebrow,.detail-big-price,.detail-tabs button.active,.support-back,.support-text-button,
 .inline-support,.contact>a,.profile-status,.kicker,.hero h1 em) { color:var(--store-dark-accent); }
[data-store-theme="dark"] :is(.step-copy h3,.detail-field-label,.detail-tabs button,.detail-variants button,
 .detail-stepper button,.close,.profile-close,.layout section b,.store-demo-mode .product-card .product-bottom .price,
 .tabs button:not(.active),.support-content :is(input,textarea,select)) { color:var(--ink); }
[data-store-theme="dark"] .detail-tabs button.active { color:var(--store-dark-accent); }
[data-store-theme="dark"] :is(.lead-badge,.runner-arrow,.detail-variants button:is(.selected,:hover),
 .products-section .tabs button:hover:not(.active),.support-options>button:hover,.checkout-demo-note,
 .demo-price-disclaimer,#message) {
 background:var(--store-dark-accent-bg); color:var(--store-dark-accent); border-color:#986246;
}
[data-store-theme="dark"] :is(.small-add,.tabs button.active,.lead-buy) { color:#fff; background:#b73d13; }
[data-store-theme="dark"] :is(.small-add,.tabs button.active) { border-color:#b73d13; }
[data-store-theme="dark"] .ranking-watermark { color:#ffc19f30; }
[data-store-theme="dark"] :is(input,textarea)::placeholder { color:#c2b6ae; opacity:1; }
[data-store-theme="dark"] .floating-support:focus-visible { outline-color:var(--store-dark-accent); }

/* Shared controls for storefront dialogs. */
:root {
 --store-dialog-panel:#fffaf5;
 --store-dialog-ink:#30241d;
 --store-dialog-border:#e9dbce;
 --store-close-bg:#f3e8de;
 --store-close-hover:#f5dacc;
}
:root[data-store-theme="dark"] {
 --store-dialog-panel:#26211e;
 --store-dialog-ink:#fcf4ec;
 --store-dialog-border:#544339;
 --store-close-bg:#3c3028;
 --store-close-hover:#55382a;
}
button.store-close,
#support-close.store-close,
.account-profile button.store-close,
#product-modal button.store-close,
#help-modal button.store-close {
 display:grid; place-items:center; flex:none; width:44px; height:44px;
 padding:0; border:1px solid var(--store-dialog-border); border-radius:50%;
 background:var(--store-close-bg); color:var(--store-dialog-ink);
 cursor:pointer; transition:background-color .16s ease;
}
button.store-close:hover,
#support-close.store-close:hover,
.account-profile button.store-close:hover,
#product-modal button.store-close:hover,
#help-modal button.store-close:hover { background:var(--store-close-hover); }
button.store-close:focus-visible { outline:2px solid #d34b1c; outline-offset:3px; }
#payment-dialog {
 box-sizing:border-box; width:min(580px,calc(100% - 24px)); max-width:none;
 max-height:none; padding:0; overflow:hidden; border:1px solid var(--store-dialog-border);
 border-radius:24px; background:var(--store-dialog-panel); color:var(--store-dialog-ink);
 box-shadow:0 20px 70px #17100e40;
}
#payment-dialog::backdrop { background:#17110dc2; }
.payment-dialog-header {
 display:flex; align-items:center; justify-content:space-between; gap:16px;
 padding:10px 16px 10px 22px; border-bottom:1px solid var(--store-dialog-border);
}
.payment-dialog-header h2 { margin:0; font-size:17px; letter-spacing:-.025em; }
#payment-dialog iframe { display:block; width:100%; height:min(720px,calc(100dvh - 108px)); border:0; }
@media(prefers-reduced-motion:no-preference) {
 #payment-dialog[open] { animation:payment-dialog-in .2s ease-out both; }
 @keyframes payment-dialog-in { from {opacity:0;transform:translateY(8px) scale(.99)} }
}

/* Keep page content anchored when scrolling or opening a storefront overlay. */
html { scrollbar-gutter:stable; }

#customer-profile {
 width:min(440px,calc(100% - 28px));
 max-height:calc(100dvh - 28px);
 padding:clamp(20px,5vw,30px);
 border-radius:22px;
 border-color:var(--store-dialog-border);
 background:var(--store-dialog-panel);
 color:var(--store-dialog-ink);
 box-shadow:0 22px 64px #1c140f42;
}
#customer-profile::backdrop { background:#17110d91; }
.profile-heading { padding-inline-end:50px; margin-bottom:18px; }
.profile-heading .section-kicker { margin:0 0 5px; }
#customer-profile .profile-heading h2 { margin:0; line-height:1.15; }
.profile-identity {
 display:grid; gap:5px; padding:12px 14px; margin-bottom:18px;
 background:var(--store-close-bg); border:1px solid var(--store-dialog-border); border-radius:12px;
}
.profile-email-label,.profile-identity .profile-status { font-size:12px; font-weight:700; }
#profile-email { margin:0; font-size:15px; line-height:1.4; overflow-wrap:anywhere; }
.profile-identity .profile-status { margin:0; }
.profile-form { display:grid; gap:8px; }
.profile-form label { font-weight:750; font-size:14px; }
.profile-form input {
 width:100%; min-width:0; min-height:46px; padding:10px 12px;
 border:1px solid var(--store-dialog-border); border-radius:10px;
 background:var(--store-dialog-panel); color:var(--store-dialog-ink); font:inherit;
}
.profile-form .profile-save {
 min-height:46px; margin-top:6px; padding:10px 16px;
 border:0; border-radius:10px; background:#b63b14; color:white;
 font:inherit; font-weight:750; cursor:pointer;
}
.profile-form .profile-save:hover { background:#9e3212; }
.profile-form .profile-save:disabled { opacity:.7; cursor:wait; }
.profile-form :is(input,button):focus-visible { outline:2px solid #e36a37; outline-offset:2px; }
#profile-message { margin:0; min-height:1.4em; font-size:13px; line-height:1.4; }
@media(prefers-reduced-motion:no-preference) {
 #customer-profile[open] { animation:profile-in .18s ease-out both; }
 @keyframes profile-in { from { opacity:0; transform:translateY(6px); } }
}

.store-mobile-nav { display:none; }

@media (max-width: 700px) {
  :root { --store-mobile-nav-height:calc(64px + env(safe-area-inset-bottom, 0px)); }
  body:has(> .store-mobile-nav) > footer { padding-bottom:calc(24px + var(--store-mobile-nav-height)); }
  .store-mobile-nav {
    position:fixed; inset:auto 0 0; z-index:80;
    display:grid; grid-template-columns:repeat(5,minmax(0,1fr));
    height:var(--store-mobile-nav-height); box-sizing:border-box;
    padding:4px max(4px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(4px, env(safe-area-inset-left, 0px));
    background:#fffdf9; border-top:1px solid #e7dfd3; box-shadow:0 -5px 24px #2d1b1014;
  }
  .store-mobile-nav > :is(a, button) {
    position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px;
    min-width:0; min-height:48px; border:0; border-radius:12px; background:transparent; color:#554c43;
    font-family:inherit; line-height:1.2; text-decoration:none; cursor:pointer;
  }
  .store-mobile-nav > :is(a, button) span { font-size:clamp(9px, 2.55vw, 11px); font-weight:700; }
  .store-mobile-nav .stable-icon { width:21px; height:21px; }
  .store-mobile-nav > [aria-current], .store-mobile-nav > [aria-expanded="true"] { color:#a73712; background:#fff0e5; }
  .store-mobile-nav > :focus-visible { outline:2px solid #b83d16; outline-offset:-2px; }
  .store-mobile-nav b {
    position:absolute; top:4px; inset-inline-start:calc(50% + 6px); min-width:16px;
    border-radius:999px; padding:2px 4px; background:#b83d16; color:#fff; font-size:9px;
  }
  body.embedded > .store-mobile-nav,
  .embedded-login body > .store-mobile-nav { display:none; }
  body:not(.embedded) > .login-card { margin-bottom:var(--store-mobile-nav-height); }
  .store-mobile-nav > .account-menu {
    position:absolute; inset:auto max(12px,env(safe-area-inset-right, 0px)) calc(100% + 8px) auto;
    z-index:1; width:min(240px,calc(100vw - 24px)); box-sizing:border-box;
  }
  .store-mobile-nav > .account-menu :is(a,button) { min-height:44px; }
  body:has(> .store-mobile-nav) > .toast { bottom:calc(var(--store-mobile-nav-height) + 10px); }
  body:has(> .store-mobile-nav) > :is(.drawer,.modal,.scrim,.support-overlay) { bottom:var(--store-mobile-nav-height); }
  body:has(> .store-mobile-nav) .modal > .modal-inner { max-height:calc(100dvh - var(--store-mobile-nav-height) - 36px); }
  body:has(> .store-mobile-nav) > dialog[open] {
    bottom:var(--store-mobile-nav-height);
    max-height:calc(100dvh - var(--store-mobile-nav-height) - 16px) !important;
  }
  body:has(> .store-mobile-nav) :is(#payment-dialog,#customer-login-dialog) iframe {
    max-height:calc(100dvh - var(--store-mobile-nav-height) - 92px);
  }
  .embedded-login body:not(.embedded) > .login-card { margin-bottom:auto; }
  [data-store-theme="dark"] .store-mobile-nav > :is([aria-current],[aria-expanded="true"]) { background:#533026; color:#ffdbc6; }
  [data-store-theme="dark"] .store-mobile-nav .account-menu :is(a,button):hover { background:#533026; }
}
