/* ═══════════════════════════════════════════════
   ListyLoo — Warm Earth Tone Minimal
   ═══════════════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
    --font-body: 'Outfit', sans-serif;
    --font-display: 'Fraunces', serif;

    --page-bg: #FAF8F5;
    --card-bg: #F2EDE6;
    --surface-raised: rgba(180, 160, 130, 0.06);
    --surface-overlay: rgba(180, 160, 130, 0.10);
    --accent: #8C7A62;
    --accent-soft: rgba(140, 122, 98, 0.10);
    --accent-hover: #7A6A54;
    --accent-tint: #B8A48C;
    --ink: #2D2A26;
    --ink-muted: #8A8279;
    --ink-faint: #B5ADA4;
    --border-subtle: rgba(160, 140, 110, 0.12);
    --shadow-sm: 0 1px 3px rgba(120, 100, 70, 0.05);
    --shadow-md: 0 2px 8px rgba(120, 100, 70, 0.07);
    --shadow-lg: 0 8px 24px rgba(120, 100, 70, 0.10);
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --green: #7BA67D;
    --green-soft: rgba(123, 166, 125, 0.10);
    --red: #C4695A;
    --red-soft: rgba(196, 105, 90, 0.10);
}

/* ── Dark Mode ── */
[data-theme="dark"] {
    --page-bg: #1E1C19;
    --card-bg: #2A2723;
    --surface-raised: rgba(255, 240, 210, 0.04);
    --surface-overlay: rgba(255, 240, 210, 0.06);
    --accent: #C4A882;
    --accent-soft: rgba(196, 168, 130, 0.12);
    --accent-hover: #D4B892;
    --accent-tint: #8A7D6E;
    --ink: #E8E4DE;
    --ink-muted: #B5AEA3;
    --ink-faint: #8A8279;
    --border-subtle: rgba(200, 180, 150, 0.10);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.20);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.25);
    --green-soft: rgba(123, 166, 125, 0.15);
    --red-soft: rgba(196, 105, 90, 0.15);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --page-bg: #1E1C19;
        --card-bg: #2A2723;
        --surface-raised: rgba(255, 240, 210, 0.04);
        --surface-overlay: rgba(255, 240, 210, 0.06);
        --accent: #C4A882;
        --accent-soft: rgba(196, 168, 130, 0.12);
        --accent-hover: #D4B892;
        --accent-tint: #8A7D6E;
        --ink: #E8E4DE;
        --ink-muted: #B5AEA3;
        --ink-faint: #8A8279;
        --border-subtle: rgba(200, 180, 150, 0.10);
        --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.15);
        --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.20);
        --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.25);
        --green-soft: rgba(123, 166, 125, 0.15);
        --red-soft: rgba(196, 105, 90, 0.15);
    }
}

/* ── Per-List Color Schemes ── */

/* Sage */
body[data-scheme="sage"] {
    --page-bg: #F7F8F5; --card-bg: #EDF0EA;
    --accent: #6B7F6B; --accent-soft: rgba(107,127,107,0.10); --accent-hover: #5A6E5A; --accent-tint: #98AB96;
    --ink: #2A2E2A; --ink-muted: #6E7A6C; --ink-faint: #A4B0A6;
    --border-subtle: rgba(100,140,110,0.12);
    --surface-raised: rgba(100,140,110,0.06); --surface-overlay: rgba(100,140,110,0.10);
    --shadow-sm: 0 1px 3px rgba(60,90,70,0.05); --shadow-md: 0 2px 8px rgba(60,90,70,0.07); --shadow-lg: 0 8px 24px rgba(60,90,70,0.10);
}
[data-theme="dark"] body[data-scheme="sage"] {
    --page-bg: #161A16; --card-bg: #222822;
    --accent: #98AB96; --accent-soft: rgba(152,171,150,0.12); --accent-hover: #A8BBA6; --accent-tint: #5A6E5A;
    --ink: #D5DCD2; --ink-muted: #8A9688; --ink-faint: #6E7A6C;
    --border-subtle: rgba(150,180,150,0.10);
    --surface-raised: rgba(150,200,150,0.04); --surface-overlay: rgba(150,200,150,0.06);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.15); --shadow-md: 0 2px 8px rgba(0,0,0,0.20); --shadow-lg: 0 8px 24px rgba(0,0,0,0.25);
}

/* Rose */
body[data-scheme="rose"] {
    --page-bg: #FBF7F5; --card-bg: #F3ECEA;
    --accent: #A47070; --accent-soft: rgba(164,112,112,0.10); --accent-hover: #935F5F; --accent-tint: #C49A9A;
    --ink: #3A2E2E; --ink-muted: #8A7676; --ink-faint: #B5A6A6;
    --border-subtle: rgba(160,110,110,0.12);
    --surface-raised: rgba(160,110,110,0.06); --surface-overlay: rgba(160,110,110,0.10);
    --shadow-sm: 0 1px 3px rgba(120,70,70,0.05); --shadow-md: 0 2px 8px rgba(120,70,70,0.07); --shadow-lg: 0 8px 24px rgba(120,70,70,0.10);
}
[data-theme="dark"] body[data-scheme="rose"] {
    --page-bg: #1E1818; --card-bg: #2C2424;
    --accent: #C49A9A; --accent-soft: rgba(196,154,154,0.12); --accent-hover: #D4AAAA; --accent-tint: #8A6666;
    --ink: #E2D8D6; --ink-muted: #B0A0A0; --ink-faint: #8A7676;
    --border-subtle: rgba(180,140,140,0.10);
    --surface-raised: rgba(200,150,150,0.04); --surface-overlay: rgba(200,150,150,0.06);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.15); --shadow-md: 0 2px 8px rgba(0,0,0,0.20); --shadow-lg: 0 8px 24px rgba(0,0,0,0.25);
}

/* Ocean */
body[data-scheme="ocean"] {
    --page-bg: #F5F8FA; --card-bg: #E8EFF3;
    --accent: #4A7082; --accent-soft: rgba(74,112,130,0.10); --accent-hover: #3A6072; --accent-tint: #7CA0B0;
    --ink: #1E2D36; --ink-muted: #5C7A88; --ink-faint: #96AEB8;
    --border-subtle: rgba(70,110,130,0.12);
    --surface-raised: rgba(70,110,130,0.06); --surface-overlay: rgba(70,110,130,0.10);
    --shadow-sm: 0 1px 3px rgba(40,70,90,0.05); --shadow-md: 0 2px 8px rgba(40,70,90,0.07); --shadow-lg: 0 8px 24px rgba(40,70,90,0.10);
}
[data-theme="dark"] body[data-scheme="ocean"] {
    --page-bg: #121C22; --card-bg: #1C2A32;
    --accent: #7CA0B0; --accent-soft: rgba(124,160,176,0.12); --accent-hover: #8CB0C0; --accent-tint: #3A6072;
    --ink: #D0DBE0; --ink-muted: #8AA0AA; --ink-faint: #5C7A88;
    --border-subtle: rgba(120,160,180,0.10);
    --surface-raised: rgba(120,180,200,0.04); --surface-overlay: rgba(120,180,200,0.06);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.15); --shadow-md: 0 2px 8px rgba(0,0,0,0.20); --shadow-lg: 0 8px 24px rgba(0,0,0,0.25);
}

/* Terracotta */
body[data-scheme="terracotta"] {
    --page-bg: #FDF9F5; --card-bg: #F4ECE4;
    --accent: #B8694A; --accent-soft: rgba(184,105,74,0.10); --accent-hover: #A45A3C; --accent-tint: #D09878;
    --ink: #33261E; --ink-muted: #8A7060; --ink-faint: #B8A498;
    --border-subtle: rgba(160,100,70,0.12);
    --surface-raised: rgba(160,100,70,0.06); --surface-overlay: rgba(160,100,70,0.10);
    --shadow-sm: 0 1px 3px rgba(120,70,40,0.05); --shadow-md: 0 2px 8px rgba(120,70,40,0.07); --shadow-lg: 0 8px 24px rgba(120,70,40,0.10);
}
[data-theme="dark"] body[data-scheme="terracotta"] {
    --page-bg: #1A1410; --card-bg: #2A2018;
    --accent: #D09878; --accent-soft: rgba(208,152,120,0.12); --accent-hover: #E0A888; --accent-tint: #8A6040;
    --ink: #E0D4CA; --ink-muted: #B09888; --ink-faint: #8A7060;
    --border-subtle: rgba(180,130,100,0.10);
    --surface-raised: rgba(200,140,100,0.04); --surface-overlay: rgba(200,140,100,0.06);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.15); --shadow-md: 0 2px 8px rgba(0,0,0,0.20); --shadow-lg: 0 8px 24px rgba(0,0,0,0.25);
}

/* Lavender */
body[data-scheme="lavender"] {
    --page-bg: #F9F7FB; --card-bg: #F0ECF4;
    --accent: #7B6B8A; --accent-soft: rgba(123,107,138,0.10); --accent-hover: #6A5A7A; --accent-tint: #A698B2;
    --ink: #2E2836; --ink-muted: #6E6480; --ink-faint: #A89CB4;
    --border-subtle: rgba(120,100,140,0.12);
    --surface-raised: rgba(120,100,140,0.06); --surface-overlay: rgba(120,100,140,0.10);
    --shadow-sm: 0 1px 3px rgba(80,60,100,0.05); --shadow-md: 0 2px 8px rgba(80,60,100,0.07); --shadow-lg: 0 8px 24px rgba(80,60,100,0.10);
}
[data-theme="dark"] body[data-scheme="lavender"] {
    --page-bg: #18141E; --card-bg: #24202C;
    --accent: #A698B2; --accent-soft: rgba(166,152,178,0.12); --accent-hover: #B6A8C2; --accent-tint: #6A5A7A;
    --ink: #DCD4E2; --ink-muted: #9890A4; --ink-faint: #6E6480;
    --border-subtle: rgba(150,130,170,0.10);
    --surface-raised: rgba(160,140,180,0.04); --surface-overlay: rgba(160,140,180,0.06);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.15); --shadow-md: 0 2px 8px rgba(0,0,0,0.20); --shadow-lg: 0 8px 24px rgba(0,0,0,0.25);
}

/* Marigold */
body[data-scheme="marigold"] {
    --page-bg: #FDFBF6; --card-bg: #F4F0E6;
    --accent: #C49530; --accent-soft: rgba(196,149,48,0.10); --accent-hover: #B08528; --accent-tint: #D4B060;
    --ink: #3A3830; --ink-muted: #8A8470; --ink-faint: #B5AE9A;
    --border-subtle: rgba(160,140,80,0.12);
    --surface-raised: rgba(160,140,80,0.06); --surface-overlay: rgba(160,140,80,0.10);
    --shadow-sm: 0 1px 3px rgba(120,100,40,0.05); --shadow-md: 0 2px 8px rgba(120,100,40,0.07); --shadow-lg: 0 8px 24px rgba(120,100,40,0.10);
}
[data-theme="dark"] body[data-scheme="marigold"] {
    --page-bg: #1C1C1A; --card-bg: #2A2926;
    --accent: #D4A03C; --accent-soft: rgba(212,160,60,0.12); --accent-hover: #E4B04C; --accent-tint: #8A7840;
    --ink: #E8E4DB; --ink-muted: #B0A890; --ink-faint: #8A8478;
    --border-subtle: rgba(180,160,100,0.10);
    --surface-raised: rgba(200,170,80,0.04); --surface-overlay: rgba(200,170,80,0.06);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.15); --shadow-md: 0 2px 8px rgba(0,0,0,0.20); --shadow-lg: 0 8px 24px rgba(0,0,0,0.25);
}

/* Sand */
body[data-scheme="sand"] {
    --page-bg: #FFFCF7; --card-bg: #F5EFE5;
    --accent: #A08A6E; --accent-soft: rgba(160,138,110,0.10); --accent-hover: #8E7A60; --accent-tint: #C4B49A;
    --ink: #3D3428; --ink-muted: #8A7E6A; --ink-faint: #B5AA96;
    --border-subtle: rgba(160,140,110,0.12);
    --surface-raised: rgba(160,140,110,0.06); --surface-overlay: rgba(160,140,110,0.10);
    --shadow-sm: 0 1px 3px rgba(120,100,70,0.05); --shadow-md: 0 2px 8px rgba(120,100,70,0.07); --shadow-lg: 0 8px 24px rgba(120,100,70,0.10);
}
[data-theme="dark"] body[data-scheme="sand"] {
    --page-bg: #1A1610; --card-bg: #28221A;
    --accent: #C4B49A; --accent-soft: rgba(196,180,154,0.12); --accent-hover: #D4C4AA; --accent-tint: #8A7A60;
    --ink: #E0D8CC; --ink-muted: #B0A490; --ink-faint: #8A7E6A;
    --border-subtle: rgba(180,160,130,0.10);
    --surface-raised: rgba(200,170,130,0.04); --surface-overlay: rgba(200,170,130,0.06);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.15); --shadow-md: 0 2px 8px rgba(0,0,0,0.20); --shadow-lg: 0 8px 24px rgba(0,0,0,0.25);
}

/* prefers-color-scheme dark variants */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) body[data-scheme="sage"] {
        --page-bg: #161A16; --card-bg: #222822; --accent: #98AB96; --accent-soft: rgba(152,171,150,0.12); --accent-hover: #A8BBA6; --accent-tint: #5A6E5A; --ink: #D5DCD2; --ink-muted: #8A9688; --ink-faint: #6E7A6C; --border-subtle: rgba(150,180,150,0.10); --surface-raised: rgba(150,200,150,0.04); --surface-overlay: rgba(150,200,150,0.06); --shadow-sm: 0 1px 3px rgba(0,0,0,0.15); --shadow-md: 0 2px 8px rgba(0,0,0,0.20); --shadow-lg: 0 8px 24px rgba(0,0,0,0.25);
    }
    :root:not([data-theme="light"]) body[data-scheme="rose"] {
        --page-bg: #1E1818; --card-bg: #2C2424; --accent: #C49A9A; --accent-soft: rgba(196,154,154,0.12); --accent-hover: #D4AAAA; --accent-tint: #8A6666; --ink: #E2D8D6; --ink-muted: #B0A0A0; --ink-faint: #8A7676; --border-subtle: rgba(180,140,140,0.10); --surface-raised: rgba(200,150,150,0.04); --surface-overlay: rgba(200,150,150,0.06); --shadow-sm: 0 1px 3px rgba(0,0,0,0.15); --shadow-md: 0 2px 8px rgba(0,0,0,0.20); --shadow-lg: 0 8px 24px rgba(0,0,0,0.25);
    }
    :root:not([data-theme="light"]) body[data-scheme="ocean"] {
        --page-bg: #121C22; --card-bg: #1C2A32; --accent: #7CA0B0; --accent-soft: rgba(124,160,176,0.12); --accent-hover: #8CB0C0; --accent-tint: #3A6072; --ink: #D0DBE0; --ink-muted: #8AA0AA; --ink-faint: #5C7A88; --border-subtle: rgba(120,160,180,0.10); --surface-raised: rgba(120,180,200,0.04); --surface-overlay: rgba(120,180,200,0.06); --shadow-sm: 0 1px 3px rgba(0,0,0,0.15); --shadow-md: 0 2px 8px rgba(0,0,0,0.20); --shadow-lg: 0 8px 24px rgba(0,0,0,0.25);
    }
    :root:not([data-theme="light"]) body[data-scheme="terracotta"] {
        --page-bg: #1A1410; --card-bg: #2A2018; --accent: #D09878; --accent-soft: rgba(208,152,120,0.12); --accent-hover: #E0A888; --accent-tint: #8A6040; --ink: #E0D4CA; --ink-muted: #B09888; --ink-faint: #8A7060; --border-subtle: rgba(180,130,100,0.10); --surface-raised: rgba(200,140,100,0.04); --surface-overlay: rgba(200,140,100,0.06); --shadow-sm: 0 1px 3px rgba(0,0,0,0.15); --shadow-md: 0 2px 8px rgba(0,0,0,0.20); --shadow-lg: 0 8px 24px rgba(0,0,0,0.25);
    }
    :root:not([data-theme="light"]) body[data-scheme="lavender"] {
        --page-bg: #18141E; --card-bg: #24202C; --accent: #A698B2; --accent-soft: rgba(166,152,178,0.12); --accent-hover: #B6A8C2; --accent-tint: #6A5A7A; --ink: #DCD4E2; --ink-muted: #9890A4; --ink-faint: #6E6480; --border-subtle: rgba(150,130,170,0.10); --surface-raised: rgba(160,140,180,0.04); --surface-overlay: rgba(160,140,180,0.06); --shadow-sm: 0 1px 3px rgba(0,0,0,0.15); --shadow-md: 0 2px 8px rgba(0,0,0,0.20); --shadow-lg: 0 8px 24px rgba(0,0,0,0.25);
    }
    :root:not([data-theme="light"]) body[data-scheme="marigold"] {
        --page-bg: #1C1C1A; --card-bg: #2A2926; --accent: #D4A03C; --accent-soft: rgba(212,160,60,0.12); --accent-hover: #E4B04C; --accent-tint: #8A7840; --ink: #E8E4DB; --ink-muted: #B0A890; --ink-faint: #8A8478; --border-subtle: rgba(180,160,100,0.10); --surface-raised: rgba(200,170,80,0.04); --surface-overlay: rgba(200,170,80,0.06); --shadow-sm: 0 1px 3px rgba(0,0,0,0.15); --shadow-md: 0 2px 8px rgba(0,0,0,0.20); --shadow-lg: 0 8px 24px rgba(0,0,0,0.25);
    }
    :root:not([data-theme="light"]) body[data-scheme="sand"] {
        --page-bg: #1A1610; --card-bg: #28221A; --accent: #C4B49A; --accent-soft: rgba(196,180,154,0.12); --accent-hover: #D4C4AA; --accent-tint: #8A7A60; --ink: #E0D8CC; --ink-muted: #B0A490; --ink-faint: #8A7E6A; --border-subtle: rgba(180,160,130,0.10); --surface-raised: rgba(200,170,130,0.04); --surface-overlay: rgba(200,170,130,0.06); --shadow-sm: 0 1px 3px rgba(0,0,0,0.15); --shadow-md: 0 2px 8px rgba(0,0,0,0.20); --shadow-lg: 0 8px 24px rgba(0,0,0,0.25);
    }
}

/* ── Scheme Picker ── */
.scheme-picker {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 0.4rem;
}

.scheme-swatch {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    border: 2.5px solid transparent;
    cursor: pointer;
    transition: transform 0.15s var(--ease-out), border-color 0.15s;
    padding: 0;
    margin-bottom: 0;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}

.scheme-swatch:hover { transform: scale(1.1); }

.scheme-swatch.selected {
    border-color: var(--ink);
    transform: scale(1.15);
}

.scheme-swatch--warm-earth { background: #8C7A62; }
.scheme-swatch--sage       { background: #6B7F6B; }
.scheme-swatch--rose       { background: #A47070; }
.scheme-swatch--ocean      { background: #4A7082; }
.scheme-swatch--terracotta { background: #B8694A; }
.scheme-swatch--lavender   { background: #7B6B8A; }
.scheme-swatch--marigold   { background: #C49530; }
.scheme-swatch--sand       { background: #A08A6E; }

/* ═══════════════════════════════════════════════
   BASE RESET & ELEMENTS (replacing Pico CSS)
   ═══════════════════════════════════════════════ */

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

html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    overflow-x: hidden;
    font-family: var(--font-body);
    font-size: 0.925rem;
    line-height: 1.6;
    color: var(--ink);
    background: var(--page-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-optical-sizing: auto;
    font-variation-settings: 'SOFT' 100, 'WONK' 1;
    letter-spacing: -0.025em;
    line-height: 1.25;
    margin: 0 0 0.75rem;
    color: var(--ink);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 1rem; }

p {
    margin: 0 0 1rem;
    line-height: 1.6;
}

small { font-size: 0.8rem; }

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s var(--ease-out);
}

a:hover { color: var(--accent-hover); }

ul, ol {
    padding-left: 1.5rem;
    margin: 0 0 1rem;
}

li { margin-bottom: 0.35rem; }

code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.85em;
    background: var(--surface-raised);
    padding: 0.15em 0.4em;
    border-radius: 4px;
}

hr {
    border: none;
    border-top: 1px solid var(--border-subtle);
    margin: 1.5rem 0;
}

figure {
    margin: 0 0 1rem;
    overflow-x: auto;
}

strong { font-weight: 600; }

/* ── Container ── */
.container {
    width: 100%;
    margin: .5rem auto;
    padding: 0 1rem;
}

@media (min-width: 576px)  { .container { max-width: 545px; } }
@media (min-width: 768px)  { .container { max-width: 735px; } }
@media (min-width: 1024px) { .container { max-width: 860px; } }

/* ── Form Elements ── */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="number"],
input[type="tel"],
input[type="date"],
input[type="file"],
select,
textarea {
    display: block;
    width: 100%;
    padding: 0.6rem 0.85rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--ink);
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
    margin-bottom: 1rem;
    -webkit-appearance: none;
    appearance: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

input::placeholder,
textarea::placeholder {
    color: var(--ink-faint);
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238A8279' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.25rem;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ink-muted);
    margin-bottom: 0.35rem;
}

/* Django form as_p rendering */
form p {
    margin-bottom: 0.25rem;
}

form p label {
    margin-bottom: 0.25rem;
}

form p input,
form p select,
form p textarea {
    margin-bottom: 0.75rem;
}

.helptext,
form .helptext {
    display: block;
    font-size: 0.78rem;
    color: var(--ink-faint);
    margin-top: -0.5rem;
    margin-bottom: 0.75rem;
}

.errorlist {
    list-style: none;
    padding: 0;
    margin: -0.5rem 0 0.75rem;
    font-size: 0.8rem;
    color: var(--red);
}

/* ── Buttons ── */
button,
[role="button"],
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.5;
    color: #fff;
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s var(--ease-out);
    -webkit-appearance: none;
    appearance: none;
    margin-bottom: 1rem;
}

button:hover,
[role="button"]:hover,
input[type="submit"]:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
}

button:disabled,
[role="button"]:disabled,
input[type="submit"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-wide {
    width: 100%;
}

@media (min-width: 600px) {
    .btn-wide {
        width: 60%;
    }
}

/* Outline variant */
button.outline,
[role="button"].outline,
.outline {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

button.outline:hover,
[role="button"].outline:hover,
.outline:hover {
    background: var(--accent-soft);
    color: var(--accent-hover);
}

/* Secondary variant */
button.secondary,
[role="button"].secondary,
.secondary {
    background: transparent;
    color: var(--ink-muted);
    border-color: var(--border-subtle);
}

button.secondary:hover,
[role="button"].secondary:hover,
.secondary:hover {
    background: var(--surface-raised);
    color: var(--ink);
    border-color: var(--ink-faint);
}

/* Outline + secondary combo */
.outline.secondary {
    background: transparent;
    color: var(--ink-muted);
    border-color: var(--border-subtle);
}

.outline.secondary:hover {
    background: var(--surface-raised);
    color: var(--ink);
    border-color: var(--ink-faint);
}

/* aria-busy spinner for buttons */
button[aria-busy="true"] {
    position: relative;
    color: transparent;
    pointer-events: none;
}

button[aria-busy="true"]::after {
    content: '';
    position: absolute;
    width: 1em;
    height: 1em;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.5s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Tables ── */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

thead th {
    text-align: left;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-muted);
    padding: 0.65rem 0.75rem;
    border-bottom: 2px solid var(--border-subtle);
}

tbody td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

tbody tr:last-child td {
    border-bottom: none;
}

/* ── Details/Summary ── */
details {
    margin-bottom: 1rem;
}

summary {
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--ink-muted);
    font-weight: 500;
    padding: 0.4rem 0;
    list-style: none;
    transition: color 0.15s;
}

summary::-webkit-details-marker { display: none; }

summary::before {
    content: '+ ';
    font-weight: 400;
}

details[open] summary::before {
    content: '- ';
}

summary:hover { color: var(--ink); }

/* ── Dialog/Modal ── */
dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    padding: 0;
    border: none;
    border-radius: var(--radius-lg);
    background: var(--card-bg);
    color: var(--ink);
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1000;
}

dialog::backdrop {
    background: rgba(45, 42, 38, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

dialog[open] {
    animation: dialogIn 0.25s var(--ease-out);
}

@keyframes dialogIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.96); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ── Item Info Dialog ── */
.item-modal-image {
    text-align: center;
    padding: 1rem 1rem 0;
}

.item-modal-image img {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.item-info-dl {
    margin: 0;
    padding: 8px 20px 16px;
}

.item-info-row {
    padding: 10px 0;
    border-bottom: 1px solid var(--divider);
}

.item-info-row:last-child {
    border-bottom: none;
}

.item-info-dl dt {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}

.item-info-dl dd {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.45;
    word-break: break-word;
    white-space: pre-line;
}


/* ── Messages (article elements) ── */
main > article.success,
main > article.error,
main > article.warning,
main > article.info {
    display: block;
    border-radius: var(--radius-md);
    border: 2px solid var(--accent);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    background: var(--accent-soft);
}

main > article.success { border: var(--green); background: var(--green-soft); }
main > article.error { border: var(--red); background: var(--red-soft); }

/* ═══════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════ */

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

main > * {
    animation: fadeUp 0.35s var(--ease-out) both;
}

@keyframes dropIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════ */

body > header {
    border-bottom: 1px solid var(--border-subtle);
    padding-top: 0;
    padding-bottom: 0;
    background: var(--page-bg);
}

body > header nav {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

body > header nav ul {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
}

header nav li { padding: 0.1rem; }
header nav li:has(.site-logo) { padding-left: 0; }

.site-logo {
    display: flex;
    align-items: center;
    gap: 0;
    text-decoration: none;
}

.logo-icon {
    display: block;
    flex-shrink: 0;
    color: var(--accent);
    position: relative;
    top: -4px;
    margin-right: -6px;
    transition: transform 0.3s var(--ease-out);
}

.site-logo:hover .logo-icon {
    transform: rotate(-6deg) scale(1.05);
}

.site-logo span:last-child {
    font-family: 'Fraunces', serif;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--ink);
}

/* ── Nav icon buttons ── */
.nav-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    color: var(--ink-muted);
    transition: color 0.2s var(--ease-out), background 0.2s var(--ease-out);
}

.nav-icon-btn:hover {
    color: var(--ink);
    background: var(--surface-raised);
}

/* ── Dropdown menus ── */
.tools-menu,
.user-menu { position: relative; }

.tools-dropdown,
.user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    margin: 0;
    padding: 0.35rem 0;
    list-style: none;
    background: var(--card-bg);
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    z-index: 100;
    animation: dropIn 0.15s var(--ease-out);
}

.tools-menu.open .tools-dropdown,
.user-menu.open .user-dropdown { display: block; }

.tools-dropdown li:not(.user-dropdown-name),
.user-dropdown li:not(.user-dropdown-name) { padding: 0; }

.tools-dropdown a,
.user-dropdown a {
    display: block;
    padding: 0.55rem 1rem;
    margin: 0;
    white-space: nowrap;
    font-size: 0.875rem;
    color: var(--ink);
    text-decoration: none;
    border-radius: 0;
    transition: background 0.15s var(--ease-out);
}

.tools-dropdown a:hover,
.user-dropdown a:hover { background: var(--surface-overlay); }

.tools-divider {
    border: none;
    border-top: 1px solid var(--border-subtle);
    margin: 0.3rem 0;
    padding: 0 !important;
    height: 0;
    line-height: 0;
    font-size: 0;
    display: block;
}

#theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

#theme-toggle svg {
    display: block;
    flex-shrink: 0;
}

.user-dropdown-name {
    padding: 0.65rem 1.15rem;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-muted);
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 0.15rem;
}

.logout-btn {
    background: none;
    border: none;
    padding: 0.55rem 1rem;
    margin: 0;
    font-size: 0.875rem;
    justify-content: flex-start;
    color: var(--ink);
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: background 0.15s var(--ease-out);
}

.logout-btn:hover { background: var(--surface-overlay); }

/* ═══════════════════════════════════════════════
   LIST INDEX
   ═══════════════════════════════════════════════ */

.list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.list-card {
    background: var(--card-bg);
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    color: var(--ink);
    transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.list-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: var(--ink);
}

.list-card-name {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 500;
    font-variation-settings: 'SOFT' 100, 'WONK' 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.list-card-meta {
    font-size: 0.75rem;
    color: var(--ink-muted);
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.list-type-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.1rem 0.5rem;
    border-radius: 2rem;
    background: var(--accent-soft);
    color: var(--accent);
}

.shared-badge {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.1rem 0.5rem;
    border-radius: 2rem;
    background: var(--green-soft);
    color: var(--green);
}

/* List card scheme accents */
.list-card[data-scheme] { border-left: 3px solid transparent; }
.list-card[data-scheme="warm-earth"] { border-left-color: #8C7A62; }
.list-card[data-scheme="sage"]       { border-left-color: #6B7F6B; }
.list-card[data-scheme="rose"]       { border-left-color: #A47070; }
.list-card[data-scheme="ocean"]      { border-left-color: #4A7082; }
.list-card[data-scheme="terracotta"] { border-left-color: #B8694A; }
.list-card[data-scheme="lavender"]   { border-left-color: #7B6B8A; }
.list-card[data-scheme="marigold"]   { border-left-color: #C49530; }
.list-card[data-scheme="sand"]       { border-left-color: #A08A6E; }

.sort-bar {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.sort-option {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 2rem;
    text-decoration: none;
    color: var(--ink-muted);
    transition: background 0.15s, color 0.15s;
}

.sort-option:hover {
    background: var(--card-bg);
    color: var(--ink);
}

.sort-option.active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 500;
}

.page-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 10;
}

.page-header-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-header-title .icon-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 0.5rem;
    margin: -0.5rem 0;
}

.page-header h2 {
    margin-bottom: 0;
    min-width: 0;
}

.list-count {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--ink-muted);
    margin-left: auto;
    white-space: nowrap;
}

.aisle-count {
    font-weight: 400;
    opacity: 0.7;
}

.list-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.6rem;
    min-height: 44px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink-muted);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s var(--ease-out), background 0.2s var(--ease-out);
    text-decoration: none;
    margin-bottom: 0;
}

.toolbar-btn:hover {
    color: var(--ink);
    background: var(--surface-raised);
}

.toolbar-btn.active {
    color: var(--accent);
    background: rgba(140, 122, 98, 0.1);
}

.bought-toggle-btn .eye-open { display: none; }
.bought-toggle-btn .eye-closed { display: inline; }
.bought-toggle-btn.active .eye-open { display: inline; }
.bought-toggle-btn.active .eye-closed { display: none; }

.page-header .btn-sm,
.btn-sm {
    font-size: 0.85rem;
    padding: 0.4rem 1rem;
}

/* ═══════════════════════════════════════════════
   LIST DETAIL
   ═══════════════════════════════════════════════ */

.store-tabs {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 1rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
}

.store-tabs::-webkit-scrollbar {
    display: none;
}

.store-tab {
    padding: 0.35rem 0.85rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    background: var(--surface-raised);
    color: var(--ink-muted);
    transition: all 0.2s var(--ease-out);
    white-space: nowrap;
    flex-shrink: 0;
}

.store-tab:hover {
    color: var(--ink);
    background: var(--surface-overlay);
}

.store-tab.active {
    background: var(--accent);
    color: #fff;
}

/* ── Aisle groups ── */
.aisle-group {
    margin-bottom: 1.5rem;
}

.aisle-header {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-muted);
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.aisle-chevron {
    transition: transform 0.2s var(--ease-out);
    flex-shrink: 0;
    color: var(--ink-muted);
}

.aisle-group.collapsed .aisle-chevron {
    transform: rotate(-90deg);
}

.aisle-group.collapsed .item-card {
    display: none;
}

/* ── List detail gear dropdown ── */
.list-detail-menu {
    position: relative;
}

.list-detail-menu .nav-icon-btn {
    margin: 0;
    padding: 0.3rem;
    background: transparent;
    border: none;
    color: var(--ink-muted);
}

.list-detail-menu .nav-icon-btn:hover {
    background: var(--surface-raised);
    color: var(--ink);
}

.list-detail-dropdown {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    margin: 0;
    padding: 0.5rem 0;
    list-style: none;
    background: var(--card-bg);
    border: none;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    z-index: 1100;
    white-space: nowrap;
    min-width: 160px;
}

@media (max-width: 599px) {
    .list-detail-dropdown {
        position: fixed;
        left: 0;
        right: 0;
        top: 0;
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
        white-space: normal;
        min-width: 0;
        animation: sheetDown 0.2s var(--ease-out);
    }
}

@keyframes sheetDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

.list-detail-menu.open .list-detail-dropdown {
    display: block;
}

.list-detail-dropdown li:not(.list-detail-dropdown-header) {
    padding: 0;
    margin: 0;
}

.list-detail-dropdown a {
    display: block;
    padding: 0.55rem 1rem;
    margin: 0;
    white-space: nowrap;
    font-size: 0.875rem;
    color: var(--ink);
    text-decoration: none;
    border-radius: 0;
    transition: background 0.15s var(--ease-out);
}

.list-detail-dropdown a:hover {
    background: var(--surface-overlay);
}

.list-detail-dropdown-header {
    padding: 0.65rem 1.15rem;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-muted);
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 0.15rem;
}

.list-detail-divider {
    border: none;
    border-top: 1px solid var(--border-subtle);
    margin: 0.3rem 0;
    padding: 0 !important;
    height: 0;
    line-height: 0;
    font-size: 0;
}

/* ── DropdownSheet (built by JS from flat .list-detail-dropdown) ── */
.dropdown-sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 1099;
}

.dropdown-sheet {
    flex-direction: column;
    max-height: 70vh;
    padding: 0;
}

@media (min-width: 600px) {
    .dropdown-sheet {
        max-height: 50vh;
    }
    .dropdown-sheet-close {
        display: none;
    }
}

.dropdown-sheet > .list-detail-dropdown-header {
    flex-shrink: 0;
}

.dropdown-sheet-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.25rem 0;
}

.dropdown-sheet-close {
    flex-shrink: 0;
    padding: 0.4rem 1rem 0.25rem;
    border-top: 1px solid var(--border-subtle);
}

.dropdown-sheet-close-btn {
    display: block;
    width: 100%;
    padding: 0.5rem;
    background: none;
    border: none;
    color: var(--ink-muted);
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.15s var(--ease-out);
    margin-bottom: 0;
}

.dropdown-sheet-close-btn:hover {
    background: var(--surface-overlay);
    color: var(--ink);
}

.store-select-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.store-select-row .store-select-item {
    flex: 1;
}

.store-select-item.active,
.filter-select-item.active {
    font-weight: 600;
    color: var(--accent);
}

.store-edit-link {
    padding: 0.55rem 1rem !important;
    font-size: 0.75rem !important;
    color: var(--ink-muted) !important;
    flex-shrink: 0;
}

.store-edit-link:hover {
    color: var(--accent) !important;
}

.store-filter-label {
    font-size: 0.8rem;
    color: var(--ink-muted);
    margin: 0.25rem 0 0.75rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.filter-pill-remove {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--surface-overlay);
    color: var(--ink);
    border: none;
    border-radius: 99px;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    font-family: inherit;
    cursor: pointer;
    line-height: 1.4;
}

.filter-pill-remove svg {
    opacity: 0.5;
}

.filter-pill-remove:hover {
    background: var(--accent);
    color: #fff;
}

.filter-pill-remove:hover svg {
    stroke: #fff;
    opacity: 1;
}

/* ── Tag filter & tag pills on cards ── */
.tag-filter-label {
    font-size: 0.8rem;
    color: var(--ink-muted);
    margin: 0.25rem 0 0.75rem;
}

.tag-filter-dropdown {
    padding: 0.5rem 0;
}

.tag-filter-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
}

.tag-filter-item input[type="checkbox"] {
    accent-color: var(--accent);
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.tag-filter-divider {
    border-top: 1px solid var(--surface-overlay);
    margin: 0.25rem 0;
}

.tag-filter-untagged {
    font-size: 0.8rem;
    color: var(--ink-muted);
}

.tag-dot {
    display: inline-block;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.toolbar-btn-active {
    color: var(--accent) !important;
}

.item-tag-pills {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
}

.item-tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.65rem;
    font-weight: 500;
    padding: 0 0.3rem;
    border-radius: 99px;
    background: var(--tag-color, var(--accent-soft));
    color: var(--tag-color, var(--accent));
    line-height: 1.4;
    white-space: nowrap;
}

.item-tag-pill[style*="--tag-color"] {
    background: color-mix(in srgb, var(--tag-color) 15%, transparent);
}

.item-details .item-tag-pills {
    margin-right: 0.35rem;
}

.item-info-dl .item-tag-pills {
    gap: 0.3rem;
}

.item-info-dl .item-tag-pill {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
}

.tag-picker-field {
    margin-bottom: 0.5rem;
}

.tag-picker-field label {
    margin-bottom: 0.35rem;
}

/* ── Detail header actions ── */
.detail-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.header-action-btn {
    font-size: 0.8rem;
    padding: 0.3rem 0.75rem;
    margin-bottom: 0;
}

/* ── Collapsible section (details/summary for add store/aisle) ── */
.collapsible-section {
    margin-bottom: 1rem;
}

.detail-summary {
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--ink-muted);
}

/* ── Quick-add URL bar ── */
.quick-add-url-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.quick-add-url-bar input[type="url"] {
    flex: 1;
    margin-bottom: 0;
    font-size: 0.95rem;
}

.quick-add-url-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
    margin-bottom: 0;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    border: none;
    cursor: pointer;
}

.quick-add-url-btn:hover {
    opacity: 0.85;
}

.quick-add-url-btn[aria-busy="true"] {
    opacity: 0.6;
    pointer-events: none;
}

/* ── Inline add form ── */
.inline-add-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.inline-add-form input {
    margin-bottom: 0;
    flex: 1;
}

.inline-add-form button {
    margin-bottom: 0;
}

/* ── Inline form reset (remove margin from inline forms) ── */
.inline-form-reset {
    margin: 0;
}

/* ── Done shopping row ── */
.done-shopping-row {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.done-shopping-row form {
    width: 100%;
    text-align: center;
}

/* ── Back link section ── */

/* ── Muted text utilities ── */
.muted-text {
    color: var(--ink-muted);
    font-size: 0.9rem;
}

.muted-text-sm {
    color: var(--ink-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* ── Trip detail meta ── */
.trip-detail-meta {
    margin-bottom: 1.5rem;
    color: var(--ink-muted);
    font-size: 0.9rem;
}

.trip-item-status {
    flex-shrink: 0;
    margin-left: auto;
    display: flex;
    align-items: center;
    align-self: center;
}

.trip-item-status form {
    display: flex;
    align-items: center;
    margin: 0;
}

.on-list-badge,
.add-to-list-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--ink-muted);
    white-space: nowrap;
    padding: 4px 0;
}

.add-to-list-btn {
    background: none;
    border: none;
    cursor: pointer;
    margin-bottom: 0;
}

.add-to-list-btn:hover {
    color: var(--ink);
}

/* ═══════════════════════════════════════════════
   ITEM CARDS
   ═══════════════════════════════════════════════ */

.item-card {
    background: var(--card-bg);
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
    animation: fadeUp 0.25s var(--ease-out) both;
    cursor: pointer;
}

.item-card.no-fade {
    animation: none;
}

.item-card.long-press-flash {
    animation: longPressFlash 0.4s var(--ease-out);
}

@keyframes longPressFlash {
    0%   { background: var(--accent); }
    100% { background: var(--card-bg); }
}

@media (hover: hover) {
    .item-card:hover {
        transform: translateY(-1px);
        box-shadow: var(--shadow-sm);
    }
}

.item-card.is-done {
}

.item-card.done-hidden {
    display: none;
}

@keyframes slideUp {
    from { max-height: 80px; opacity: 1; margin-bottom: 0.4rem; padding-top: 0.65rem; padding-bottom: 0.65rem; }
    to   { max-height: 0; opacity: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; }
}

.item-card.sliding-up {
    overflow: hidden;
    animation: slideUp 0.35s var(--ease-out) forwards;
}

.item-card.is-snoozed {
    opacity: 0.4;
    padding: 0.35rem 0.85rem;
    cursor: pointer;
}

.item-card.is-snoozed .item-name {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.item-card.is-snoozed .snoozed-label {
    font-style: italic;
}

.snoozed-alert {
    font-size: 0.8rem;
    color: var(--ink-muted);
    margin: 0.25rem 0 0.75rem;
}

.snoozed-alert a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.snoozed-alert a:hover {
    text-decoration: underline;
}

.item-card.htmx-request {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.item-card.is-done .item-name {
    text-decoration: line-through;
}

.item-check {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border-subtle);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--ease-out);
    background: none;
    padding: 0;
    margin: 0;
    color: transparent;
}

.item-check svg {
    width: 22px;
    height: 22px;
}

.item-check:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.item-card.is-done .item-check {
    border-color: var(--green);
    background: var(--green);
    color: #fff;
}

/* Checked state for shopping trip display */
.item-check.is-checked {
    border-color: var(--green);
    background: var(--green);
    color: #fff;
}

.item-info {
    flex: 1;
    min-width: 0;
}

.item-name {
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.3;
    word-break: break-word;
}

.organic-icon {
    vertical-align: -2px;
    margin-left: .2rem;
    opacity: 0.85;
}

.item-details {
    font-size: 0.75rem;
    color: var(--ink-muted);
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.15rem;
}

.item-quantity {
    font-weight: 500;
}

.item-brand {
    color: var(--ink-faint);
}

.item-category {
    font-weight: 500;
}

.item-notes {
    color: var(--ink-faint);
    font-style: italic;
}

.category-chip {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 500;
    padding: 0.1rem 0.45rem;
    border-radius: 2rem;
    background: var(--surface-raised);
    white-space: nowrap;
}

.item-actions {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.item-star-btn {
    color: var(--ink-muted);
}
.item-star-btn:hover {
    color: var(--accent);
    background: none;
}
.item-star-btn.starred {
    color: #d4a017;
}

/* ── Item three-dot menu ── */
.item-menu {
    position: relative;
}

.item-dropdown {
    display: none;
    position: fixed;
    margin: 0;
    padding: 0.35rem 0;
    list-style: none;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 130px;
    z-index: 9999;
}



.item-dropdown li { padding: 0; }

.item-dropdown a,
.item-dropdown button {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    width: 100%;
    padding: 0.55rem 1rem;
    margin: 0;
    white-space: nowrap;
    font-size: 0.875rem;
    font-family: var(--font-body);
    color: var(--ink);
    text-decoration: none;
    background: none;
    border: none;
    border-radius: 0;
    cursor: pointer;
}

.item-dropdown a:hover,
.item-dropdown button:hover {
    background: var(--surface-overlay);
}

.item-dropdown-danger {
    color: var(--danger, #c44) !important;
}

/* Desktop: show dropdown items inline as icon buttons, hide three-dot trigger */
@media (min-width: 600px) {
    .item-menu-trigger {
        display: none !important;
    }

    .item-menu .item-dropdown {
        display: flex !important;
        position: static;
        background: none;
        box-shadow: none;
        padding: 0;
        min-width: 0;
        gap: 0.15rem;
    }

    .item-menu .item-dropdown li {
        display: flex;
    }

    .item-menu .item-dropdown a,
    .item-menu .item-dropdown button {
        display: flex;
        align-items: center;
        justify-content: center;
        width: auto;
        padding: 0.25rem;
        gap: 0;
        font-size: 0;
        color: var(--ink-muted);
        border-radius: var(--radius-sm);
    }

    .item-menu .item-dropdown a:hover,
    .item-menu .item-dropdown button:hover {
        background: var(--surface-overlay);
        color: var(--ink);
    }

    .item-menu .item-dropdown .item-dropdown-danger {
        color: var(--ink-muted) !important;
    }

    .item-menu .item-dropdown .item-dropdown-danger:hover {
        color: var(--danger, #c44) !important;
    }

    .item-menu .item-dropdown svg {
        flex-shrink: 0;
    }
}

.item-price {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--ink-muted);
    white-space: nowrap;
}

.item-store-prices {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 2px;
}
.store-price-tag {
    font-size: 0.7rem;
    color: var(--ink-muted);
    background: var(--page-bg);
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.store-prices-section {
    margin-top: 0.5rem;
}
.store-prices-section > label {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    display: block;
}
.store-price-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}
.store-price-label {
    flex: 1;
    font-size: 0.9rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.store-price-input {
    width: 7rem;
    font-size: 0.9rem;
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--page-bg);
    color: var(--ink);
}

.item-image-thumb {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    cursor: pointer;
}


/* ── Image upload widget ── */
.image-upload-field {
    margin-bottom: 1rem;
}

.image-upload-field > label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

.image-upload-preview {
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.image-upload-preview img {
    display: block;
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    background: var(--page-bg);
    border: 1px solid var(--divider);
}

.image-upload-actions {
    display: flex;
    gap: 0.5rem;
}

.image-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    font-size: 0.82rem;
    font-family: var(--font-body);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    color: var(--ink);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.image-upload-btn:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.image-upload-btn.danger {
    color: var(--danger, #c44);
    border-color: var(--danger, #c44);
}

.image-upload-btn.danger:hover {
    background: rgba(204, 68, 68, 0.08);
}

.image-upload-btn[hidden],
.image-upload-field input[type="file"] {
    display: none;
}

/* ── Item list link (search results) ── */
.item-list-link {
    font-size: 0.75rem;
    color: var(--accent);
    text-decoration: none;
}

.item-list-link:hover {
    color: var(--accent-hover);
}

/* ── Icon buttons ── */
.icon-btn {
    background: none;
    border: none;
    padding: 0.4rem;
    margin: 0;
    cursor: pointer;
    color: var(--ink-faint);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: color 0.2s var(--ease-out), background 0.2s var(--ease-out);
}

.icon-btn:hover {
    color: var(--ink);
    background: var(--surface-raised);
}

.icon-btn.danger:hover {
    color: var(--red);
    background: var(--red-soft);
}

/* ── Bought section ── */
.bought-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border-subtle);
}

.bought-toggle-btn {
    background: none;
    border: none;
    padding: 0.4rem 0.85rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--ink-muted);
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    background: var(--surface-raised);
}

.bought-toggle-btn:hover {
    background: var(--surface-overlay);
    color: var(--ink);
}

/* ── Store / Tag filtering & Offline ── */
.item-card.store-filtered,
.item-card.genre-filtered,
.item-card.tag-filtered {
    display: none !important;
}

.aisle-group.tag-filtered-group {
    display: none !important;
}

.filter-select-item .genre-check {
    display: inline-block;
    width: 1.2em;
    visibility: hidden;
    color: var(--accent);
    font-weight: 600;
}

.filter-select-item.active .genre-check {
    visibility: visible;
}

.offline-banner {
    background: var(--accent);
    color: #fff;
    text-align: center;
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
}

.sync-indicator {
    flex-shrink: 0;
    color: var(--ink-muted);
    animation: syncPulse 1.5s ease-in-out infinite;
}

@keyframes syncPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Add item input ── */
.add-item-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.add-item-bar input[type="text"] {
    flex: 1;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--surface-raised);
    padding: 0.6rem 1rem;
    font-size: 0.875rem;
    margin-bottom: 0;
}

.add-item-bar input[type="text"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.add-item-bar button {
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 0;
}

/* ── Autocomplete ── */
.autocomplete-wrap {
    position: relative;
    flex: 1;
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    background: var(--card-bg);
    border: none;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.autocomplete-results:not(:empty) {
    display: block;
}

.autocomplete-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.15s var(--ease-out);
}

.autocomplete-item:hover {
    background: var(--surface-overlay);
}

.autocomplete-item .ac-category {
    font-size: 0.7rem;
    color: var(--ink-faint);
    margin-left: 0.35rem;
}

.autocomplete-item .ac-on-list {
    font-size: 0.65rem;
    color: var(--ink-faint);
    margin-left: 0.35rem;
    font-style: italic;
}

.autocomplete-item.ac-existing {
    opacity: 0.65;
}

/* Autocomplete inside quick-add dialog */
#quick-add-dialog .autocomplete-wrap {
    position: relative;
}

#quick-add-dialog .autocomplete-results {
    z-index: 300;
}

/* Overlay that dims form fields below autocomplete */
.quick-add-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--page-bg);
    opacity: 0.6;
    z-index: 200;
    border-radius: var(--radius-lg);
    pointer-events: auto;
    cursor: default;
}

.quick-add-overlay[hidden] {
    display: none;
}

/* Keep name field + autocomplete above overlay */
#quick-add-dialog article header {
    position: relative;
    z-index: 250;
}

#quick-add-dialog .autocomplete-wrap {
    z-index: 250;
}


/* Duplicate input highlight */
#quick-add-name.input-duplicate {
    border-color: var(--amber, #C4993C);
    box-shadow: 0 0 0 2px rgba(196, 153, 60, 0.25);
}

/* Duplicate prompt banner */
#quick-add-dialog .quick-add-duplicate-prompt {
    position: relative;
    z-index: 250;
    background: rgba(196, 153, 60, 0.18);
    border: 1px solid rgba(196, 153, 60, 0.35);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.75rem;
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--ink);
}

#quick-add-dialog .quick-add-duplicate-prompt[hidden] {
    display: none !important;
}

/* Disable form fields while duplicate banner is showing */
.quick-add-scroll.duplicate-active {
    opacity: 0.35;
    pointer-events: none;
}

#quick-add-dialog .quick-add-duplicate-prompt .duplicate-actions {
    display: flex;
    gap: 0.5rem;
}

#quick-add-dialog .quick-add-duplicate-prompt .btn-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    border: none;
    transition: background 0.15s var(--ease-out);
}

#quick-add-dialog .quick-add-duplicate-prompt .btn-primary {
    background: var(--accent);
    color: #fff;
}

#quick-add-dialog .quick-add-duplicate-prompt .btn-primary:hover {
    background: var(--accent-hover, #7A6A54);
}

#quick-add-dialog .quick-add-duplicate-prompt .btn-secondary {
    background: var(--surface-overlay);
    color: var(--ink-muted);
}

#quick-add-dialog .quick-add-duplicate-prompt .btn-secondary:hover {
    background: var(--border-subtle);
}

/* ═══════════════════════════════════════════════
   SHOPPING TRIP HISTORY
   ═══════════════════════════════════════════════ */

.trip-card {
    background: var(--card-bg);
    border: none;
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 0.6rem;
    display: block;
    text-decoration: none;
    color: var(--ink);
    transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

.trip-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: var(--ink);
}

.trip-date {
    font-weight: 500;
    font-size: 0.95rem;
}

.trip-meta {
    font-size: 0.8rem;
    color: var(--ink-muted);
    margin-top: 0.2rem;
}

/* ═══════════════════════════════════════════════
   SHARING
   ═══════════════════════════════════════════════ */

.share-list {
    list-style: none;
    padding: 0;
    margin-top: 1rem;
}

.share-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.share-user {
    font-weight: 500;
}

.share-permission {
    font-size: 0.8rem;
    color: var(--ink-muted);
}

/* ═══════════════════════════════════════════════
   TOOLBAR ADD BUTTON
   ═══════════════════════════════════════════════ */

.toolbar-add-btn {
    margin-left: auto;
    margin-top: 0;
    margin-bottom: 0;
    align-self: center;
    line-height: 1;
    background: transparent;
    color: var(--accent);
    border: 1.5px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.75rem;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.toolbar-add-btn:hover {
    background: var(--accent);
    color: #fff;
}

/* ═══════════════════════════════════════════════
   FAB (legacy, unused)
   ═══════════════════════════════════════════════ */

.fab {
    position: fixed;
    bottom: 1.75rem;
    right: 1.75rem;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg), 0 0 0 0 var(--accent-soft);
    z-index: 200;
    transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
}

.fab:hover {
    transform: scale(1.04);
    box-shadow: var(--shadow-lg), 0 0 0 8px var(--accent-soft);
    color: #fff;
}

.fab svg { display: block; }

/* ═══════════════════════════════════════════════
   FULLSCREEN DIALOG (reusable)
   ═══════════════════════════════════════════════ */

.fullscreen-dialog {
    max-width: 440px;
    width: 90vw;
    max-height: 85vh;
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow-lg);
    background: var(--card-bg);
    color: var(--ink);
    padding: 0;
    overflow: visible;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
}

.fullscreen-dialog[open] {
    display: flex;
    flex-direction: column;
}

.fullscreen-dialog::backdrop {
    background: rgba(45, 42, 38, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.fullscreen-dialog > article {
    margin: 0;
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: none;
    background: var(--card-bg);
    color: var(--ink);
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 85vh;
}

.fullscreen-dialog .dialog-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1rem 1.25rem;
    min-height: 0;
}

@media (max-width: 599px) {
    .fullscreen-dialog {
        width: calc(100vw - 2rem);
        max-width: 440px;
        max-height: 85vh;
        border-radius: var(--radius-lg);
    }

    .fullscreen-dialog > article {
        max-height: 85vh;
        border-radius: var(--radius-lg);
    }
}

/* ═══════════════════════════════════════════════
   QUICK-ADD DIALOG
   ═══════════════════════════════════════════════ */

.fullscreen-dialog article header {
    background: transparent;
    border-bottom: 1px solid var(--border-subtle);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.fullscreen-dialog article header h3 {
    font-family: var(--font-display);
    font-variation-settings: 'SOFT' 100, 'WONK' 1;
    color: var(--ink);
    margin: 0;
}

.fullscreen-dialog article header button[aria-label="Close"],
.fullscreen-dialog article header button[rel="prev"] {
    background: transparent;
    border: none;
    color: var(--ink-muted);
    cursor: pointer;
    padding: 0.25rem;
    margin: 0;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: auto;
    min-height: auto;
}

.fullscreen-dialog article header button[aria-label="Close"]:hover,
.fullscreen-dialog article header button[rel="prev"]:hover {
    background: var(--surface-overlay);
    color: var(--ink);
}

#quick-add-dialog label {
    color: var(--ink-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

#quick-add-dialog form {
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}

.quick-add-name-area {
    padding: 1rem 1.25rem 0;
    position: relative;
    z-index: 250;
    flex-shrink: 0;
}

.quick-add-name-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.quick-add-name-row input {
    flex: 1;
    min-width: 0;
}

.quick-add-inline-submit {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    margin-bottom: 1rem !important;
}

.quick-add-inline-submit:hover {
    filter: brightness(1.08);
}

.tmdb-preview {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: var(--surface-overlay);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.tmdb-preview[hidden] {
    display: none;
}

.tmdb-preview-poster {
    width: 50px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.tmdb-preview-info {
    flex: 1;
    min-width: 0;
}

.tmdb-preview-title {
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1.3;
}

.tmdb-preview-meta {
    font-size: 0.75rem;
    color: var(--ink-muted);
    margin-top: 0.1rem;
}

.tmdb-preview-overview {
    font-size: 0.75rem;
    color: var(--ink-muted);
    margin-top: 0.25rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.quick-add-scroll {
    padding: 0.5rem 1.25rem 1rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

#quick-add-dialog input,
#quick-add-dialog select {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink);
}

#quick-add-dialog input:focus,
#quick-add-dialog select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

#quick-add-dialog footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border-top: 1px solid var(--border-subtle);
    padding: 0.75rem 1.25rem;
}

#quick-add-dialog footer button {
    flex: 1;
}

.quick-add-barcode-top {
    display: flex;
    width: calc(100% - 2.5rem);
    justify-content: center;
    margin: 0.75rem 1.25rem 0;
    background: transparent;
    color: var(--ink-muted);
    border: 1px solid var(--border-subtle);
}

.quick-add-barcode-top + .error {
    margin: 0.35rem 1.25rem 0;
}

#quick-add-dialog button[type="submit"] {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    margin-bottom: 0;
}

#quick-add-dialog button[type="submit"]:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

#quick-add-dialog [aria-label="Close"] {
    background: none;
    border: none;
    color: var(--ink-faint);
    cursor: pointer;
    padding: 0.25rem;
    margin: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: color 0.15s, background 0.15s;
    font-size: 1.2rem;
    line-height: 1;
}

#quick-add-dialog [aria-label="Close"]::before {
    content: '\00D7';
}

#quick-add-dialog [aria-label="Close"]:hover {
    color: var(--ink);
    background: var(--surface-raised);
}

.quick-add-checkbox {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.quick-add-checkbox input[type="checkbox"] {
    width: 1.15rem;
    height: 1.15rem;
    accent-color: var(--accent);
    margin: 0;
    cursor: pointer;
}

#quick-add-grocery-fields[hidden] {
    display: none;
}

.select-with-add {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.select-with-add button {
    margin-bottom: 1rem;
}

.select-with-add select {
    flex: 1;
    min-width: 0;
}

.add-inline-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    flex-shrink: 0;
    padding: 0;
    margin: 0;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--surface-raised, var(--card-bg));
    color: var(--ink-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.add-inline-btn:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.add-inline-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.add-inline-btn:disabled:hover {
    background: var(--surface-raised, var(--card-bg));
    color: var(--ink-muted);
}

#quick-add-dialog textarea {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink);
    resize: vertical;
    font-family: inherit;
    font-size: inherit;
    min-height: 2.5rem;
}

#quick-add-dialog textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

.qty-stepper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.qty-stepper .qty-input {
    width: 3.5rem;
    text-align: center;
    -moz-appearance: textfield;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
    flex-shrink: 0;
}

.qty-stepper .qty-input::-webkit-inner-spin-button,
.qty-stepper .qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-btn-group {
    display: flex;
    margin-left: auto;
    margin-bottom: 1rem;
}

.qty-stepper .qty-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 6rem;
    height: 2.5rem;
    padding: 0;
    margin: 0;
    border: 1px solid var(--border-subtle);
    background: var(--surface-raised, var(--card-bg));
    color: var(--ink);
    font-size: 1.15rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
}

.qty-stepper .qty-btn:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.qty-stepper .qty-dec {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    border-right: none;
}

.qty-stepper .qty-inc {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.days-stepper-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0 0.75rem;
    font-size: 0.85rem;
}
.days-stepper-row .days-stepper-label {
    color: var(--ink-muted);
}
.days-stepper-row .qty-stepper {
    gap: 0;
}
.days-stepper-row .qty-stepper .qty-btn {
    width: 2.25rem;
    height: 2rem;
    font-size: 1rem;
}
.days-stepper-row .qty-stepper .qty-input {
    width: 2.25rem;
    height: 2rem;
    font-size: 0.85rem;
    border-radius: 0;
    border-left: none;
    border-right: none;
    margin-bottom: 0;
}

/* ═══════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════ */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: var(--ink-muted);
}
.back-link:hover { color: var(--accent); }

.form-card {
    max-width: 580px;
    margin: 0 auto;
    border: none;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    background: var(--card-bg);
}

.form-card h2 { margin-bottom: 1.25rem; }

.form-card label {
    font-size: 0.875rem;
    font-weight: 500;
}

.form-card input,
.form-card select,
.form-card textarea {
    border-radius: var(--radius-sm);
}

.form-card button[type="submit"] {
    border-radius: var(--radius-sm);
    background: var(--accent);
    border-color: var(--accent);
    font-weight: 500;
}

.form-card button[type="submit"]:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.form-actions button,
.form-actions a {
    width: 100%;
    text-align: center;
    margin-bottom: 0;
}

/* ── Danger outline button ── */
.danger-outline-btn {
    background: transparent;
    color: var(--red);
    border: 1px solid var(--red);
}

.danger-outline-btn:hover {
    background: var(--red-soft);
    color: var(--red);
    border-color: var(--red);
}

.confirm-dialog-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.confirm-dialog-actions .btn-wide {
    flex: 1;
}

/* ── List type chooser ── */
.list-type-chooser-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.6rem 0.85rem;
    background: var(--page-bg);
    border: 1px solid var(--ink-faint);
    border-radius: var(--radius-sm);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s;
    margin-bottom: 0;
}

.list-type-chooser-btn:hover {
    border-color: var(--accent);
    background: var(--page-bg);
    color: var(--ink);
}

/* Hide the native select — the chooser button replaces it */
p:has(.list-type-chooser-btn) > select {
    display: none;
}

.type-chooser-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.type-chooser-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    width: 100%;
    padding: 0.7rem 0.85rem;
    background: var(--page-bg);
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: left;
    transition: all 0.15s;
    margin-bottom: 0;
    color: var(--ink);
}

.type-chooser-option:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--ink);
}

.type-chooser-option.active {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.type-chooser-name {
    font-weight: 600;
    font-size: 0.92rem;
}

.type-chooser-desc {
    font-size: 0.78rem;
    color: var(--ink-muted);
    line-height: 1.35;
}

/* ── Revoke button ── */
.revoke-btn {
    padding: 0.25rem 0.75rem;
    margin: 0;
    font-size: 0.8rem;
}

/* ═══════════════════════════════════════════════
   AUTH CARDS
   ═══════════════════════════════════════════════ */

.verification-banner {
    background: rgba(196, 153, 60, 0.12);
    border: 2px solid var(--accent-tint, #c4993c);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--ink);
}

.verification-banner a {
    font-weight: 600;
}

.auth-card {
    max-width: 400px;
    margin: 2rem auto;
    border: none;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    text-align: center;
    background: var(--card-bg);
}

.auth-card h2 { margin-bottom: 1.25rem; }
.auth-card form { text-align: left; }

.auth-card p {
    font-size: 0.875rem;
    color: var(--ink-muted);
    margin-top: 1rem;
}

.auth-card p a {
    color: var(--accent);
    font-weight: 500;
}

.auth-card button[type="submit"] {
    width: 100%;
    border-radius: var(--radius-sm);
    background: var(--accent);
    border-color: var(--accent);
    font-weight: 500;
}

.auth-card button[type="submit"]:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

/* ═══════════════════════════════════════════════
   API TOKEN PAGE
   ═══════════════════════════════════════════════ */

.token-callout {
    border: 2px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 1rem;
    background: var(--accent-soft);
    margin-bottom: 1rem;
}

.token-callout .token-display {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
}

.token-callout code {
    flex: 1;
    word-break: break-all;
    padding: 0.5rem;
    background: var(--surface-raised);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
}

/* ═══════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════ */

body > footer {
    border-top: 1px solid var(--border-subtle);
    padding-top: 1.5rem;
    margin-top: 3rem;
    padding-bottom: 1.5rem;
}

body > footer small {
    color: var(--ink-faint);
    font-size: 0.8rem;
}

/* ═══════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════ */

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--ink-muted);
}

.no-results-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--ink-muted);
    display: none;
}
.no-results-state button {
    color: var(--accent);
    background: none;
    border: none;
    cursor: pointer;
    font-size: inherit;
    text-decoration: underline;
    padding: 0;
}

.empty-state a {
    color: var(--accent);
    font-weight: 500;
}

.all-done-state {
    font-family: var(--ff-display);
    font-size: 1.15rem;
    font-style: italic;
    color: var(--accent);
}

/* ═══════════════════════════════════════════════
   BARCODE
   ═══════════════════════════════════════════════ */

.barcode-btn {
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    color: var(--ink-muted);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    transition: all 0.2s var(--ease-out);
}

.barcode-btn:hover,
.barcode-btn:active,
.barcode-btn:focus {
    background: transparent;
    border-color: var(--accent);
    color: var(--accent);
}

/* ── Barcode Scanner Overlay ── */
.barcode-scanner-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.barcode-scanner-box {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    width: 100%;
    max-width: 420px;
    position: relative;
}

.barcode-scanner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    font-weight: 500;
}

.barcode-scanner-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--muted);
    padding: 0 4px;
    line-height: 1;
}

.barcode-scanner-close:hover {
    color: var(--ink);
}

#barcode-scanner-reader {
    width: 100%;
    background: #000;
}

#barcode-scanner-reader video {
    width: 100%;
    display: block;
    object-fit: cover;
}

#barcode-scanner-reader img[alt="Info icon"] {
    display: none;
}

#html5-qrcode-button-camera-permission,
#html5-qrcode-button-camera-stop,
#html5-qrcode-button-camera-start {
    display: none;
}

.barcode-scanner-status {
    text-align: center;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    color: var(--ink-muted);
}

.barcode-scanner-status.found {
    color: var(--green);
    font-weight: 500;
}

/* ═══════════════════════════════════════════════
   DONE SHOPPING BUTTON
   ═══════════════════════════════════════════════ */

.done-shopping-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.65rem 1.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s var(--ease-out), transform 0.2s var(--ease-out);
    margin: 0;
}

.done-shopping-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.done-shopping-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.done-shopping-store-label:not(:empty) {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.85;
    margin-top: 2px;
}

/* ═══════════════════════════════════════════════
   MOBILE
   ═══════════════════════════════════════════════ */

@media (max-width: 768px) {
    .fab {
        bottom: 1.25rem;
        right: 1.25rem;
    }

    .form-card {
        padding: 1.25rem;
        box-shadow: none;
    }

    .auth-card {
        padding: 1.5rem;
        box-shadow: none;
    }
}

/* ═══════════════════════════════════════════════
   ERROR CLASSES
   ═══════════════════════════════════════════════ */

.error {
    color: var(--red);
}

/* ═══════════════════════════════════════════════
   PILL PICKER (multi-select store tags)
   ═══════════════════════════════════════════════ */

.pill-picker-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.pill-picker-row .add-inline-btn {
    flex-shrink: 0;
    margin: 0;
}

.pill-picker {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.4rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    min-width: 0;
    flex: 1;
    padding-bottom: 2px;
}

.pill-picker::-webkit-scrollbar {
    display: none;
}

.pill-picker .pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    background: var(--surface-raised);
    color: var(--ink-muted);
    border: 1px solid var(--border-subtle);
    transition: all 0.15s var(--ease-out);
    margin: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

.pill-picker .pill input[type="checkbox"] {
    display: none;
}

.pill-picker .pill:hover {
    background: var(--surface-overlay);
    color: var(--ink);
}

.pill-picker .pill.selected,
#quick-add-dialog .pill-picker .pill.selected {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.pill-picker .pill.selected:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

/* ═══════════════════════════════════════════════
   STORE EDIT PAGE (aisle ordering)
   ═══════════════════════════════════════════════ */

.store-default-toggle {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1rem;
    cursor: pointer;
}

.store-default-toggle input[type="checkbox"] {
    margin-top: 0.2rem;
}

.store-default-help {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--ink-muted);
    margin-top: 0.15rem;
}

.store-edit-aisle-list {
    margin-bottom: 1rem;
}

.store-edit-aisle-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.85rem;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    margin-bottom: 0.35rem;
    transition: box-shadow 0.15s var(--ease-out);
}

.store-edit-aisle-item:hover {
    box-shadow: var(--shadow-sm);
}

.store-edit-aisle-item .drag-handle {
    cursor: grab;
    color: var(--ink-faint);
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.store-edit-aisle-item .drag-handle:active {
    cursor: grabbing;
}

.store-edit-aisle-item .aisle-item-name {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
}

.store-edit-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--card-border, var(--card-bg));
}

@media (min-width: 600px) {
    .store-edit-actions {
        flex-direction: row;
    }
    .store-edit-save,
    .store-edit-cancel {
        flex: 1;
    }
}

.store-edit-save {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    width: 100%;
}

.store-edit-save:hover {
    opacity: 0.9;
}

.store-edit-cancel {
    padding: 0.6rem 1.5rem;
    text-align: center;
    width: 100%;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
}


/* ═══════════════════════════════════════════════
   TODO LIST — PRIORITY DOTS & DUE DATES
   ═══════════════════════════════════════════════ */

.priority-high .item-name::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--red);
    margin-right: 0.4rem;
    flex-shrink: 0;
    vertical-align: middle;
}

.priority-medium .item-name::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #D4A03C;
    margin-right: 0.4rem;
    flex-shrink: 0;
    vertical-align: middle;
}

.priority-low .item-name::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ink-faint);
    margin-right: 0.4rem;
    flex-shrink: 0;
    vertical-align: middle;
}

.item-due {
    font-size: 0.75rem;
    color: var(--ink-muted);
}

.item-due.overdue {
    color: var(--red);
    font-weight: 600;
}

/* ── Sort Dropdown ── */
.sort-menu { position: relative; }

.sort-dropdown {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    margin: 0;
    padding: 0.35rem 0;
    list-style: none;
    background: var(--card-bg);
    border: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    animation: dropIn 0.15s var(--ease-out);
}

.sort-menu.open .sort-dropdown { display: block; }

.sort-dropdown li { padding: 0; }

.sort-dropdown a {
    display: block;
    padding: 0.55rem 1rem;
    margin: 0;
    white-space: nowrap;
    font-size: 0.875rem;
    color: var(--ink);
    text-decoration: none;
    border-radius: 0;
    transition: background 0.15s var(--ease-out);
}

.sort-dropdown a:hover { background: var(--surface-overlay); }

.sort-dropdown a.active {
    color: var(--accent);
    font-weight: 600;
}

.sort-divider {
    border: none;
    border-top: 1px solid var(--border-subtle);
    margin: 0.3rem 0;
    padding: 0 !important;
    height: 0;
    line-height: 0;
    font-size: 0;
    display: block;
}

/* ── Due Date Quick Pills ── */
.due-date-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.due-date-row > * {
    margin-bottom: 0 !important;
}

.due-date-row input[type="date"] {
    flex: 1;
    min-width: 0;
}

.due-date-pills {
    display: flex;
    gap: 0.3rem;
    flex-shrink: 0;
}

.due-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    background: var(--surface-raised);
    color: var(--ink-muted);
    border: 1px solid var(--border-subtle);
    transition: all 0.15s var(--ease-out);
    white-space: nowrap;
    margin: 0;
    line-height: 1.3;
}

.due-pill:hover {
    background: var(--surface-overlay);
    color: var(--ink);
}

.due-pill.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ── Priority Pills ── */
.priority-pills {
    display: flex;
    gap: 0.35rem;
}

.priority-pill {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.5rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border-subtle);
    background: var(--surface-raised);
    color: var(--ink-muted);
    transition: all 0.15s var(--ease-out);
    margin: 0;
}

.priority-pill:hover {
    background: var(--surface-overlay);
}

.priority-pill.high.active {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}

.priority-pill.medium.active {
    background: #D4A03C;
    border-color: #D4A03C;
    color: #fff;
}

.priority-pill.low.active {
    background: var(--ink-faint);
    border-color: var(--ink-faint);
    color: #fff;
}

#quick-add-todo-fields[hidden] {
    display: none;
}

/* ═══════════════════════════════════════════════
   LIST SWITCHER FAB + BOTTOM SHEET
   ═══════════════════════════════════════════════ */

.fab-speed-dial {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    pointer-events: none;
}

.fab-speed-dial.is-open {
    pointer-events: auto;
}

.fab-trigger {
    pointer-events: auto;
    width: 54px;
    height: 54px;
    min-width: 54px;
    min-height: 54px;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(255,255,255,0.18) 0%, transparent 50%, rgba(0,0,0,0.12) 100%), var(--accent);
    color: #fff;
    border: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: filter 0.15s var(--ease-out), transform 0.2s var(--ease-out);
}

.fab-trigger:hover {
    filter: brightness(1.08);
    transform: scale(1.05);
}

.fab-trigger:active {
    transform: scale(0.95);
}

.fab-trigger .fab-icon-close {
    display: none;
}

.fab-speed-dial.is-open .fab-trigger {
    background: linear-gradient(145deg, rgba(255,255,255,0.18) 0%, transparent 50%, rgba(0,0,0,0.12) 100%), var(--ink-muted);
}

.fab-speed-dial.is-open .fab-trigger .fab-icon-open {
    display: none;
}

.fab-speed-dial.is-open .fab-trigger .fab-icon-close {
    display: block;
}

.fab-panel {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    transform: translateY(8px) scale(0.96);
    transform-origin: bottom right;
    transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}

.fab-speed-dial.is-open .fab-panel {
    pointer-events: auto;
    opacity: 1;
    transform: translateY(0) scale(1);
}

.fab-panel-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.9rem;
    border: none;
    background: none;
    cursor: pointer;
    text-decoration: none;
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 0.9rem;
    width: 100%;
    text-align: left;
    transition: background 0.12s var(--ease-out);
    -webkit-tap-highlight-color: transparent;
}

.fab-panel-item:hover {
    background: var(--surface-overlay);
}

.fab-panel-add {
    color: var(--accent);
    font-weight: 600;
    border-top: 1px solid var(--border-subtle);
    padding: 0.7rem 0.9rem;
    margin-bottom: 0;
}

.fab-panel-add svg {
    flex-shrink: 0;
}

.fab-panel-list {
    justify-content: space-between;
}

.fab-panel-list-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.fab-panel-list-type {
    font-size: 0.75rem;
    color: var(--ink-faint);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

.fab-panel-all {
    color: var(--ink-muted);
    font-weight: 500;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-subtle);
    margin: 0;
    padding: 0.55rem 0.9rem;
    justify-content: space-between;
}

.fab-panel-all svg {
    flex-shrink: 0;
    color: var(--ink-faint);
}

.fab-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s var(--ease-out);
}

.fab-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 599px) {
    .fab-speed-dial {
        bottom: 20px;
        right: 16px;
    }

    .fab-trigger {
        width: 54px;
        height: 54px;
        min-width: 54px;
        min-height: 54px;
    }

    .fab-panel {
        min-width: 180px;
    }
}

.list-switcher-sheet {
    border: none;
    background: transparent;
    padding: 0;
    margin: auto;
    max-width: 480px;
    width: calc(100% - 2rem);
    max-height: none;
    overflow: visible;
}

.list-switcher-sheet::backdrop {
    background: rgba(0, 0, 0, 0.4);
}

.list-switcher-sheet article {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.list-switcher-sheet header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem 0.75rem;
    flex-shrink: 0;
}

.list-switcher-sheet header h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--ink);
}

.list-switcher-sheet-close {
    background: none;
    border: none;
    color: var(--ink-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.list-switcher-sheet-close:hover {
    background: var(--surface-overlay);
    color: var(--ink);
}

.list-switcher-sheet nav {
    overflow-y: auto;
    padding: 0.25rem 0.5rem 0.75rem;
    -webkit-overflow-scrolling: touch;
}

.list-switcher-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--ink);
    font-size: 0.95rem;
    transition: background 0.12s var(--ease-out);
}

.list-switcher-item:hover {
    background: var(--surface-overlay);
}

.list-switcher-item.is-current {
    background: var(--accent-soft);
    font-weight: 600;
}

.list-switcher-item .switcher-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-switcher-item .switcher-check {
    flex-shrink: 0;
    color: var(--accent);
    width: 18px;
    height: 18px;
}

.list-switcher-new {
    margin-top: 0.25rem;
    border-top: 1px solid var(--border-subtle);
    border-radius: 0;
    padding-top: 0.75rem;
    color: var(--accent);
    font-weight: 500;
    gap: 0.5rem;
}

#items-container {
    padding-bottom: 5rem;
}

@media (min-width: 600px) {
    .card-grid > .aisle-group {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    .card-grid > .aisle-group > .aisle-header {
        grid-column: 1 / -1;
    }
}

/* ═══════════════════════════════════════════════
   MISC OVERRIDES
   ═══════════════════════════════════════════════ */

/* ── Undo Toast ── */
.undo-toast {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: -80px;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    background: #2D2A26;
    color: #F2EDE6;
    font-size: 0.875rem;
    box-shadow: var(--shadow-lg);
    transition: bottom 0.3s var(--ease-out);
    max-width: calc(100% - 2rem);
    width: max-content;
}

.undo-toast > span {
    min-width: 0;
}

#undo-toast-name {
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 18ch;
    white-space: nowrap;
    vertical-align: bottom;
}

.undo-toast.visible {
    bottom: 24px;
}

.undo-toast-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.undo-toast-btn:hover {
    color: var(--accent-hover);
}

[data-theme="dark"] .undo-toast {
    background: #3A3632;
}

/* Reset article to non-semantic (no longer Pico) */
article {
    display: block;
}

/* Ensure footer inside article/dialog behaves */
article footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ── Watchlist ── */

.watchlist-search {
    margin: 0.25rem 0 0.5rem;
}
.watchlist-search input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
}

.watchlist-card {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.watchlist-card.is-done {
    opacity: 0.5;
}

.watchlist-poster {
    width: 40px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.watchlist-year {
    color: var(--ink-muted);
    font-size: 0.85em;
    font-weight: 400;
}

.watchlist-type-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.1em 0.4em;
    border-radius: 4px;
    vertical-align: middle;
}

.watchlist-type-movie {
    background: var(--accent-soft);
    color: var(--accent);
}

.watchlist-type-tv {
    background: var(--green-soft);
    color: var(--green);
}

.watchlist-rating {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    font-size: 0.8rem;
    color: var(--ink-muted);
}

.watchlist-rating svg {
    color: #d4a843;
}

.watchlist-genres {
    font-size: 0.75rem;
    color: var(--ink-muted);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.watchlist-rec {
    font-size: 0.75rem;
    color: var(--ink-muted);
    font-style: italic;
}

.watchlist-watched-date {
    font-size: 0.75rem;
    color: var(--ink-muted);
}

/* ── Watchlist "Watched" button ── */
button.watchlist-mark-watched-btn,
button.watchlist-mark-watched-btn:hover,
button.watchlist-mark-watched-btn:active,
button.watchlist-mark-watched-btn:focus {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: inherit;
    padding: 0.2em 0.55em;
    border-radius: 4px;
    border: 1px solid var(--green);
    background: transparent;
    color: var(--green);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s var(--ease-out), color 0.15s var(--ease-out);
    margin: 0;
    line-height: 1.3;
}

button.watchlist-mark-watched-btn:hover {
    background: var(--green);
    color: #fff;
}

/* ── IMDB badge ── */
.imdb-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.55rem;
    font-weight: 800;
    font-family: inherit;
    letter-spacing: 0.03em;
    padding: 0.15em 0.35em;
    border-radius: 3px;
    background: #F5C518;
    color: #000;
    text-decoration: none;
    line-height: 1.3;
    white-space: nowrap;
}

.imdb-badge:hover {
    background: #e6b800;
}

/* ── Watchlist card tap target ── */
.watchlist-card {
    cursor: pointer;
}

/* ── Watchlist info modal content ── */

.watchlist-modal-poster {
    width: 100%;
    background: #1a1a1a;
    display: flex;
    justify-content: center;
}

.watchlist-modal-poster img {
    width: 100%;
    max-width: 342px;
    max-height: 30vh;
    object-fit: contain;
    display: block;
}

.watchlist-modal-body {
    padding: 1rem 1.25rem 1.25rem;
}

.watchlist-modal-body h3 {
    margin: 0 0 0.5rem;
    font-family: var(--font-display);
    font-size: 1.2rem;
    line-height: 1.3;
    color: var(--ink);
}

.watchlist-modal-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.watchlist-modal-runtime,
.watchlist-modal-date {
    font-size: 0.8rem;
    color: var(--ink-muted);
}

.watchlist-modal-genres {
    font-size: 0.8rem;
    color: var(--ink-muted);
    margin-bottom: 0.6rem;
}

.watchlist-modal-overview {
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--ink);
    margin: 0 0 0.75rem;
}

.watchlist-modal-lang,
.watchlist-modal-rec {
    font-size: 0.8rem;
    color: var(--ink-muted);
    margin-bottom: 0.35rem;
}

.watchlist-modal-rec a {
    color: var(--accent);
}

.watchlist-modal-watched {
    font-size: 0.8rem;
    color: var(--green);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.watchlist-modal-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-subtle);
}

.watchlist-modal-link {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}

.watchlist-modal-link:hover {
    text-decoration: underline;
}

/* Watchlist edit page */
.watchlist-edit-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.watchlist-edit-poster {
    width: 100px;
    border-radius: 6px;
    flex-shrink: 0;
}

.watchlist-edit-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.watchlist-edit-meta h3 {
    margin: 0;
    font-size: 1.1rem;
}

.watchlist-imdb-link {
    font-size: 0.8rem;
    color: var(--accent);
    text-decoration: none;
}

.watchlist-imdb-link:hover {
    text-decoration: underline;
}

.watchlist-overview {
    font-size: 0.85rem;
    color: var(--ink-muted);
    line-height: 1.5;
    margin-bottom: 1rem;
}

/* Watchlist autocomplete results */
.watchlist-ac-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem;
}

.watchlist-ac-poster {
    width: 36px;
    height: 54px;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0;
}

.watchlist-ac-no-poster {
    background: var(--card-bg);
}

.watchlist-ac-info {
    flex: 1;
    min-width: 0;
}

.watchlist-ac-title {
    font-weight: 500;
    font-size: 0.9rem;
    line-height: 1.3;
}

.watchlist-ac-year {
    color: var(--ink-muted);
    font-weight: 400;
}

.watchlist-ac-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.15rem;
    flex-wrap: wrap;
}

.watchlist-ac-overview {
    font-size: 0.75rem;
    color: var(--ink-muted);
    margin-top: 0.25rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Streaming Provider Logos (item cards) ── */
.provider-logos {
    display: flex;
    gap: 4px;
    align-items: center;
    margin-top: 0.3rem;
    flex-wrap: wrap;
}

.provider-logo {
    height: 20px;
    width: 20px;
    border-radius: 3px;
    object-fit: cover;
}

.provider-logos-link {
    display: contents;
}

.provider-unsubscribed {
    opacity: 0.15;
}

/* ── Streaming Setup Banner ── */
.streaming-setup-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--card-bg);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: var(--ink-muted);
    text-decoration: none;
    transition: background 0.15s ease;
}

.streaming-setup-banner:hover {
    background: var(--surface-overlay);
    color: var(--accent);
}

/* ── Streaming Settings Page ── */
.streaming-settings-form {
    max-width: 600px;
}

.streaming-region-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.streaming-region-row label {
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
}

.streaming-region-select {
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: var(--page-bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 0.9rem;
}

.streaming-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.streaming-service-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.65rem;
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    cursor: pointer;
    transition: background 0.15s ease;
}

.streaming-service-option:hover {
    background: var(--surface-overlay);
}

.streaming-service-option.selected {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.streaming-service-option input[type="checkbox"] {
    display: none;
}

.streaming-service-logo {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    object-fit: cover;
}

.streaming-service-name {
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.2;
}

.streaming-save-btn {
    margin-top: 0.5rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* ── Settings ────────────────────────────────────────── */

.settings-section {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.settings-section-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    margin: 0 0 1rem;
}

.settings-currency {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.settings-currency label,
.settings-currency input {
    margin-bottom: 0;
}
input[type="text"].currency-input {
    width: 4rem;
    display: inline-block;
    font-size: 0.9rem;
    padding: 0.25rem 0.4rem;
    text-align: center;
}

.settings-delivery {
    margin-bottom: 1.25rem;
}

.settings-delivery-label {
    font-weight: 600;
    font-size: 0.95rem;
    margin: 0 0 0.6rem;
}

.settings-pill-picker {
    display: flex;
    gap: 0.5rem;
}

button.settings-pill {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.9rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    background: transparent;
    border: 1.5px solid var(--border-subtle);
    color: var(--muted-text);
    cursor: pointer;
    transition: all 0.15s;
    margin: 0;
}

button.settings-pill:hover {
    border-color: var(--accent);
    color: var(--text);
    background: transparent;
}

button.settings-pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.settings-push-status,
.settings-email-status {
    margin-bottom: 0.25rem;
}

.settings-notif-types-heading {
    font-weight: 600;
    font-size: 0.95rem;
    margin: 0 0 0.25rem;
}

.settings-status-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    margin: 0 0 1rem;
}

.settings-status-active { color: var(--success, #4a8); }
.settings-status-inactive { color: var(--muted-text); }

.settings-enable-btn {
    margin-bottom: 1.5rem;
}

button.settings-disable-btn {
    background: transparent;
    border: none;
    color: var(--muted-text);
    font-size: 0.82rem;
    padding: 0;
    margin: -0.5rem 0 1rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

button.settings-disable-btn:hover {
    color: var(--text);
    background: transparent;
}

.settings-notif-types {
    border-top: 1px solid var(--border-subtle);
    padding-top: 1rem;
}

.settings-notif-types .muted-text {
    margin: 0 0 1rem;
}

.settings-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    cursor: pointer;
}

.settings-toggle-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
    min-width: 0;
}

.settings-toggle-label {
    font-weight: 600;
    font-size: 0.95rem;
}

.settings-toggle-desc {
    font-size: 0.82rem;
    color: var(--muted-text);
}

/* Toggle switch */
.settings-toggle-switch {
    flex-shrink: 0;
    position: relative;
    width: 44px;
    height: 24px;
}

.settings-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-track {
    position: absolute;
    inset: 0;
    background: var(--border-subtle);
    border-radius: 12px;
    transition: background 0.2s;
}

.toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.settings-toggle-switch input:checked + .toggle-track {
    background: var(--accent);
}

.settings-toggle-switch input:checked + .toggle-track::after {
    transform: translateX(20px);
}

/* ── Shortlist ───────────────────────────────────────── */

.shortlist-card {
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    overflow: hidden;
}

.shortlist-card .shortlist-card-body {
    padding: 0.75rem 1rem;
    flex: 1;
}

.shortlist-card .item-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    flex-direction: row;
    gap: 0.25rem;
}

.shortlist-card .item-actions .icon-btn {
    background: rgba(255,255,255,0.85);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shortlist-image-area {
    width: 100%;
    background: var(--card-bg);
}

.shortlist-og-image {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    display: block;
}

@media (max-width: 599px) {
    .shortlist-og-image {
        max-height: 160px;
    }
}

.shortlist-extraction-status {
    font-size: 0.82rem;
    padding: 0.35rem 0 0.35rem 1rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}
.extraction-pending {
    background: var(--card-bg, #F2EDE6);
    color: var(--muted, #8C7A62);
}

.extraction-pending a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}
.extraction-failed {
    background: #fef2f2;
    color: #b91c1c;
}
.extraction-failed a {
    color: #b91c1c;
    font-weight: 600;
    text-decoration: underline;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }

.shortlist-source {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.25rem;
}

.shortlist-favicon {
    width: 16px;
    height: 16px;
    border-radius: 2px;
    flex-shrink: 0;
}

.shortlist-domain {
    font-size: 0.75rem;
    color: var(--muted-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shortlist-description {
    font-size: 0.85rem;
    color: var(--muted-color);
    margin-top: 0.25rem;
    line-height: 1.4;
}

.shortlist-price {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-top: 0.35rem;
}

/* Winner styling */
.shortlist-winner {
    border: 2px solid #DAA520;
    box-shadow: 0 0 8px rgba(218, 165, 32, 0.25);
}

.shortlist-winner-banner {
    background: linear-gradient(135deg, #DAA520, #F0C040);
    color: #fff;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 0.2rem 0;
    text-transform: uppercase;
}

/* Rating buttons */
/* Rating block — combined rating bar + comment row */
.shortlist-rating-block {
    margin-top: 0.5rem;
    background: var(--page-bg);
    border-radius: 12px;
    overflow: hidden;
}

.shortlist-rating-bar {
    display: flex;
    padding: 3px;
    gap: 3px;
}

.rating-btn {
    flex: 1;
    border: none;
    background: transparent;
    border-radius: 9px;
    padding: 0.45rem 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    transition: all 0.2s ease;
    color: var(--ink-faint);
    margin-bottom: 0;
}

.rating-btn:hover {
    background: rgba(0,0,0,0.03);
    color: var(--ink-muted);
}

.rating-btn .rating-label {
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.rating-btn .rating-count {
    font-size: 0.72rem;
    font-weight: 600;
}

.rating-btn.rating-no.active {
    background: #EDECEA;
    color: #6B6660;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.rating-btn.rating-like.active {
    background: #EDF7E1;
    color: #558B2F;
    box-shadow: 0 1px 3px rgba(85, 139, 47, 0.15);
}

.rating-btn.rating-love.active {
    background: #FFEBEE;
    color: #E53935;
    box-shadow: 0 1px 3px rgba(229, 57, 53, 0.15);
}

.rating-btn.rating-love.active svg { fill: #E53935; }

/* Divider between rating bar and comment row */
.shortlist-rating-divider {
    height: 1px;
    background: var(--ink-faint);
    opacity: 0.3;
    margin: 0 10px;
}

/* Comment row inside rating block */
.shortlist-comment-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--ink-faint);
    transition: color 0.15s;
    margin-bottom: 0;
    margin-top: 0;
}

.shortlist-comment-btn:hover {
    color: var(--ink-muted);
}

.shortlist-comment-btn .unread-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

.shortlist-comment-btn.has-unread {
    color: var(--accent);
}

/* Reject / Unreject banner */
.shortlist-reject-banner {
    border-top: 1px solid var(--border-color);
    background: #EBE5DC;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.shortlist-reject-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    width: 100%;
    font-size: 0.75rem;
    padding: 0.4rem 0;
    border: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    background: transparent;
    cursor: pointer;
    font-family: var(--font-body);
    transition: background 0.15s, color 0.15s;
    margin-bottom: 0;
}

.shortlist-reject-btn.reject {
    color: var(--muted-color);
}

.shortlist-reject-btn.reject:hover {
    background: #fef2f2;
    color: #b91c1c;
}

.shortlist-reject-btn.unreject {
    color: var(--accent-color);
}

.shortlist-reject-btn.unreject:hover {
    background: #f0fdf4;
    color: #16a34a;
}

/* Comments section (on edit page) */
.comment-section {
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.comment-section h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.comment-thread {
    margin-bottom: 1rem;
}

.comment-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.comment-item:last-of-type {
    border-bottom: none;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

/* Comment 3-dot menu */
.comment-menu-wrapper {
    position: relative;
    margin-left: auto;
}

.comment-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--ink-faint);
    padding: 0.2rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    margin-bottom: 0;
}

.comment-menu-btn:hover {
    color: var(--ink-muted);
    background: var(--accent-soft);
}

.comment-menu {
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 10;
    display: flex;
    flex-direction: column;
    background: var(--page-bg);
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
    min-width: 120px;
    overflow: hidden;
}

.comment-menu-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--ink);
    text-align: left;
    transition: background 0.1s;
    margin-bottom: 0;
    width: 100%;
}

.comment-menu-item:hover {
    background: var(--accent-soft);
}

.comment-menu-item.comment-menu-delete {
    color: var(--red);
}

.comment-menu-item.comment-menu-delete:hover {
    background: var(--red-soft);
}

.comment-text {
    font-size: 0.9rem;
    margin-top: 0.25rem;
    line-height: 1.5;
}

/* Edited label */
.comment-edited-label {
    font-size: 0.7rem;
    color: var(--ink-faint);
    margin-top: 0.15rem;
    font-style: italic;
}

/* Inline edit form */
.comment-edit-form {
    margin-top: 0.35rem;
}

.comment-edit-form textarea {
    width: 100%;
    font-size: 0.85rem;
    font-family: inherit;
    resize: vertical;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--ink-faint);
    border-radius: var(--radius-sm);
    background: var(--page-bg);
    color: var(--ink);
    margin-bottom: 0;
}

.comment-edit-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.comment-edit-actions {
    display: flex;
    gap: 0.35rem;
    justify-content: flex-end;
    margin-top: 0.35rem;
}

.comment-form {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    margin-top: 0.75rem;
}

.comment-form textarea {
    flex: 1;
    font-size: 0.85rem;
    resize: vertical;
}

.comment-form .btn-sm {
    flex-shrink: 0;
    align-self: flex-end;
}

/* Mention autocomplete */
.mention-wrapper {
    position: relative;
    flex: 1;
}

.mention-wrapper textarea {
    width: 100%;
}

.mention-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    list-style: none;
    margin: 0 0 4px 0;
    padding: 4px 0;
    background: var(--page-bg);
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 150px;
    overflow-y: auto;
    z-index: 10;
}

.mention-dropdown li {
    padding: 6px 12px;
    margin: 0;
    font-size: 0.85rem;
    color: #3d3529;
    cursor: pointer;
}

[data-theme="dark"] .mention-dropdown li {
    color: #E8E4DE;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .mention-dropdown li {
        color: #E8E4DE;
    }
}

.mention-dropdown li.active,
.mention-dropdown li:hover {
    background: rgba(140, 122, 98, 0.15);
    color: var(--accent-color);
    font-weight: 600;
}

/* Styled @mentions in comment text */
.comment-text .mention {
    color: var(--accent-color);
    font-weight: 600;
}

/* URL preview (in quick-add and edit form) */
.shortlist-url-preview {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.shortlist-preview-image {
    width: 100%;
    max-height: 150px;
    object-fit: cover;
    display: block;
}

.shortlist-preview-info {
    padding: 0.5rem 0.75rem;
}

.shortlist-preview-title {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.3;
}

.shortlist-preview-desc {
    font-size: 0.8rem;
    color: var(--muted-color);
    margin-top: 0.2rem;
    line-height: 1.4;
}

.shortlist-preview-price {
    font-weight: 600;
    color: var(--accent-color);
    margin-top: 0.25rem;
}

/* Edit page image */
.shortlist-edit-image {
    margin-bottom: 1rem;
    border-radius: 10px;
    overflow: hidden;
}

.shortlist-edit-image img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    display: block;
}

.shortlist-edit-source {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.shortlist-edit-source a {
    color: var(--accent-color);
}

/* Shortlist URL row in quick-add */
.shortlist-url-row {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.shortlist-url-row input[type="url"] {
    flex: 1;
}

.shortlist-url-row .btn-sm {
    flex-shrink: 0;
    margin-top: 0.35rem;
}

/* ── Shortlist Dark Mode ─────────────────────────────── */

[data-theme="dark"] .extraction-pending {
    background: rgba(255,255,255,0.08);
    color: #999;
}
[data-theme="dark"] .extraction-failed {
    background: rgba(185, 28, 28, 0.15);
    color: #fca5a5;
}
[data-theme="dark"] .extraction-failed a {
    color: #fca5a5;
}
[data-theme="dark"] .shortlist-card .item-actions .icon-btn {
    background: rgba(0,0,0,0.6);
}

[data-theme="dark"] .shortlist-winner {
    border-color: #DAA520;
    box-shadow: 0 0 8px rgba(218, 165, 32, 0.15);
}

[data-theme="dark"] .shortlist-rating-block {
    background: rgba(0,0,0,0.25);
}
[data-theme="dark"] .rating-btn.rating-no.active {
    background: rgba(255,255,255,0.1);
    color: #B5AEA3;
}
[data-theme="dark"] .rating-btn.rating-like.active {
    background: rgba(85, 139, 47, 0.2);
    color: #AED581;
}
[data-theme="dark"] .rating-btn.rating-love.active {
    background: rgba(229, 57, 53, 0.2);
    color: #EF9A9A;
}

[data-theme="dark"] .shortlist-reject-banner {
    background: #222019;
}

[data-theme="dark"] .shortlist-reject-btn.reject:hover {
    background: rgba(185, 28, 28, 0.15);
    color: #fca5a5;
}

[data-theme="dark"] .shortlist-reject-btn.unreject:hover {
    background: rgba(22, 163, 74, 0.15);
    color: #86efac;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .extraction-pending {
        background: rgba(255,255,255,0.08);
        color: #999;
    }
    :root:not([data-theme="light"]) .extraction-failed {
        background: rgba(185, 28, 28, 0.15);
        color: #fca5a5;
    }
    :root:not([data-theme="light"]) .extraction-failed a {
        color: #fca5a5;
    }
    :root:not([data-theme="light"]) .shortlist-card .item-actions .icon-btn {
        background: rgba(0,0,0,0.6);
    }
    :root:not([data-theme="light"]) .shortlist-winner {
        border-color: #DAA520;
        box-shadow: 0 0 8px rgba(218, 165, 32, 0.15);
    }
    :root:not([data-theme="light"]) .shortlist-rating-block {
        background: rgba(0,0,0,0.25);
    }
    :root:not([data-theme="light"]) .rating-btn.rating-no.active {
        background: rgba(255,255,255,0.1);
        color: #B5AEA3;
    }
    :root:not([data-theme="light"]) .rating-btn.rating-like.active {
        background: rgba(85, 139, 47, 0.2);
        color: #AED581;
    }
    :root:not([data-theme="light"]) .rating-btn.rating-love.active {
        background: rgba(229, 57, 53, 0.2);
        color: #EF9A9A;
    }
    :root:not([data-theme="light"]) .shortlist-reject-banner {
        background: #222019;
    }
    :root:not([data-theme="light"]) .shortlist-reject-btn.reject:hover {
        background: rgba(185, 28, 28, 0.15);
        color: #fca5a5;
    }
    :root:not([data-theme="light"]) .shortlist-reject-btn.unreject:hover {
        background: rgba(22, 163, 74, 0.15);
        color: #86efac;
    }
}
