/**
 * koopmaat-compare — calm side-by-side compare + picker.
 *
 * Palette: navy structure, teal CTA, ORANGE accent (brand) — orange is the
 * "look here" color for diff hairlines, group dots, and the picker pill, so it
 * threads through the experience as a wayfinding cue without picking winners.
 *
 * No row borders. Same rows: zero decoration. Differing rows: 2px orange
 * hairline at ~60% opacity. Group titles in muted-navy with a small orange
 * dot. Compare lives inside a soft cream-wash card; mobile sticky header
 * tracks columns when you scroll.
 */

.kc-compare,
.kc-picker,
.kc-picker-cta,
.kc-page-header {
    --kc-navy: #1f3a5f;
    --kc-navy-soft: #2d4a73;
    --kc-teal: #3fa38a;
    --kc-teal-soft: #5fb5a0;
    --kc-orange: #e8794b;
    --kc-orange-soft: #f4a784;
    --kc-orange-wash: #fdf5ef;
    --kc-ink: #1a2330;
    --kc-ink-soft: #4a5568;
    --kc-muted: #8b95a5;
    --kc-muted-soft: #b8c0cb;
    --kc-line: #eef0f3;
    --kc-bg: #ffffff;
    --kc-bg-card: #fafbfc;
    --kc-bg-wash: #fbf8f4;
    --kc-radius: 14px;
    --kc-shadow-card: 0 1px 2px rgba(31, 58, 95, 0.04), 0 4px 16px rgba(31, 58, 95, 0.06);
    --kc-shadow-modal: 0 8px 24px rgba(31, 58, 95, 0.12), 0 24px 48px rgba(31, 58, 95, 0.12);
}

/* ──────────── Page header row (H1 + pill) ──────────── */

.kc-page-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.kc-page-header .page-title {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
}

/* ──────────── Picker CTA pill ──────────── */

.kc-picker-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.95rem;
    min-height: 44px; /* mobile-safe tap target */
    background: transparent;
    color: var(--kc-orange);
    border: 1.5px solid var(--kc-orange);
    border-radius: 999px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.88rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(232, 121, 75, 0.06);
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
    white-space: nowrap;
    flex: 0 0 auto;
}
.kc-picker-cta:hover {
    background: var(--kc-orange);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(232, 121, 75, 0.2);
}
.kc-picker-cta:focus-visible {
    outline: 3px solid rgba(232, 121, 75, 0.35);
    outline-offset: 2px;
}
.kc-picker-cta__icon { display: inline-flex; }
.kc-picker-cta__label { font-weight: 600; }

/* ──────────── Compare section ──────────── */

.kc-compare {
    width: min(100%, 920px);
    margin: 1.5rem auto 2.5rem;
    padding: 2rem 2rem 1.5rem;
    color: var(--kc-ink);
    font-family: inherit;
    line-height: 1.6;
    background: var(--kc-bg-wash);
    border-radius: var(--kc-radius);
    box-shadow: var(--kc-shadow-card);
    box-sizing: border-box;
}

/* ── Head ── */
.kc-compare__head {
    text-align: center;
    margin-bottom: 1.5rem;
}
.kc-compare__title {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--kc-navy);
    letter-spacing: -0.01em;
    margin: 0 0 0.35rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}
.kc-compare__sub {
    color: var(--kc-muted);
    font-size: 0.92rem;
    margin: 0 0 0.85rem;
}
/* Editorial CTA — outline-only teal. Calmer than a filled pill so it doesn't
   compete visually with the orange "Bekijk prijs" buy pills. Fills on hover. */
.kc-compare__editorial-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 1.1rem;
    background: transparent;
    color: var(--kc-teal);
    border: 1.5px solid var(--kc-teal);
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1;
    box-sizing: border-box;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.kc-compare__editorial-cta:hover {
    background: var(--kc-teal);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(63, 163, 138, 0.18);
}
.kc-compare__editorial-cta:focus-visible {
    outline: 3px solid rgba(63, 163, 138, 0.3);
    outline-offset: 2px;
}

/* ── Sparse-data banner ── */
.kc-compare__sparse-banner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1rem;
    margin-bottom: 1.25rem;
    background: var(--kc-orange-wash);
    border-left: 3px solid var(--kc-orange);
    border-radius: 6px;
    color: var(--kc-ink-soft);
    font-size: 0.88rem;
    line-height: 1.5;
}
.kc-compare__sparse-icon { font-size: 1rem; flex-shrink: 0; opacity: 0.8; }
.kc-compare__sparse-text strong { color: var(--kc-ink); }

/* ── Item header strip (sticky on scroll, both desktop AND mobile) ── */
.kc-items {
    position: sticky;
    /* Theme's .site-header is itself sticky at top:0; its height differs by
       viewport (65px desktop, 57px mobile, sometimes changed by theme updates).
       compare-ui.js measures it live and writes --kc-sticky-top on :root, so
       this offset stays accurate without baking in a breakpoint. 65px fallback
       covers the no-JS case on desktop. Admin-bar selectors below add the WP
       bar height on top. */
    top: var(--kc-sticky-top, 65px);
    z-index: 10;
    display: grid;
    grid-template-columns: 36% 1fr 1fr;
    /* start-align so images top-align regardless of name length (1 vs 2 lines).
       Bottom-alignment caused images to shift down when one name wrapped. */
    align-items: start;
    /* column gap prevents bridge-button (200px fixed) from overlapping the
       adjacent column when the column width is <200px. Mobile breakpoint sets
       its own gap below. */
    column-gap: 0.75rem;
    row-gap: 0;
    padding: 1rem 0 1.25rem;
    background: var(--kc-bg-wash);
    background: linear-gradient(180deg, var(--kc-bg-wash) 85%, rgba(251, 248, 244, 0.7));
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-bottom: 1px solid var(--kc-line);
    margin-bottom: 0.5rem;
}
.kc-items::before { content: ''; /* aligns with row labels */ }

/* Logged-in admin view: WP admin bar (32px / 46px on narrow) sits ABOVE the
   theme's .site-header. So sticky offset = admin bar + theme header. */
body.admin-bar .kc-items { top: calc(var(--kc-sticky-top, 65px) + 32px); }
@media (max-width: 782px) {
    body.admin-bar .kc-items { top: calc(var(--kc-sticky-top, 65px) + 46px); }
}

.kc-item {
    text-align: center;
    padding: 0 0.5rem;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.kc-item__img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin: 0 0 0.5rem;
    background: var(--kc-bg);
    border-radius: 50%;
    padding: 6px;
    box-shadow: inset 0 0 0 1px var(--kc-line);
}
.kc-item__name {
    font-weight: 600;
    font-size: 0.96rem;
    color: var(--kc-navy);
    margin-bottom: 0.15rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
    /* Reserve 3-line height so prices + buy pills align across items even when
       one product name wraps to 3 lines (e.g. "Philips Sonicare DiamondClean
       Prestige 9900") and the other stays on 1 or 2. */
    min-height: calc(3 * 1.3em);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    text-align: center;
}
.kc-item__price {
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--kc-ink);
    line-height: 1.2;
    margin-bottom: 0.2rem;
    font-variant-numeric: tabular-nums;
}
.kc-item__no-price {
    color: var(--kc-muted);
    font-weight: 400;
    font-size: 0.85rem;
}
/* Buy pill — fallback for products with <2 offers in koopmaat_offers (the bridge
   plugin only upgrades anchors when there are ≥2 offers; for solo-offer products
   the anchor stays as our HTML). Visually mirrors the bridge-upgraded button
   styling below so the strip looks consistent regardless of offer count. */
.kc-item__buy {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.12rem;
    margin-top: 0.5rem;
    margin-bottom: 0.4rem;
    padding: 0.45rem 1.1rem;
    min-height: 44px;
    max-width: 100%;
    background: var(--kc-orange);
    color: #fff;
    border: 1.5px solid var(--kc-orange);
    border-radius: 999px;
    text-decoration: none;
    line-height: 1.15;
    box-shadow: 0 1px 2px rgba(232, 121, 75, 0.18), 0 4px 12px rgba(232, 121, 75, 0.14);
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
    text-align: center;
}
.kc-item__buy-primary {
    display: block;
    font-weight: 600;
    font-size: 0.92rem;
    color: #fff;
}
.kc-item__buy-secondary {
    display: block;
    font-weight: 500;
    font-size: 0.72rem;
    color: #fff;
    opacity: 0.85;
}
.kc-item__buy:hover {
    background: #d56838;
    border-color: #d56838;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(232, 121, 75, 0.25), 0 6px 18px rgba(232, 121, 75, 0.2);
}
.kc-item__buy:focus-visible {
    outline: 3px solid rgba(232, 121, 75, 0.35);
    outline-offset: 2px;
}

/* Bridge-upgraded button: re-color to orange in compare context for the vibe.
   The bridge uses teal site-wide; here we override to orange so the compare
   page has its own identity (matching the diff hairlines + group dots).
   Also force width:auto + max-width:100% to override the bridge's hardcoded
   width:200px, which overflows columns narrower than 200px (which ours are). */
.kc-item .item-cta-compare-primary {
    background: var(--kc-orange);
    background-image: none;
    border-color: var(--kc-orange);
    box-shadow: 0 1px 2px rgba(232, 121, 75, 0.18), 0 4px 12px rgba(232, 121, 75, 0.14);
    margin-top: 0.55rem;
    margin-bottom: 0.45rem;
    /* Bridge plugin's inline CSS sets min-width:200px on its CTA button. Our
       compare columns are ~191px wide, so the button overflows and the two
       adjacent pills touch. Override min-width to 0 (same pattern the bridge
       itself uses for .product-card .item-cta-compare-primary). Combined with
       max-width:100% the button shrinks to its column. */
    min-width: 0 !important;
    max-width: 100% !important;
    width: auto !important;
    padding: 0.55rem 0.9rem !important;
    box-sizing: border-box;
}
.kc-item .item-cta-compare-primary:hover {
    background: #d56838;
    background-image: none;
    border-color: #d56838;
    box-shadow: 0 2px 6px rgba(232, 121, 75, 0.25), 0 6px 18px rgba(232, 121, 75, 0.2);
}
.kc-item .item-cta-compare-primary:focus-visible {
    outline: 3px solid rgba(232, 121, 75, 0.35);
    outline-offset: 2px;
}
/* Bridge's default button text is sized for product cards (~16-17px primary).
   Inside our compare context that reads oversized — match the bridge's own
   .product-card overrides for desktop, leave mobile alone (it's already fine). */
@media (min-width: 641px) {
    .kc-item .item-cta-compare-primary .cta-line-1 { font-size: 13.5px; }
    .kc-item .item-cta-compare-primary .cta-line-2 { font-size: 10.5px; }
}

.kc-item__from {
    display: inline-block;
    font-size: 0.72rem;
    color: var(--kc-muted);
    text-decoration: none;
    line-height: 1.3;
    padding: 0;
    margin-top: 0.1rem;
    border-bottom: 1px dotted transparent;
}
.kc-item__from:hover { color: var(--kc-navy); border-bottom-color: var(--kc-navy); }

/* ── Groups ── */
.kc-groups {
    display: flex;
    flex-direction: column;
    gap: 2.25rem;
    padding-top: 1.5rem;
}
.kc-group { display: flex; flex-direction: column; gap: 0.15rem; }
.kc-group__title {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--kc-navy-soft);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin: 0 0 0.85rem;
    padding: 0 0.5rem;
}
.kc-group__title::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--kc-orange);
    border-radius: 50%;
    flex-shrink: 0;
    opacity: 0.85;
}

/* ── Differing rows ── */
.kc-row {
    display: grid;
    grid-template-columns: 36% 1fr 1fr;
    align-items: baseline;
    padding: 0.7rem 0.5rem;
    border-radius: 6px;
    transition: background 0.12s ease;
}
.kc-row:hover { background: rgba(255, 255, 255, 0.6); }

.kc-row__label {
    color: var(--kc-ink-soft);
    font-weight: 500;
    font-size: 0.94rem;
    position: relative;
    padding-left: 0.85rem;
    line-height: 1.4;
}

/* THE ONLY diff signal: orange hairline before differing-row label. Same rows: nothing. */
.kc-row--differs .kc-row__label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 18px;
    background: var(--kc-orange);
    border-radius: 2px;
    opacity: 0.65;
}

.kc-row__cell {
    color: var(--kc-ink);
    font-size: 0.94rem;
    padding: 0 0.5rem;
    line-height: 1.4;
    min-width: 0;
    /* Center-align value cells so they sit directly under their product card
       (image + name + price + buy pill are all centered in their columns). */
    text-align: center;
}
.kc-row__value {
    display: block;
    font-weight: 600;
    color: var(--kc-ink);
    font-variant-numeric: tabular-nums;
}
/* "—" sparse cells visually softer — class added in render.php when formatted=="—" */
.kc-row__value--empty { color: var(--kc-muted-soft); font-weight: 400; }
.kc-row__formula {
    display: block;
    font-size: 0.76rem;
    color: var(--kc-muted);
    margin-top: 0.2rem;
    line-height: 1.35;
    font-variant-numeric: tabular-nums;
}

/* ── Overeenkomsten / Beide roll-up line ── */
.kc-overlap {
    display: grid;
    grid-template-columns: 36% 1fr;
    align-items: baseline;
    padding: 0.85rem 0.5rem 0.85rem 1.35rem;
    margin-top: 0.4rem;
    background: rgba(255, 255, 255, 0.55);
    border-radius: 6px;
}
.kc-overlap__label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--kc-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.kc-overlap__list {
    color: var(--kc-ink-soft);
    font-size: 0.88rem;
    line-height: 1.65;
    padding: 0 0.5rem;
}

/* ── Foot ── */
.kc-compare__foot {
    margin-top: 2rem;
    padding: 0.5rem 1rem 0;
    text-align: center;
}
.kc-compare__neutral-note {
    color: var(--kc-muted);
    font-size: 0.8rem;
    margin: 0;
    font-style: italic;
    letter-spacing: 0.02em;
}

/* ── Errors ── */
.kc-compare__error {
    max-width: 600px;
    margin: 2rem auto;
    padding: 1rem;
    background: #fef2f2;
    border-left: 3px solid #dc2626;
    border-radius: 6px;
    color: #991b1b;
    font-size: 0.95rem;
}

/* ──────────── Picker modal (tap-twice grid) ──────────── */

.kc-picker {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.kc-picker[hidden] { display: none; }

.kc-picker__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(26, 35, 48, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: auto;
}
.kc-picker--open .kc-picker__backdrop { opacity: 1; }

/*
 * Sheet is a fixed-height flex column with THREE zones:
 *   head (fixed) · grid-wrap (the ONE scroll surface) · foot (fixed)
 * The sheet itself never scrolls — only the grid-wrap does.
 */
.kc-picker__sheet {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 600px;
    height: min(640px, calc(100vh - 4rem));
    background: var(--kc-bg);
    border-radius: var(--kc-radius);
    box-shadow: var(--kc-shadow-modal);
    overflow: hidden; /* clip rounded corners */
    margin: 1rem;
    pointer-events: auto;
    transform: translateY(16px) scale(0.98);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.kc-picker--open .kc-picker__sheet { transform: translateY(0) scale(1); opacity: 1; }

/* ── Head (fixed top) ── */
.kc-picker__head {
    flex: 0 0 auto;
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid var(--kc-line);
    background: var(--kc-bg);
}
.kc-picker__head-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
}
.kc-picker__head-text { flex: 1 1 auto; min-width: 0; }
.kc-picker__title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--kc-navy);
    margin: 0 0 0.25rem;
    letter-spacing: -0.01em;
    line-height: 1.25;
}
.kc-picker__sub {
    color: var(--kc-muted);
    font-size: 0.88rem;
    margin: 0;
    line-height: 1.5;
}
.kc-picker__close {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 999px;
    cursor: pointer;
    color: var(--kc-muted);
    transition: background 0.12s ease, color 0.12s ease;
    margin: -0.4rem -0.4rem 0 0;
}
.kc-picker__close:hover { background: var(--kc-bg-card); color: var(--kc-ink); }

/* Chips */
.kc-picker__chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.kc-picker__loading,
.kc-picker__empty,
.kc-picker__error {
    color: var(--kc-muted);
    font-size: 0.9rem;
    padding: 0.35rem 0;
}
.kc-picker__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    min-height: 36px;
    background: var(--kc-bg-card);
    border: 1.5px solid transparent;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.86rem;
    color: var(--kc-ink-soft);
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
    box-sizing: border-box;
}
.kc-picker__chip:hover { background: #f1f3f6; }
.kc-picker__chip--active {
    background: var(--kc-navy);
    border-color: var(--kc-navy);
    color: #fff;
}
.kc-picker__chip--active .kc-picker__chip-count { color: rgba(255, 255, 255, 0.75); }
.kc-picker__chip-count { font-size: 0.74rem; color: var(--kc-muted); font-weight: 500; }

/* Parent chips — larger touch target, slight different look */
.kc-picker__chip--parent {
    font-size: 0.92rem;
    padding: 0.55rem 1rem;
}

/* Back-to-parents chip in subcategory view */
.kc-picker__chip--back {
    background: transparent;
    border-color: var(--kc-line);
    color: var(--kc-navy);
    font-weight: 600;
    padding-left: 0.7rem;
}
.kc-picker__chip--back:hover { background: var(--kc-bg-card); border-color: var(--kc-navy); }
.kc-picker__chip-back-arrow { font-size: 1rem; line-height: 1; margin-right: 0.2rem; }
.kc-picker__chip-back-label { font-size: 0.86rem; }

/* ── Grid wrap (the ONE scroll surface) ── */
.kc-picker__grid-wrap {
    flex: 1 1 auto;
    min-height: 0; /* required so flex child can shrink + scroll */
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--kc-bg-card);
    -webkit-overflow-scrolling: touch;
}
.kc-picker__grid-empty {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--kc-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}
.kc-picker__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    padding: 1rem 1.25rem 1.25rem;
}
.kc-picker__grid[hidden] { display: none; }

/* Cards */
.kc-picker__card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 1rem 0.65rem 0.85rem;
    background: var(--kc-bg);
    border: 1.5px solid var(--kc-line);
    border-radius: 12px;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.12s ease, background 0.12s ease, transform 0.1s ease, box-shadow 0.12s ease;
    min-height: 140px;
}
.kc-picker__card:hover {
    border-color: var(--kc-orange-soft);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(232, 121, 75, 0.08);
}
.kc-picker__card--selected {
    border-color: var(--kc-orange);
    background: var(--kc-orange-wash);
    box-shadow: 0 4px 14px rgba(232, 121, 75, 0.15);
}
.kc-picker__card--selected:hover { transform: translateY(-1px); }

.kc-picker__card-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 0.15rem;
}
.kc-picker__card-img--placeholder {
    width: 60px;
    height: 60px;
    background: var(--kc-bg-card);
    border-radius: 6px;
}
.kc-picker__card-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--kc-ink);
    line-height: 1.3;
    overflow-wrap: anywhere;
    text-align: center;
}

/* 1 / 2 badge in upper-right */
.kc-picker__card-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--kc-orange);
    color: #fff;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(232, 121, 75, 0.35);
    line-height: 1;
}
.kc-picker__card-badge[hidden] { display: none; }

/* ── Foot (fixed bottom) ── */
.kc-picker__foot {
    flex: 0 0 auto;
    padding: 0.85rem 1.5rem 1.25rem;
    background: var(--kc-bg);
    border-top: 1px solid var(--kc-line);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.kc-picker__progress {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}
.kc-picker__progress-text {
    color: var(--kc-muted);
    font-size: 0.82rem;
    line-height: 1.4;
    flex: 1 1 auto;
}
.kc-picker__progress-count {
    color: var(--kc-ink-soft);
    font-size: 0.85rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    flex: 0 0 auto;
}
.kc-picker__submit {
    padding: 0.85rem 1rem;
    min-height: 48px;
    background: var(--kc-orange);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.98rem;
    cursor: pointer;
    transition: background 0.12s ease, transform 0.1s ease, opacity 0.12s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.kc-picker__submit:hover:not(:disabled) {
    background: #d56838;
    transform: translateY(-1px);
}
.kc-picker__submit:disabled {
    background: var(--kc-line);
    color: var(--kc-muted);
    cursor: not-allowed;
}

/* ──────────── Mobile (≤640px) ──────────── */

@media (max-width: 640px) {
    /* Page header row stacks; pill demoted to right-aligned secondary */
    .kc-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .kc-page-header .kc-picker-cta {
        align-self: stretch;
        justify-content: center;
        font-size: 0.92rem;
    }

    .kc-compare {
        padding: 1.25rem 0.75rem 1rem;
        margin: 1rem auto 2rem;
        border-radius: 10px;
    }
    .kc-compare__title { font-size: 1.2rem; line-height: 1.3; }

    /* Item header stays sticky — critical for mobile UX so columns are always identified */
    .kc-items {
        grid-template-columns: 1fr 1fr;
        padding: 0.85rem 0;
        gap: 0.5rem;
    }
    .kc-items::before { display: none; }
    .kc-item__img { width: 52px; height: 52px; padding: 4px; }
    .kc-item__name { font-size: 0.88rem; }
    .kc-item__price { font-size: 1.02rem; }
    .kc-item__from { font-size: 0.7rem; padding: 0.05rem 0.35rem; }

    .kc-groups { gap: 1.75rem; padding-top: 1rem; }
    .kc-group__title { font-size: 0.74rem; margin-bottom: 0.65rem; }
    .kc-group__title::before { width: 7px; height: 7px; }

    /* Rows: 3-cell grid with label on its own row above two values. The sticky
       header above tells the user which value is which product, so we don't
       need inline labels. */
    .kc-row {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 0.15rem 0.4rem;
        padding: 0.65rem 0.5rem;
    }
    .kc-row__label {
        grid-column: 1 / -1;
        grid-row: 1;
        font-size: 0.74rem;
        font-weight: 700;
        color: var(--kc-muted);
        text-transform: uppercase;
        letter-spacing: 0.05em;
        padding-left: 0.65rem;
        margin-bottom: 0.1rem;
    }
    .kc-row--differs .kc-row__label::before {
        height: 12px;
        top: 50%;
    }
    .kc-row__cell {
        grid-row: 2;
        padding: 0 0.5rem;
        font-size: 0.9rem;
    }
    .kc-row__formula { font-size: 0.7rem; }

    .kc-overlap {
        grid-template-columns: 1fr;
        gap: 0.2rem;
        padding: 0.75rem 0.75rem 0.75rem 1rem;
    }
    .kc-overlap__list { padding: 0; font-size: 0.85rem; }

    .kc-compare__sparse-banner {
        font-size: 0.84rem;
        padding: 0.6rem 0.75rem;
    }

    /* Picker: bottom sheet on mobile */
    .kc-picker { align-items: flex-end; }
    .kc-picker__sheet {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 16px 16px 0 0;
        height: 88vh;
        transform: translateY(100%);
    }
    .kc-picker--open .kc-picker__sheet { transform: translateY(0); }

    .kc-picker__head { padding: 1.25rem 1.1rem 0.85rem; }
    .kc-picker__title { font-size: 1.15rem; }
    .kc-picker__sub { font-size: 0.85rem; }

    .kc-picker__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.65rem;
        padding: 0.85rem 1rem 1rem;
    }
    .kc-picker__card { padding: 0.85rem 0.5rem 0.7rem; min-height: 125px; }
    .kc-picker__card-img,
    .kc-picker__card-img--placeholder { width: 52px; height: 52px; }
    .kc-picker__card-name { font-size: 0.8rem; }

    .kc-picker__foot { padding: 0.7rem 1.1rem 1rem; }
    .kc-picker__submit { font-size: 0.95rem; }
}

/* Wider breakpoint — narrow column inside theme container */
@media (min-width: 641px) and (max-width: 880px) {
    .kc-compare { padding: 1.5rem 1.25rem; }
}
