/* Phase 18.9.5.28.5.8.9.50.10 — Total Site Dark Mode Cleanup
   Final route-by-route polish: removes forced text boxes, fixes checkout/cart/addresses, and hardens public dark mode without tinting product media. */
html[data-marketak-theme="dark"]{
  --dm-bg:#050d1a;
  --dm-bg-2:#081426;
  --dm-panel:#0d192c;
  --dm-panel-2:#111f35;
  --dm-panel-3:#152640;
  --dm-line:rgba(148,163,184,.22);
  --dm-line-strong:rgba(96,165,250,.42);
  --dm-text:#f8fbff;
  --dm-muted:#c9d7ea;
  --dm-soft:#9fb0c8;
  --dm-blue:#60a5fa;
  --dm-cyan:#67e8f9;
  --dm-purple:#8b5cf6;
  --dm-green:#34d399;
  --dm-warning:#fde68a;
  --dm-danger:#fb7185;
  --dm-radius:24px;
  --dm-shadow:0 26px 72px rgba(0,0,0,.36);
  color-scheme:dark;
}
html[data-marketak-theme="dark"] body{
  background:radial-gradient(circle at 18% -12%,rgba(37,99,235,.16),transparent 32%),linear-gradient(180deg,#050d1a,#07111f 52%,#050d1a)!important;
  color:var(--dm-text)!important;
}
html[data-marketak-theme="dark"] img,
html[data-marketak-theme="dark"] picture,
html[data-marketak-theme="dark"] video,
html[data-marketak-theme="dark"] iframe{filter:none!important;opacity:1!important;mix-blend-mode:normal!important;}
html[data-marketak-theme="dark"] :where(h1,h2,h3,h4,h5,h6,b,strong,label,summary){color:var(--dm-text)!important;opacity:1!important;text-shadow:none!important;}
html[data-marketak-theme="dark"] :where(p,small,li,em,span,.muted,.section-sub,.eyebrow){color:var(--dm-muted)!important;opacity:1!important;text-shadow:none!important;}
html[data-marketak-theme="dark"] a:not(.btn){color:#93c5fd!important;}
html[data-marketak-theme="dark"] :where(input,textarea,select){background:#091426!important;color:var(--dm-text)!important;border:1px solid var(--dm-line)!important;box-shadow:inset 0 0 0 1px rgba(255,255,255,.02)!important;}
html[data-marketak-theme="dark"] :where(input::placeholder,textarea::placeholder){color:#91a3bb!important;opacity:1!important;}
html[data-marketak-theme="dark"] :where(.btn,button,.mini-btn){color:var(--dm-text)!important;border-color:var(--dm-line)!important;text-shadow:none!important;}
html[data-marketak-theme="dark"] :where(.btn:not(.ghost):not(.danger),.primary,.checkout-submit-v16,.summary-checkout-v1724,.plan-submit-v1895251){background:linear-gradient(135deg,#2563eb,#7c3aed)!important;color:#fff!important;border-color:transparent!important;}
html[data-marketak-theme="dark"] :where(.btn.ghost,.ghost,.mini-btn,button:not(.gallery-arrow):not(.share-center-close-v58):not(.smart-popup-close)){background:linear-gradient(145deg,#101d31,#0b1628)!important;color:var(--dm-text)!important;border:1px solid var(--dm-line)!important;}

/* prevent the ugly highlight rectangles around text that appeared from broad old overrides */
html[data-marketak-theme="dark"] body:not(.role-admin) :where(p,span,small,b,strong,h1,h2,h3,h4,label,summary,li,em){
  background-color:transparent!important;
  background-image:none!important;
  box-decoration-break:clone;
}
html[data-marketak-theme="dark"] body:not(.role-admin) :where(mark,.text-highlight,.highlight,[style*="background-color: rgb(187"],[style*="background:#b"],[style*="background: #b"]){
  background:transparent!important;
  color:inherit!important;
}

/* Plans: clean premium cards, no square boxes on feature lines */
html[data-marketak-theme="dark"] body.route-plans :where(.plans-v189525-page,.plans-page-section,.plans-hero-pro,.plans-hero-v189525,.vendor-plan-status-card-v189525,.trial-plan-wide,.trial-plan-v189525,.pricing-card-v189525,.pricing-pro-card,.compact-plan,.compare-table-card-v189525,.upgrade-card-v189525){
  background:linear-gradient(145deg,rgba(15,27,46,.98),rgba(8,18,33,.98))!important;
  color:var(--dm-text)!important;
  border:1px solid var(--dm-line)!important;
  box-shadow:var(--dm-shadow)!important;
}
html[data-marketak-theme="dark"] body.route-plans :where(.trial-wide-stats span,.plan-price-v1895251,.plan-duration-tile-v1895251,.plan-summary-strip-v1895252 span){
  background:linear-gradient(145deg,#091426,#111f35)!important;
  color:var(--dm-text)!important;
  border:1px solid rgba(148,163,184,.24)!important;
  border-radius:18px!important;
}
html[data-marketak-theme="dark"] body.route-plans .plan-feature-preview-v189525,
html[data-marketak-theme="dark"] body.route-plans .plan-features-pro,
html[data-marketak-theme="dark"] body.route-plans .plan-details-pro{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}
html[data-marketak-theme="dark"] body.route-plans :where(.plan-feature-preview-v189525 li,.plan-features-pro li){
  display:flex!important;align-items:flex-start!important;gap:8px!important;
  background:transparent!important;
  border:0!important;
  border-radius:0!important;
  padding:5px 0!important;
  margin:0!important;
  color:#eaf2ff!important;
  line-height:1.8!important;
}
html[data-marketak-theme="dark"] body.route-plans :where(.plan-feature-preview-v189525 li span,.plan-features-pro li span){
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  min-width:20px!important;width:20px!important;height:20px!important;border-radius:999px!important;
  background:rgba(52,211,153,.16)!important;color:#86efac!important;border:1px solid rgba(134,239,172,.28)!important;
}
html[data-marketak-theme="dark"] body.route-plans .plan-details-pro summary{
  background:linear-gradient(135deg,#2563eb,#7c3aed)!important;color:#fff!important;
  border:0!important;border-radius:16px!important;padding:12px 16px!important;box-shadow:0 14px 34px rgba(37,99,235,.26)!important;
}
html[data-marketak-theme="dark"] body.route-plans .plan-details-pro[open]{background:transparent!important;}
html[data-marketak-theme="dark"] body.route-plans :where(.compare-table-pro,.compare-table-v189525){background:#0a1424!important;border-color:var(--dm-line)!important;overflow:hidden!important;border-radius:20px!important;}
html[data-marketak-theme="dark"] body.route-plans :where(.compare-table-pro th,.compare-table-pro td,.compare-table-v189525 th,.compare-table-v189525 td){background:#0e1a2d!important;color:#eaf2ff!important;border-color:rgba(148,163,184,.16)!important;}
html[data-marketak-theme="dark"] body.route-plans :where(.compare-table-pro tr:nth-child(even) th,.compare-table-pro tr:nth-child(even) td,.compare-table-v189525 tr:nth-child(even) th,.compare-table-v189525 tr:nth-child(even) td){background:#121f35!important;}

/* Cart / checkout / addresses: dark all real panels, not the entire media */
html[data-marketak-theme="dark"] body:is(.route-cart,.route-checkout,.route-addresses) :where(
  .cart-page-pro,.cart-main-pro,.cart-layout-pro,.vendor-isolated-carts-v172,.vendor-carts-head-v172,.vendor-cart-card-v172,.vendor-cart-card-v1724,.cart-line-pro,.cart-line-v16,.cart-summary-pro,.cart-summary-v16,.cart-address-preview-v1895271,.cart-address-preview-v1895273,.empty-state,.empty-state-v1895273,
  .checkout-v16-page,.checkout-hero-v16,.checkout-single-vendor-hero-v173,.checkout-vendor-isolated-hero-v172,.checkout-card-v16,.customer-card-v16,.order-summary-v16,.checkout-coupon-box-v1895171,.checkout-coupon-box-v1895172,.checkout-loyalty-box-v189518,.checkout-address-book-pro,.address-choice-pro,.checkout-address-empty-pro,.checkout-map-card,.checkout-map-card-pro,.checkout-delivery-real-card,.checkout-payment-pro-card,.checkout-payment-option,.checkout-one-payment-card,.checkout-safe-v16,.digital-policy-acceptance-box-v189541,.digital-policy-acceptance-box-v1895411,.legal-acceptance-box-v123,.deposit-checkout-box-v18953,
  .customer-address-center-v1895271,.customer-address-center-v1895273,.address-hero-v1895271,.address-form-card-v1895271,.address-form-card-v1895273,.address-list-card-v1895271,.address-list-card-v1895273,.address-card-v1895271,.map-panel-v1895271
){
  background:linear-gradient(145deg,rgba(15,27,46,.98),rgba(8,18,33,.99))!important;
  color:var(--dm-text)!important;
  border:1px solid var(--dm-line)!important;
  box-shadow:var(--dm-shadow)!important;
}
html[data-marketak-theme="dark"] body:is(.route-cart,.route-checkout,.route-addresses) :where(.summary-line,.delivery-line,.delivery-auto-line,.checkout-item-v16,.checkout-coupon-applied-card-v18951741,.address-choice-top,.default-row-v1895271,.cart-info-v16,.vendor-card-body-v1724,.checkout-proof-not-needed-v173,.payment-split-note,.checkout-digital-policy-box-v189541,.checkout-digital-policy-box-v1895411){
  background:#0a1424!important;color:var(--dm-text)!important;border:1px solid var(--dm-line)!important;border-radius:16px!important;
}
html[data-marketak-theme="dark"] body:is(.route-cart,.route-checkout,.route-addresses) :where(.checkout-delivery-real-card,.checkout-payment-pro-card,.checkout-safe-v16,.checkout-digital-policy-box-v189541,.legal-acceptance-box-v123,.summary-guard-v1721,.notice.warning){
  background:linear-gradient(145deg,rgba(12,24,42,.98),rgba(16,29,49,.98))!important;
}
html[data-marketak-theme="dark"] body:is(.route-cart,.route-checkout,.route-addresses) :where(.checkout-coupon-ok-v1895171,.checkout-coupon-applied-v189517,.ok,.auto-delivery-ready){color:#86efac!important;}
html[data-marketak-theme="dark"] body:is(.route-cart,.route-checkout,.route-addresses) :where(.warning,.delivery-required-note,.checkout-payment-gate-warning-v1895923,.checkout-payment-gate-warning-top-v1895923){color:#fde68a!important;background:rgba(251,191,36,.12)!important;border-color:rgba(251,191,36,.32)!important;}
html[data-marketak-theme="dark"] body:is(.route-cart,.route-checkout,.route-addresses) :where(.cart-summary-pro input,.order-summary-v16 input,.checkout-loyalty-box-v189518 input){background:#0b1425!important;color:#fff!important;border-color:var(--dm-line)!important;}
html[data-marketak-theme="dark"] body:is(.route-cart,.route-checkout,.route-addresses) :where(.cart-img-link,.checkout-item-v16 img,.cart-line-pro img,.cart-line-v16 img){background:#f8fafc!important;border-radius:14px!important;}

/* Product details: keep image canvas clean, harden text panels and offer/variant blocks */
html[data-marketak-theme="dark"] body.route-product :where(.product-buy-panel,.info-panel,.order-card-pro,.product-stock-pro-v57,.product-return-policy-card-v118,.product-digital-policy-card-v189541,.product-deposit-badge-v18953,.product-offer-strip-v61,.offer-countdown,.product-options-v28,.product-variant-picker-v185,.variant-axis-group-v185,.variant-compatible-grid-v185,.variant-match-card-v185,.product-long-description,.product-specs-table-v28,.safe-alerts,.review-form-v23,.review-card-v23,.login-required-note,.product-share-center-v58 .share-center-card-v58){
  background:linear-gradient(145deg,rgba(15,27,46,.98),rgba(8,18,33,.99))!important;
  color:var(--dm-text)!important;
  border:1px solid var(--dm-line)!important;
  box-shadow:0 22px 58px rgba(0,0,0,.28)!important;
}
html[data-marketak-theme="dark"] body.route-product :where(.product-gallery-pro,.gallery-stage,.main-media-box,.media-stage-v23){background:#f8fafc!important;color:#0f172a!important;border-color:rgba(96,165,250,.65)!important;}
html[data-marketak-theme="dark"] body.route-product :where(.product-price-line,.rating-line-v23,.count-row,.variant-global-note-v185,.variant-starts-from-v18945){background:#0a1424!important;color:var(--dm-text)!important;border:1px solid var(--dm-line)!important;border-radius:16px!important;}
html[data-marketak-theme="dark"] body.route-product :where(.variant-color-chip-v185,.variant-size-chip-v185,.select-color-v29,.select-size-v29,.thumb-btn){background:#101d31!important;color:#eaf2ff!important;border:1px solid var(--dm-line)!important;}
html[data-marketak-theme="dark"] body.route-product :where(.variant-color-chip-v185.active,.variant-size-chip-v185.active,.select-color-v29.active,.select-size-v29.active,.thumb-btn.active){background:linear-gradient(135deg,#2563eb,#7c3aed)!important;color:#fff!important;border-color:rgba(147,197,253,.6)!important;}
html[data-marketak-theme="dark"] body.route-product :where(.safe-alerts,.product-return-policy-card-v118){background:#101d31!important;}
html[data-marketak-theme="dark"] body.route-product :where(.product-detail-verified-pill-v189386,.store-pill-verified-exact-v189385,.product-store-pill-verified-v189385,.sf-verified-pill-v189385,.product-detail-verified-inside-v189387){background:rgba(96,165,250,.16)!important;color:#dbeafe!important;border:1px solid rgba(96,165,250,.42)!important;opacity:1!important;}
html[data-marketak-theme="dark"] body.route-product :where(.sale-badge-static,.product-offer-strip-v61,.offer-countdown){color:#fde68a!important;}

/* Header dropdowns and menu cards */
html[data-marketak-theme="dark"] :where(.mega-menu,.mega-menu-v30,.dropdown-menu,.account-dropdown,.user-dropdown,.category-dropdown,.nav-dropdown){
  background:linear-gradient(180deg,#0d1a2d,#091426)!important;color:var(--dm-text)!important;border:1px solid var(--dm-line)!important;box-shadow:0 28px 86px rgba(0,0,0,.45)!important;
}
html[data-marketak-theme="dark"] :where(.mega-menu,.mega-menu-v30,.dropdown-menu,.nav-dropdown) :where(a,button,.mega-card,.mega-grid a,.mega-grid button){
  background:linear-gradient(145deg,#111f35,#0a1424)!important;color:var(--dm-text)!important;border:1px solid var(--dm-line)!important;border-radius:14px!important;
}
html[data-marketak-theme="dark"] :where(.mega-menu,.mega-menu-v30,.dropdown-menu,.nav-dropdown) :where(a:hover,button:hover,.mega-grid a:hover){background:linear-gradient(135deg,#1d4ed8,#6d28d9)!important;color:#fff!important;}

/* Store / products filters: match products page style */
html[data-marketak-theme="dark"] body:is(.route-store,.route-products,.route-stores) :where(.storefront-pro-hero,.store-page-panel-pro,.storefront-tabs,.store-tabs,.storefront-category-card-v155,.storefront-products-head-v114,.storefront-products-head-v119,.storefront-filter-panel-v155,.products-filter-sidebar-v66,.filter-group-v66,.filter-panel-v66,.products-result-head-v66,.storefront-result-head-v155,.storefront-products-count-v114,.store-legal-card-v1242,.store-delivery-pro,.store-payment-method-card,.store-welcome-card-v155,.storefront-welcome-strip-v155,.storefront-mini-identity-v155,.storefront-plan-suite-v113){
  background:linear-gradient(145deg,rgba(15,27,46,.98),rgba(8,18,33,.99))!important;color:var(--dm-text)!important;border:1px solid var(--dm-line)!important;box-shadow:var(--dm-shadow)!important;
}
html[data-marketak-theme="dark"] body:is(.route-store,.route-products,.route-stores) :where(.storefront-category-card-v155,.home-category-tile-v186,.filter-group-v66 a,.filter-group-v66 button,.storefront-filter-panel-v155 a,.storefront-filter-panel-v155 button){background:#101d31!important;color:var(--dm-text)!important;border-color:var(--dm-line)!important;}
html[data-marketak-theme="dark"] body:is(.route-store,.route-products,.route-stores) :where(.filter-group-v66 .active,.storefront-filter-panel-v155 .active,.apply-filter-v66){background:linear-gradient(135deg,#2563eb,#7c3aed)!important;color:#fff!important;}

/* Homepage rails and offers: remove transparent/white glass and use consistent dark cards */
html[data-marketak-theme="dark"] body.route-home :where(.hero-market,.hero-slider-card,.home-wide-promo-v186,.home-product-rail-v186,.home-category-rail-v186,.home-category-tile-v186,.exclusive-offers-pro-v62,.exclusive-offer-card-v62,.deal-card-v186,.home-store-card-v186,.verified-store-shell-v65,.newsletter-pro-v65,.section){
  background:linear-gradient(145deg,rgba(15,27,46,.98),rgba(8,18,33,.99))!important;color:var(--dm-text)!important;border-color:var(--dm-line)!important;box-shadow:var(--dm-shadow)!important;
}
html[data-marketak-theme="dark"] body.route-home :where(.home-product-tile-v186,.exclusive-offer-card-v62,.deal-card-v186){background:#101d31!important;border:1px solid var(--dm-line)!important;color:var(--dm-text)!important;}
html[data-marketak-theme="dark"] body.route-home :where(.home-product-tile-v186 img,.exclusive-offer-card-v62 img,.deal-card-v186 img){background:#f8fafc!important;}

/* Popups / share modals */
html[data-marketak-theme="dark"] :where(.marketak-smart-popup-v1895231 .smart-popup-card,.marketak-smart-popup-v1895182 .smart-popup-card,.smart-popup-card,.share-center-card-v58,.product-share-center-v58,.storefront-share-center-v111){
  background:linear-gradient(145deg,#0d1a2d,#091426)!important;color:var(--dm-text)!important;border:1px solid var(--dm-line)!important;box-shadow:0 32px 90px rgba(0,0,0,.5)!important;
}
html[data-marketak-theme="dark"] :where(.share-action-v58,.share-copy-row-v58,input.share-copy-input,.share-preview-thumb-v58){background:#101d31!important;color:var(--dm-text)!important;border-color:var(--dm-line)!important;}
html[data-marketak-theme="dark"] :where(.smart-popup-card .smart-popup-body,.smart-popup-card .smart-popup-content){background:#0d1a2d!important;color:var(--dm-text)!important;}

/* Referral / win pages */
html[data-marketak-theme="dark"] body:is(.route-win-with-marketak,.route-referrals,.route-referral) :where(.referral-guest-card,.referral-hero,.referral-rules,.referral-page .panel-card,.referral-stats-grid .stat-card,.share-box,.section,.card,.box){
  background:linear-gradient(145deg,rgba(15,27,46,.98),rgba(8,18,33,.99))!important;color:var(--dm-text)!important;border:1px solid var(--dm-line)!important;box-shadow:var(--dm-shadow)!important;
}

/* Customer forms / account-like public pages */
html[data-marketak-theme="dark"] body:is(.route-login,.route-register,.route-profile,.route-orders,.route-notifications) :where(.card,.box,.panel-card,.section,.order-card-pro,.empty-state,.notice,.info-panel){
  background:linear-gradient(145deg,rgba(15,27,46,.98),rgba(8,18,33,.99))!important;color:var(--dm-text)!important;border:1px solid var(--dm-line)!important;box-shadow:var(--dm-shadow)!important;
}

/* Final safety net for public pages: obvious white panels become dark, but not product media canvases */
html[data-marketak-theme="dark"] body:not(.role-admin) :where(.card,.box,.panel-card,.info-panel,.notice,.empty-state,.modal,.dropdown,.table-card,.summary-card,[class*="-card"],[class*="-box"],[class*="-panel"]):not(.product-gallery-pro):not(.gallery-stage):not(.main-media-box):not(.media-stage-v23):not(.product-img):not(.store-cover-mini):not(.storefront-cover):not(.hero-slide):not(.thumb-btn){
  color:var(--dm-text)!important;
}
html[data-marketak-theme="dark"] body:not(.role-admin) :where(.card,.box,.panel-card,.info-panel,.notice,.empty-state,.modal,.dropdown,.table-card,[class*="-card"],[class*="-box"],[class*="-panel"]):not(.product-gallery-pro):not(.gallery-stage):not(.main-media-box):not(.media-stage-v23):not(.product-img):not(.store-cover-mini):not(.storefront-cover):not(.hero-slide):not(.thumb-btn):not([class*="image"]):not([class*="img"]){
  border-color:var(--dm-line)!important;
}

@media (max-width: 900px){
  html[data-marketak-theme="dark"] body:is(.route-cart,.route-checkout,.route-addresses) :where(.cart-layout-pro,.checkout-grid-v16,.address-layout-v1895271){gap:16px!important;}
  html[data-marketak-theme="dark"] body.route-plans .pricing-card-v189525{border-radius:22px!important;}
}
