/* content/tools/shopping-list/shopping-list.css
 *
 * Phase 5a — page-specific styles for /shopping-list. The shared button
 * + add-modal styles live in ../lib/shopping-list.css and are imported
 * via extra_css_json on the page row. This file just covers the page
 * layout (the add form, list rows, sections).
 *
 * Reuses diary's design tokens — diary.css's :root tokens are NOT loaded
 * on this page, but the shared shopping-list.css redeclares the diary-
 * specific tokens at :root so the values are available here too.
 */

/* ════════════════════════════════════════════════════════════════════════
 * PAGE WRAPPER
 * ════════════════════════════════════════════════════════════════════════ */
.shopping-list-app {
    max-width: 720px;
    margin: 0 auto;
    padding: var(--s-4) var(--s-4) var(--s-10);
}
.shopping-list-app h1.page-title {
    margin: 0 0 var(--s-2);
    letter-spacing: -0.01em;
}
.shopping-list-intro {
    color: var(--text-light);
    line-height: 1.5;
    margin: 0 0 var(--s-6);
}

/* ════════════════════════════════════════════════════════════════════════
 * SECTION HEADERS — same uppercase muted-label treatment as the diary
 * ════════════════════════════════════════════════════════════════════════ */
.diary-section {
    margin: 0 0 var(--s-6);
}
.diary-section-h {
    margin: 0 0 var(--s-3);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
    line-height: 1.2;
    border: 0;
    padding: 0;
}

/* ════════════════════════════════════════════════════════════════════════
 * CARD — base surface (shared diary vocabulary)
 * ════════════════════════════════════════════════════════════════════════ */
.diary-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--r-md);
    padding: var(--s-4);
}
.diary-card--tight { padding: var(--s-3); }

/* ════════════════════════════════════════════════════════════════════════
 * ADD FORM
 * ════════════════════════════════════════════════════════════════════════ */
.shopping-list-add-form {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
}
.shopping-list-add-form > * { min-width: 0; }
.shopping-list-add-form .full {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    line-height: 1.3;
}
.shopping-list-add-form input[type="text"],
.shopping-list-add-form input[type="number"],
.shopping-list-add-form select,
.shopping-list-add-form textarea {
    font-size: 16px;
    font-family: inherit;
    line-height: 1.4;
    padding: var(--s-3);
    border: 1px solid var(--border-color);
    border-radius: var(--r-md);
    background: var(--card-bg);
    color: var(--text-color);
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
}
.shopping-list-add-form textarea {
    min-height: 4rem;
    resize: vertical;
    line-height: 1.5;
}
.shopping-list-add-form input:focus,
.shopping-list-add-form select:focus,
.shopping-list-add-form textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
    border-color: var(--primary-color);
}
.shopping-list-add-form select option,
.shopping-list-add-form select optgroup {
    color: var(--text-color);
    background-color: var(--card-bg);
}
.shopping-list-add-qty-row {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: var(--s-2);
}
.shopping-list-add-qty-row label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    line-height: 1.3;
}
.shopping-list-add-actions {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    margin-top: var(--s-1);
}
@media (min-width: 480px) {
    .shopping-list-add-actions { flex-direction: row; }
    .shopping-list-add-actions button { flex: 1; }
}
.shopping-list-add-actions button {
    appearance: none;
    border: 1px solid var(--accent-color);
    background: var(--accent-color);
    color: var(--card-bg);
    padding: var(--s-3) var(--s-5);
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--r-md);
    cursor: pointer;
    min-height: 48px;
}
.shopping-list-add-actions button.is-secondary {
    background: var(--card-bg);
    color: var(--accent-color);
}
.shopping-list-add-actions button:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* ════════════════════════════════════════════════════════════════════════
 * SCAN BUTTON (inline) + SCAN MODAL
 * ════════════════════════════════════════════════════════════════════════ */
/* Mobile (default): input on its own row at full container width, scan
 * button stacked below as a full-width secondary action. The search box
 * stays as wide as possible — important because the autocomplete popout
 * inherits its width from the input, and on phones a 60%-wide popout of
 * branded products is unreadable.
 *
 * Desktop (≥ 480 px): same row, scan button pinned to the right with the
 * input flexing to fill remaining space.
 *
 * The selector targets `.autocomplete` (the wrapper div autocomplete.js
 * inserts around the input) rather than the input itself — without that
 * the wrapper shrinks to its content width and the layout collapses. */
.shopping-list-add-name-row {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
}
.shopping-list-add-name-row > .autocomplete,
.shopping-list-add-name-row > input {
    width: 100%;
    min-width: 0;
    margin-bottom: 0;                                /* override .autocomplete's default bottom margin */
}
@media (min-width: 480px) {
    .shopping-list-add-name-row {
        flex-direction: row;
        align-items: stretch;
    }
    .shopping-list-add-name-row > .autocomplete,
    .shopping-list-add-name-row > input {
        flex: 1 1 auto;
    }
    .shopping-list-add-name-row > .shopping-list-scan-btn {
        flex: 0 0 auto;
    }
}
.shopping-list-scan-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 var(--s-3);
    border: 1px solid var(--accent-color);
    background: var(--card-bg);
    color: var(--accent-color);
    border-radius: var(--r-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    min-height: 44px;
    width: 100%;                                     /* full width on mobile */
    transition: background 120ms ease, color 120ms ease;
}
@media (min-width: 480px) {
    .shopping-list-scan-btn { width: auto; }
}
.shopping-list-scan-btn:hover,
.shopping-list-scan-btn:focus-visible {
    background: var(--accent-color);
    color: var(--card-bg);
    outline: none;
}
.shopping-list-scan-btn:focus-visible {
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.shopping-scan-modal[hidden] { display: none; }
.shopping-scan-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;                                  /* above shopping-modal (1100) so a from-modal scan would still work */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--s-3);
}
.shopping-scan-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
}
.shopping-scan-modal-inner {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: var(--r-lg);
    padding: var(--s-5) var(--s-4) var(--s-4);
    box-shadow: var(--shadow-pop);
}
.shopping-scan-modal-close {
    position: absolute;
    top: var(--s-2);
    right: var(--s-2);
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-light);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}
.shopping-scan-modal-close:hover,
.shopping-scan-modal-close:focus-visible {
    background: var(--surface-muted);
    color: var(--text-color);
    outline: none;
}
.shopping-scan-modal-title {
    margin: 0 var(--s-8) var(--s-3) 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.25;
    border: 0;
    padding: 0;
}
.shopping-scan-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #000;
    border-radius: var(--r-md);
    overflow: hidden;
    margin-bottom: var(--s-3);
}
.shopping-scan-stage video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.shopping-scan-reticle {
    position: absolute;
    inset: 12% 8%;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--r-sm);
    pointer-events: none;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.18);
}
.shopping-scan-status {
    min-height: 1.4em;
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: var(--s-3);
    line-height: 1.4;
}
.shopping-scan-status.is-error   { color: var(--error-color); }
.shopping-scan-status.is-success { color: var(--accent-color); }
.shopping-scan-actions {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
}
@media (min-width: 480px) {
    .shopping-scan-actions { flex-direction: row-reverse; }
    .shopping-scan-actions button { flex: 1; }
}
.shopping-scan-actions button {
    appearance: none;
    border: 1px solid var(--accent-color);
    background: var(--accent-color);
    color: var(--card-bg);
    padding: var(--s-3) var(--s-4);
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--r-md);
    cursor: pointer;
    min-height: 44px;
}
.shopping-scan-actions button.is-secondary {
    background: var(--card-bg);
    color: var(--accent-color);
}
.shopping-scan-actions button:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}
body.shopping-scan-modal-open { overflow: hidden; }

/* ════════════════════════════════════════════════════════════════════════
 * AUTOCOMPLETE COMPONENT — duplicated from diary.css's autocomplete block
 * so the search popout has the same styling here as on the diary. The
 * autocomplete component is shared (lib/autocomplete.js) but the styles
 * historically lived only in diary.css; rather than crack open every page
 * to share a common stylesheet we redeclare the rules here. Kept in sync
 * with diary.css's "AUTOCOMPLETE COMPONENT" block — promote to a shared
 * file if a third surface ever needs them.
 * ════════════════════════════════════════════════════════════════════════ */

/* Source-badge tokens — diary.css defines these at :root + dark; replicate
 * so the badge colours work without diary.css. */
:root {
    --source-enc-bg:       #dcfce7;
    --source-enc-fg:       #15803d;
    --source-off-bg:       #dbeafe;
    --source-off-fg:       #1d4ed8;
}
[data-theme="dark"] {
    --source-enc-bg:       rgba(34, 197, 94, 0.18);
    --source-enc-fg:       #86efac;
    --source-off-bg:       rgba(96, 165, 250, 0.18);
    --source-off-fg:       #93c5fd;
}

.source-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--r-pill);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    line-height: 1.5;
}
.source-badge--enc { background: var(--source-enc-bg); color: var(--source-enc-fg); }
.source-badge--off { background: var(--source-off-bg); color: var(--source-off-fg); }

.autocomplete {
    position: relative;
    margin-bottom: var(--s-3);
}
.autocomplete-input {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: var(--r-md);
    padding: var(--s-3) var(--s-4) var(--s-3) var(--s-10);
    font: inherit;
    font-size: 16px;
    background: var(--card-bg) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><path d='m21 21-4.3-4.3'/></svg>") no-repeat var(--s-3) center;
    min-height: 48px;
    box-sizing: border-box;
    color: var(--text-color);
}
.autocomplete-input:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
    border-color: var(--primary-color);
}
.autocomplete-input.is-open {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}
.autocomplete-popout {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--primary-color);
    border-top: 0;
    border-radius: 0 0 var(--r-md) var(--r-md);
    box-shadow: var(--shadow-pop);
    max-height: 360px;
    overflow-y: auto;
    z-index: 10;
}

/* Close button — see diary.css for the canonical block. Duplicated here
 * because the shopping-list page doesn't load diary.css. */
.autocomplete-close {
    position: absolute;
    top: calc(100% + 4px);
    right: 4px;
    width: 32px;
    height: 32px;
    z-index: 11;
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: 0;
}
.autocomplete-close:hover,
.autocomplete-close:focus-visible {
    background: var(--surface-muted);
    color: var(--text-color);
    outline: none;
}
.autocomplete-result {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--s-3);
    align-items: center;
    padding: var(--s-3) var(--s-4);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}
.autocomplete-result:last-child { border-bottom: 0; }
.autocomplete-result:hover,
.autocomplete-result:focus,
.autocomplete-result.is-active {
    background: var(--primary-soft);
}
.autocomplete-result .name-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--s-2);
    min-width: 0;
}
.autocomplete-result .name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-color);
    min-width: 0;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}
.autocomplete-result .meta {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
}
.autocomplete-result .kcal {
    font-variant-numeric: tabular-nums;
    color: var(--text-light);
    font-size: 13px;
    white-space: nowrap;
    text-align: right;
}
.autocomplete-result .autocomplete-result-right {
    display: flex;
    align-items: center;
    gap: var(--s-2);
}
.autocomplete-result .kcal strong {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}
.autocomplete-result .kcal small {
    font-size: 11px;
    color: var(--text-muted);
}
.autocomplete-state {
    padding: var(--s-6) var(--s-4);
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
}
.autocomplete-state.is-loading::before {
    content: '';
    display: block;
    width: 20px; height: 20px;
    margin: 0 auto var(--s-3);
    border: 2px solid var(--border-strong);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: nfl-shopping-spin 0.8s linear infinite;
}
@keyframes nfl-shopping-spin { to { transform: rotate(360deg); } }
.autocomplete-state.is-error { color: var(--error-color); }
.autocomplete-state .freetext-cta {
    margin-top: var(--s-3);
    font-size: 13px;
    color: var(--primary-color);
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    background: transparent;
    border: 0;
    font-family: inherit;
}
.autocomplete-state .freetext-cta + .freetext-cta { margin-left: var(--s-3); }

/* Degraded-mode notice — see diary.css for the canonical block. Duplicated
 * here because the shopping-list page doesn't load diary.css. */
.autocomplete-degraded-notice {
    margin: 0 0 var(--s-3);
    padding: var(--s-2) var(--s-3);
    display: flex;
    gap: var(--s-2);
    align-items: flex-start;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-color);
    background: var(--surface-muted);
    border-left: 3px solid var(--text-light);
    border-radius: var(--r-sm);
}
.autocomplete-degraded-icon {
    flex: 0 0 auto;
    color: var(--text-light);
    font-weight: 700;
    line-height: 1.45;
}

/* Same defensive width-claim as diary.css — keeps the notice on its own
 * line in any flex/grid parent. */
.autocomplete-degraded-notice {
    width: 100%;
    flex: 1 0 100%;
    grid-column: 1 / -1;
}

/* Phase 5c — "Read more →" link on autocomplete rows whose USDA result
 * has a matching whole-foods encyclopedia entry. Mirrors diary.css so the
 * link works on the shopping-list page too. */
.autocomplete-result-encyclopedia {
    font-size: 11px;
    font-weight: 500;
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px dashed currentColor;
    padding-bottom: 1px;
    flex: 0 0 auto;
    line-height: 1.5;
}
.autocomplete-result-encyclopedia:hover,
.autocomplete-result-encyclopedia:focus-visible {
    color: var(--primary-dark);
    border-bottom-style: solid;
    outline: none;
}

/* On the /shopping-list page, picking an autocomplete row IS the add
 * action — we add the item directly with default qty=1, unit=item rather
 * than routing through the shared inline-chip + modal. Hide the chip so
 * the row reads as one click target. (Other surfaces — diary, scanner —
 * still show the chip via the same shared autocomplete.) */
.shopping-list-app .autocomplete-popout .shopping-add-btn--inline-chip {
    display: none;
}

/* Inline toast — shown after a row-click direct-add. Slides in below the
 * add form, auto-dismisses after ~2s. Same accent palette as the modal
 * toast for visual consistency. */
.shopping-list-inline-toast {
    margin: var(--s-2) 0 0;
    padding: var(--s-2) var(--s-3);
    background: var(--accent-soft);
    border: 1px solid var(--accent-color);
    border-radius: var(--r-md);
    font-size: 13px;
    color: var(--text-color);
    text-align: center;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity 140ms ease, transform 140ms ease;
    pointer-events: none;
}
.shopping-list-inline-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ════════════════════════════════════════════════════════════════════════
 * LIST SECTIONS — To buy / Got it
 * ════════════════════════════════════════════════════════════════════════ */
.shopping-list-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--r-md);
    padding: var(--s-3) var(--s-4);
    margin-bottom: var(--s-3);
}
.shopping-list-section-h {
    margin: 0 0 var(--s-2);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
    line-height: 1.2;
    border: 0;
    padding: 0;
}
.shopping-list-section-count {
    background: var(--surface-muted);
    color: var(--text-muted);
    border-radius: var(--r-pill);
    padding: 1px 8px;
    font-size: 11px;
    margin-left: 4px;
    letter-spacing: 0;
    text-transform: none;
}

/* "Got it" — collapsible. The toggle button replaces the static h3 so
 * it's keyboard accessible. */
.shopping-list-section-toggle {
    appearance: none;
    background: transparent;
    border: 0;
    color: var(--text-muted);
    font: inherit;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0;
    line-height: 1.2;
}
.shopping-list-section-toggle:hover,
.shopping-list-section-toggle:focus-visible {
    color: var(--text-color);
    outline: none;
}
.shopping-list-toggle-chevron {
    margin-left: auto;
    color: var(--text-muted);
    transition: transform 120ms ease;
}
.shopping-list-section--got.is-expanded .shopping-list-toggle-chevron {
    transform: rotate(180deg);
}
.shopping-list-section--got .shopping-list-items {
    margin-top: var(--s-2);
}

/* ════════════════════════════════════════════════════════════════════════
 * LIST ROWS
 * ════════════════════════════════════════════════════════════════════════ */
.shopping-list-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.shopping-list-item {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) 32px;
    gap: var(--s-3);
    padding: var(--s-2) 0;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    min-height: 44px;
}
.shopping-list-item:last-child { border-bottom: 0; }

/* Custom checkbox — uses native input but visually replaced for theme
 * + size control. Mobile-friendly hit target. */
.shopping-list-item-check {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    cursor: pointer;
}
.shopping-list-item-check input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}
.shopping-list-item-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-strong);
    border-radius: var(--r-sm);
    background: var(--card-bg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 120ms ease, border-color 120ms ease;
}
.shopping-list-item-check input[type="checkbox"]:checked + .shopping-list-item-checkbox {
    background: var(--accent-color);
    border-color: var(--accent-color);
}
.shopping-list-item-check input[type="checkbox"]:checked + .shopping-list-item-checkbox::after {
    content: '';
    width: 5px;
    height: 10px;
    border: solid var(--card-bg);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translate(-1px, -1px);
}
.shopping-list-item-check input[type="checkbox"]:focus-visible + .shopping-list-item-checkbox {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.shopping-list-item-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.shopping-list-item-name {
    font-weight: 500;
    color: var(--text-color);
    font-size: 15px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}
.shopping-list-item-qty {
    font-size: 12px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}
.shopping-list-item-notes {
    font-size: 12px;
    color: var(--text-muted);
    overflow-wrap: anywhere;
    line-height: 1.4;
}
.shopping-list-item-ref {
    margin-left: 4px;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 12px;
}
.shopping-list-item-remove {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--s-2);
    font-size: 18px;
    line-height: 1;
    border-radius: var(--r-sm);
    min-width: 32px;
    min-height: 32px;
}
.shopping-list-item-remove:hover,
.shopping-list-item-remove:focus-visible {
    background: var(--surface-muted);
    color: var(--error-color);
    outline: none;
}

/* Checked state — strike-through name + dim. */
.shopping-list-item.is-checked .shopping-list-item-name {
    text-decoration: line-through;
    color: var(--text-muted);
}
.shopping-list-item.is-checked .shopping-list-item-qty,
.shopping-list-item.is-checked .shopping-list-item-notes {
    opacity: 0.7;
}

/* ════════════════════════════════════════════════════════════════════════
 * EMPTY STATE
 * ════════════════════════════════════════════════════════════════════════ */
.shopping-list-empty[hidden] { display: none; }
.shopping-list-empty {
    padding: var(--s-8) var(--s-4);
    text-align: center;
    background: var(--surface-muted);
    border: 1px dashed var(--border-strong);
    border-radius: var(--r-lg);
    color: var(--text-muted);
}
.shopping-list-empty .empty-icon {
    font-size: 56px;
    display: block;
    margin: 0 auto var(--s-3);
    opacity: 0.55;
    line-height: 1;
}
.shopping-list-empty h3 {
    margin: 0 0 var(--s-2);
    font-size: 18px;
    color: var(--text-color);
    font-weight: 600;
    line-height: 1.25;
    border: 0;
    padding: 0;
}
.shopping-list-empty p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-muted);
}

/* ════════════════════════════════════════════════════════════════════════
 * TOOLS ROW
 * ════════════════════════════════════════════════════════════════════════ */
.shopping-list-tools {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
}
.shopping-list-tools button {
    appearance: none;
    padding: var(--s-2) var(--s-4);
    font-size: 14px;
    font-weight: 500;
    border: 1px solid var(--border-strong);
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: var(--r-md);
    cursor: pointer;
    min-height: 40px;
}
.shopping-list-tools button:hover {
    background: var(--surface-muted);
}
.shopping-list-tools button.is-danger {
    border-color: var(--error-border);
    color: var(--error-strong);
}
.shopping-list-tools button.is-danger:hover {
    background: var(--error-soft);
}
.shopping-list-tools input[type="file"] { display: none; }
.shopping-list-storage-note {
    margin-top: var(--s-3);
    padding-top: var(--s-3);
    border-top: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 13px;
    line-height: 1.5;
}
.shopping-list-storage-note code {
    background: var(--surface-muted);
    padding: 1px 6px;
    border-radius: var(--r-sm);
    font-size: 0.95em;
}
