:root {
    color-scheme: light;
}

html[data-color-mode="dark"] {
    color-scheme: dark;
    --bg-color: #090d14;
    --bg-secondary: #0f1623;
    --card-bg: #141d2b;
    --text-color: #f1f5f9;
    --text-muted: #a8b3c5;
    --border-color: #293548;
}

html[data-color-mode="dark"] .mh-lc-payment-notice,
body.dark-mode .mh-lc-payment-notice {
    background: #f8fbff00 !important;
}

.color-mode-toggle {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    color: #0f172a;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}

.color-mode-toggle:hover {
    color: #0070f3;
    border-color: #0070f3;
    transform: translateY(-1px);
}

#masthead .color-mode-toggle i {
    font-size: 20px;
    line-height: 20px !important;
    width: 20px !important;
    height: 20px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    transform: translate(-50%, -50%) !important;
    color: #0f172a !important;
    text-align: center !important;
}

html[data-color-mode="dark"] #masthead .color-mode-toggle i {
    color: #f8fafc !important;
}

html[data-color-mode="dark"] body,
html[data-color-mode="dark"] #page,
html[data-color-mode="dark"] #primary,
html[data-color-mode="dark"] #content.site-content,
html[data-color-mode="dark"] main,
html[data-color-mode="dark"] .site-main,
html[data-color-mode="dark"] .content-area {
    background-color: #090d14 !important;
    color: #f1f5f9 !important;
}

html[data-color-mode="dark"] body [style*="background: #ffffff"],
html[data-color-mode="dark"] body [style*="background:#ffffff"],
html[data-color-mode="dark"] body [style*="background: #fff"],
html[data-color-mode="dark"] body [style*="background:#fff"],
html[data-color-mode="dark"] body [style*="background: white"],
html[data-color-mode="dark"] body [style*="background: #f8fafc"],
html[data-color-mode="dark"] body [style*="background:#f8fafc"],
html[data-color-mode="dark"] body [style*="background: #f9fafb"],
html[data-color-mode="dark"] body [style*="background: #f1f5f9"],
html[data-color-mode="dark"] body [style*="background: #f5f7fa"] {
    background: #0f1623 !important;
}

html[data-color-mode="dark"] body [style*="background: #f0f9ff"],
html[data-color-mode="dark"] body [style*="background: #eff6ff"],
html[data-color-mode="dark"] body [style*="background: #e0f2fe"],
html[data-color-mode="dark"] body [style*="background: #eef2ff"] {
    background: #111e31 !important;
}

html[data-color-mode="dark"] body [style*="color: #0f172a"],
html[data-color-mode="dark"] body [style*="color:#0f172a"],
html[data-color-mode="dark"] body [style*="color: #1e293b"],
html[data-color-mode="dark"] body [style*="color: #334155"],
html[data-color-mode="dark"] body [style*="color: #374151"],
html[data-color-mode="dark"] h1,
html[data-color-mode="dark"] h2,
html[data-color-mode="dark"] h3,
html[data-color-mode="dark"] h4,
html[data-color-mode="dark"] h5,
html[data-color-mode="dark"] h6,
html[data-color-mode="dark"] label,
html[data-color-mode="dark"] legend,
html[data-color-mode="dark"] th,
html[data-color-mode="dark"] td {
    color: #f1f5f9 !important;
}

html[data-color-mode="dark"] body [style*="color: #475569"],
html[data-color-mode="dark"] body [style*="color:#475569"],
html[data-color-mode="dark"] body [style*="color: #64748b"],
html[data-color-mode="dark"] body [style*="color:#64748b"],
html[data-color-mode="dark"] .woocommerce .woocommerce-result-count,
html[data-color-mode="dark"] .woocommerce-breadcrumb,
html[data-color-mode="dark"] .product_meta,
html[data-color-mode="dark"] .woocommerce-review__published-date {
    color: #a8b3c5 !important;
}

html[data-color-mode="dark"] .site-header,
html[data-color-mode="dark"] #masthead {
    background: rgba(9, 13, 20, .96) !important;
    border-bottom-color: #293548 !important;
}

html[data-color-mode="dark"] .site-header .nav-menu a,
html[data-color-mode="dark"] .site-header .site-title,
html[data-color-mode="dark"] .site-header .cart-toggle i,
html[data-color-mode="dark"] .site-header .account-label,
html[data-color-mode="dark"] .site-header .account-toggle,
html[data-color-mode="dark"] .site-header .account-btn,
html[data-color-mode="dark"] .site-header .menu-toggle i {
    color: #f1f5f9 !important;
}

html[data-color-mode="dark"] body #masthead .main-navigation .nav-menu > li.current-menu-item > a,
html[data-color-mode="dark"] body #masthead .main-navigation .nav-menu > li.current_page_item > a,
html[data-color-mode="dark"] body #masthead .main-navigation .nav-menu > li.current-menu-ancestor > a,
html[data-color-mode="dark"] body #masthead .main-navigation .nav-menu > li > a.is-active-link,
body.dark-mode #masthead .main-navigation .nav-menu > li.current-menu-item > a,
body.dark-mode #masthead .main-navigation .nav-menu > li.current_page_item > a,
body.dark-mode #masthead .main-navigation .nav-menu > li.current-menu-ancestor > a,
body.dark-mode #masthead .main-navigation .nav-menu > li > a.is-active-link {
    color: #38bdf8 !important;
}

html[data-color-mode="dark"] .site-header .account-toggle,
html[data-color-mode="dark"] .site-header .account-btn,
html[data-color-mode="dark"] .color-mode-toggle {
    background: #141d2b !important;
    border-color: #344258 !important;
    color: #f8fafc !important;
}

html[data-color-mode="dark"] .cart-popup,
html[data-color-mode="dark"] .cart-popup-header,
html[data-color-mode="dark"] .cart-popup-items,
html[data-color-mode="dark"] .cart-popup-footer,
html[data-color-mode="dark"] .account-popup,
html[data-color-mode="dark"] .mobile-menu-content,
html[data-color-mode="dark"] .mobile-drawer-header,
html[data-color-mode="dark"] .mobile-bottom-nav {
    background: #101824 !important;
    color: #f1f5f9 !important;
    border-color: #293548 !important;
}

html[data-color-mode="dark"] .cart-popup-item,
html[data-color-mode="dark"] .account-popup a,
html[data-color-mode="dark"] .mobile-menu-content a,
html[data-color-mode="dark"] .mobile-bottom-nav a,
html[data-color-mode="dark"] .mobile-bottom-nav i {
    color: #dbe5f1 !important;
    border-color: #293548 !important;
}

/* Header account dropdown and mini cart */
html[data-color-mode="dark"] #masthead .header-account .account-popup,
html[data-color-mode="dark"] #masthead .header-account .account-popup.glass-panel,
body.dark-mode #masthead .header-account .account-popup,
body.dark-mode #masthead .header-account .account-popup.glass-panel {
    background: #101824 !important;
    border-color: #344258 !important;
    color: #f1f5f9 !important;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .42) !important;
}

html[data-color-mode="dark"] #masthead .header-account .account-header,
body.dark-mode #masthead .header-account .account-header {
    background: #141d2b !important;
    border-bottom-color: #293548 !important;
    color: #f8fafc !important;
}

html[data-color-mode="dark"] #masthead .header-account .account-menu li a,
html[data-color-mode="dark"] #masthead .header-account .account-menu li a span,
body.dark-mode #masthead .header-account .account-menu li a,
body.dark-mode #masthead .header-account .account-menu li a span {
    color: #dbe5f1 !important;
}

html[data-color-mode="dark"] #masthead .header-account .account-menu li a:hover,
body.dark-mode #masthead .header-account .account-menu li a:hover {
    background: #1a2637 !important;
    color: #38bdf8 !important;
}

html[data-color-mode="dark"] #masthead .header-account .account-menu li.divider,
body.dark-mode #masthead .header-account .account-menu li.divider {
    background: #293548 !important;
}

html[data-color-mode="dark"] #masthead .header-cart .cart-popup,
body.dark-mode #masthead .header-cart .cart-popup {
    background: #101824 !important;
    border-color: #344258 !important;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .42) !important;
}

html[data-color-mode="dark"] #masthead .header-cart .cart-popup-header,
html[data-color-mode="dark"] #masthead .header-cart .cart-popup-items,
html[data-color-mode="dark"] #masthead .header-cart .cart-popup-footer,
body.dark-mode #masthead .header-cart .cart-popup-header,
body.dark-mode #masthead .header-cart .cart-popup-items,
body.dark-mode #masthead .header-cart .cart-popup-footer {
    background: #101824 !important;
    border-color: #293548 !important;
}

html[data-color-mode="dark"] #masthead .header-cart .cart-popup-header h4,
body.dark-mode #masthead .header-cart .cart-popup-header h4 {
    color: #f8fafc !important;
}

html[data-color-mode="dark"] #masthead .header-cart .cart-popup-item,
body.dark-mode #masthead .header-cart .cart-popup-item {
    background: #141d2b !important;
    border-color: #2c394d !important;
}

html[data-color-mode="dark"] #masthead .header-cart .cart-popup-item:hover,
body.dark-mode #masthead .header-cart .cart-popup-item:hover {
    background: #1a2637 !important;
    border-color: #3d506a !important;
}

html[data-color-mode="dark"] #masthead .header-cart .cart-popup-item .item-name,
body.dark-mode #masthead .header-cart .cart-popup-item .item-name {
    color: #f1f5f9 !important;
}

html[data-color-mode="dark"] #masthead .header-cart .cart-popup-item .item-price,
body.dark-mode #masthead .header-cart .cart-popup-item .item-price {
    color: #38bdf8 !important;
}

html[data-color-mode="dark"] #masthead .header-cart .cart-popup-footer .cart-total span,
body.dark-mode #masthead .header-cart .cart-popup-footer .cart-total span {
    color: #a8b3c5 !important;
}

html[data-color-mode="dark"] #masthead .header-cart .cart-popup-footer .cart-total strong,
body.dark-mode #masthead .header-cart .cart-popup-footer .cart-total strong {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

html[data-color-mode="dark"] #masthead .header-cart .cart-popup-footer .button.button-outline,
body.dark-mode #masthead .header-cart .cart-popup-footer .button.button-outline {
    background: #141d2b !important;
    border-color: #3d506a !important;
    color: #f1f5f9 !important;
}

html[data-color-mode="dark"] #masthead .header-cart .cart-popup-footer .button.button-outline:hover,
body.dark-mode #masthead .header-cart .cart-popup-footer .button.button-outline:hover {
    background: #1a2637 !important;
    border-color: #38bdf8 !important;
}

html[data-color-mode="dark"] .woocommerce,
html[data-color-mode="dark"] .woocommerce-page,
html[data-color-mode="dark"] .woocommerce div.product,
html[data-color-mode="dark"] .woocommerce-cart-wrapper,
html[data-color-mode="dark"] .woocommerce-checkout-wrapper,
html[data-color-mode="dark"] .woocommerce-account .woocommerce-MyAccount-content,
html[data-color-mode="dark"] .woocommerce-account .woocommerce-MyAccount-navigation,
html[data-color-mode="dark"] .woocommerce table.shop_table,
html[data-color-mode="dark"] .woocommerce table.shop_table tr,
html[data-color-mode="dark"] .woocommerce .cart_totals,
html[data-color-mode="dark"] .woocommerce #customer_details,
html[data-color-mode="dark"] .woocommerce-checkout #order_review,
html[data-color-mode="dark"] .woocommerce-checkout #payment,
html[data-color-mode="dark"] .woocommerce-checkout .form-row,
html[data-color-mode="dark"] .woocommerce div.product .woocommerce-tabs .panel,
html[data-color-mode="dark"] .woocommerce div.product .woocommerce-tabs ul.tabs,
html[data-color-mode="dark"] .product-card,
html[data-color-mode="dark"] .products .product {
    background-color: #141d2b !important;
    color: #e8eef7 !important;
    border-color: #293548 !important;
}

html[data-color-mode="dark"] input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]),
html[data-color-mode="dark"] textarea,
html[data-color-mode="dark"] select,
html[data-color-mode="dark"] .select2-container .select2-selection,
html[data-color-mode="dark"] .select2-dropdown,
html[data-color-mode="dark"] .quantity .qty {
    background: #0c131f !important;
    color: #f1f5f9 !important;
    border-color: #344258 !important;
}

html[data-color-mode="dark"] input::placeholder,
html[data-color-mode="dark"] textarea::placeholder {
    color: #7f8ca1 !important;
}

html[data-color-mode="dark"] table,
html[data-color-mode="dark"] tr,
html[data-color-mode="dark"] td,
html[data-color-mode="dark"] th,
html[data-color-mode="dark"] hr,
html[data-color-mode="dark"] fieldset {
    border-color: #293548 !important;
}

html[data-color-mode="dark"] .woocommerce-message,
html[data-color-mode="dark"] .woocommerce-info,
html[data-color-mode="dark"] .woocommerce-error {
    background: #111e31 !important;
    color: #e8eef7 !important;
    border-color: #0070f3 !important;
}

html[data-color-mode="dark"] a:not(.button):not(.products-header-btn):not(.demo-shop-btn) {
    color: #7db8ff;
}

html[data-color-mode="dark"] .button,
html[data-color-mode="dark"] button,
html[data-color-mode="dark"] input[type="submit"] {
    border-color: #344258;
}

html[data-color-mode="dark"] img {
    color-scheme: only light;
}

/* Homepage sections and product loop */
html[data-color-mode="dark"] #features,
html[data-color-mode="dark"] #products,
html[data-color-mode="dark"] #live-demo,
html[data-color-mode="dark"] #faq,
html[data-color-mode="dark"] .roznhe-faq-section,
html[data-color-mode="dark"] .site-content > section {
    background-color: #0f1623 !important;
    background-image: none !important;
}

html[data-color-mode="dark"] .features-grid-3x3 > div,
html[data-color-mode="dark"] .usecases-grid-3x3 > article,
html[data-color-mode="dark"] .action-pc-card,
html[data-color-mode="dark"] .action-pc-card .prod-info-box,
html[data-color-mode="dark"] .roznhe-faq-card {
    background: #141d2b !important;
    color: #e8eef7 !important;
    border-color: #2c394d !important;
}

html[data-color-mode="dark"] .action-pc-card h3,
html[data-color-mode="dark"] .action-pc-card h3 a,
html[data-color-mode="dark"] .action-pc-card .prod-title,
html[data-color-mode="dark"] .action-pc-card .prod-info-box,
html[data-color-mode="dark"] .action-pc-card .prod-info-box p,
html[data-color-mode="dark"] .faq-question-text,
html[data-color-mode="dark"] .faq-answer {
    color: #e8eef7 !important;
}

html[data-color-mode="dark"] .action-pc-card .prod-info-box > div:last-child,
html[data-color-mode="dark"] .action-pc-card .card-price {
    border-color: #2c394d !important;
}

/* Shop page */
html[data-color-mode="dark"] .shop-page-wrapper,
html[data-color-mode="dark"] .shop-products-section {
    background: #090d14 !important;
}

html[data-color-mode="dark"] .shop-sidebar .sidebar-widget,
html[data-color-mode="dark"] .shop-toolbar,
html[data-color-mode="dark"] .shop-pagination,
html[data-color-mode="dark"] .no-products {
    background: #141d2b !important;
    color: #e8eef7 !important;
    border-color: #2c394d !important;
}

/* Dark mode: remove the full-width background behind shop pagination */
html[data-color-mode="dark"] .shop-pagination {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

html[data-color-mode="dark"] .shop-page-wrapper .glass-panel,
html[data-color-mode="dark"] .shop-pagination a.page-numbers,
html[data-color-mode="dark"] .shop-pagination span.page-numbers {
    background: #141d2b !important;
    color: #dbe5f1 !important;
    border-color: #2c394d !important;
}

html[data-color-mode="dark"] .shop-sidebar .widget-title,
html[data-color-mode="dark"] .category-list a,
html[data-color-mode="dark"] .price-filter-list a,
html[data-color-mode="dark"] .shop-toolbar .woocommerce-result-count {
    color: #dbe5f1 !important;
    border-color: #2c394d !important;
}

html[data-color-mode="dark"] .category-list li.active a,
html[data-color-mode="dark"] .category-list a:hover,
html[data-color-mode="dark"] .price-filter-list a:hover {
    background: #13243a !important;
    color: #62adff !important;
}

/* Purchase guide */
html[data-color-mode="dark"] .ash-tutorials-page {
    background: #090d14 !important;
    color: #dbe5f1 !important;
}

html[data-color-mode="dark"] .tut-qs-card,
html[data-color-mode="dark"] .tut-module-card,
html[data-color-mode="dark"] .tut-tip-box {
    background: #141d2b !important;
    color: #dbe5f1 !important;
    border-color: #2c394d !important;
}

html[data-color-mode="dark"] .tut-title,
html[data-color-mode="dark"] .tut-qs-header h2,
html[data-color-mode="dark"] .tut-qs-card h3,
html[data-color-mode="dark"] .tut-module-title-wrap h2,
html[data-color-mode="dark"] .tut-step-text strong {
    color: #f1f5f9 !important;
}

html[data-color-mode="dark"] .tut-desc,
html[data-color-mode="dark"] .tut-qs-header p,
html[data-color-mode="dark"] .tut-qs-card p,
html[data-color-mode="dark"] .tut-module-intro,
html[data-color-mode="dark"] .tut-step-text,
html[data-color-mode="dark"] .tut-tip-box {
    color: #a8b3c5 !important;
}

/* Blog */
html[data-color-mode="dark"] .rz-blog-wrapper,
html[data-color-mode="dark"] .rz-blog-hero {
    background: #090d14 !important;
    color: #e8eef7 !important;
}

html[data-color-mode="dark"] .rz-blog-filter-bar,
html[data-color-mode="dark"] .rz-post-card,
html[data-color-mode="dark"] .rz-post-body,
html[data-color-mode="dark"] .rz-cat-pill,
html[data-color-mode="dark"] .rz-pagination-wrap .page-numbers {
    background: #141d2b !important;
    color: #dbe5f1 !important;
    border-color: #2c394d !important;
}

html[data-color-mode="dark"] .rz-pagination-wrap a.page-numbers,
html[data-color-mode="dark"] .rz-pagination-wrap span.page-numbers {
    background: #141d2b !important;
    color: #dbe5f1 !important;
    border-color: #2c394d !important;
}

html[data-color-mode="dark"] .rz-blog-title,
html[data-color-mode="dark"] .rz-post-heading,
html[data-color-mode="dark"] .rz-post-heading a,
html[data-color-mode="dark"] .rz-author-name {
    color: #f1f5f9 !important;
}

html[data-color-mode="dark"] .rz-blog-desc,
html[data-color-mode="dark"] .rz-post-excerpt,
html[data-color-mode="dark"] .rz-post-meta-item {
    color: #a8b3c5 !important;
}

/* About page */
html[data-color-mode="dark"] .ash-about-wrapper,
html[data-color-mode="dark"] .ash-ab-hero {
    background: #090d14 !important;
    background-image: none !important;
    color: #e8eef7 !important;
}

html[data-color-mode="dark"] .ash-ab-card-outer,
html[data-color-mode="dark"] .ash-ab-engine-box,
html[data-color-mode="dark"] .ash-ab-feature-item,
html[data-color-mode="dark"] .ash-ab-value-card {
    background: #141d2b !important;
    color: #e8eef7 !important;
    border-color: #2c394d !important;
}

html[data-color-mode="dark"] .ash-ab-card-dots {
    background: #1b2738 !important;
    border-color: #2c394d !important;
}

html[data-color-mode="dark"] .ash-ab-title,
html[data-color-mode="dark"] .ash-ab-section-title,
html[data-color-mode="dark"] .ash-ab-engine-header h2,
html[data-color-mode="dark"] .ash-ab-feature-item h3,
html[data-color-mode="dark"] .ash-ab-value-card h3 {
    color: #f1f5f9 !important;
}

html[data-color-mode="dark"] .ash-ab-lead,
html[data-color-mode="dark"] .ash-ab-story-paragraphs p,
html[data-color-mode="dark"] .ash-ab-engine-header p,
html[data-color-mode="dark"] .ash-ab-feature-item p,
html[data-color-mode="dark"] .ash-ab-section-desc,
html[data-color-mode="dark"] .ash-ab-value-card p {
    color: #a8b3c5 !important;
}

/* Contact and support pages */
html[data-color-mode="dark"] .ash-support-wrapper,
html[data-color-mode="dark"] .ash-sp-hero,
html[data-color-mode="dark"] body.page-template-page-contact #content.site-content {
    background: #090d14 !important;
    background-image: none !important;
}

html[data-color-mode="dark"] .ash-sp-card,
html[data-color-mode="dark"] .ash-sp-card-body,
html[data-color-mode="dark"] .ash-sp-form-box,
html[data-color-mode="dark"] body.page-template-page-contact #content > .container > div[style*="grid-template-columns"] {
    background: #141d2b !important;
    color: #e8eef7 !important;
    border-color: #2c394d !important;
}

html[data-color-mode="dark"] .ash-sp-title,
html[data-color-mode="dark"] .ash-sp-info-header h2,
html[data-color-mode="dark"] .ash-sp-card-body h4,
html[data-color-mode="dark"] .ash-sp-form-header h3,
html[data-color-mode="dark"] .ash-sp-form-field label {
    color: #f1f5f9 !important;
}

html[data-color-mode="dark"] .ash-sp-lead,
html[data-color-mode="dark"] .ash-sp-info-header p,
html[data-color-mode="dark"] .ash-sp-card p,
html[data-color-mode="dark"] .ash-sp-form-header p {
    color: #a8b3c5 !important;
}

html[data-color-mode="dark"] .ash-sp-notice-badge {
    background: #0f1826 !important;
    color: #dbe5f1 !important;
    border-color: #2c394d !important;
}

/* Footer */
html[data-color-mode="dark"] .site-footer,
html[data-color-mode="dark"] #colophon,
html[data-color-mode="dark"] .site-footer > .container {
    background: #080c13 !important;
    color: #dbe5f1 !important;
}

html[data-color-mode="dark"] .site-footer .footer-wave path {
    fill: #080c13 !important;
}

html[data-color-mode="dark"] .site-footer .widget-title,
html[data-color-mode="dark"] .site-footer .footer-logo,
html[data-color-mode="dark"] .site-footer .site-info,
html[data-color-mode="dark"] .site-footer .site-copyright-text {
    color: #f1f5f9 !important;
}

html[data-color-mode="dark"] .site-footer p,
html[data-color-mode="dark"] .site-footer li,
html[data-color-mode="dark"] .site-footer .footer-links a,
html[data-color-mode="dark"] .site-footer .contact-list,
html[data-color-mode="dark"] .site-footer .contact-list a {
    color: #a8b3c5 !important;
}

html[data-color-mode="dark"] .site-footer .social-btn {
    background: #141d2b !important;
    color: #dbe5f1 !important;
    border-color: #2c394d !important;
}

html[data-color-mode="dark"] .site-footer .site-info {
    border-top-color: #253044 !important;
}

/* Policy pages: complete dark surfaces and readable content */
:is(html[data-color-mode="dark"], body.dark-mode) :is(.ash-terms-page, .ash-refund-page, .ash-privacy-page) {
    background: #080d15 !important;
    color: #cbd5e1 !important;
}

:is(html[data-color-mode="dark"], body.dark-mode) :is(.terms-card-wrapper, .ref-card-wrapper, .priv-card-wrapper) {
    background: #111827 !important;
    border-color: #334155 !important;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .3) !important;
}

:is(html[data-color-mode="dark"], body.dark-mode) :is(.terms-notice-box, .ref-notice-box, .priv-notice-box) {
    background: #0f2033 !important;
    border-color: #28537a !important;
}

:is(html[data-color-mode="dark"], body.dark-mode) :is(.warranty-feature-card, .terms-feature-card, .ref-feature-card, .priv-feature-card) {
    background: #172235 !important;
    border-color: #334155 !important;
}

:is(html[data-color-mode="dark"], body.dark-mode) :is(
    .ash-terms-page .section-title, .ref-section-title, .priv-section-title,
    .ash-terms-page .notice-head, .ref-notice-head, .priv-notice-head,
    .warranty-feature-card h4, .terms-feature-card h4, .ref-feature-card h4, .priv-feature-card h4,
    .terms-cta-panel h3, .ref-cta-panel h3, .priv-cta-panel h3
) {
    color: #f8fafc !important;
}

:is(html[data-color-mode="dark"], body.dark-mode) :is(
    .ash-terms-page .section-body, .ref-section-body, .priv-section-body,
    .ash-terms-page .section-body p, .ref-section-body p, .priv-section-body p,
    .ash-terms-page .section-intro, .ref-section-intro, .priv-section-intro,
    .ash-terms-page .notice-text, .ref-notice-text, .priv-notice-text,
    .warranty-feature-card p, .terms-feature-card p, .ref-feature-card p, .priv-feature-card p
) {
    color: #cbd5e1 !important;
}

:is(html[data-color-mode="dark"], body.dark-mode) :is(.terms-divider, .ref-divider, .priv-divider) {
    background: #334155 !important;
    border-color: #334155 !important;
}

:is(html[data-color-mode="dark"], body.dark-mode) :is(.terms-cta-panel, .ref-cta-panel, .priv-cta-panel) {
    background: #172235 !important;
    border-color: #334155 !important;
}

/* Mobile drawer: dark cards, readable labels and matching account actions */
:is(html[data-color-mode="dark"], body.dark-mode) .mobile-menu-content,
:is(html[data-color-mode="dark"], body.dark-mode) .mobile-drawer-header {
    background: #0f172a !important;
    border-color: #334155 !important;
}

:is(html[data-color-mode="dark"], body.dark-mode) .mobile-menu-content .mobile-nav-link {
    background: #172235 !important;
    border-color: #475569 !important;
    color: #f8fafc !important;
}

:is(html[data-color-mode="dark"], body.dark-mode) .mobile-menu-content .mobile-nav-link.is-active-item {
    background: rgba(56, 189, 248, .13) !important;
    border-color: #38bdf8 !important;
    color: #38bdf8 !important;
}

:is(html[data-color-mode="dark"], body.dark-mode) .mobile-drawer-auth-buttons {
    border-top-color: #334155 !important;
}

:is(html[data-color-mode="dark"], body.dark-mode) .mobile-drawer-auth-buttons a {
    background: #172235 !important;
    border-color: #475569 !important;
    color: #f8fafc !important;
}

/* Mobile drawer: explicit light-mode palette */
html[data-color-mode="light"] .mobile-menu-content,
html[data-color-mode="light"] .mobile-drawer-header,
html:not([data-color-mode="dark"]) .mobile-menu-content,
html:not([data-color-mode="dark"]) .mobile-drawer-header {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

html[data-color-mode="light"] .mobile-menu-content .mobile-nav-link,
html:not([data-color-mode="dark"]) .mobile-menu-content .mobile-nav-link {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #334155 !important;
    box-shadow: none !important;
}

html[data-color-mode="light"] .mobile-menu-content .mobile-nav-link i,
html:not([data-color-mode="dark"]) .mobile-menu-content .mobile-nav-link i {
    color: #0070f3 !important;
}

html[data-color-mode="light"] .mobile-menu-content .mobile-nav-link.is-active-item,
html:not([data-color-mode="dark"]) .mobile-menu-content .mobile-nav-link.is-active-item {
    background: #e0f2fe !important;
    border-color: #38bdf8 !important;
    color: #0369a1 !important;
    box-shadow: 0 3px 12px rgba(56, 189, 248, .18) !important;
}

html[data-color-mode="light"] .mobile-drawer-auth-buttons,
html:not([data-color-mode="dark"]) .mobile-drawer-auth-buttons {
    background: #ffffff !important;
    border-top-color: #e2e8f0 !important;
}

html[data-color-mode="light"] .mobile-drawer-auth-buttons a,
html:not([data-color-mode="dark"]) .mobile-drawer-auth-buttons a {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #334155 !important;
}

html[data-color-mode="light"] .mobile-drawer-auth-buttons a:last-child,
html:not([data-color-mode="dark"]) .mobile-drawer-auth-buttons a:last-child {
    background: linear-gradient(135deg, #0070f3, #0ea5e9) !important;
    border-color: transparent !important;
    color: #ffffff !important;
}

@media (max-width: 991px) {
    #masthead .header-actions > :not(.color-mode-toggle):not(.header-cart) {
        display: none !important;
    }

    #masthead .header-actions {
        width: auto !important;
        min-width: 42px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
    }

    #masthead .color-mode-toggle,
    #masthead .header-cart {
        display: inline-flex !important;
    }

    /* Cart popup spans the full screen width, anchored to the fixed header */
    #masthead .header-actions,
    #masthead .header-cart {
        position: static !important;
    }

    #masthead .header-cart .cart-popup {
        position: absolute !important;
        top: 100% !important;
        right: 0 !important;
        left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: calc(100vh - 120px) !important;
        margin: 0 !important;
        border-radius: 0 0 16px 16px !important;
    }

    #masthead .header-cart .cart-popup-items {
        overflow-y: auto !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .color-mode-toggle,
    html[data-color-mode="dark"] * {
        transition-duration: .01ms !important;
    }
}
