:root {
    /* Light mode (default) */
    --background-primary: #ffffff;
    --background-secondary: #f8f9fa;
    --background-tertiary: #e8e9ea;
    --text-primary: #000000;
    /* ~5.1:1 on white / ~4.6:1 on secondary bg (WCAG AA for normal text) */
    --text-secondary: #5a6268;
    --border-color: #dee2e6;
    --chart-grid-color: #555555;
    --chart-text-color: #000000;
    --input-background-color: #ffffff;
    --hamburger-menu-color: #3c4043;

    --toggleHeight: 16em;
    --toggleWidth: 30em;
    --toggleBtnRadius: 10em;

    --bgColor--night: #423966;
    --toggleBtn-bgColor--night: var(--bgColor--night);
    --mooncolor: #D9FBFF;
    --bgColor--day: #9ee3fb;
    --toggleBtn-bgColor--day: var(--bgColor--day);
}

[data-theme="dark"] {
    /* Dark mode */
    --background-primary: #1b1b1b;
    --background-secondary: #313131;
    --background-tertiary: #858585;
    --text-primary: #ffffff;
    --text-secondary: #adb5bd;
    --border-color: #495057;
    --chart-grid-color: var(--background-tertiary);
    --chart-text-color: #ffffff;
    --input-background-color: var(--background-secondary);
    --hamburger-menu-color: var(--text-secondary);
}

select.form-select {
    background-color: var(--background-primary);
    color: var(--text-primary);
}

body {
    background-color: var(--background-primary);
    color: var(--text-primary);
}

input, select, textarea {
    color: var(--text-primary);
}

/* Skip link + shared focus / motion accessibility */
.skip-link {
    position: absolute;
    left: 0.75rem;
    top: 0.75rem;
    z-index: 2000;
    padding: 0.5rem 0.85rem;
    background: var(--background-primary);
    color: var(--text-primary);
    border: 2px solid #1a73e8;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transform: translateY(-200%);
}

.skip-link:focus,
.skip-link:focus-visible {
    transform: translateY(0);
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}

:focus-visible {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}

.bb-nav-card-title {
    color: inherit;
    text-decoration: none;
}

.bb-nav-card-title:hover,
.bb-nav-card-title:focus-visible {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.shuttle-drops-pname .bb-nav-card-title:hover,
.shuttle-drops-pname .bb-nav-card-title:focus-visible {
    text-decoration: none;
}

.bb-nav-card-title:focus-visible {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}

a.ml-sres-shop-text,
a.related-product-shop,
a.shop-compare-shop,
a.shuttle-drops-shop-tag {
    color: inherit;
    text-decoration: none;
}

a.ml-sres-shop-text:hover,
a.ml-sres-shop-text:focus-visible,
a.related-product-shop:hover,
a.related-product-shop:focus-visible,
a.shop-compare-shop:hover,
a.shop-compare-shop:focus-visible,
a.shuttle-drops-shop-tag:hover,
a.shuttle-drops-shop-tag:focus-visible {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.sale-quality-badge {
    display: inline-block;
    width: fit-content;
    margin: 4px 0 0;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.3;
    white-space: nowrap;
    vertical-align: middle;
}

.shuttle-drops-pname .sale-quality-badge,
.ml-row-main .sale-quality-badge {
    display: block;
    margin: 4px 0 0;
}

.product-price .sale-quality-badge,
.related-product-price .sale-quality-badge,
.pd-stat .sale-quality-badge {
    display: inline-block;
    margin: 0 0 0 0.4rem;
}

.sale-quality-badge--lowest90d,
.sale-quality-badge--atl {
    background: rgba(25, 135, 84, 0.12);
    color: #157347;
}

.sale-quality-badge--belowTypical {
    background: rgba(25, 135, 84, 0.08);
    color: #3d8b5e;
}

.sale-quality-badge--fakeSale {
    background: rgba(196, 130, 14, 0.14);
    color: #9a6700;
}

.buy-verdict {
    margin: 0 0 0.75rem;
    padding: 0.55rem 0.7rem;
    border-radius: 8px;
    border: 1px solid transparent;
}

.buy-verdict-headline,
.buy-verdict-detail {
    margin: 0;
}

.buy-verdict-headline {
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.3;
}

.buy-verdict-detail {
    margin-top: 0.15rem;
    font-size: 0.75rem;
    line-height: 1.35;
    opacity: 0.9;
}

.buy-verdict--buy {
    background: rgba(25, 135, 84, 0.12);
    border-color: rgba(25, 135, 84, 0.28);
    color: #157347;
}

.buy-verdict--wait {
    background: rgba(108, 117, 125, 0.1);
    border-color: rgba(108, 117, 125, 0.28);
    color: #5c636a;
}

.buy-verdict--fake {
    background: rgba(196, 130, 14, 0.14);
    border-color: rgba(196, 130, 14, 0.32);
    color: #9a6700;
}

[data-theme="dark"] .sale-quality-badge--lowest90d,
[data-theme="dark"] .sale-quality-badge--atl {
    background: rgba(63, 185, 80, 0.16);
    color: #7ee787;
}

[data-theme="dark"] .sale-quality-badge--belowTypical {
    background: rgba(63, 185, 80, 0.1);
    color: #56d364;
}

[data-theme="dark"] .sale-quality-badge--fakeSale {
    background: rgba(210, 153, 34, 0.18);
    color: #e3b341;
}

[data-theme="dark"] .buy-verdict--buy {
    background: rgba(63, 185, 80, 0.16);
    border-color: rgba(63, 185, 80, 0.32);
    color: #7ee787;
}

[data-theme="dark"] .buy-verdict--wait {
    background: rgba(139, 148, 158, 0.14);
    border-color: rgba(139, 148, 158, 0.28);
    color: #c9d1d9;
}

[data-theme="dark"] .buy-verdict--fake {
    background: rgba(210, 153, 34, 0.18);
    border-color: rgba(210, 153, 34, 0.35);
    color: #e3b341;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}