/* ================================================================
   CartWise — Page layouts & components
   Warm, human-centred grocery companion
   Tokens + base components live in ui.css
   ================================================================ */

:root {
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4.5rem;
    --space-section: clamp(2rem, 5vw, 3.25rem);
    --backdrop: rgba(45, 55, 72, 0.32);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

a {
    color: var(--link);
    text-decoration: none;
    transition: color var(--cw-ease);
}
a:hover {
    color: var(--link-hover);
    text-decoration: none;
}

/* ── Layout ────────────────────────────────────────────────────── */
.app-wrap {
    max-width: var(--max-width);
    margin: 0 auto;
    padding-left: max(var(--space-md), env(safe-area-inset-left));
    padding-right: max(var(--space-md), env(safe-area-inset-right));
    padding-top: max(var(--space-md), env(safe-area-inset-top));
    padding-bottom: max(var(--space-section), env(safe-area-inset-bottom));
}

/* ── Header ────────────────────────────────────────────────────── */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    padding: 0.7rem 0.85rem;
    margin-bottom: var(--space-lg);
    border: 1px solid oklch(0.995 0.004 255 / 0.74);
    border-radius: 24px;
    background:
        linear-gradient(135deg, oklch(0.995 0.004 255 / 0.88), oklch(0.975 0.008 255 / 0.72)),
        radial-gradient(130% 160% at 0% 0%, oklch(0.52 0.12 255 / 0.08), transparent 48%);
    box-shadow: 0 14px 38px oklch(0.28 0.025 260 / 0.07);
    backdrop-filter: blur(18px);
}
.site-header--cartwise {
    flex-wrap: wrap;
    align-items: center;
    row-gap: var(--space-sm);
}
.site-header-brand {
    flex-shrink: 0;
}
.site-header--cartwise .site-primary-nav {
    flex: 1 1 auto;
    justify-content: center;
    min-width: 0;
}
@media (max-width: 820px) {
    .site-header--cartwise .site-primary-nav,
    .site-header--cartwise .site-nav--secondary {
        display: none;
    }
}
.site-nav--secondary a {
    color: var(--text-secondary);
}
.site-nav--secondary .account-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    max-width: 12rem;
    color: var(--cw-primary);
    border: 1px solid oklch(0.52 0.12 255 / 0.13);
    background: linear-gradient(180deg, oklch(0.995 0.004 255 / 0.92), var(--cw-primary-light));
    box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.65);
}
.site-nav--secondary .account-chip span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.site-nav--secondary .account-chip:hover {
    color: var(--cw-primary);
    background: color-mix(in oklch, var(--cw-primary-light), white 36%);
}

.site-logo {
    font-family: var(--cw-font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--cw-ink);
    text-decoration: none;
}
.site-logo:hover { text-decoration: none; color: var(--cw-ink); opacity: 0.82; }

.site-header-right {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}
.page-auth .site-header {
    margin-bottom: var(--space-md);
}
.page-auth .site-primary-nav,
.page-auth .basket-trigger,
.page-auth .site-nav--secondary {
    display: none;
}
.page-auth .site-header-right {
    margin-left: auto;
}

/* Language switch */
.lang-switch {
    display: flex;
    align-items: center;
    gap: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
}
.lang-switch .lang-link {
    padding: 0.45rem 0.55rem;
    min-height: 40px;
    min-width: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    text-decoration: none;
    border-radius: var(--radius-pill);
    transition: all var(--cw-ease);
    -webkit-tap-highlight-color: transparent;
}
.lang-switch .lang-link:hover { color: var(--text); text-decoration: none; background: var(--bg-elevated); }
.lang-switch .lang-link-active { color: var(--cw-primary); font-weight: 600; }
.lang-switch .lang-sep { color: var(--border); margin: 0 0.1rem; opacity: 0.6; }

/* Navigation links */
.site-nav { display: flex; align-items: center; gap: var(--space-xs); }
.site-nav a {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.55rem 0.82rem;
    border-radius: var(--radius-pill);
    transition: all var(--cw-ease);
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}
.site-nav a:hover { color: var(--text); background: oklch(0.995 0.004 255 / 0.82); text-decoration: none; }

/* Basket trigger pill */
.basket-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-width: 44px;
    min-height: 44px;
    padding: 0.5rem 0.85rem;
    background: oklch(0.995 0.004 255 / 0.86);
    border: 1px solid oklch(0.28 0.025 260 / 0.07);
    border-radius: var(--radius-pill);
    color: var(--text);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: all var(--cw-ease);
}
.basket-trigger:hover { background: var(--cw-n100); color: var(--text); text-decoration: none; transform: translateY(-1px); }
.basket-trigger.has-items { background: var(--cw-primary-light); color: var(--cw-primary); }
.basket-trigger .basket-count {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    font-size: 0.6875rem;
    font-weight: 700;
    background: var(--cw-primary);
    color: var(--cw-primary-ink);
    border-radius: var(--radius-pill);
}
.basket-trigger.has-items .basket-count {
    display: inline-flex;
}

/* ── Cards ─────────────────────────────────────────────────────── */
.card {
    background: var(--card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    padding: var(--space-lg);
    box-shadow: var(--shadow-soft);
}

/* ── Forms ─────────────────────────────────────────────────────── */
input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 16px;
    font-family: var(--cw-font-body);
    color: var(--cw-ink);
    background: var(--cw-surface);
    border: 1px solid var(--cw-border);
    border-radius: var(--cw-radius-input);
    transition: border-color var(--cw-ease), box-shadow var(--cw-ease);
}
.home-search-input,
.page-search .search-input {
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--cw-primary);
    box-shadow: 0 0 0 3px var(--cw-primary-light);
}
.home-search-input:focus,
.page-search .search-input:focus {
    border-color: transparent !important;
    box-shadow: none !important;
}
select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}
textarea { resize: vertical; min-height: 120px; }

.btn-primary, button.btn-primary,
button:not(.basket-trigger):not(.basket-sidebar-close):not(.basket-sidebar-item-remove):not(.exit-popup-close) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.5rem;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--cw-font-heading);
    letter-spacing: -0.015em;
    color: #fff;
    background: var(--cw-primary);
    border: none;
    border-radius: var(--radius-btn);
    cursor: pointer;
    box-shadow: 0 2px 8px oklch(0.52 0.12 255 / 0.20);
    -webkit-tap-highlight-color: transparent;
    transition: background var(--cw-ease), box-shadow var(--cw-ease), transform var(--cw-ease);
}
button:hover:not(:disabled), .btn-primary:hover {
    background: var(--cw-primary-hover);
    box-shadow: 0 4px 16px oklch(0.52 0.12 255 / 0.28);
}
button:active:not(:disabled) { transform: scale(0.98); }

.back {
    display: inline-block;
    font-size: 0.9375rem;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
    padding: 0.25rem 0;
}
.back:hover { color: var(--text); }

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ── Badges ────────────────────────────────────────────────────── */
.cheapest-badge {
    display: inline-flex;
    align-items: center;
    background: var(--cw-accent);
    color: #fff;
    font-family: var(--cw-font-heading);
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: var(--cw-radius-badge);
    margin-left: 0.5rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.catalog-badge {
    display: inline-block;
    font-family: var(--cw-font-heading);
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: var(--cw-radius-badge);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-left: 0.35rem;
}
.catalog-full   { background: var(--cw-primary-light); color: var(--cw-primary); }
.catalog-promo  { background: var(--cw-warn-bg); color: var(--cw-warn); }
.catalog-partial { background: var(--bg-elevated); color: var(--text-muted); }
.confidence-badge { display: inline-block; font-family: var(--cw-font-heading); font-size: 0.75rem; font-weight: 600; padding: 0.2rem 0.5rem; border-radius: var(--cw-radius-badge); }
.confidence-strong { background: var(--cw-success-bg); color: var(--cw-success); }
.confidence-ok { background: var(--cw-warn-bg); color: var(--cw-warn); }
.confidence-low { background: var(--cw-error-bg); color: var(--cw-error); }

.retailer-pill {
    display: inline-flex;
    align-items: center;
    font-family: var(--cw-font-heading);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--cw-n100);
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-pill);
}

/* ====================================================================
   HOMEPAGE — guided flow, warm bands, single compare panel
   ==================================================================== */

body.page-home {
    background:
        radial-gradient(900px 560px at 7% -12%, oklch(0.52 0.12 255 / 0.095), transparent 62%),
        radial-gradient(760px 460px at 92% 2%, oklch(0.72 0.12 65 / 0.075), transparent 58%),
        radial-gradient(620px 420px at 55% 110%, oklch(0.52 0.10 165 / 0.065), transparent 62%),
        linear-gradient(180deg, oklch(0.992 0.006 255), var(--cw-bg) 44%, oklch(0.965 0.01 255));
    background-attachment: fixed;
}

.page-home .home-main--flow {
    max-width: var(--home-max, 1080px);
    padding-top: var(--space-sm);
    padding-bottom: var(--space-xl);
}

.page-home .site-header {
    margin-bottom: var(--space-sm);
}

.home-app {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.7fr);
    gap: clamp(2rem, 5vw, 3.5rem);
    align-items: start;
    padding: clamp(1.25rem, 3.5vw, 2.75rem) 0 var(--space-xl);
}
.home-app-primary {
    min-width: 0;
}
.home-eyebrow {
    display: none;
}
.home-app-title {
    max-width: 12ch;
    margin: 0 0 0.75rem;
    color: var(--cw-ink);
    font-family: var(--cw-font-heading);
    font-size: clamp(2.15rem, 5.5vw, 3.15rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.05;
}
.home-app-subtitle {
    max-width: 34rem;
    margin: 0 0 1.75rem;
    color: var(--text-muted);
    font-size: 1.0625rem;
    line-height: 1.5;
    font-weight: 450;
}
.home-search-box {
    max-width: 640px;
    margin: 0 0 1rem;
}
.home-search-label {
    display: block;
    margin: 0 0 0.5rem;
    color: var(--cw-ink);
    font-weight: 600;
}
.home-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    padding: 0.4rem;
    border: 1px solid var(--cw-border-subtle);
    border-radius: var(--cw-radius-search);
    background: var(--cw-surface);
    box-shadow: var(--cw-shadow-search);
}
.home-search-input {
    min-width: 0;
    min-height: 56px;
    padding: 0 1.1rem;
    border: 0;
    border-radius: 14px;
    background: transparent;
    font-size: 1.0625rem;
    font-weight: 500;
    color: var(--cw-ink);
}
.home-search-input::placeholder {
    color: var(--cw-n500);
    opacity: 0.85;
}
.home-search-input:focus {
    background: transparent;
    box-shadow: none;
    outline: none;
}
.home-search-row:focus-within {
    border-color: oklch(0.52 0.12 255 / 0.35);
    box-shadow: var(--cw-shadow-search), 0 0 0 3px var(--cw-primary-light);
}
.home-search-submit {
    min-height: 56px;
    padding: 0 1.45rem;
    border: 0;
    border-radius: 14px;
    background: var(--cw-primary);
    color: var(--cw-primary-ink);
    font-family: var(--cw-font-body);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: background var(--cw-ease), transform var(--cw-ease);
}
.home-search-submit:hover {
    background: var(--cw-primary-hover);
}
.home-search-submit:active {
    transform: scale(0.98);
}
.home-quick-search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 1.5rem;
}
.home-quick-search a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--cw-border-subtle);
    border-radius: var(--radius-pill);
    background: var(--cw-surface);
    color: var(--cw-n700);
    font-weight: 500;
    font-size: 0.875rem;
    transition: border-color var(--cw-ease), color var(--cw-ease), background var(--cw-ease);
}
.home-quick-search a:hover {
    border-color: oklch(0.52 0.12 255 / 0.28);
    color: var(--cw-primary);
    background: var(--cw-primary-wash);
}
.home-list-compare {
    max-width: 640px;
    border-top: 1px solid var(--border-subtle);
    padding-top: 1.25rem;
}
.home-list-compare summary {
    width: fit-content;
    color: var(--cw-n700);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9375rem;
    list-style: none;
}
.home-list-compare summary::-webkit-details-marker { display: none; }
.home-list-compare summary:hover {
    color: var(--cw-primary);
}
.home-list-form {
    display: grid;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}
.home-list-input {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--cw-border);
    border-radius: 16px;
    background: var(--cw-surface);
    font-size: 1rem;
    resize: vertical;
}
.home-list-input:focus {
    border-color: var(--cw-primary);
    box-shadow: 0 0 0 3px var(--cw-primary-light);
}
.home-list-submit {
    justify-self: start;
    min-height: 44px;
    padding: 0.7rem 1.2rem;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--cw-primary);
    color: var(--cw-primary-ink);
    font-family: var(--cw-font-body);
    font-weight: 600;
    cursor: pointer;
}
.home-today {
    padding: 1.35rem 1.35rem 1.15rem;
    border: 1px solid var(--cw-border-subtle);
    border-radius: 22px;
    background: var(--cw-surface);
    box-shadow: var(--cw-shadow);
}
.home-today-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-md);
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-subtle);
}
.home-today-label {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.home-today-head strong {
    color: var(--cw-ink);
    font-family: var(--cw-font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    text-align: right;
}
.home-today-save {
    margin: 1rem 0 0;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9375rem;
}
.home-today-save span {
    color: var(--cw-primary);
    font-family: var(--cw-font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.home-today-list {
    list-style: none;
    display: grid;
    gap: 0.35rem;
    margin: 1rem 0;
    padding: 0;
}
.home-today-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.7rem 0.75rem;
    border-radius: 12px;
}
.home-today-list li.is-cheapest {
    background: var(--cw-primary-wash);
}
.home-today-list li.is-cheapest span,
.home-today-list li.is-cheapest strong {
    color: var(--cw-primary);
    font-weight: 700;
}
.home-today-list span {
    color: var(--text-muted);
    font-weight: 500;
}
.home-today-list strong {
    color: var(--cw-ink);
    font-family: var(--cw-font-heading);
    font-variant-numeric: tabular-nums;
}
.home-today-meta {
    margin: 0.35rem 0 0;
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.45;
}
@media (max-width: 820px) {
    .page-home .site-header {
        padding-bottom: var(--space-xs);
    }
    .page-home .site-primary-nav,
    .page-home .site-nav--secondary {
        display: none;
    }
    .home-app {
        grid-template-columns: 1fr;
        gap: 1.75rem;
        padding-top: 1.25rem;
    }
    .home-app-title {
        max-width: 11ch;
    }
    .home-app-subtitle {
        font-size: 1rem;
        margin-bottom: 1.35rem;
    }
    .home-search-row {
        grid-template-columns: 1fr;
        border-radius: 20px;
    }
    .home-search-submit {
        width: 100%;
    }
    .home-today {
        padding: 1.15rem;
    }
}
@media (max-width: 520px) {
    .home-search-input,
    .home-search-submit {
        min-height: 52px;
    }
    .home-today-head {
        flex-direction: column;
        gap: var(--space-xs);
    }
    .home-today-head strong {
        text-align: left;
    }
}

/* Hero band — cohesive, not floating in void */
.home-hero-band {
    padding: var(--space-lg) var(--space-md) var(--space-xl);
    margin: 0 calc(-1 * max(var(--space-md), env(safe-area-inset-left))) var(--space-md);
    padding-left: max(var(--space-md), env(safe-area-inset-left));
    padding-right: max(var(--space-md), env(safe-area-inset-right));
    background: linear-gradient(145deg, #ffffff 0%, oklch(0.96 0.01 255) 48%, oklch(0.95 0.015 255) 100%);
    border-radius: 0 0 22px 22px;
    border: 1px solid oklch(0.52 0.12 255 / 0.12);
    border-top: none;
    box-shadow: 0 12px 40px rgba(45, 55, 72, 0.06);
}
@media (max-width: 640px) {
    .home-hero-band {
        margin-left: calc(-1 * var(--space-sm));
        margin-right: calc(-1 * var(--space-sm));
        border-radius: 0 0 16px 16px;
    }
}

.page-home .hero {
    padding: 0;
    text-align: left;
}
.page-home .hero-split {
    display: flex;
    align-items: center;
    gap: clamp(var(--space-md), 4vw, var(--space-xl));
}
.page-home .hero-content {
    flex: 1 1 0;
    min-width: 0;
}
.page-home .hero-illustration {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 8px 24px oklch(0.52 0.12 255 / 0.12));
}
.page-home .hero-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}
.page-home .hero-cta {
    text-decoration: none;
    box-shadow: 0 4px 20px oklch(0.52 0.12 255 / 0.28);
}
.page-home .hero-cta:hover {
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}
.page-home .hero-live-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
    margin: 0;
}
.page-home .hero-updated--inline {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
}
@media (max-width: 768px) {
    .page-home .hero-split {
        flex-direction: column;
        gap: var(--space-md);
    }
    .page-home .hero-illustration {
        order: -1;
    }
    .page-home .hero-illustration svg {
        width: 200px;
        height: 168px;
    }
}

.page-home .hero-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--cw-font-heading);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--cw-primary);
    margin: 0 0 var(--space-sm);
}
.page-home .hero-label__icon { flex-shrink: 0; }
.page-home .hero-headline {
    font-family: var(--cw-font-heading);
    font-size: clamp(1.85rem, 4.5vw, 2.65rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--cw-ink);
    margin: 0 0 var(--space-sm);
    max-width: none;
}
.page-home .hero-subline {
    font-size: 1.0625rem;
    line-height: 1.55;
    color: var(--text-muted);
    margin: 0;
    max-width: 36em;
}

/* Visual thread between hero and snapshot */
.home-flow-connector {
    width: 2px;
    height: 1.25rem;
    margin: 0 auto var(--space-sm);
    background: linear-gradient(180deg, var(--cw-primary) 0%, oklch(0.52 0.12 255 / 0.2) 100%);
    border-radius: 2px;
}

/* Snapshot — two-column on wide screens, one story */
.page-home .home-snapshot {
    margin-bottom: var(--space-section);
}
.page-home .cheapest-card--snapshot {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: linear-gradient(135deg, #ffffff 0%, #f8faf8 100%);
    border: 1px solid rgba(242, 155, 62, 0.2);
    box-shadow: var(--cw-shadow);
}
@media (min-width: 700px) {
    .page-home .cheapest-card--snapshot {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
        align-items: start;
        gap: var(--space-xl);
        padding: var(--space-lg) var(--space-xl);
    }
    .page-home .cheapest-card__lead {
        padding-right: var(--space-md);
        border-right: 1px solid var(--cw-n100);
    }
}
.page-home .cheapest-card__lead .cheapest-store-row {
    margin-bottom: var(--space-sm);
}
.page-home .cheapest-savings--big {
    font-size: 1.125rem;
    margin-top: var(--space-sm);
}
.page-home .cheapest-savings__amount {
    color: var(--cw-accent);
    font-size: 1.35rem;
    letter-spacing: -0.02em;
}
.page-home .cheapest-label {
    font-family: var(--cw-font-heading);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0 0 var(--space-xs);
}
.page-home .cheapest-store {
    font-family: var(--cw-font-heading);
    font-size: clamp(1.35rem, 2.2vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--cw-ink);
    margin: 0;
}
.page-home .cheapest-basket-title {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 600;
    margin: 0 0 var(--space-xs);
}
.page-home .cheapest-basket-list {
    list-style: none;
    margin: 0 0 var(--space-sm);
    padding: 0;
}
.page-home .cheapest-basket-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-sm);
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--cw-n100);
    font-size: 0.9375rem;
}
.page-home .cheapest-basket-list li:last-child { border-bottom: none; }
.page-home .cheapest-basket-list .retailer-name { color: var(--text-muted); }
.page-home .cheapest-basket-list .retailer-total { font-weight: 600; color: var(--cw-ink); }
.page-home .cheapest-updated {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}
.page-home .cheapest-basis {
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--text-muted);
    margin: var(--space-md) 0 0;
    padding-top: var(--space-md);
    border-top: 1px solid var(--cw-n100);
    max-width: 52rem;
}

/* Single compare panel — search + basket feel connected */
.home-compare-panel {
    padding: var(--space-lg);
    margin-bottom: var(--space-section);
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid var(--cw-border);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.8) inset,
        0 8px 32px rgba(45, 55, 72, 0.07);
    position: relative;
}
.home-compare-panel::before {
    content: "";
    position: absolute;
    left: 0;
    top: 1.25rem;
    bottom: 1.25rem;
    width: 4px;
    border-radius: 4px;
    background: linear-gradient(180deg, var(--cw-primary) 0%, var(--cw-success-soft) 100%);
    opacity: 0.85;
}
@media (min-width: 640px) {
    .home-compare-panel {
        padding: var(--space-xl);
    }
}

.home-compare-panel__head {
    margin-bottom: var(--space-lg);
    padding-left: 0.5rem;
}
.home-compare-panel__title {
    font-family: var(--cw-font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--cw-ink);
    margin: 0 0 var(--space-xs);
}
.home-compare-panel__sub {
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--text-muted);
    margin: 0;
    max-width: 40rem;
}

.home-compare-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-left: 0.25rem;
}

.home-step {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-md);
    align-items: start;
}
.home-step__rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 2.5rem;
    flex-shrink: 0;
}
.home-step__badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    font-family: var(--cw-font-heading);
    font-size: 0.875rem;
    font-weight: 800;
    color: #fff;
    background: var(--cw-primary);
    border-radius: 50%;
    box-shadow: 0 2px 8px oklch(0.52 0.12 255 / 0.35);
}
.home-step__line {
    flex: 1;
    width: 3px;
    min-height: 2rem;
    margin: 0.35rem 0;
    background: linear-gradient(180deg, var(--cw-primary-light) 0%, var(--cw-n200) 100%);
    border-radius: 3px;
}
.home-step__title {
    font-family: var(--cw-font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--cw-ink);
    margin: 0 0 0.25rem;
}
.home-step__hint {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0 0 var(--space-sm);
    line-height: 1.45;
}
.home-step__form {
    margin: 0;
}

.page-home .search-first-form,
.page-home .home-step__form.search-first-form {
    display: flex;
    gap: var(--space-sm);
    align-items: stretch;
    flex-wrap: wrap;
}
.page-home .search-first-input {
    flex: 1;
    min-width: 200px;
    padding: 0.85rem 1rem;
    font-size: 16px;
    border-radius: var(--radius-input);
    background: var(--cw-n50);
    border: 1.5px solid var(--border);
}
.page-home .search-first-input:focus {
    background: #fff;
    border-color: var(--cw-primary);
    box-shadow: 0 0 0 4px var(--cw-primary-light);
}
.page-home .search-first-btn {
    padding: 0.85rem 1.4rem;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--cw-font-heading);
    color: #fff;
    background: var(--cw-primary);
    border: none;
    border-radius: var(--radius-btn);
    cursor: pointer;
    box-shadow: 0 2px 8px oklch(0.52 0.12 255 / 0.22);
    transition: background var(--cw-ease), box-shadow var(--cw-ease), transform var(--cw-ease);
}
.page-home .search-first-btn:hover {
    background: var(--cw-primary-hover);
    box-shadow: 0 4px 14px oklch(0.52 0.12 255 / 0.3);
}
.page-home .search-first-btn:active { transform: scale(0.98); }

.page-home .shopping-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}
.page-home .shopping-input {
    padding: 1rem 1.1rem;
    font-size: 1rem;
    border-radius: 14px;
    border: 1.5px solid var(--border);
    background: var(--cw-n50);
    box-shadow: none;
    min-height: 0;
}
.page-home .shopping-input:focus {
    background: #fff;
    border-color: var(--cw-primary);
    box-shadow: 0 0 0 4px var(--cw-primary-light);
}
.page-home .shopping-btn { align-self: flex-start; }

/* Newsletter */
.page-home .newsletter-section {
    padding: var(--space-section) 0 var(--space-lg);
}
.page-home .newsletter-heading {
    font-family: var(--cw-font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--cw-ink);
    margin: 0 0 var(--space-sm);
}
.page-home .newsletter-subtext {
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--text-muted);
    margin: 0 0 var(--space-md);
    max-width: 32rem;
}
.page-home .newsletter-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}
.page-home .newsletter-input {
    padding: 1rem 1.15rem;
    font-size: 1rem;
    border-radius: 14px;
    border: 1.5px solid var(--border);
    background: var(--card);
    box-shadow: none;
}
.page-home .newsletter-input:focus {
    border-color: var(--cw-primary);
    box-shadow: 0 0 0 4px var(--cw-primary-light);
}
.page-home .newsletter-btn { align-self: flex-start; }

.page-home .newsletter-card {
    background: linear-gradient(145deg, #ffffff 0%, #f9faf9 100%);
    border-radius: 18px;
    padding: var(--space-lg) var(--space-xl);
    box-shadow: var(--cw-shadow);
    border: 1px solid var(--cw-border-subtle);
}
.page-home .newsletter-checkboxes { display: flex; flex-direction: column; gap: 0.65rem; }
.page-home .newsletter-check {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    cursor: pointer;
}
.page-home .newsletter-check input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    accent-color: var(--cw-primary);
}
.page-home .newsletter-nospam { font-size: 0.8125rem; color: var(--text-muted); margin: 0; }

/* Footer */
.site-footer {
    padding: var(--space-section) 0 0;
    text-align: left;
    font-size: 0.8125rem;
    color: var(--text-muted);
}
.page-static .site-footer {
    margin-top: var(--space-lg);
    max-width: none;
}
.site-footer-card {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(180px, auto);
    gap: var(--space-md) var(--space-xl);
    align-items: start;
    padding: clamp(1rem, 3vw, 1.45rem);
    border: 1px solid oklch(0.995 0.004 255 / 0.74);
    border-radius: 24px;
    background:
        linear-gradient(135deg, oklch(0.995 0.004 255 / 0.82), oklch(0.965 0.01 255 / 0.66)),
        radial-gradient(100% 180% at 0% 0%, oklch(0.52 0.12 255 / 0.06), transparent 55%),
        radial-gradient(100% 180% at 100% 100%, oklch(0.72 0.12 65 / 0.06), transparent 55%);
    box-shadow: 0 12px 34px oklch(0.28 0.025 260 / 0.055);
    backdrop-filter: blur(16px);
}
.site-footer .footer-brand {
    min-width: 0;
}
.site-footer .footer-logo {
    margin-bottom: 0.35rem;
}
.site-footer .footer-brand p {
    max-width: 34rem;
    margin: 0;
    line-height: 1.5;
}
.site-footer a {
    color: var(--text-muted);
    padding: 0.35rem 0;
    transition: color var(--cw-ease);
}
.site-footer a:hover { color: var(--cw-primary); }
.site-footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.25rem 0.85rem;
    font-weight: 600;
}
.site-footer .footer-data-freshness {
    margin-top: 0.65rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: -0.01em;
}
.site-footer .footer-contact {
    grid-column: 2;
    margin: -0.45rem 0 0;
    text-align: right;
    font-size: 0.85rem;
}
.site-footer .footer-contact a {
    color: var(--cw-n600, #4a5568);
    text-decoration: none;
}
.site-footer .footer-contact a:hover {
    color: var(--cw-primary);
    text-decoration: underline;
}
.site-footer .footer-disclaimer {
    grid-column: 1 / -1;
    margin: var(--space-sm) 0 0;
    padding-top: var(--space-sm);
    border-top: 1px solid oklch(0.28 0.025 260 / 0.07);
    max-width: 60rem;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--text-muted);
    opacity: 0.95;
}

/* Newsletter flash */
.page-home .newsletter-flash {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-input);
    margin: 0 0 var(--space-md);
    font-size: 0.9375rem;
}
.page-home .newsletter-flash-success { background: var(--cw-success-bg); color: var(--cw-success); }
.page-home .newsletter-flash-info { background: var(--cw-n100); color: var(--text-muted); }
.page-home .newsletter-flash-error { background: var(--cw-error-bg); color: var(--cw-error); }

/* Exit popup */
.exit-popup {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
}
.exit-popup[hidden] { display: none !important; }
.exit-popup-backdrop { position: absolute; inset: 0; background: var(--backdrop); cursor: pointer; }
.exit-popup-card {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: var(--card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    padding: var(--space-xl);
    box-shadow: var(--cw-shadow-lifted);
}
.exit-popup-close {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    font-size: 1.25rem;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--cw-ease);
}
.exit-popup-close:hover { color: var(--text); background: var(--cw-n100); }
.exit-popup-heading {
    font-family: var(--cw-font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--cw-ink);
    margin: 0 2.5rem 0.75rem 0;
}
.exit-popup-subtext { font-size: 0.9375rem; color: var(--text-muted); margin: 0 0 var(--space-md); line-height: 1.6; }
.exit-popup-form { display: flex; flex-direction: column; gap: var(--space-sm); }
.exit-popup-input {
    width: 100%;
    padding: 0.9rem 1rem;
    font-size: 16px;
    border-radius: var(--radius-input);
    border: 1.5px solid var(--border);
}
.exit-popup-input:focus {
    border-color: var(--cw-primary);
    box-shadow: 0 0 0 4px var(--cw-primary-light);
}
.exit-popup-btn {
    width: 100%;
    min-height: 50px;
    padding: 0.9rem;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--cw-font-heading);
    letter-spacing: -0.015em;
    color: #fff;
    background: var(--cw-primary);
    border: none;
    border-radius: var(--radius-btn);
    cursor: pointer;
    box-shadow: 0 2px 8px oklch(0.52 0.12 255 / 0.20);
    transition: background var(--cw-ease), box-shadow var(--cw-ease);
}
.exit-popup-btn:hover { background: var(--cw-primary-hover); box-shadow: 0 4px 16px oklch(0.52 0.12 255 / 0.28); }
.exit-popup-success { font-size: 0.9375rem; color: var(--cw-success); margin: 0; }

/* ====================================================================
   SEARCH RESULTS
   ==================================================================== */
.page-search { background: var(--bg); min-height: 100vh; }
.page-search .site-header { margin-bottom: 0; }
.page-search .search-header {
    padding: 0 0 var(--space-md);
    border-bottom: 1px solid var(--cw-n100);
    margin-bottom: var(--space-lg);
}
.page-search .search-results-label {
    font-family: var(--cw-font-heading);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--cw-ink);
    margin: 0;
}
.page-search .search-results-label strong { color: var(--cw-primary); }

/* Product-type section */
.results-product-type {
    margin-bottom: var(--space-xl);
}
.results-product-type-title {
    font-family: var(--cw-font-heading);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0 0 var(--space-sm);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--cw-n100);
}
.results-cheapest-row {
    font-size: 0.9375rem;
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
}
.results-cheapest-row .cheapest-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.results-cheapest-row .cheapest-item span:first-child { font-weight: 600; color: var(--cw-ink); }
.results-cheapest-row .cheapest-item .price {
    font-family: var(--cw-font-heading);
    font-weight: 700;
    color: var(--cw-accent);
    letter-spacing: -0.02em;
}

/* Product cards grid */
.results-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-md);
    list-style: none;
    margin: 0;
    padding: 0;
}
.product-card-premium {
    background: var(--card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    padding: var(--space-lg);
    box-shadow: var(--cw-shadow);
    transition: box-shadow var(--cw-ease), transform var(--cw-ease);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}
.product-card-premium:hover {
    transform: translateY(-2px);
    box-shadow: var(--cw-shadow-hover);
}
.product-card-image-link {
    display: block;
    width: 72px;
    height: 72px;
    border: 1px solid var(--cw-n100);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #fff;
}
.product-card-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.store-identity {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}
.store-logo {
    width: 44px;
    height: 18px;
    object-fit: contain;
    flex: 0 0 auto;
    border-radius: 4px;
}
.retailer-pill.store-identity {
    width: fit-content;
    max-width: 100%;
    padding-left: 0.35rem;
}
.retailer-pill .store-logo {
    width: 36px;
    height: 14px;
}
.product-card-premium .product-card-image-link {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
}
.product-card-premium .product-card-retailer { margin-bottom: 0.25rem; }
.product-card-premium .product-card-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--cw-ink);
    text-decoration: none;
    line-height: 1.4;
    letter-spacing: -0.015em;
    display: block;
}
.product-card-premium .product-card-title:hover { color: var(--cw-primary); text-decoration: none; }
.product-card-premium .product-card-size { font-size: 0.8125rem; color: var(--text-muted); margin: 0; }
.product-card-premium .product-card-price {
    font-family: var(--cw-font-heading);
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--cw-primary);
    margin-top: auto;
}
.product-card-premium .product-card-unit { font-size: 0.8125rem; color: var(--text-muted); }
.product-card-premium .product-add-btn {
    margin-top: 0.25rem;
    width: 100%;
    padding: 0.65rem 1rem;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--cw-font-heading);
    letter-spacing: -0.01em;
    color: #fff;
    background: var(--cw-primary);
    border: none;
    border-radius: var(--radius-btn);
    cursor: pointer;
    box-shadow: 0 2px 6px oklch(0.52 0.12 255 / 0.18);
    transition: background var(--cw-ease), box-shadow var(--cw-ease), transform var(--cw-ease);
}
.product-card-premium .product-add-btn:hover {
    background: var(--cw-primary-hover);
    box-shadow: 0 4px 12px oklch(0.52 0.12 255 / 0.25);
}
.product-card-premium .product-add-btn:active { transform: scale(0.97); }

/* Show all toggle */
.results-show-all-wrap { margin-top: var(--space-lg); text-align: center; }
.results-show-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.35rem;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--cw-font-heading);
    letter-spacing: -0.01em;
    color: var(--cw-primary);
    background: transparent;
    border: 1.5px solid var(--cw-primary);
    border-radius: var(--radius-btn);
    cursor: pointer;
    transition: all var(--cw-ease);
}
.results-show-all-btn:hover { background: var(--cw-primary-light); }
.results-show-all-btn[aria-expanded="true"] .show-all-label-initial { display: none; }
.results-show-all-btn[aria-expanded="false"] .show-all-label-expanded { display: none; }

/* Legacy retailer block */
.page-search .retailer-results {
    margin-bottom: var(--space-xl);
    background: var(--card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    padding: var(--space-lg);
    box-shadow: var(--cw-shadow);
}
.page-search .retailer-name {
    font-family: var(--cw-font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--cw-ink);
    margin: 0 0 var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--cw-n100);
}
.page-search .product-card-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-sm); }
.page-search .product-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: var(--space-sm);
    align-items: start;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--cw-n100);
}
.page-search .product-card:last-child { border-bottom: none; }
.page-search .product-card-body { display: contents; }
.page-search .product-card > .product-card-image-link { grid-column: 1; grid-row: 1 / -1; }
.page-search .product-card-title { font-size: 0.9375rem; font-weight: 500; color: var(--cw-ink); text-decoration: none; grid-column: 2; }
.page-search .product-card-title:hover { color: var(--cw-primary); }
.page-search .product-card-prices { grid-column: 2; }
.page-search .product-price { font-family: var(--cw-font-heading); font-size: 1.125rem; font-weight: 700; color: var(--cw-ink); }
.page-search .product-unit-price { font-size: 0.8125rem; color: var(--text-muted); }
/* Place the actions cluster in the list-card grid — not the add button itself.
   (product-card-body uses display:contents; grid-column on .product-add-btn
   leaked into premium cards and forced a 3-col actions grid that overflowed.) */
.page-search .product-card .product-card-actions {
    grid-column: 3;
    grid-row: 1 / -1;
    align-self: center;
}
.page-search .product-add-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: var(--cw-font-heading);
    color: #fff;
    background: var(--cw-primary);
    border: none;
    border-radius: var(--radius-btn);
    cursor: pointer;
    transition: background var(--cw-ease);
}
.page-search .product-add-btn:hover { background: var(--cw-primary-hover); }

/* Search form inline */
.page-search .search-form-section {
    margin: 0 0 var(--space-md);
}
.page-search .search-form-inline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    padding: 0.35rem;
    border: 1px solid var(--cw-border-subtle);
    border-radius: var(--cw-radius-search);
    background: var(--cw-surface);
    box-shadow: var(--cw-shadow);
    align-items: center;
    max-width: 40rem;
    margin-bottom: var(--space-md);
}
.page-search .search-input {
    flex: 1;
    max-width: none;
    min-height: 48px;
    padding: 0.75rem 1rem;
    font-size: 16px;
    border-radius: 12px;
    border: 0;
    background: transparent;
}
.page-search .search-input:focus {
    border-color: transparent;
    box-shadow: none;
    outline: none;
}
.page-search .search-form-inline:focus-within {
    border-color: oklch(0.52 0.12 255 / 0.35);
    box-shadow: var(--cw-shadow), 0 0 0 3px var(--cw-primary-light);
}
.page-search .search-submit {
    min-height: 48px;
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    font-family: var(--cw-font-body);
    color: var(--cw-primary-ink);
    background: var(--cw-primary);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 2px 8px oklch(0.52 0.12 255 / 0.20);
    transition: background var(--cw-ease);
}
.page-search .search-submit:hover { background: var(--cw-primary-hover); }

.page-search .search-meta { font-size: 0.8125rem; color: var(--text-muted); margin: 0 0 var(--space-xs); }
.page-search .search-showing { font-size: 0.9375rem; color: var(--text-muted); margin: 0 0 var(--space-sm); }
.page-search .search-sort,
.page-search .search-mode { margin: 0 0 var(--space-md); font-size: 0.8125rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; }
.page-search .search-sort-label,
.page-search .search-mode-link { color: var(--text-muted); }
.page-search .search-sort-link,
.page-search .search-mode-link { color: var(--cw-primary); text-decoration: none; }
.page-search .search-sort-link:hover,
.page-search .search-mode-link:hover { text-decoration: underline; }
.page-search .search-sort-link.is-active,
.page-search .search-mode-link.is-active { font-weight: 600; color: var(--cw-ink); pointer-events: none; }
.page-search .search-fallback-msg {
    font-size: 0.9375rem;
    color: var(--text-muted);
    margin: 0 0 var(--space-md);
    padding: var(--space-md);
    background: var(--cw-n100);
    border-radius: var(--radius-input);
}

.page-search .search-match-notice {
    margin: 0 0 var(--space-lg);
    padding: var(--space-md) var(--space-lg);
    border-radius: 16px;
    background: var(--cw-warn-bg);
    max-width: 52rem;
}
.page-search .search-match-notice-empty {
    background: var(--cw-n100);
}
.page-search .search-match-kicker {
    display: block;
    margin-bottom: var(--space-xs);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}
.page-search .search-match-notice h2 {
    margin: 0 0 var(--space-xs);
    color: var(--cw-ink);
    font-size: 1.35rem;
    letter-spacing: 0;
}
.page-search .search-match-notice p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.55;
}
.page-search .alternative-match-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    min-height: 1.75rem;
    margin: 0.15rem 0 var(--space-sm);
}
.page-search .alternative-match-tag {
    display: inline-flex;
    align-items: center;
    min-height: 1.65rem;
    padding: 0.18rem 0.5rem;
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    background: var(--cw-n100);
    color: var(--text-muted);
    font-size: 0.7rem;
    line-height: 1.2;
}
.page-search .alternative-match-tag.is-exact {
    border-color: oklch(0.52 0.12 255 / 0.35);
    background: oklch(0.52 0.12 255 / 0.09);
    color: var(--cw-primary-hover);
}
.page-search .alternative-match-tag.is-near {
    border-color: rgba(224, 154, 45, 0.35);
    background: rgba(224, 154, 45, 0.09);
    color: #8a5a12;
}

/* ── Price comparison UX ── */
.comparison-block {
    background: var(--card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
    box-shadow: var(--cw-shadow);
}
.comparison-heading {
    font-family: var(--cw-font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--cw-ink);
    margin: 0 0 var(--space-md);
}
.comparison-product {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0 0 var(--space-md);
}
.comparison-rows {
    list-style: none;
    margin: 0;
    padding: 0;
}
.comparison-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-sm);
    border-bottom: 1px solid var(--cw-n100);
    font-size: 1rem;
    transition: background var(--cw-ease);
}
.comparison-row-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
    flex: 1;
}
.comparison-product-title {
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--text-muted);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.search-attribute-miss {
    margin-bottom: var(--space-lg);
}
.search-attribute-miss-text {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--cw-ink);
}
.comparison-row:last-child { border-bottom: none; }
.comparison-row:hover { background: var(--cw-n50); }
.comparison-row-cheapest {
    background: var(--cw-primary-wash);
    margin-left: calc(-1 * var(--space-sm));
    margin-right: calc(-1 * var(--space-sm));
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
    border-radius: 12px;
    border-bottom-color: transparent;
}
.comparison-row-cheapest:hover { background: var(--cw-primary-light); }
.comparison-retailer { font-weight: 500; color: var(--cw-ink); }
.comparison-price {
    font-family: var(--cw-font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--cw-ink);
}
.comparison-row-cheapest .comparison-price { color: var(--cw-primary); font-size: 1.3125rem; }
.loyalty-price-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-left: 0.35rem;
    padding: 0.15rem 0.4rem;
    border-radius: 999px;
    background: var(--cw-primary-light);
    color: var(--cw-primary);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.1;
    vertical-align: middle;
}
.regular-price {
    display: block;
    margin-top: 0.15rem;
    color: var(--cw-n600);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0;
    text-decoration: line-through;
}
.comparison-cheapest-badge {
    font-family: var(--cw-font-heading);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--cw-primary);
    margin-left: 0.35rem;
    text-transform: uppercase;
}
.search-mode-inline {
    margin-bottom: var(--space-lg);
    font-size: 0.8125rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
}
.search-sort-inline { color: var(--text-muted); margin-left: auto; }
.search-sort-inline .search-sort-link { color: var(--cw-primary); }

.best-per-store { margin-bottom: var(--space-xl); }
.best-per-store-heading {
    font-family: var(--cw-font-heading);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0 0 var(--space-md);
}
.best-per-store-retailer {
    background: var(--card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    box-shadow: none;
    transition: box-shadow var(--cw-ease);
}
.best-per-store-retailer:hover { box-shadow: var(--cw-shadow); }
.best-per-store-retailer:last-of-type { margin-bottom: 0; }
.best-per-store-retailer-name {
    font-family: var(--cw-font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--cw-ink);
    margin: 0 0 var(--space-sm);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--cw-n100);
}
.best-per-store-list { list-style: none; margin: 0; padding: 0; }
.best-per-store-single,
.best-per-store-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: var(--space-sm) var(--space-md);
    align-items: center;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--cw-n100);
}
.best-per-store-item:last-child { border-bottom: none; }
.best-per-store-single .product-add-btn {
    grid-column: 3;
    grid-row: 1 / -1;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}
.best-per-store-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--cw-ink);
    text-decoration: none;
    grid-column: 2;
}
.best-per-store-title:hover { color: var(--cw-primary); text-decoration: none; }
.best-per-store-item > .product-card-image-link { grid-column: 1; grid-row: 1 / -1; }
.best-per-store-size { font-size: 0.8125rem; color: var(--text-muted); grid-column: 2; }
.best-per-store-price {
    font-family: var(--cw-font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--cw-primary);
}
.best-per-store-item .product-add-btn {
    grid-column: 4;
    grid-row: 1 / -1;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.see-all-results { margin-top: var(--space-lg); margin-bottom: var(--space-xl); }
.see-all-btn {
    display: block;
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: var(--cw-font-heading);
    color: var(--text-muted);
    background: var(--cw-n50);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-input);
    cursor: pointer;
    text-align: center;
    transition: all var(--cw-ease);
}
.see-all-btn:hover { color: var(--cw-primary); border-color: var(--cw-primary); background: var(--card); }
.see-all-content { margin-top: var(--space-md); }
.results-cards-grid-full { margin-top: var(--space-sm); }

.page-search .search-empty {
    padding: var(--space-2xl);
    text-align: center;
    background: var(--card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    box-shadow: var(--cw-shadow);
}
.page-search .search-not-found {
    font-family: var(--cw-font-heading);
    font-weight: 700;
    color: var(--cw-ink);
    margin: 0 0 var(--space-xs);
}
.page-search .search-did-you-mean,
.page-search .search-try-different { color: var(--text-muted); margin: 0 0 var(--space-sm); }
.page-search .search-suggest-links a { color: var(--cw-primary); }
.page-search .meta { font-size: 0.8125rem; color: var(--text-muted); margin-top: var(--space-lg); }

.data-freshness-line {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0 0 var(--space-md);
    letter-spacing: -0.01em;
}

/* ====================================================================
   BASKET SIDEBAR
   ==================================================================== */
.basket-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 380px;
    height: 100%;
    background: var(--card);
    border-left: 1px solid var(--border-subtle);
    box-shadow: -8px 0 40px oklch(0.28 0.025 260 / 0.12);
    z-index: 1000;
    overflow-y: auto;
    padding: var(--space-lg);
    padding-top: max(var(--space-lg), env(safe-area-inset-top));
    padding-right: max(var(--space-lg), env(safe-area-inset-right));
    transform: translateX(104%);
    transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}
.basket-sidebar.is-open {
    transform: translateX(0);
}
.basket-sidebar-inner { position: relative; }
.basket-sidebar-title {
    font-family: var(--cw-font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--cw-ink);
    margin: 0 0 var(--space-md);
}
.basket-sidebar-list { list-style: none; margin: 0 0 var(--space-md); padding: 0; }
.basket-sidebar-item {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--cw-n100);
}
.basket-sidebar-item-title { flex: 1 1 100%; font-size: 0.9375rem; font-weight: 500; color: var(--cw-ink); }
.basket-sidebar-item-meta { font-size: 0.8125rem; color: var(--text-muted); }
.basket-sidebar-item-remove {
    margin-left: auto;
    padding: 0.25rem 0.5rem;
    font-size: 1.25rem;
    line-height: 1;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-pill);
    transition: all var(--cw-ease);
}
.basket-sidebar-item-remove:hover { color: var(--cw-error); background: var(--cw-error-bg); }

.basket-sidebar-totals {
    margin: var(--space-md) 0;
    padding: var(--space-md) 0;
    border-top: 1px solid var(--cw-n100);
    border-bottom: 1px solid var(--cw-n100);
}
.basket-sidebar-totals-title {
    font-family: var(--cw-font-heading);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: 0 0 var(--space-sm);
}
.basket-sidebar-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.9375rem;
}
.basket-sidebar-total-row .store-name { color: var(--text-muted); }
.basket-sidebar-total-row .store-total { font-family: var(--cw-font-heading); font-weight: 700; color: var(--cw-ink); }
.basket-sidebar-total-row.cheapest .store-name { font-weight: 600; color: var(--cw-primary); }
.basket-sidebar-total-row.cheapest .store-total { color: var(--cw-primary); font-weight: 700; }
.basket-sidebar-total { font-size: 0.9375rem; font-weight: 600; color: var(--cw-ink); margin: 0 0 var(--space-sm); }
.basket-sidebar-form { margin-top: var(--space-md); }
.basket-sidebar-compare {
    display: inline-block;
    width: 100%;
    padding: 0.85rem 1.25rem;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--cw-font-heading);
    letter-spacing: -0.015em;
    color: #fff;
    background: var(--cw-primary);
    border: none;
    border-radius: var(--radius-btn);
    cursor: pointer;
    text-align: center;
    box-shadow: 0 2px 8px oklch(0.52 0.12 255 / 0.20);
    transition: background var(--cw-ease), box-shadow var(--cw-ease);
}
.basket-sidebar-compare:hover { background: var(--cw-primary-hover); color: #fff; box-shadow: 0 4px 16px oklch(0.52 0.12 255 / 0.28); }
.basket-sidebar-close {
    position: absolute;
    top: 0;
    right: 0;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--cw-ease);
}
.basket-sidebar-close:hover { color: var(--cw-ink); background: var(--cw-n100); }
.basket-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: oklch(0.28 0.025 260 / 0.28);
    z-index: 999;
    cursor: pointer;
    opacity: 0;
    transition: opacity 280ms cubic-bezier(0.22, 1, 0.36, 1);
}
.basket-sidebar-backdrop.is-open {
    opacity: 1;
}
.basket-sidebar[hidden], .basket-sidebar-backdrop[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) {
    .basket-sidebar {
        transition: none;
    }
    .basket-sidebar-backdrop {
        transition: none;
    }
}

/* ====================================================================
   BASKET PAGE (compare)
   ==================================================================== */
.basket-card {
    background: var(--card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    box-shadow: var(--cw-shadow);
    transition: box-shadow var(--cw-ease);
}
.basket-card:hover { box-shadow: var(--cw-shadow-hover); }
.basket-card.cheapest {
    border-color: oklch(0.52 0.12 255 / 0.30);
    background: var(--cw-success-bg);
}
.basket-card .retailer-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.basket-card .retailer-header h3 { font-family: var(--cw-font-heading); font-size: 1.0625rem; font-weight: 700; color: var(--cw-ink); }
.basket-total { font-family: var(--cw-font-heading); font-size: 1.25rem; font-weight: 700; color: var(--cw-ink); }
.basket-card.cheapest .basket-total { color: var(--cw-primary); }
.catalog-note { font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.25rem; }
.missing-list { color: var(--cw-accent); font-size: 0.875rem; margin-top: 0.5rem; }
.promo-warning {
    background: var(--cw-warn-bg);
    border: 1px solid rgba(242, 155, 62, 0.25);
    border-radius: var(--radius-input);
    padding: var(--space-md);
    font-size: 0.875rem;
    color: var(--cw-warn);
    margin-bottom: var(--space-sm);
}
.basket-card.promo-card { opacity: 0.85; border-style: dashed; }
.price { font-family: var(--cw-font-heading); font-weight: 700; color: var(--cw-ink); }
.price-cheapest { color: var(--cw-success); }
.unit-price { color: var(--text-muted); font-size: 0.875rem; }
.basket-comparing-note { font-size: 0.875rem; color: var(--text-muted); margin-bottom: var(--space-md); }
.basket-promo-heading { font-family: var(--cw-font-heading); margin: var(--space-lg) 0 var(--space-sm); color: var(--text-muted); font-size: 1rem; font-weight: 600; }
.basket-total--muted { color: var(--text-muted); }
.basket-ingest-hint { margin-top: var(--space-xs); font-size: 0.875rem; }
.basket-ingest-hint code { background: var(--cw-n100); padding: 0.2rem 0.5rem; border-radius: 6px; font-size: 0.8125rem; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
th {
    text-align: left;
    padding: 0.625rem 0.75rem;
    background: var(--cw-n50);
    color: var(--text-muted);
    font-family: var(--cw-font-heading);
    font-weight: 600;
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
td { padding: 0.625rem 0.75rem; border-bottom: 1px solid var(--cw-n100); }
tr:last-child td { border-bottom: none; }

.page-title {
    font-family: var(--cw-font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--cw-ink);
    margin: 0 0 var(--space-md);
}

/* ====================================================================
   ADMIN
   ==================================================================== */
.admin-page { background: var(--bg); min-height: 100vh; }
.admin-page > .lang-switch { margin-bottom: var(--space-md); }
.admin-page > header {
    padding-bottom: var(--space-md);
    margin-bottom: var(--space-lg);
    border-bottom: 1px solid var(--cw-n100);
}
.admin-page > header h1 {
    font-family: var(--cw-font-heading);
    font-size: 1.3125rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}
.admin-page > header h1 a { color: var(--cw-ink); text-decoration: none; }
.admin-page > header h1 a:hover { opacity: 0.7; }
.admin-page > header p { color: var(--text-muted); font-size: 0.9375rem; margin-top: 0.35rem; }
.admin-page .card h2 {
    font-family: var(--cw-font-heading);
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 var(--space-md);
}

.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.admin-table th {
    text-align: left;
    padding: 0.75rem;
    background: var(--cw-n50);
    color: var(--text-muted);
    font-family: var(--cw-font-heading);
    font-weight: 700;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.admin-table td { padding: 0.75rem; border-bottom: 1px solid var(--cw-n100); }
.status-ok { color: var(--cw-success); font-weight: 600; }
.status-warn { color: var(--cw-warn); font-weight: 600; }
.admin-desc { color: var(--text-muted); font-size: 0.8125rem; }

/* ====================================================================
   RESPONSIVE
   ==================================================================== */
@media (max-width: 768px) {
    .app-wrap { padding-left: var(--space-sm); padding-right: var(--space-sm); }
    .site-header {
        border-radius: 20px;
        padding: 0.7rem;
        gap: 0.65rem;
    }
    .site-header-right {
        margin-left: auto;
    }
    .site-footer-card {
        grid-template-columns: 1fr;
        border-radius: 20px;
    }
    .site-footer-nav {
        justify-content: flex-start;
    }
    .site-footer .footer-contact {
        grid-column: auto;
        margin: 0;
        text-align: left;
    }
    .site-footer .footer-disclaimer {
        grid-column: auto;
    }
    .page-home .hero { padding: var(--space-xl) 0; }
    .page-home .search-first-form { flex-direction: column; align-items: stretch; }
    .page-home .search-first-input { min-width: 0; }
    .page-home .search-first-btn { width: 100%; }
    .results-cards-grid { grid-template-columns: 1fr; }
    .page-search .product-card { grid-template-columns: auto 1fr; }
    .page-search .product-card-title,
    .page-search .product-card-prices { grid-column: 2; }
    .page-search .product-card .product-card-actions {
        grid-column: 2;
        grid-row: auto;
        justify-self: start;
    }
    .best-per-store-item { grid-template-columns: auto 1fr; }
    .best-per-store-title,
    .best-per-store-size { grid-column: 2; }
    .best-per-store-price,
    .best-per-store-item .product-add-btn { grid-column: 2; grid-row: auto; justify-self: start; }
    .best-per-store-single { grid-template-columns: 1fr; }
    .best-per-store-single .product-add-btn { grid-column: 1; grid-row: auto; justify-self: start; }

    .basket-sidebar {
        max-width: none;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        height: auto;
        max-height: 88vh;
        border-radius: var(--radius-card) var(--radius-card) 0 0;
        border-left: none;
        border-top: 1px solid var(--border);
        box-shadow: 0 -8px 40px rgba(45, 55, 72, 0.12);
    }
}

@media (max-width: 480px) {
    .page-home .hero-headline { font-size: 1.75rem; }
    .site-nav a { padding: 0.5rem; }
}

/* ── Static pages (history / alerts / settings) ── */
.page-static .page-static-main {
    padding: var(--space-lg) 0 var(--space-section);
    max-width: 42rem;
}
.page-static-title {
    font-family: var(--cw-font-heading);
    margin-bottom: var(--space-sm);
}
.page-static-lead {
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
    font-size: 1rem;
    line-height: 1.6;
}
.page-static-card {
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
}
.page-static-body {
    margin-bottom: var(--space-md);
    color: var(--text-muted);
    line-height: 1.6;
}
.page-static-subtitle {
    margin: calc(var(--space-lg) * 0.85) 0 var(--space-sm);
    color: var(--text);
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0;
}
.page-static-hint {
    margin-top: var(--space-md);
    color: var(--text-muted);
}
.page-static-meta {
    margin-top: var(--space-lg);
    color: var(--text-muted);
}
.settings-card .lang-switch {
    margin-top: var(--space-md);
}
.page-auth .auth-shell {
    width: 100%;
    margin: clamp(1rem, 6vw, 3.5rem) auto 0;
}
.page-auth .auth-shell--split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
    gap: var(--space-xl);
    align-items: stretch;
    max-width: 980px;
}
.page-auth .auth-shell--center {
    max-width: 460px;
}
.page-auth .auth-shell--focus {
    max-width: 520px;
}
.page-auth .auth-story {
    min-height: 520px;
    padding: var(--space-xl);
    border: 1px solid var(--cw-border-subtle);
    border-radius: 24px;
    background:
        radial-gradient(90% 70% at 0% 0%, oklch(0.52 0.12 255 / 0.08), transparent 55%),
        radial-gradient(70% 50% at 100% 100%, oklch(0.72 0.08 65 / 0.08), transparent 50%),
        var(--cw-surface);
    box-shadow: var(--cw-shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    position: relative;
}
.page-auth .auth-story-title {
    margin: 0;
    max-width: 14ch;
    font-family: var(--cw-font-heading);
    font-size: 3.1rem;
    line-height: 1.04;
    letter-spacing: 0;
    color: var(--cw-ink);
}
.page-auth .auth-story-copy {
    max-width: 34rem;
    margin: var(--space-md) 0 0;
    color: var(--text-muted);
    font-size: 1rem;
}
.page-auth .auth-preview-card {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--cw-border);
    border-radius: var(--radius-card);
    background: var(--cw-border);
    max-width: 420px;
}
.page-auth .auth-preview-row {
    display: flex;
    justify-content: space-between;
    gap: var(--space-md);
    padding: 1rem 1.1rem;
    background: rgba(255, 255, 255, 0.88);
    color: var(--text-muted);
    font-weight: 700;
}
.page-auth .auth-preview-row strong {
    color: var(--cw-ink);
    font-family: var(--cw-font-heading);
    letter-spacing: 0;
}
.page-auth .auth-preview-row--active {
    background: var(--cw-primary-light);
    color: var(--cw-primary);
}
.page-auth .auth-card {
    align-self: center;
    padding: var(--space-xl);
    border-radius: var(--radius-card);
    border: 1px solid var(--cw-border);
    box-shadow: 0 18px 54px rgba(45, 55, 72, 0.08);
}
.page-auth .auth-card--focus {
    position: relative;
    overflow: hidden;
    padding: clamp(1.5rem, 5vw, 2.75rem);
}
.page-auth .auth-card--focus::before {
    content: none;
}
.page-auth .auth-hero-mark {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin-bottom: var(--space-lg);
    border-radius: var(--radius-card);
    background: var(--cw-primary-light);
}
.page-auth .auth-hero-mark img {
    width: 30px;
    height: 30px;
}
.page-auth .auth-title {
    margin: 0 0 var(--space-xs);
}
.page-auth .auth-card--focus .auth-title {
    max-width: 11ch;
    font-size: 2.45rem;
    line-height: 1.08;
    letter-spacing: 0;
}
.page-auth .auth-subtext {
    margin: 0 0 var(--space-lg);
    color: var(--text-muted);
    line-height: 1.55;
}
.page-auth .auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}
.page-auth .auth-social {
    display: grid;
    gap: var(--space-sm);
    margin: 0 0 var(--space-md);
}
.page-auth .auth-social-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    min-height: 52px;
    padding: 0.85rem 1rem;
    border: 1px solid var(--cw-border);
    border-radius: var(--radius-control);
    background: #fff;
    color: var(--cw-ink);
    font-weight: 850;
    text-decoration: none;
    box-shadow: 0 10px 26px rgba(45, 55, 72, 0.05);
}
.page-auth .auth-social-button:hover {
    border-color: color-mix(in oklch, var(--cw-primary), white 45%);
    background: var(--cw-n50);
    color: var(--cw-ink);
    text-decoration: none;
}
.page-auth .auth-provider-mark {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: var(--cw-n100);
    color: var(--cw-ink);
    font-size: 0.95rem;
    font-weight: 900;
    line-height: 1;
}
.page-auth .auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin: var(--space-md) 0;
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 800;
}
.page-auth .auth-divider::before,
.page-auth .auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--cw-border);
}
.page-auth .auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--cw-ink);
}
.page-auth .auth-field input {
    min-height: 52px;
    background: var(--cw-n50);
}
.page-auth .auth-field input:focus {
    background: #fff;
}
.page-auth .auth-submit {
    width: 100%;
    margin-top: 0.25rem;
}
.page-auth .auth-primary-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-top: var(--space-lg);
    font-size: 0.9375rem;
    color: var(--text-muted);
}
.page-auth .auth-primary-link a,
.page-auth .auth-muted-link {
    font-weight: 700;
}
.page-auth .auth-muted-link {
    display: block;
    width: fit-content;
    margin: var(--space-sm) auto 0;
    font-size: 0.875rem;
}
.page-auth .auth-links {
    display: flex;
    justify-content: space-between;
    gap: var(--space-sm);
    flex-wrap: wrap;
    margin-top: var(--space-lg);
    font-size: 0.875rem;
}
.page-auth .auth-hint {
    margin: calc(var(--space-sm) * -1) 0 0;
    color: var(--text-muted);
    font-size: 0.8125rem;
}
.page-auth .auth-flash {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-input);
    margin: 0 0 var(--space-md);
    font-size: 0.875rem;
    line-height: 1.45;
}
.page-auth .auth-flash-error {
    background: var(--cw-error-bg);
    color: var(--cw-error);
}
.page-auth .auth-flash-info {
    background: var(--cw-info-bg);
    color: var(--cw-n700);
}
.page-auth .account-list {
    margin: 0 0 var(--space-lg);
}
.page-auth .account-list div {
    display: flex;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
}
.page-auth .account-list dt {
    color: var(--text-muted);
    font-size: 0.875rem;
}
.page-auth .account-list dd {
    color: var(--cw-ink);
    font-weight: 600;
    overflow-wrap: anywhere;
    text-align: right;
}

@media (max-width: 520px) {
    .page-auth .auth-card {
        padding: var(--space-lg);
    }
    .page-auth .auth-card--focus .auth-title {
        max-width: 13ch;
        font-size: 2rem;
    }
    .page-auth .auth-links,
    .page-auth .account-list div {
        flex-direction: column;
    }
    .page-auth .account-list dd {
        text-align: left;
    }
}

@media (max-width: 860px) {
    .page-auth .auth-shell--split {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    .page-auth .auth-story {
        min-height: auto;
        padding: var(--space-lg);
    }
    .page-auth .auth-story-title {
        max-width: 18ch;
        font-size: 2.3rem;
    }
}
.cw-skeleton--block {
    height: 140px;
    width: 100%;
    border-radius: var(--radius-card);
}

/* ── Account hub, saved lists, and personalization ───────────────── */
.account-hub {
    padding: var(--space-lg) 0 var(--space-section);
}
.account-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
    gap: var(--space-xl);
    align-items: end;
    margin-bottom: var(--space-lg);
}
.account-kicker,
.account-panel-kicker {
    margin: 0 0 var(--space-xs);
    color: var(--cw-primary);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.account-title {
    max-width: 720px;
}
.account-subtext {
    margin: var(--space-sm) 0 0;
    max-width: 48rem;
    color: var(--text-muted);
}
.account-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--cw-border);
    border-radius: 18px;
    background: var(--cw-border);
}
.account-stats > div {
    background: #fff;
    padding: var(--space-md);
}
.account-stat-value {
    display: block;
    font-family: var(--cw-font-heading);
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--cw-ink);
}
.account-stat-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.78rem;
}
.account-flash {
    width: fit-content;
    padding: 0.7rem 1rem;
    margin: 0 0 var(--space-md);
    color: var(--cw-primary);
    background: var(--cw-primary-light);
    border-radius: var(--radius-pill);
    font-weight: 700;
}
.account-action-strip,
.home-command-dock {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin: var(--space-lg) 0;
}
.account-action,
.home-command-pill {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0.55rem 0.9rem;
    border: 1px solid var(--cw-border);
    border-radius: var(--radius-pill);
    background: #fff;
    color: var(--cw-ink);
    font-weight: 700;
    font-size: 0.875rem;
    transition: transform var(--cw-ease), border-color var(--cw-ease), background var(--cw-ease);
}
.account-action:hover,
.home-command-pill:hover {
    transform: translateY(-1px);
    border-color: var(--cw-primary);
    background: var(--cw-primary-light);
}
.home-command-pill--strong {
    background: var(--cw-ink);
    border-color: var(--cw-ink);
    color: #fff;
}
.home-command-pill--strong:hover {
    background: var(--cw-n700);
    color: #fff;
}
.account-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
    gap: var(--space-lg);
    align-items: start;
}
.account-panel {
    background: #fff;
    border: 1px solid var(--cw-border);
    border-radius: 18px;
    padding: var(--space-lg);
    box-shadow: 0 14px 36px rgba(45, 55, 72, 0.06);
}
.account-panel--wide {
    grid-column: span 1;
}
.account-panel-head {
    display: flex;
    justify-content: space-between;
    gap: var(--space-md);
    align-items: start;
    margin-bottom: var(--space-md);
}
.account-panel-title {
    margin: 0;
}
.account-panel-count {
    flex: 0 0 auto;
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-pill);
    background: var(--cw-n100);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.8125rem;
}
.saved-list-stack,
.favorite-list {
    display: grid;
    gap: var(--space-sm);
    list-style: none;
    padding: 0;
    margin: 0;
}
.saved-list-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    border-top: 1px solid var(--cw-n100);
}
.saved-list-title,
.favorite-title {
    margin: 0;
    color: var(--cw-ink);
    font-weight: 800;
    letter-spacing: -0.02em;
}
.saved-list-meta,
.favorite-meta,
.saved-list-preview {
    margin: 0.2rem 0 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}
.saved-list-actions {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}
.saved-list-actions form {
    margin: 0;
}
.saved-list-btn {
    min-height: 40px;
    padding-inline: 1rem;
}
.saved-list-delete,
.favorite-delete {
    border: 0;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 700;
    padding: 0.5rem;
    border-radius: var(--radius-pill);
}
.saved-list-delete:hover,
.favorite-delete:hover {
    color: var(--cw-error);
    background: var(--cw-error-bg);
}
.account-empty {
    padding: var(--space-lg);
    background: var(--cw-n50);
    border: 1px dashed var(--cw-border);
    border-radius: 14px;
}
.account-empty h3,
.account-empty p {
    margin: 0;
}
.account-empty p {
    margin-top: var(--space-xs);
    color: var(--text-muted);
}
.account-form,
.preferences-grid {
    display: grid;
    gap: var(--space-md);
}
.preferences-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.preferences-notes {
    grid-column: 1 / -1;
}
.account-submit {
    justify-self: start;
}
.favorite-item {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: var(--space-sm);
    align-items: center;
    padding: var(--space-sm) 0;
    border-top: 1px solid var(--cw-n100);
}
.favorite-image {
    width: 56px;
    height: 56px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--cw-border);
    border-radius: 10px;
}
.favorite-body {
    min-width: 0;
}
.account-signout {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--cw-border);
    color: var(--text-muted);
}
.account-danger-zone {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-lg);
    margin-top: var(--space-md);
    border-color: rgba(220, 38, 38, 0.18);
    background: #fffafa;
}
.account-danger-zone form {
    margin: 0;
    flex: 0 0 auto;
}
.account-data-copy {
    margin: var(--space-xs) 0 0;
    color: var(--text-muted);
    max-width: 68ch;
}
.home-personalize-band {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-lg);
    align-items: center;
    margin: var(--space-section) 0;
    padding: var(--space-lg);
    background: #fff;
    border: 1px solid var(--cw-border);
    border-radius: 18px;
}
.home-personalize-copy {
    margin: var(--space-xs) 0 0;
    color: var(--text-muted);
    max-width: 46rem;
}
.home-personalize-actions {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.product-card-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-xs);
    align-items: center;
}
.product-card-premium .product-card-actions .product-add-btn,
.best-per-store-item .product-card-actions .product-add-btn {
    width: auto;
    margin: 0;
}
button.product-save-btn,
.product-card-premium button.product-save-btn,
.best-per-store-item button.product-save-btn {
    min-height: 39px;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--cw-border);
    border-radius: var(--radius-pill);
    background: #fff !important;
    color: var(--cw-ink) !important;
    box-shadow: none !important;
    cursor: pointer;
    font-family: var(--cw-font-heading);
    font-size: 0.8125rem;
    font-weight: 800;
}
button.product-save-btn:hover {
    background: var(--cw-accent-light) !important;
    border-color: var(--cw-accent);
}
button.product-save-btn.is-saved {
    background: var(--cw-accent) !important;
    border-color: var(--cw-accent);
    color: #fff !important;
}
.best-per-store-item .product-card-actions {
    grid-column: 4;
    grid-row: 1 / -1;
}
.basket-sidebar-save-form {
    display: grid;
    gap: var(--space-xs);
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--cw-n100);
}
.basket-sidebar-list-name {
    min-height: 42px;
    padding: 0.65rem 0.85rem;
    font-size: 0.9375rem;
}
.basket-sidebar-save {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--cw-border);
    border-radius: var(--radius-pill);
    background: #fff;
    color: var(--cw-ink);
    font-weight: 800;
    cursor: pointer;
}
.basket-sidebar-save:hover {
    border-color: var(--cw-primary);
    background: var(--cw-primary-light);
}
.basket-sidebar-save-status {
    min-height: 1.2em;
    margin: 0;
    color: var(--cw-primary);
    font-size: 0.8125rem;
    font-weight: 700;
}

@media (max-width: 820px) {
    .account-hero,
    .account-grid,
    .home-personalize-band {
        grid-template-columns: 1fr;
    }
    .preferences-grid {
        grid-template-columns: 1fr;
    }
    .account-danger-zone {
        align-items: stretch;
        flex-direction: column;
    }
    .account-danger-zone form,
    .account-danger-zone .cw-btn {
        width: 100%;
    }
    .saved-list-card,
    .favorite-item,
    .account-signout {
        grid-template-columns: 1fr;
    }
    .saved-list-actions,
    .home-personalize-actions {
        align-items: stretch;
        flex-direction: column;
    }
    .account-stats {
        grid-template-columns: 1fr;
    }
    .product-card-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .page-home .search-first-form,
    .page-home .home-step__form.search-first-form {
        display: grid;
        grid-template-columns: 1fr;
    }
    .page-home .search-first-input,
    .page-home .search-first-btn,
    .page-home .shopping-btn {
        width: 100%;
        min-width: 0;
    }
}

/* ── History page ───────────────────────────────────────────────── */
.page-history .app-wrap {
    max-width: var(--home-max, 1120px);
}
.history-main {
    display: grid;
    gap: var(--space-lg);
    padding: var(--space-sm) 0 var(--space-section);
}
.history-app {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.7fr);
    gap: var(--space-xl);
    align-items: start;
    padding: clamp(1.5rem, 4vw, 3rem) 0 var(--space-md);
}
.history-app-primary {
    min-width: 0;
}
.history-title {
    max-width: 13ch;
    margin: 0 0 var(--space-sm);
    font-size: 3.05rem;
    line-height: 1.02;
    letter-spacing: 0;
}
.history-lead {
    max-width: 38rem;
    margin: 0 0 var(--space-lg);
    color: var(--text-muted);
    font-size: 1.08rem;
    line-height: 1.55;
}
.history-panel,
.history-product-picker {
    border: 1px solid var(--cw-border);
    border-radius: var(--radius-card);
    background: #fff;
    box-shadow: var(--cw-shadow);
}
.history-filter-form {
    display: grid;
    grid-template-columns: minmax(260px, 1fr);
    gap: var(--space-sm);
    max-width: 680px;
    padding: 0.45rem;
    border: 1px solid var(--cw-border);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 46px rgba(45, 55, 72, 0.08);
    align-items: end;
}
.history-query-field {
    display: grid;
    gap: 0.45rem;
    padding: 0.15rem 0.35rem 0;
}
.history-query-field input {
    min-height: 56px;
    border: 0;
    background: var(--cw-n50);
    font-size: 1.02rem;
}
.history-query-field input:focus {
    background: #fff;
}
.history-window-field {
    display: grid;
    gap: 0.5rem;
    padding: 0 0.35rem;
}
.history-filter-label,
.history-section-kicker {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.history-window-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.history-window-option {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.68rem;
    border: 1px solid var(--cw-border);
    border-radius: var(--radius-pill);
    background: #fff;
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--cw-ease), border-color var(--cw-ease), color var(--cw-ease), transform var(--cw-ease);
}
.history-window-option:hover {
    border-color: oklch(0.52 0.12 255 / 0.35);
    color: var(--cw-primary);
    transform: translateY(-1px);
}
.history-window-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.history-window-option.is-active {
    border-color: oklch(0.52 0.12 255 / 0.35);
    background: var(--cw-primary-light);
    color: var(--cw-primary);
}
.history-filter-submit {
    min-height: 54px;
    border-radius: 14px;
}
.history-live-card {
    display: grid;
    gap: var(--space-md);
    padding: var(--space-lg);
    border: 1px solid oklch(0.52 0.12 255 / 0.16);
    border-radius: var(--radius-card);
    background: #fff;
    box-shadow: var(--cw-shadow);
}
.history-live-head {
    display: flex;
    justify-content: space-between;
    gap: var(--space-sm);
    align-items: flex-start;
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-subtle);
}
.history-live-head p,
.history-live-head span {
    margin: 0;
}
.history-live-head span {
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.4;
    text-align: right;
}
.history-live-stats {
    display: grid;
    gap: 0.7rem;
    margin: 0;
}
.history-live-stats div {
    display: flex;
    justify-content: space-between;
    gap: var(--space-sm);
    align-items: baseline;
}
.history-live-stats dt {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
}
.history-live-stats dd {
    margin: 0;
    color: var(--cw-ink);
    font-family: var(--cw-font-heading);
    font-size: 1.25rem;
    font-weight: 900;
}
.history-live-store {
    width: fit-content;
    margin: 0;
    padding: 0.42rem 0.72rem;
    border-radius: var(--radius-pill);
    background: var(--cw-primary-light);
    color: var(--cw-primary);
    font-weight: 800;
}
.history-product-picker {
    padding: var(--space-md);
}
.history-product-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}
.history-product-option {
    min-width: 0;
    display: grid;
    gap: 0.35rem;
    padding: var(--space-sm);
    border: 1px solid var(--cw-border);
    border-radius: 12px;
    background: #fff;
    color: var(--cw-ink);
    transition: background var(--cw-ease), border-color var(--cw-ease), transform var(--cw-ease);
}
.history-product-option:hover {
    border-color: oklch(0.52 0.12 255 / 0.35);
    transform: translateY(-1px);
}
.history-product-option span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 800;
}
.history-product-option strong {
    color: var(--text-muted);
    font-size: 0.8125rem;
}
.history-product-option.is-active {
    border-color: oklch(0.52 0.12 255 / 0.35);
    background: var(--cw-success-bg);
}
.history-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.58fr);
    gap: var(--space-md);
    align-items: start;
}
.history-panel {
    padding: var(--space-md);
}
.history-panel--wide {
    min-width: 0;
}
.history-panel-head {
    display: flex;
    justify-content: space-between;
    gap: var(--space-md);
    align-items: start;
    margin-bottom: var(--space-md);
}
.history-panel-title {
    margin: 0.25rem 0 0;
    line-height: 1.2;
}
.history-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0.35rem 0.7rem;
    border-radius: var(--radius-pill);
    background: var(--cw-n100);
    color: var(--cw-ink);
    font-size: 0.8125rem;
    font-weight: 800;
    white-space: nowrap;
}
.history-chart-wrap {
    width: 100%;
    overflow: hidden;
    border: 1px solid oklch(0.52 0.12 255 / 0.14);
    border-radius: 14px;
    background:
        linear-gradient(180deg, oklch(0.52 0.12 255 / 0.05) 0%, rgba(255, 255, 255, 0) 42%),
        #fff;
}
.history-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 0.9rem;
    margin: -0.25rem 0 0.75rem;
    color: var(--cw-n700);
    font-size: 0.8125rem;
    font-weight: 800;
}
.history-chart-legend--compact {
    margin: 0.2rem 0 0.55rem;
    font-size: 0.75rem;
}
.history-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.history-legend-swatch {
    display: inline-block;
    width: 0.85rem;
    height: 0.25rem;
    border-radius: var(--radius-pill);
    background: var(--cw-primary);
}
.history-legend-swatch.is-regular {
    background: var(--cw-n500);
}
.history-legend-swatch.is-loyalty {
    background: #2563eb;
}
.history-chart,
.saved-history-chart {
    display: block;
    width: 100%;
    height: auto;
}
.history-chart-axis {
    stroke: var(--cw-n200);
    stroke-width: 1.5;
}
.history-chart-line {
    fill: none;
    stroke: var(--cw-primary);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.history-chart-line--regular {
    stroke: var(--cw-n500);
    stroke-width: 2.75;
    stroke-dasharray: 8 7;
}
.history-chart-line--loyalty {
    stroke: #2563eb;
    stroke-width: 3;
}
.history-chart-dot {
    fill: #fff;
    stroke: var(--cw-primary);
    stroke-width: 3;
}
.history-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}
.history-stats div,
.history-insight-list li {
    min-width: 0;
    padding: var(--space-sm);
    border: 1px solid var(--cw-n100);
    border-radius: 12px;
    background: var(--cw-n50);
}
.history-stats dt {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 800;
}
.history-stats dd {
    margin-top: 0.2rem;
    color: var(--cw-ink);
    font-family: var(--cw-font-heading);
    font-size: 1.25rem;
    font-weight: 900;
}
.is-up {
    color: var(--cw-error) !important;
}
.is-down {
    color: var(--cw-success) !important;
}
.history-insight-list {
    display: grid;
    gap: var(--space-sm);
    list-style: none;
    margin: 0;
    padding: 0;
}
.history-insight-list span {
    display: block;
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 700;
}
.history-insight-list strong {
    display: block;
    margin-top: 0.2rem;
    color: var(--cw-ink);
    overflow-wrap: anywhere;
}
.history-empty {
    display: grid;
    gap: var(--space-sm);
    padding: var(--space-lg);
    border: 1px dashed var(--cw-border);
    border-radius: 12px;
    background: var(--cw-n50);
}
.history-empty h3,
.history-empty p {
    margin: 0;
}
.history-muted {
    color: var(--text-muted);
    line-height: 1.55;
}
.history-text-link {
    color: var(--cw-primary);
    font-weight: 800;
}
.saved-history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: var(--space-md);
}
.saved-history-card {
    display: grid;
    gap: var(--space-sm);
    min-width: 0;
    padding: var(--space-sm);
    border: 1px solid var(--cw-n100);
    border-radius: 12px;
    background: var(--cw-n50);
}
.saved-history-head {
    display: flex;
    justify-content: space-between;
    gap: var(--space-sm);
    align-items: start;
}
.saved-history-head h3,
.saved-history-head p {
    margin: 0;
}
.saved-history-head h3 {
    color: var(--cw-ink);
    font-size: 1rem;
}
.saved-history-head p,
.saved-history-delta {
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 700;
}
.saved-history-head strong {
    color: var(--cw-primary);
    font-family: var(--cw-font-heading);
    font-size: 1.15rem;
}
.saved-history-chart {
    border-radius: 12px;
    background: #fff;
}

/* Product comparison detail */
.product-detail-main {
    display: grid;
    gap: var(--space-lg);
    padding: var(--space-md) 0 var(--space-section);
}
.product-detail-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 0.32fr);
    gap: var(--space-lg);
    align-items: end;
}
.product-detail-title {
    max-width: 18ch;
    margin: 0;
    color: var(--cw-ink);
    font-family: var(--cw-font-heading);
    font-size: clamp(2.2rem, 5vw, 4.2rem);
    line-height: 1.02;
    letter-spacing: 0;
}
.product-detail-lead {
    max-width: 42rem;
    margin: var(--space-md) 0 0;
    color: var(--text-muted);
    font-size: 1.08rem;
}
.product-detail-cheapest,
.product-store-panel,
.product-store-card {
    border: 1px solid var(--cw-border);
    border-radius: var(--radius-card);
    background: #fff;
    box-shadow: var(--cw-shadow);
}
.product-detail-cheapest {
    padding: var(--space-md);
}
.product-detail-cheapest span,
.product-detail-cheapest p {
    margin: 0;
    color: var(--text-muted);
    font-weight: 700;
}
.product-detail-cheapest strong {
    display: block;
    margin: 0.35rem 0;
    color: var(--cw-primary);
    font-family: var(--cw-font-heading);
    font-size: 2.4rem;
    line-height: 1;
}
.product-store-panel {
    padding: var(--space-md);
}
.product-store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: var(--space-md);
}
.product-store-card {
    display: grid;
    gap: var(--space-md);
    padding: var(--space-md);
}
.product-store-card.is-cheapest {
    border-color: oklch(0.52 0.12 255 / 0.22);
    background: var(--cw-primary-wash);
}
.product-store-head {
    display: flex;
    justify-content: space-between;
    gap: var(--space-sm);
    align-items: center;
}
.product-store-body {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: var(--space-sm);
    align-items: start;
}
.product-store-body:has(> div:first-child) {
    grid-template-columns: 1fr;
}
.product-store-image {
    width: 92px;
    height: 92px;
    object-fit: contain;
}
.product-store-body h3,
.product-store-body p {
    margin: 0;
}
.product-store-body h3 {
    color: var(--cw-ink);
    font-size: 1.05rem;
    line-height: 1.3;
}
.product-store-body p {
    color: var(--text-muted);
    font-weight: 700;
}
.product-store-actions {
    margin-top: auto;
}

.product-info-panel {
    border: 1px solid var(--cw-border);
    border-radius: var(--radius-card);
    background: #fff;
    box-shadow: var(--cw-shadow);
    padding: var(--space-md);
    display: grid;
    gap: var(--space-md);
}
.product-info-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
    gap: var(--space-sm) var(--space-md);
    margin: 0;
}
.product-info-facts > div {
    display: grid;
    gap: 0.2rem;
}
.product-info-facts dt {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.product-info-facts dd {
    margin: 0;
    color: var(--cw-ink);
    font-size: 0.98rem;
    line-height: 1.35;
}
.product-info-block h3 {
    margin: 0 0 0.4rem;
    color: var(--cw-ink);
    font-family: var(--cw-font-heading);
    font-size: 1.05rem;
}
.product-info-block p {
    margin: 0;
    color: var(--cw-ink);
    line-height: 1.45;
    white-space: pre-wrap;
}
.product-info-muted {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9em;
}
.product-nutrition-table {
    width: min(100%, 28rem);
    border-collapse: collapse;
}
.product-nutrition-table th,
.product-nutrition-table td {
    padding: 0.45rem 0.55rem;
    border-bottom: 1px solid var(--cw-border);
    text-align: left;
    font-size: 0.92rem;
}
.product-nutrition-table th {
    color: var(--text-muted);
    font-weight: 600;
    width: 65%;
}
.product-nutrition-table td {
    color: var(--cw-ink);
    font-variant-numeric: tabular-nums;
}
.product-store-meta {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.35rem;
    color: var(--cw-ink);
    font-size: 0.82rem;
    line-height: 1.35;
}
.product-store-meta li span {
    display: block;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

@media (max-width: 860px) {
    .history-app,
    .history-filter-form,
    .history-grid,
    .product-detail-hero {
        grid-template-columns: 1fr;
    }
    .history-live-head span {
        text-align: left;
    }
    .history-filter-submit {
        width: 100%;
    }
    .history-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .history-main {
        padding-top: var(--space-md);
    }
    .history-app {
        gap: var(--space-lg);
        padding-top: var(--space-lg);
    }
    .history-title {
        font-size: 2.1rem;
    }
    .history-lead {
        font-size: 1rem;
        margin-bottom: var(--space-md);
    }
    .history-panel,
    .history-product-picker {
        padding: var(--space-sm);
    }
    .history-live-card {
        padding: var(--space-md);
    }
    .history-stats {
        grid-template-columns: 1fr;
    }
    .history-panel-head,
    .saved-history-head {
        flex-direction: column;
    }
}

/* Search experience refresh */
.page-search {
    background: linear-gradient(180deg, #f7f8f7 0%, #ffffff 58%);
}
.page-search .app-wrap {
    max-width: 1180px;
}
.page-search .search-header {
    border-bottom: none;
    margin: var(--space-lg) 0 var(--space-sm);
    padding: 0;
}
.page-search .search-results-label {
    max-width: 18ch;
    font-size: 2.6rem;
    line-height: 1;
    font-weight: 900;
}
.page-search .search-results-label span {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--cw-n500);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.page-search .search-results-label strong {
    display: block;
    color: var(--cw-ink);
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    overflow-wrap: anywhere;
}
.page-search .search-main {
    display: grid;
    gap: var(--space-md);
}
.page-search .back {
    width: fit-content;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    color: var(--text-muted);
    font-weight: 700;
}
.page-search .search-form-section {
    max-width: 40rem;
    padding: 0.4rem;
    border: 1px solid var(--cw-border-subtle);
    border-radius: var(--cw-radius-search);
    background: var(--cw-surface);
    box-shadow: var(--cw-shadow-search);
}
.page-search .search-form-inline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
    max-width: none;
}
.page-search .search-input {
    max-width: none;
    min-height: 52px;
    border-radius: 14px;
    border: 0;
    background: transparent;
}
.page-search .search-submit {
    min-height: 52px;
    border-radius: 14px;
    box-shadow: none;
    color: var(--cw-primary-ink);
}
}
.page-search .data-freshness-line {
    margin: calc(-1 * var(--space-xs)) 0 0;
    color: var(--text-muted);
}
.page-search .search-mode,
.page-search .search-mode-inline,
.page-search .search-sort {
    width: fit-content;
    max-width: 100%;
    margin: 0;
    padding: 0.25rem;
    gap: 0;
    border: 1px solid var(--cw-border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(33, 41, 34, 0.04);
}
.page-search .search-sort-label,
.page-search .search-sort-sep,
.page-search .search-sort-inline {
    display: none;
}
.page-search .search-sort-link,
.page-search .search-mode-link {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    color: var(--text-muted);
    font-weight: 700;
    text-decoration: none;
}
.page-search .search-sort-link.is-active,
.page-search .search-mode-link.is-active {
    background: var(--cw-primary-light);
    color: var(--cw-primary);
}
.page-search .comparison-block {
    padding: var(--space-md);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(33, 41, 34, 0.06);
}
.page-search .comparison-heading {
    margin-bottom: var(--space-sm);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.page-search .comparison-rows {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
    gap: var(--space-sm);
}
.page-search .comparison-row {
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xs);
    padding: var(--space-sm);
    border: 1px solid var(--cw-n100);
    border-radius: 8px;
    background: #fff;
}
.page-search .comparison-row-cheapest {
    margin: 0;
    border-color: oklch(0.52 0.12 255 / 0.22);
    background: var(--cw-primary-wash);
}
.page-search .comparison-price {
    font-size: 1.55rem;
}
.page-search .comparison-cheapest-badge {
    display: inline-flex;
    margin-left: 0;
    margin-top: 0.2rem;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    background: #fff;
}
.page-search .best-per-store {
    display: none;
}
.page-search .see-all-results {
    margin: 0 0 var(--space-xl);
}
.page-search .see-all-btn,
.page-search button.see-all-btn {
    display: none !important;
}
.page-search .see-all-content[hidden] {
    display: block;
}
.page-search .see-all-content {
    margin-top: 0;
}
.page-search .results-product-type {
    margin-bottom: var(--space-xl);
}
.page-search .results-product-type-title {
    margin-top: var(--space-sm);
    border-bottom: none;
}
.page-search .results-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 205px), 1fr));
    gap: var(--space-sm);
}
.page-search .product-card-premium {
    min-width: 0;
    padding: var(--space-sm);
    gap: 0.7rem;
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(33, 41, 34, 0.05);
}
.page-search .product-card-premium:hover {
    transform: none;
    box-shadow: 0 10px 26px rgba(33, 41, 34, 0.08);
}
.page-search .product-card-premium .product-card-image-link {
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    background: #fff;
}
.page-search .product-card-premium .product-card-title {
    min-height: 2.8em;
    font-weight: 750;
    overflow-wrap: anywhere;
}
.page-search .product-card-premium .product-card-price {
    font-size: 1.55rem;
}
.page-search .product-card-actions {
    grid-template-columns: 1fr;
    min-width: 0;
    width: 100%;
}
.page-search .product-card-premium .product-card-actions .product-add-btn,
.page-search .product-card-premium .product-card-actions .product-save-btn {
    grid-column: auto;
    grid-row: auto;
    justify-self: stretch;
    align-self: stretch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border-radius: 8px;
}
.page-search .retailer-pill.store-identity {
    width: 100%;
    overflow: hidden;
}
.page-search .retailer-pill.store-identity span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.page-search .search-empty {
    border-radius: 8px;
}

@media (max-width: 820px) {
    .page-search .site-header {
        padding-bottom: var(--space-sm);
    }
    .page-search .site-primary-nav,
    .page-search .site-nav--secondary {
        display: none;
    }
    .page-search .basket-trigger:not(.has-items) {
        display: none;
    }
    .page-search .search-results-label {
        max-width: 14ch;
        font-size: 2.15rem;
    }
}

@media (max-width: 520px) {
    .page-search .app-wrap {
        padding-left: var(--space-sm);
        padding-right: var(--space-sm);
    }
    .page-search .search-form-section {
        padding: 0.65rem;
    }
    .page-search .search-form-inline {
        grid-template-columns: 1fr;
    }
    .page-search .search-mode,
    .page-search .search-mode-inline,
    .page-search .search-sort {
        width: 100%;
    }
    .page-search .search-sort-link,
    .page-search .search-mode-link {
        flex: 1 1 0;
        padding-left: 0.45rem;
        padding-right: 0.45rem;
        text-align: center;
    }
    .page-search .comparison-rows,
    .page-search .results-cards-grid {
        grid-template-columns: 1fr;
    }
    .page-search .product-card-premium {
        display: grid;
        grid-template-columns: 92px minmax(0, 1fr);
        align-items: start;
    }
    .page-search .product-card-premium .product-card-image-link {
        grid-row: 1 / 5;
    }
    .page-search .product-card-actions {
        grid-column: 1 / -1;
    }
}
