/*
 * styles.css — Clerkenwell Supermarkets, product-specific styles.
 *
 * Loaded AFTER app.css + theme-dark.css + theme-light.css so it can override
 * any of those rules.  This file owns:
 *
 *   - Supermarket-pill colour swatches (.s-tesco / .s-sainsburys / ...)
 *   - Search results layout (.product-card, .group-card, .offering)
 *   - Sample basket comparator (.basket-super, .basket-items)
 *   - Receipt-scanner basket-builder (.receipt-row, .receipt-panel)
 *   - Weekly report placeholder (.weekly-report)
 *
 * Where colours are needed for surfaces or text, this file uses the
 * Trains theme tokens (--bg, --panel, --text-bright, --text-dim) so the
 * page works correctly in both light and dark mode.  Supermarket brand
 * colours (Tesco blue, Sainsbury's orange, etc.) are kept as literal
 * brand hex values because they identify the supermarket and should not
 * shift with theme.
 */


/* ===================================================================
 * Form controls — theme-aware bare input/select/textarea styling.
 *
 * The Trains shell scopes input styling to `.search-field input/select`
 * (which the Trains search-widget DOM uses).  The Supermarkets DOM uses
 * BARE <input>, <select>, <textarea> elements, so we need a baseline
 * that reads the theme tokens and produces dark-mode-correct surfaces
 * by default.
 * =================================================================== */

input[type="text"],
input[type="search"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95em;
    padding: 8px 12px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-sizing: border-box;
}

input[type="text"]:focus,
input[type="search"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #2560e6;
    box-shadow: 0 0 0 3px rgba(37, 96, 230, 0.18);
}

/* Native dropdown caret — render via background-image so dark-mode <select>
 * doesn't draw the OS-default chevron on a now-white default surface.        */
select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%23a3b3c8' d='M0 0l5 6 5-6z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
    cursor: pointer;
}

select option {
    background: var(--panel);
    color: var(--text);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-dim);
    opacity: 0.6;
}


/* ===================================================================
 * Supermarket pill swatches.
 * =================================================================== */

.supermarket {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 700;
    color: #ffffff;
    font-size: 1.05em;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.s-tesco      { background: #00539f; }
.s-sainsburys { background: #f06c00; }
.s-waitrose   { background: #5d8a3c; }
.s-asda       { background: #78b93f; }
.s-iceland    { background: #e31837; }
.s-coop       { background: #00b1e7; }
.s-lidl       { background: #0050aa; }
.s-aldi       { background: #002f6c; }
.s-morrisons  { background: #c9a600; }
.s-ocado      { background: #6a2d85; }


/* ===================================================================
 * Tab 1 — Product search.
 * =================================================================== */

.search-bar {
    max-width: 700px;
    margin: 24px auto 0;
    padding: 0 16px;
    position: relative;
}
.search-bar input {
    width: 100%;
    padding: 14px 18px;
    font-size: 1.05em;
}

.suggestions {
    position: absolute;
    top: 100%;
    left: 16px;
    right: 16px;
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
    max-height: 320px;
    overflow-y: auto;
    z-index: 10;
    display: none;
}
.suggestions.open { display: block; }
.suggestion-item {
    padding: 10px 18px;
    cursor: pointer;
    font-size: 0.95em;
    border-bottom: 1px solid var(--panel-border);
    color: var(--text-bright);
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover, .suggestion-item.active { background: rgba(37, 96, 230, 0.08); }
.suggestion-item mark { background: #fff3a3; padding: 0 1px; }

.filters {
    max-width: 900px;
    margin: 14px auto 0;
    padding: 0 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}
.filters label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    border-radius: 4px;
    transition: opacity 0.15s;
    opacity: 0.45;
}
.filters label:has(input:checked) { opacity: 1; }
.filters input[type="checkbox"] { cursor: pointer; }

.sort-bar {
    max-width: 700px;
    margin: 12px auto 0;
    padding: 0 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    font-size: 0.98em;
    color: var(--text);
    flex-wrap: wrap;
}
.sort-bar label { font-weight: 600; }
.sort-bar__group { margin-left: 8px; font-weight: 500; }
.sort-bar select {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.95em;
    cursor: pointer;
}

.stats {
    text-align: center;
    padding: 12px 16px;
    font-size: 0.85em;
    color: var(--text-dim);
}

.results {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 16px 40px;
}
.result-count { padding: 8px 0; font-size: 0.9em; color: var(--text-dim); }

.product-card {
    background: var(--panel);
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 10px;
    box-shadow: 0 0 0 1px rgba(50, 50, 93, 0.10),
                0 1px 3px 0 rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.product-info { flex: 1; min-width: 0; }
.product-name { font-weight: 600; font-size: 0.98em; color: var(--text-bright); }
.product-name a { color: inherit; text-decoration: none; }
.product-name a:hover { text-decoration: underline; color: #2560e6; }
.product-meta { font-size: 0.88em; color: var(--text-dim); margin-top: 6px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.product-meta .supermarket { font-size: 1em; }

.product-prices { text-align: right; white-space: nowrap; }
.price-main  { font-size: 1.2em;  font-weight: 700; color: #065f46; }
.price-club  { font-size: 0.95em; font-weight: 600; color: #b91c1c; }
.price-unit  { font-size: 0.88em; color: var(--text-dim); margin-top: 2px; }
.price-unit strong { color: var(--text-bright); }
.price-offer { font-size: 0.78em; color: #b91c1c; font-weight: 500; }

.empty {
    background: var(--panel);
    border-radius: 12px;
    text-align: center;
    padding: 40px;
    color: var(--text-dim);
    font-size: 1.05em;
}

.group-card {
    background: var(--panel);
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 12px;
    box-shadow: 0 0 0 1px rgba(50, 50, 93, 0.10),
                0 1px 3px 0 rgba(0, 0, 0, 0.05);
}
.group-header {
    font-weight: 600;
    font-size: 1em;
    color: var(--text-bright);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--panel-border);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.group-spread { font-size: 0.85em; color: #b91c1c; font-weight: 700; }
.group-offerings {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}
.offering {
    padding: 8px 10px;
    background: rgba(50, 50, 93, 0.04);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.offering a { text-decoration: none; color: inherit; display: block; }
.offering a:hover { text-decoration: underline; }
.offering .supermarket { font-size: 0.85em; padding: 2px 6px; }
.offering .price-row { display: flex; justify-content: space-between; align-items: baseline; }
.offering .price-main { font-size: 1.05em; font-weight: 700; color: #065f46; }
.offering .price-per-kg { font-size: 0.8em; color: var(--text-dim); }
.offering.cheapest {
    background: rgba(16, 185, 129, 0.14);
    box-shadow: inset 0 0 0 1px #10b981;
}


/* ===================================================================
 * Tab 2 — Your basket (receipt scanner).
 * =================================================================== */

.receipt-intro {
    max-width: 900px;
    margin: 24px auto 14px;
    padding: 0 16px;
    color: var(--text);
    line-height: 1.5;
}

.receipt-panel {
    max-width: 900px;
    margin: 0 auto 18px;
    padding: 16px 18px;
    background: var(--panel);
    border-radius: 8px;
    box-shadow: 0 0 0 1px rgba(50, 50, 93, 0.10),
                0 1px 3px 0 rgba(0, 0, 0, 0.05);
}
.receipt-origin-row {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 0.95em;
    margin-bottom: 12px;
}
.receipt-origin-row select { padding: 6px 10px; border-radius: 6px; min-width: 160px; }

.receipt-panel__buttons {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.receipt-ocr-status {
    color: var(--text-dim);
    font-size: 0.9em;
    min-height: 1.2em;
}

.receipt-ocr-tips {
    display: none;
    background: rgba(50, 50, 93, 0.04);
    border-radius: 6px;
    padding: 12px 16px;
    margin: 8px 0 12px;
    font-size: 0.9em;
    color: var(--text);
    line-height: 1.5;
}
.receipt-ocr-tips ul { margin: 6px 0 0; padding-left: 22px; }
.receipt-ocr-tips.open { display: block; }

.receipt-photos-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
}
.receipt-photos-actions { display: none; }
.receipt-photos-actions.open { display: block; }
.receipt-cascade-status { color: var(--text-dim); font-size: 0.92em; }

.receipt-import-panel {
    display: none;
    max-width: 900px;
    margin: 0 auto 18px;
    background: var(--panel);
    border-radius: 8px;
    padding: 14px 16px;
    box-shadow: 0 0 0 1px rgba(50, 50, 93, 0.10),
                0 1px 3px 0 rgba(0, 0, 0, 0.05);
}
.receipt-import-panel.open { display: block; }
.receipt-import-hint { margin-bottom: 8px; color: var(--text-dim); font-size: 0.9em; }
.receipt-text {
    width: 100%;
    font-family: "Liberation Mono", ui-monospace, monospace;
    padding: 10px;
    font-size: 13px;
    border-radius: 6px;
}
.receipt-import-actions {
    margin-top: 8px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.receipt-basket-header {
    max-width: 900px;
    margin: 0 auto 8px;
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}
.receipt-basket-title {
    margin: 0;
    color: var(--text-bright);
    font-size: 1.15em;
    line-height: 1;
}

/* "Compare across shops »" — drop the blue fill, use the secondary-button   */
/* shape (transparent bg + 1px border).  Reads as a text-button so the heading */
/* stays the visual focus.  Selector chain beats the .primary-btn rule from    */
/* app.css.                                                                     */
#receipt-run.primary-btn,
#receipt-run.primary-btn.primary-btn-large {
    background: transparent;
    color: var(--text-bright);
    border: 1px solid var(--panel-border);
    box-shadow: none;
    font-weight: 600;
}
#receipt-run.primary-btn:hover {
    background: rgba(37, 96, 230, 0.08);
    border-color: #2560e6;
    color: #2560e6;
}

.receipt-rows {
    max-width: 900px;
    margin: 0 auto 10px;
    padding: 0 16px;
}

.receipt-row {
    display: grid;
    grid-template-columns: 32px 1fr 70px 70px 36px;
    gap: 10px;
    align-items: stretch;
    margin-bottom: 8px;
    position: relative;
}
.receipt-row .row-num {
    color: var(--text-dim);
    font-size: 0.95em;
    padding-top: 9px;
    text-align: right;
}
.receipt-row input.row-input {
    padding: 8px 10px;
    font-size: 1em;
    border-radius: 6px;
    width: 100%;
}
.receipt-row input.row-input.locked {
    background: rgba(16, 185, 129, 0.10);
    border-color: #10b981;
    color: #065f46;
    font-weight: 600;
}
.receipt-row .row-price {
    padding: 8px 6px;
    font-size: 0.92em;
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    background: rgba(50, 50, 93, 0.04);
    color: var(--text-bright);
    text-align: right;
    line-height: 1.25;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.receipt-row .row-price .label {
    font-size: 0.7em;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.receipt-row .row-price.row-latest {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.35);
    color: #065f46;
}
.receipt-row .row-price.row-latest.unmatched {
    background: rgba(50, 50, 93, 0.04);
    border-color: var(--panel-border);
    color: var(--text-dim);
}
.receipt-row .row-price.cheaper-now {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
    color: #065f46;
    font-weight: 700;
}
.receipt-row .row-price.pricier-now {
    background: rgba(190, 18, 60, 0.10);
    border-color: rgba(190, 18, 60, 0.40);
    color: #8a2b25;
}
.receipt-row .row-remove {
    background: var(--panel);
    color: #b91c1c;
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2em;
    line-height: 1;
}
.receipt-row .row-remove:hover {
    background: rgba(190, 18, 60, 0.10);
    border-color: #b91c1c;
}
.receipt-row .row-suggestions {
    position: absolute;
    top: 100%;
    left: 42px;
    right: 194px;
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-top: none;
    max-height: 320px;
    overflow-y: auto;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    border-radius: 0 0 6px 6px;
}
.receipt-row .row-suggestion {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--panel-border);
    font-size: 0.95em;
    line-height: 1.3;
    color: var(--text-bright);
}
.receipt-row .row-suggestion:hover { background: rgba(37, 96, 230, 0.06); }
.receipt-row .row-suggestion .sug-name { display: block; }
.receipt-row .row-suggestion .sug-meta { color: var(--text-dim); font-size: 0.85em; display: block; margin-top: 2px; }

.receipt-row-actions {
    max-width: 900px;
    margin: 0 auto 18px;
    padding: 0 16px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.receipt-status { color: var(--text-dim); font-size: 0.88em; flex: 1; }

.photo-thumb {
    position: relative;
    width: 110px;
    height: 140px;
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    overflow: hidden;
    background: var(--panel);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb .photo-status {
    position: absolute; top: 4px; left: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    font-size: 0.75em;
    padding: 2px 6px;
    border-radius: 3px;
    line-height: 1.2;
}
.photo-thumb .photo-status.done    { background: rgba(16, 185, 129, 0.90); }
.photo-thumb .photo-status.failed  { background: rgba(190, 18, 60, 0.90); }
.photo-thumb .photo-status.running { background: rgba(37, 96, 230, 0.90); }
.photo-thumb .photo-remove {
    position: absolute; top: 4px; right: 4px;
    background: rgba(255, 255, 255, 0.92);
    color: #b91c1c;
    border: 1px solid #b91c1c;
    border-radius: 50%;
    width: 22px; height: 22px;
    padding: 0;
    line-height: 1;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.photo-thumb .photo-remove:hover { background: rgba(190, 18, 60, 0.10); }


/* ===================================================================
 * Tab 3 — Sample baskets.
 * =================================================================== */

.basket-picker {
    max-width: 900px;
    margin: 24px auto;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}
.basket-picker label { font-weight: 600; color: var(--text-bright); }
.basket-picker select {
    width: 100%;
    padding: 10px;
    font-size: 1em;
    border-radius: 6px;
}

.basket-results {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px 40px;
}
.basket-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.basket-super {
    background: var(--panel);
    border-radius: 8px;
    padding: 18px 20px;
    box-shadow: 0 0 0 1px rgba(50, 50, 93, 0.10),
                0 1px 3px 0 rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.basket-super.cheapest {
    background: rgba(16, 185, 129, 0.10);
    box-shadow: inset 0 0 0 2px #10b981;
}
.basket-super .super-head { display: flex; justify-content: space-between; align-items: center; }
.basket-super .total { font-size: 2.0em; font-weight: 700; color: #065f46; }
.basket-super .breakdown { font-size: 0.96em; color: var(--text-dim); line-height: 1.5; }
.basket-super .match-rate { font-size: 0.9em; color: var(--text-dim); }
.basket-super .match-rate.low { color: #b91c1c; font-weight: 600; }
.basket-super .loyalty-row { margin-top: 4px; font-size: 0.96em; color: #065f46; line-height: 1.5; }
.basket-super .loyalty-row strong { color: var(--text-bright); font-size: 1.05em; }
.basket-super .loyalty-savings { color: #b91c1c; font-weight: 600; font-size: 0.92em; }

.split-card {
    background: linear-gradient(135deg, rgba(255, 175, 64, 0.15) 0%, rgba(255, 175, 64, 0.30) 100%);
    border: 2px solid #f59e0b;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}
.split-card h3 { margin-bottom: 12px; color: #b45309; }
.split-card .total { font-size: 2.2em; font-weight: 700; color: #b45309; }
.split-card .subtotal { font-size: 0.95em; color: var(--text-dim); margin: 4px 0; }
.split-card .shop-breakdown { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.split-card .shop-breakdown .chip {
    background: rgba(255, 255, 255, 0.70);
    /* Chip background is always white-70%, so force a dark text colour here
       instead of inheriting body's --text — in dark mode --text is light
       and would render as light-on-white inside the chip. */
    color: #1e293b;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.88em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.basket-items {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(50, 50, 93, 0.10),
                0 1px 3px 0 rgba(0, 0, 0, 0.05);
}
.basket-items table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--panel);
    font-size: 0.96em;
}
.basket-items th, .basket-items td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--panel-border);
    color: var(--text);
}
.basket-items th {
    background: rgba(50, 50, 93, 0.04);
    font-weight: 600;
    color: var(--text-bright);
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.04);
}
.basket-items td.price { text-align: right; font-family: "Liberation Mono", ui-monospace, monospace; }
.basket-items td.cheapest { background: rgba(16, 185, 129, 0.10); font-weight: 700; color: #065f46; }
.basket-items td.missing  { color: var(--text-dim); text-align: center; }
.basket-items td.imputed  { color: var(--text-dim); font-style: italic; background: rgba(50, 50, 93, 0.04); }
.basket-items td.shop-cell { vertical-align: top; min-width: 180px; }
.basket-items td.shop-cell.cheapest { background: rgba(16, 185, 129, 0.10); }
.basket-items .shop-cell-price { font-size: 1.05em; font-weight: 700; color: #065f46; font-family: "Liberation Mono", ui-monospace, monospace; }
.basket-items td.cheapest .shop-cell-price { color: #047857; }
.basket-items .shop-cell-name { font-size: 0.8em; color: var(--text-dim); line-height: 1.2; margin-top: 2px; }
.basket-items tr:hover { background: rgba(50, 50, 93, 0.03); }


/* ===================================================================
 * Tab 4 — Weekly report (placeholder).
 * =================================================================== */

.weekly-report {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 16px;
    color: var(--text);
    line-height: 1.6;
}
.weekly-report h2 { margin-bottom: 8px; color: var(--text-bright); }
.weekly-report h3 { margin-top: 24px; margin-bottom: 12px; color: var(--text-bright); }
.weekly-report__sub { color: var(--text-dim); font-size: 0.95em; margin-bottom: 24px; }
.weekly-report__notice {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.40);
    padding: 18px 22px;
    border-radius: 8px;
    margin-bottom: 24px;
    color: #92400e;
}
.weekly-report__notice-title { font-weight: 700; font-size: 1.05em; margin-bottom: 6px; }
.weekly-report__list { padding-left: 22px; line-height: 1.7; color: var(--text); }
.weekly-report__list li { margin-bottom: 4px; }
.weekly-report__list strong { color: var(--text-bright); }
.weekly-report__status {
    margin-top: 28px;
    padding: 14px 18px;
    background: rgba(50, 50, 93, 0.06);
    border-left: 3px solid var(--panel-border);
    color: var(--text-dim);
    font-size: 0.9em;
    border-radius: 0 6px 6px 0;
}

/* Weekly-report live render (weekly_report.js) — editorial card, tables, basket cards. */
.wr-editorial {
    background: var(--panel);
    border-radius: 8px;
    padding: 20px 24px;
    margin: 18px 0 24px;
    box-shadow: 0 0 0 1px rgba(50, 50, 93, 0.10),
                0 4px 12px 0 rgba(50, 50, 93, 0.06);
    border-left: 4px solid #2560e6;
}
.wr-editorial__headline {
    margin: 0 0 12px;
    font-size: 1.15em;
    color: var(--text-bright);
    line-height: 1.35;
}
.wr-editorial__body {
    margin: 0 0 12px;
    color: var(--text);
    line-height: 1.6;
    font-size: 1.0em;
}
.wr-editorial__cite {
    font-size: 0.8em;
    color: var(--text-dim);
    font-style: italic;
}
.wr-editorial--missing {
    color: var(--text-dim);
    font-size: 0.9em;
    padding: 12px 16px;
    background: rgba(190, 18, 60, 0.06);
    border-radius: 6px;
    margin: 12px 0;
}

.wr-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--panel);
    border-radius: 8px;
    overflow: hidden;
    margin: 12px 0 24px;
    box-shadow: 0 0 0 1px rgba(50, 50, 93, 0.10),
                0 1px 3px 0 rgba(0, 0, 0, 0.05);
    font-size: 0.95em;
}
.wr-table th,
.wr-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--panel-border);
    color: var(--text);
}
.wr-table th {
    background: rgba(50, 50, 93, 0.04);
    font-weight: 600;
    color: var(--text-bright);
    font-size: 0.9em;
}
.wr-table td.num,
.wr-table th.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.wr-table tr:last-child td { border-bottom: none; }
.wr-table tr:hover { background: rgba(50, 50, 93, 0.03); }
.wr-table a { color: #2560e6; text-decoration: none; }
.wr-table a:hover { text-decoration: underline; }

.wr-movers .supermarket {
    font-size: 0.78em;
    padding: 2px 6px;
}

.wr-delta-up   { color: #b91c1c; font-weight: 700; }
.wr-delta-down { color: #047857; font-weight: 700; }

.wr-basket-card {
    background: var(--panel);
    border-radius: 8px;
    padding: 16px 18px;
    margin: 12px 0;
    box-shadow: 0 0 0 1px rgba(50, 50, 93, 0.10),
                0 1px 3px 0 rgba(0, 0, 0, 0.05);
}
.wr-basket-card__header {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: baseline;
    padding-bottom: 8px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--panel-border);
}
.wr-basket-card__label {
    font-weight: 700;
    color: var(--text-bright);
    font-size: 1.05em;
}
.wr-basket-card__items {
    color: var(--text-dim);
    font-size: 0.88em;
}
.wr-basket-card__cheapest {
    margin-left: auto;
    color: #065f46;
    font-size: 0.92em;
}
.wr-basket-card__cheapest strong { color: var(--text-bright); }

.wr-basket-table {
    margin: 0;
    box-shadow: none;
    font-size: 0.9em;
}
.wr-basket-table .supermarket {
    font-size: 0.78em;
    padding: 2px 6px;
}
.wr-cheapest td {
    background: rgba(16, 185, 129, 0.08);
    font-weight: 600;
}

.wr-basket-note {
    background: rgba(50, 50, 93, 0.04);
    border-radius: 6px;
    padding: 10px 14px;
    color: var(--text-dim);
    font-size: 0.9em;
    line-height: 1.5;
    margin: 8px 0 14px;
}


/* ===================================================================
 * Utility helpers.
 * =================================================================== */

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

.primary-btn-large {
    padding: 14px 28px;
    font-size: 1.05em;
    font-weight: 700;
}
.primary-btn--small {
    padding: 6px 14px;
    font-size: 0.9em;
}
