/* ================================================
   Pam's Closets — style.css  v10
   Navy & Cream Theme · Mobile-First · Touch-Optimised
   ================================================ */

/* ── Variables ── */
:root {
    --primary:       #1a3a5c;
    --primary-dk:    #0f2540;
    --primary-lt:    #2e5f8a;
    --primary-faint: #eaf0f6;
    --accent:        #c9a84c;
    --success:       #27ae60;
    --danger:        #c0392b;
    --text:          #1a2535;
    --text-muted:    #6b7280;
    --bg:            #f7f5f0;
    --card:          #ffffff;
    --border:        #dde3ea;
    --shadow-sm:     0 1px 4px rgba(0,0,0,.08);
    --shadow-md:     0 4px 16px rgba(0,0,0,.10);
    --shadow-lg:     0 8px 32px rgba(0,0,0,.14);
    --r-sm:          10px;
    --r-md:          16px;
    --r-lg:          22px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
button { font-family: inherit; }

html {
    -webkit-tap-highlight-color: transparent;
    /* Respect iPhone notch */
    padding-top: env(safe-area-inset-top);
    padding-top: constant(safe-area-inset-top);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    padding-bottom: calc(env(safe-area-inset-bottom) + 16px);
}

/* Universal touch fix */
button, a, label,
.house-row, .cat-card, .list-item, .gallery-item, .toggle-btn {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

/* ================================================
   HEADER
   ================================================ */
.header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding-top: env(safe-area-inset-top);
    padding-top: constant(safe-area-inset-top);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 58px;
    padding: 0 12px;
    max-width: 900px;
    margin: 0 auto;
}

.header-title {
    flex: 1;
    min-width: 0;
    text-align: center;
}

.header-title h1 {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    text-align: center;
    letter-spacing: -0.3px;
}

.breadcrumb {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.hdr-btn {
    flex-shrink: 0;
    width: 44px; height: 44px;
    border: none;
    border-radius: var(--r-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    transition: background .15s, transform .1s;
}

.back-btn  { background: var(--bg);     color: var(--text); }
.back-btn:active  { background: var(--border); transform: scale(.93); }

.add-btn   { background: var(--primary); color: #fff; }
.add-btn:active   { background: var(--primary-dk); transform: scale(.93); }

/* ================================================
   VIEWS
   ================================================ */
.main-content { padding: 20px 0 40px; }

.view { display: none; animation: fadeUp .22s ease; }
.view.active { display: block; }

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

/* ================================================
   HOME VIEW
   ================================================ */
.home-hero {
    text-align: center;
    padding: 24px 16px 20px;
}

.hero-icon {
    width: 72px; height: 72px;
    margin: 0 auto 14px;
    border-radius: 22px;
    background: linear-gradient(135deg, var(--primary-lt), var(--primary-dk));
    display: flex; align-items: center; justify-content: center;
    font-size: 36px;
    color: #fff;
    box-shadow: 0 6px 20px rgba(26,58,92,.28);
}

.hero-title {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 6px;
}

.hero-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 0;
}

@media (min-width: 400px) {
    .hero-title { font-size: 26px; }
}

/* House rows */
.house-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 16px;
}


.house-row {
    width: 100%;
    background: var(--card);
    border: none;
    border-radius: var(--r-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    text-align: center;
    transition: transform .15s, box-shadow .15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 22px 12px 18px;
    min-height: 120px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.house-row:active {
    transform: scale(.96);
    box-shadow: var(--shadow-sm);
}

/* Utility row (All Closets / All Favs) stays horizontal */
.house-list-utility .house-row {
    flex-direction: row;
    text-align: left;
    padding: 16px 16px;
    min-height: 64px;
    gap: 12px;
}

.house-row-icon {
    flex-shrink: 0;
    width: 56px; height: 56px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary-lt), var(--primary-dk));
    display: flex; align-items: center; justify-content: center;
    font-size: 26px;
    color: #fff;
    box-shadow: 0 4px 12px rgba(26,58,92,.25);
}

/* Smaller icon in utility rows */
.house-list-utility .house-row-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    font-size: 20px;
}

.house-row-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    align-items: center;
}

/* Utility rows: body stays left-aligned */
.house-list-utility .house-row-body {
    align-items: flex-start;
}

.house-row-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.house-row-count {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.house-row-arrow {
    font-size: 13px;
    color: var(--border);
    flex-shrink: 0;
    display: none; /* hide arrow on primary cards */
}

/* Show arrow on utility rows */
.house-list-utility .house-row-arrow {
    display: block;
}

/* ================================================
   CATEGORY GRID  (house view + sub view)
   ================================================ */
.cat-grid {
    display: grid;
    /* 2 columns on all small phones; auto-fill on larger */
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 14px;
}

@media (min-width: 480px) {
    .cat-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 700px) {
    .cat-grid { grid-template-columns: repeat(4, 1fr); }
}

.cat-card {
    background: var(--card);
    border: none;
    border-radius: var(--r-md);
    padding: 18px 10px 14px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: transform .15s, box-shadow .15s;
    width: 100%;
    /* Minimum hit target */
    min-height: 110px;
}

.cat-card:active {
    transform: scale(.95);
    box-shadow: none;
}

.cat-icon {
    width: 52px; height: 52px;
    border-radius: var(--r-sm);
    background: var(--primary-faint);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    color: var(--primary);
    transition: background .2s, color .2s;
}

.cat-card:active .cat-icon {
    background: var(--primary);
    color: #fff;
}

.cat-card h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.cat-count {
    font-size: 11px;
    color: var(--text-muted);
}

/* Sub-category indicator badge */
.cat-card .sub-badge {
    font-size: 10px;
    background: var(--primary-faint);
    color: var(--primary);
    border-radius: 20px;
    padding: 2px 8px;
    font-weight: 600;
}

/* ================================================
   ITEMS VIEW
   ================================================ */
.view-toggle {
    display: flex;
    gap: 8px;
    padding: 0 16px 14px;
}

.toggle-btn {
    flex: 1;
    padding: 11px;
    border: 2px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--card);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    gap: 6px;
    transition: all .2s;
}

.toggle-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* List */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 14px;
}

.list-item {
    background: var(--card);
    border-radius: var(--r-md);
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    border: none;
    width: 100%;
    text-align: left;
    overflow: hidden;
    transition: transform .15s;
    min-height: 80px;
}

.list-item:active { transform: scale(.98); }

.list-thumb {
    flex-shrink: 0;
    width: 66px; height: 66px;
    border-radius: var(--r-sm);
    object-fit: cover;
    object-position: center top;
    background: var(--bg);
    display: block;
}

.list-ph {
    flex-shrink: 0;
    width: 66px; height: 66px;
    border-radius: var(--r-sm);
    background: var(--primary-faint);
    display: flex; align-items: center; justify-content: center;
    font-size: 26px;
    color: var(--primary);
}

.list-body { flex: 1; min-width: 0; }

.list-body h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.list-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex; flex-wrap: wrap; gap: 6px;
}

.list-notes {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.list-arrow { color: var(--border); font-size: 13px; flex-shrink: 0; }

/* Gallery */
.items-gallery {
    display: none;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 14px;
}

@media (min-width: 480px) {
    .items-gallery { grid-template-columns: repeat(3, 1fr); }
}

.gallery-item {
    background: var(--card);
    border-radius: var(--r-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: none;
    text-align: left;
    transition: transform .15s;
    width: 100%;
}

.gallery-item:active { transform: scale(.96); }

.gallery-img {
    width: 100%; height: 150px;
    object-fit: cover;
    display: block;
}

.gallery-ph {
    width: 100%; height: 150px;
    background: var(--primary-faint);
    display: flex; align-items: center; justify-content: center;
    font-size: 48px;
    color: var(--primary);
}

.gallery-info { padding: 8px 10px 10px; }
.gallery-info h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gallery-info p { font-size: 12px; color: var(--text-muted); }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 50px 24px;
    margin: 0 14px;
    background: var(--card);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
}

.empty-state i { font-size: 52px; color: var(--border); margin-bottom: 14px; }
.empty-state h3 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.empty-state p { color: var(--text-muted); font-size: 14px; }

/* Spinner */
.loading { text-align: center; padding: 60px; }
.loading i { font-size: 38px; color: var(--primary); }
.loading p { margin-top: 12px; color: var(--text-muted); }

/* ================================================
   BUTTONS
   ================================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border: none;
    border-radius: var(--r-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: background .2s, transform .1s;
}
.btn:active { transform: scale(.96); }
.btn-primary  { background: var(--primary);  color: #fff; }
.btn-primary:active  { background: var(--primary-dk); }
.btn-secondary { background: var(--bg); color: var(--text); }
.btn-secondary:active { background: var(--border); }
.btn-danger   { background: var(--danger);   color: #fff; }
.btn-danger:active   { background: var(--primary-dk); }

/* Photo buttons row */
.photo-btns {
    display: flex;
    gap: 10px;
}

.btn-gallery, .btn-cam {
    flex: 1;
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px;
    padding: 13px 12px;
    border-radius: var(--r-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
    transition: background .15s, transform .1s;
}

.btn-gallery {
    border: 2px dashed var(--border);
    background: var(--bg);
    color: var(--text);
}
.btn-gallery:active { border-color: var(--primary); background: var(--primary-faint); }

.btn-cam {
    background: var(--primary-faint);
    border: none;
    color: var(--primary);
}
.btn-cam:active { background: var(--primary); color: #fff; transform: scale(.96); }

/* ================================================
   MODALS
   ================================================ */
.modal {
    display: none;
    position: fixed; inset: 0;
    z-index: 500;
    background: rgba(0,0,0,.55);
    overflow-y: auto;
    padding: 0;
    align-items: flex-end;
    justify-content: center;
}

.modal.active { display: flex; }

.modal-sheet {
    background: var(--card);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    width: 100%;
    max-width: 620px;
    max-height: 92vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: sheetUp .25s ease;
    padding-bottom: env(safe-area-inset-bottom);
}

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

.modal-hdr {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 18px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--card);
    z-index: 10;
}

.modal-hdr h2 { font-size: 19px; font-weight: 700; }

.close-btn {
    width: 36px; height: 36px;
    background: var(--bg);
    border: none;
    border-radius: 50%;
    font-size: 22px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    touch-action: manipulation;
}
.close-btn:active { background: var(--border); }

/* Form */
#itemForm { padding: 14px 18px; }
.form-ctx {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-bottom: 14px;
    padding: 8px 12px;
    background: var(--primary-faint);
    border-radius: var(--r-sm);
}
/* Side-by-side form fields (Brand + Size) */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 13px 14px;
    border: 2px solid var(--border);
    border-radius: var(--r-sm);
    font-size: 16px;  /* 16px stops iOS zoom */
    font-family: inherit;
    background: var(--card);
    color: var(--text);
    transition: border-color .2s;
    -webkit-appearance: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}
.form-group small { display: block; margin-top: 5px; font-size: 12px; color: var(--text-muted); }

.photo-preview { margin-top: 10px; }
.photo-preview img {
    max-width: 100%;
    max-height: 180px;
    border-radius: var(--r-sm);
    object-fit: cover;
}

.form-actions {
    display: flex;
    gap: 10px;
    padding: 14px 18px 20px;
    border-top: 1px solid var(--border);
    background: var(--card);
}
.form-actions .btn { flex: 1; }

/* Camera */
.cam-view {
    background: #000;
    aspect-ratio: 4/3;
    width: 100%;
    overflow: hidden;
}
.cam-view video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-controls {
    display: flex;
    gap: 10px;
    padding: 14px 18px;
    background: var(--bg);
}
.cam-controls .btn { flex: 1; }

/* Item detail */
.item-detail { padding: 14px 18px; }

.detail-img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: var(--r-md);
    margin-bottom: 14px;
    display: block;
}

/* Google Lens button */
.lens-wrap { margin-bottom: 18px; }
.btn-lens {
    width: 100%;
    display: flex; align-items: center; justify-content: center;
    gap: 10px;
    padding: 14px 18px;
    background: #fff;
    border: 2px solid var(--border);
    border-radius: var(--r-md);
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: background .2s, border-color .2s, transform .1s;
    box-shadow: var(--shadow-sm);
}
.btn-lens:active {
    background: #f5f5f5;
    border-color: #4285F4;
    transform: scale(.97);
}
.lens-icon { width: 22px; height: 22px; object-fit: contain; }

.detail-row { margin-bottom: 14px; }
.detail-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    margin-bottom: 3px;
}
.detail-value { font-size: 16px; font-weight: 500; color: var(--text); }

/* ================================================
   MOVE MODAL
   ================================================ */

/* 3-button row in item detail */
.view-actions {
    gap: 8px;
}

.btn-move {
    background: #f0f4ff;
    color: #3b5bdb;
    border: none;
}
.btn-move:active { background: #3b5bdb; color: #fff; }

/* Move modal header accent */
.move-hdr { background: #f8f8f8; }

/* Move modal body padding */
.move-body { padding: 16px 18px 8px; }

/* Step label */
.move-step-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-bottom: 12px;
}

/* House picker */
.move-house-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.move-house-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px;
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: var(--r-md);
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    text-align: left;
    transition: border-color .15s, background .15s, transform .1s;
    touch-action: manipulation;
    cursor: pointer;
}
.move-house-btn span { flex: 1; }
.move-house-btn:active {
    border-color: var(--primary);
    background: var(--primary-faint);
    transform: scale(.98);
}
.move-house-btn.move-house-current {
    border-color: var(--primary);
    background: var(--primary-faint);
}
.move-house-btn.move-house-current::after {
    content: 'Current';
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    background: #fff;
    border: 1px solid var(--primary);
    border-radius: 20px;
    padding: 2px 8px;
    margin-left: auto;
}

.move-house-icon {
    width: 44px; height: 44px;
    border-radius: var(--r-sm);
    background: linear-gradient(135deg, var(--primary-lt), var(--primary-dk));
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    color: #fff;
    flex-shrink: 0;
}

/* Category + sub-cat list */
.move-cat-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.move-cat-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: var(--r-sm);
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    text-align: left;
    transition: border-color .15s, background .15s, transform .1s;
    touch-action: manipulation;
    cursor: pointer;
}
.move-cat-btn span { flex: 1; }
.move-cat-btn:active {
    border-color: var(--primary);
    background: var(--primary-faint);
    transform: scale(.98);
}

.move-cat-icon {
    font-size: 18px;
    color: var(--primary);
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.move-cat-arrow {
    font-size: 13px;
    color: var(--text-muted);
}

.move-cat-check {
    font-size: 13px;
    color: var(--success);
}

/* Back button inside move modal */
.move-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    touch-action: manipulation;
    padding: 4px 0 14px;
}
.move-back-btn:active { opacity: .6; }

/* Install prompt */
.install-prompt {
    position: fixed;
    bottom: calc(24px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    background: var(--success);
    color: #fff;
    padding: 14px 28px;
    border: none;
    border-radius: 40px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(39,174,96,.4);
    z-index: 1000;
    display: flex; align-items: center; gap: 8px;
    touch-action: manipulation;
    animation: slideUp .4s ease;
}

@keyframes slideUp {
    from { bottom: -80px; opacity: 0; }
    to   { bottom: calc(24px + env(safe-area-inset-bottom)); opacity: 1; }
}

/* ================================================
   RESPONSIVE HELPERS
   ================================================ */
@media (min-width: 600px) {
    .modal { align-items: center; padding: 24px; }
    .modal-sheet { border-radius: var(--r-lg); }
    /* On tablet+, show 3 house cards in a nice grid */
    .house-list-primary {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }
    .house-list-utility {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ================================================
   SEARCH & FILTER  v11
   ================================================ */

/* ── Search button in header ── */
.search-btn {
    background: var(--bg);
    color: var(--primary);
    border: none;
}
.search-btn:active { background: var(--border); transform: scale(.93); }

/* ── Home search bar ── */
.home-search-wrap {
    padding: 0 16px 20px;
}

.home-search-bar {
    position: relative;
    display: flex;
    align-items: center;
}

.home-search-icon {
    position: absolute;
    left: 16px;
    font-size: 15px;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
}

#homeSearchInput {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border: 2px solid var(--border);
    border-radius: var(--r-md);
    font-size: 16px;
    font-family: inherit;
    background: var(--card);
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: border-color .2s, box-shadow .2s;
    -webkit-appearance: none;
    /* Hide native 'x' button — we handle clearing ourselves */
}
#homeSearchInput::-webkit-search-cancel-button { display: none; }
#homeSearchInput:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,58,92,.15);
}
#homeSearchInput::placeholder { color: var(--text-muted); }

/* ── Search results view ── */
.search-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 14px;
    gap: 12px;
}

.search-result-count {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .4px;
}

.search-clear-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    touch-action: manipulation;
    padding: 4px 0;
    -webkit-tap-highlight-color: transparent;
}
.search-clear-link:active { opacity: .6; }

.search-results-list {
    padding: 0 14px;
}

/* Highlighted search match text */
mark {
    background: #fff3c0;
    color: inherit;
    border-radius: 2px;
    padding: 0 1px;
}

/* Location + category badge row in search results */
.search-location-badge {
    margin-bottom: 3px;
}

.location-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    background: var(--primary-faint);
    color: var(--primary);
    border-radius: 20px;
    padding: 2px 8px;
}

.category-chip-sm {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    background: #f0f4ff;
    color: #3b5bdb;
    border-radius: 20px;
    padding: 2px 8px;
}

/* Empty search state */
.search-empty {
    text-align: center;
    padding: 50px 24px;
    margin: 0;
    background: var(--card);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
}
.search-empty i  { font-size: 48px; color: var(--border); margin-bottom: 14px; display: block; }
.search-empty h3 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.search-empty p  { color: var(--text-muted); font-size: 14px; }

/* ── Items view filter bar ── */
.filter-bar {
    padding: 0 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.filter-search-icon {
    position: absolute;
    left: 14px;
    font-size: 14px;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
}

#filterInput {
    width: 100%;
    padding: 12px 38px 12px 40px;
    border: 2px solid var(--border);
    border-radius: var(--r-sm);
    font-size: 15px;
    font-family: inherit;
    background: var(--card);
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: border-color .2s, box-shadow .2s;
    -webkit-appearance: none;
}
#filterInput::-webkit-search-cancel-button { display: none; }
#filterInput:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,58,92,.15);
}
#filterInput::placeholder { color: var(--text-muted); }

.filter-clear-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    font-size: 17px;
    color: var(--text-muted);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    padding: 4px;
    display: flex; align-items: center; justify-content: center;
}
.filter-clear-btn:active { color: var(--primary); transform: scale(.9); }

/* ── Color chips ── */
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 2px 0 2px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 2px solid var(--border);
    border-radius: 20px;
    background: var(--card);
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: border-color .15s, background .15s, transform .1s;
    white-space: nowrap;
}
.filter-chip:active {
    transform: scale(.95);
}
.filter-chip.active {
    border-color: var(--primary);
    background: var(--primary-faint);
    color: var(--primary);
}

.color-dot {
    font-size: 10px;
}

/* ================================================
   RESPONSIVE adjustments for search/filter
   ================================================ */
@media (min-width: 600px) {
    .home-search-wrap { padding: 0 24px 20px; }
}

/* ================================================
   PACK FOR VACATION  v1
   ================================================ */

/* ── Home screen CTA button ── */
.pack-cta-wrap {
    padding: 4px 16px 20px;
    display: flex;
    justify-content: center;
}

.pack-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--primary-lt), var(--primary-dk));
    color: #fff;
    border: none;
    border-radius: 50px;
    box-shadow: 0 4px 16px rgba(26,58,92,.30);
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: 0.2px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: transform .15s, box-shadow .15s;
}
.pack-cta-btn i {
    font-size: 18px;
}
.pack-cta-btn:active {
    transform: scale(.96);
    box-shadow: 0 2px 8px rgba(26,58,92,.20);
}

/* ── Modal overrides for pack sheet ── */
.pack-modal-sheet {
    max-height: 96vh;
}

.pack-modal-hdr {
    background: linear-gradient(135deg, var(--primary-lt), var(--primary-dk));
    border-bottom: none;
    padding: 20px 18px 16px;
}

.pack-hdr-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pack-hdr-icon {
    font-size: 28px;
    color: rgba(255,255,255,.9);
}

.pack-modal-hdr h2 {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    margin: 0;
}

.pack-hdr-sub {
    font-size: 11px;
    color: rgba(255,255,255,.70);
    margin: 2px 0 0;
}

.pack-modal-hdr .close-btn {
    background: rgba(255,255,255,.18);
    color: #fff;
}
.pack-modal-hdr .close-btn:active { background: rgba(255,255,255,.30); }

/* ── Step 1: Form ── */
.pack-form-body {
    padding: 18px 18px 4px;
}

.pack-dinner-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.pack-dinner-card {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--r-sm);
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}

.pack-dinner-card.pack-dinner-dressy {
    border-color: var(--accent);
    background: #fdf8ed;
}

.pack-dinner-icon {
    font-size: 22px;
    color: var(--primary);
}

.pack-dinner-dressy .pack-dinner-icon {
    color: var(--accent);
}

.pack-dinner-card label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--text-muted);
    margin: 0;
}

.pack-dinner-card input[type="number"] {
    width: 72px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    padding: 6px 8px;
    border: 2px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--primary);
    background: var(--card);
    -webkit-appearance: none;
}
.pack-dinner-card input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
}

/* ── API key section ── */
.pack-api-section {
    margin-bottom: 16px;
}

.pack-api-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 14px;
    background: var(--bg);
    border: 2px dashed var(--border);
    border-radius: var(--r-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: border-color .15s;
}
.pack-api-toggle:active { border-color: var(--primary); }

.pack-api-wrap {
    padding: 12px 0 0;
}

.pack-api-note {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    line-height: 1.5;
}

.pack-api-input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: var(--r-sm);
    font-size: 14px;
    font-family: monospace;
    background: var(--card);
    color: var(--text);
    -webkit-appearance: none;
}
.pack-api-input:focus { outline: none; border-color: var(--primary); }

.pack-generate-btn {
    gap: 8px;
}

/* ── Step 2: Loading ── */
.pack-loading-body {
    padding: 48px 24px;
    text-align: center;
}

.pack-loading-icon {
    margin-bottom: 20px;
}

.pack-spin-suitcase {
    font-size: 52px;
    color: var(--primary);
    display: inline-block;
    animation: packBounce 1.4s ease-in-out infinite;
}

@keyframes packBounce {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-14px); }
}

.pack-status-msg {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 24px;
    min-height: 24px;
}

.pack-loading-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
    max-width: 260px;
    margin: 0 auto;
}

.pls {
    font-size: 13px;
    color: var(--text-muted);
    padding: 6px 12px;
    background: var(--bg);
    border-radius: var(--r-sm);
}

/* ── Results ── */
.pack-weather-banner {
    padding: 16px 18px 0;
}

.pack-weather-strip {
    background: linear-gradient(135deg, var(--primary-lt), var(--primary-dk));
    border-radius: var(--r-md);
    padding: 16px;
    margin-bottom: 10px;
}

.pack-dest-title {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 8px;
}

.pack-weather-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.wpill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(255,255,255,.18);
    color: #fff;
    border-radius: 20px;
    padding: 4px 10px;
}

.pack-summary-text {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.55;
    padding: 0 18px 12px;
}

/* Progress bar */
.pack-progress-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px 14px;
}

.pack-progress-bar-bg {
    flex: 1;
    height: 8px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.pack-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-lt), var(--accent));
    border-radius: 10px;
    transition: width .3s ease;
    width: 0%;
}

.pack-progress-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Pack sections */
.pack-sections {
    padding: 0 14px;
}

.pack-section {
    background: var(--card);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 12px;
    overflow: hidden;
}

.pack-section-hdr {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--border);
}

.pack-sec-icon {
    font-size: 16px;
    color: var(--primary);
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.pack-section-hdr h3 {
    flex: 1;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.pack-sec-count {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg);
    border-radius: 20px;
    padding: 2px 8px;
}

.pack-items-list {
    padding: 4px 0;
}

.pack-item-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background .15s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.pack-item-row:active { background: var(--bg); }

.pack-checkbox {
    flex-shrink: 0;
    width: 20px; height: 20px;
    accent-color: var(--primary);
    margin-top: 1px;
    cursor: pointer;
}

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

.pack-item-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.pack-qty {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-faint);
    border-radius: 10px;
    padding: 1px 6px;
    margin-left: 4px;
}

.pack-item-reason {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.4;
}

.pack-owned {
    font-size: 11px;
    font-weight: 600;
    color: var(--success);
    white-space: nowrap;
    flex-shrink: 0;
}

.pack-not-owned {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Checked-off item */
.pack-item-checked .pack-item-name {
    text-decoration: line-through;
    color: var(--text-muted);
    opacity: .6;
}

/* Shopping section */
.pack-shop-section .pack-section-hdr { background: #fdf8ed; }
.pack-shop-section .pack-sec-icon    { color: var(--accent); }

.pack-shop-items {
    list-style: none;
    padding: 8px 16px 12px;
}

.pack-shop-items li {
    font-size: 14px;
    color: var(--text);
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}
.pack-shop-items li::before {
    content: '🛍️';
    font-size: 14px;
}
.pack-shop-items li:last-child { border-bottom: none; }

/* Weather tips */
.pack-tips-section .pack-sec-icon { color: var(--accent); }
.pack-tips-text {
    font-size: 14px;
    color: var(--text);
    line-height: 1.6;
    padding: 8px 16px 14px;
}

/* Don't forget */
.pack-dontforget-list {
    list-style: none;
    padding: 4px 0 4px;
}
.pack-dontforget-list li {
    border-bottom: 1px solid var(--border);
}
.pack-dontforget-list li:last-child { border-bottom: none; }

/* Shopping / extras wrapper */
#packShoppingList,
#packExtras {
    padding: 0 14px;
}

/* Result action buttons */
.pack-result-actions {
    display: flex;
    gap: 10px;
    padding: 14px 18px 20px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}
.pack-result-actions .btn { flex: 1; }

/* Error message */
.pack-error {
    background: #fff3f3;
    border: 1px solid #fca5a5;
    border-radius: var(--r-sm);
    color: #c0392b;
    font-size: 13px;
    font-weight: 500;
    padding: 10px 14px;
    margin-bottom: 14px;
    line-height: 1.5;
}

/* ── Print styles ── */
@media print {
    .header, .pack-modal-hdr, .pack-progress-wrap,
    .pack-result-actions, .pack-api-section,
    .modal:not(#packModal) { display: none !important; }

    #packModal { position: static !important; background: none !important; }
    .pack-modal-sheet { max-height: none !important; box-shadow: none !important; border-radius: 0 !important; }
    .pack-weather-banner { padding: 0 !important; }
    .pack-section { page-break-inside: avoid; box-shadow: none !important; border: 1px solid #ddd !important; }
    .pack-checkbox { display: none; }
    .pack-item-row { padding: 6px 16px !important; }
}

/* ── Pack v3 additions ─────────────────────────────────────── */

/* Closet source pill in weather banner */
.closet-pill {
    background: #c9a84c22;
    border-color: #c9a84c;
    color: #7a5c10;
}

/* "No API key needed" info strip */
.pack-info-note {
    background: #eaf0f6;
    border: 1px solid #c3d3e5;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #1a3a5c;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.pack-info-note i { color: var(--accent); }

/* ── Print styles ──────────────────────────────────────────── */
@media print {
    /* Hide everything except the pack results */
    body > *:not(#packModal) { display: none !important; }
    #packModal {
        position: static !important;
        background: none !important;
        display: block !important;
    }
    .modal-sheet.pack-modal-sheet {
        box-shadow: none !important;
        border-radius: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .pack-modal-hdr,
    #packStep1,
    #packStep2,
    .pack-result-actions,
    .pack-progress-wrap { display: none !important; }
    #packResults {
        display: block !important;
        padding: 0 !important;
    }
    .pack-section { page-break-inside: avoid; }
    .pack-checkbox { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ── All Closets view ──────────────────────────────────────── */

/* "All Closets" house-row button */
.house-row-all {
    /* no border needed — sits in its own utility row */
}
.house-row-all-icon {
    background: linear-gradient(135deg, #1a3a5c 0%, #2e5f8a 50%, #c9a84c 100%) !important;
}

/* House location badges shown on item cards in All Closets mode */
.house-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
    margin-right: 4px;
}
.house-badge-main {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}
.house-badge-deer {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}
.house-badge-lbk {
    background: #cffafe;
    color: #155e75;
    border: 1px solid #67e8f9;
}

/* ── Favorites feature ────────────────────────────────────── */

/* ❤️ heart button on list items */
.fav-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #d1d5db;
    transition: color .2s, transform .15s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    padding: 0;
    margin-left: 4px;
    position: relative;
    z-index: 2;
}
.fav-btn:active { transform: scale(1.25); }
.fav-btn.fav-active { color: #e74c3c; }
.fav-btn.fav-active i { animation: heartPop .25s ease; }

/* ❤️ heart button overlaid on gallery cards */
.gallery-item { position: relative; }
.fav-btn-gallery {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 32px;
    height: 32px;
    font-size: 15px;
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(4px);
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
    color: #d1d5db;
    z-index: 3;
}
.fav-btn-gallery.fav-active { color: #e74c3c; }

/* Heart pop animation */
@keyframes heartPop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.45); }
    100% { transform: scale(1); }
}

/* ❤️ full-width heart button inside detail modal */
.detail-fav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    margin: 4px 0 12px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: #fafafa;
    font-size: 15px;
    font-weight: 600;
    color: #9ca3af;
    cursor: pointer;
    transition: all .2s;
    touch-action: manipulation;
}
.detail-fav-btn i { font-size: 18px; }
.detail-fav-btn:active { transform: scale(.97); }
.detail-fav-btn.fav-active {
    color: #e74c3c;
    border-color: #fca5a5;
    background: #fff5f5;
}

/* ❤️ Favorites-only filter button in the filter bar */
.filter-bar-row2 {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
}
.fav-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: #9ca3af;
    cursor: pointer;
    white-space: nowrap;
    transition: all .2s;
    touch-action: manipulation;
    flex-shrink: 0;
}
.fav-filter-btn:active { transform: scale(.96); }
.fav-filter-btn.active {
    color: #e74c3c;
    border-color: #fca5a5;
    background: #fff5f5;
}
.fav-filter-btn.active i::before { content: '\f004'; font-family: 'Font Awesome 5 Free'; font-weight: 900; }

/* ❤️ "All Favorites" home-screen row */
.house-row-favs {
    border-top: 1px solid var(--border);
}
.house-row-favs-icon {
    background: linear-gradient(135deg, #e74c3c, #c0392b) !important;
}


/* ================================================
   PER-HOUSE COLOUR THEMING
   ================================================ */

/* ── Main House  — deep navy / slate blue ── */
button.house-row[data-house="Main House"] {
    border: 2px solid #bfdbfe;
    background: linear-gradient(160deg, #eff6ff 0%, #ffffff 60%);
}
button.house-row[data-house="Main House"] .house-row-icon {
    background: linear-gradient(135deg, #60a5fa, #1e40af) !important;
    box-shadow: 0 4px 14px rgba(59,130,246,.30);
}
button.house-row[data-house="Main House"] .house-row-name { color: #1e3a8a; }

/* ── Glencove ── */
button.house-row[data-house="Glencove"] {
    border: 2px solid #bbf7d0;
    background: linear-gradient(160deg, #f0fdf4 0%, #ffffff 60%);
}
button.house-row[data-house="Glencove"] .house-row-icon {
    background: linear-gradient(135deg, #4ade80, #15803d) !important;
    box-shadow: 0 4px 14px rgba(34,197,94,.25);
}
button.house-row[data-house="Glencove"] .house-row-name { color: #14532d; }

/* ── Palm Beach ── */
button.house-row[data-house="Palm Beach"] {
    border: 2px solid #a5f3fc;
    background: linear-gradient(160deg, #ecfeff 0%, #ffffff 60%);
}
button.house-row[data-house="Palm Beach"] .house-row-icon {
    background: linear-gradient(135deg, #22d3ee, #0e7490) !important;
    box-shadow: 0 4px 14px rgba(6,182,212,.25);
}
button.house-row[data-house="Palm Beach"] .house-row-name { color: #155e75; }

/* ── All Closets  — navy-to-gold ── */
button.house-row[data-house="All Closets"] {
    border: 2px solid #fde68a;
    background: linear-gradient(160deg, #fffbeb 0%, #ffffff 60%);
}

/* ── All Favorites  — rose red ── */
button.house-row#allFavsBtn {
    border: 2px solid #fecaca;
    background: linear-gradient(160deg, #fff5f5 0%, #ffffff 60%);
}
button.house-row#allFavsBtn .house-row-name { color: #c0392b; }

/* ================================================
   PER-HOUSE CATEGORY ICON THEMING
   Uses data-house attribute set on <main> by JS
   ================================================ */

/* Main House category icons — navy */
main[data-house="Main House"] .cat-icon {
    background: #eaf0f6;
    color: #1a3a5c;
}
main[data-house="Main House"] .cat-card:active .cat-icon {
    background: #1a3a5c;
    color: #fff;
}
main[data-house="Main House"] .cat-card .sub-badge {
    background: #eaf0f6;
    color: #1a3a5c;
}

/* Glencove category icons */
main[data-house="Glencove"] .cat-icon {
    background: #e8f5ee;
    color: #1a6b3c;
}
main[data-house="Glencove"] .cat-card:active .cat-icon {
    background: #1a6b3c;
    color: #fff;
}
main[data-house="Glencove"] .cat-card .sub-badge {
    background: #e8f5ee;
    color: #1a6b3c;
}

/* Palm Beach category icons */
main[data-house="Palm Beach"] .cat-icon {
    background: #e0f7fa;
    color: #0e7090;
}
main[data-house="Palm Beach"] .cat-card:active .cat-icon {
    background: #0e7090;
    color: #fff;
}
main[data-house="Palm Beach"] .cat-card .sub-badge {
    background: #e0f7fa;
    color: #0e7090;
}

/* All Closets category icons — gold accent */
main[data-house="All Closets"] .cat-icon {
    background: #fdf6e3;
    color: #b8860b;
}
main[data-house="All Closets"] .cat-card:active .cat-icon {
    background: #c9a84c;
    color: #fff;
}
main[data-house="All Closets"] .cat-card .sub-badge {
    background: #fdf6e3;
    color: #b8860b;
}

/* Items view filter bar accent colour per house */
main[data-house="Main House"]     .fav-filter-btn { border-color: #1a3a5c; color: #1a3a5c; }
main[data-house="Glencove"]    .fav-filter-btn { border-color: #1a6b3c; color: #1a6b3c; }
main[data-house="Palm Beach"]  .fav-filter-btn { border-color: #0e7090; color: #0e7090; }

/* ── Pack closet selector dropdown ── */
.pack-closet-select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--card);
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    font-weight: 500;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%231a3a5c' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
    transition: border-color .2s;
}
.pack-closet-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-faint);
}

/* ── Outfit Suggestions & Pack Tabs ───────────────────── */
.pack-tabs {
    display: flex;
    gap: 0;
    margin: 12px 0 0;
    border-bottom: 2px solid var(--border, #e5e7eb);
}
.pack-tab-btn {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted, #6b7280);
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.pack-tab-btn.active {
    color: var(--primary, #1a3a5c);
    border-bottom-color: var(--primary, #1a3a5c);
    background: var(--primary-faint, #eaf0f6);
}
.pack-tab-btn:hover:not(.active) {
    color: var(--primary-lt, #2e5f8a);
    background: #f3f6f9;
}
.pack-tab-pane { padding-top: 10px; }

/* Outfit cards */
.outfit-suggestions {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-bottom: 16px;
}
.outfit-card {
    background: var(--card, #fff);
    border-radius: var(--r-md, 12px);
    box-shadow: var(--shadow-md, 0 2px 8px rgba(0,0,0,.08));
    overflow: hidden;
    border: 1px solid var(--border, #e5e7eb);
}
.outfit-card-hdr {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px 10px;
    background: linear-gradient(135deg, var(--primary-faint, #eaf0f6) 0%, #fff 100%);
    border-bottom: 1px solid var(--border, #e5e7eb);
}
.outfit-icon { font-size: 24px; line-height: 1; flex-shrink: 0; }
.outfit-label-wrap { display: flex; flex-direction: column; gap: 2px; }
.outfit-label {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary, #1a3a5c);
}
.outfit-occasions {
    font-size: 11px;
    color: var(--text-muted, #6b7280);
    font-style: italic;
}
.outfit-pieces {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
    padding: 12px 14px;
}
.outfit-piece {
    background: var(--primary-faint, #eaf0f6);
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.outfit-piece-role {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted, #6b7280);
    font-weight: 700;
}
.outfit-piece-item {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary, #1a3a5c);
    word-break: break-word;
    line-height: 1.3;
}
.outfit-tip {
    font-size: 12px;
    color: #7c6f3b;
    background: #fefce8;
    border-top: 1px solid #fde68a;
    padding: 8px 16px;
    font-style: italic;
}
.pack-no-outfits {
    text-align: center;
    color: var(--text-muted, #6b7280);
    padding: 32px 16px;
    font-style: italic;
}

/* ── Per-house color themes (vertical card style) ── */
button.house-row[data-house="Main House"] {
    border: 2px solid #bfdbfe;
    background: linear-gradient(160deg, #eff6ff 0%, #ffffff 60%);
}
button.house-row[data-house="Main House"] .house-row-icon {
    background: linear-gradient(135deg, #60a5fa, #1e40af);
    box-shadow: 0 4px 14px rgba(59,130,246,.35);
}
button.house-row[data-house="Main House"] .house-row-name { color: #1e3a8a; }

button.house-row[data-house="Glencove"] {
    border: 2px solid #bbf7d0;
    background: linear-gradient(160deg, #f0fdf4 0%, #ffffff 60%);
}
button.house-row[data-house="Glencove"] .house-row-icon {
    background: linear-gradient(135deg, #4ade80, #15803d);
    box-shadow: 0 4px 14px rgba(34,197,94,.30);
}
button.house-row[data-house="Glencove"] .house-row-name { color: #14532d; }

button.house-row[data-house="Palm Beach"] {
    border: 2px solid #a5f3fc;
    background: linear-gradient(160deg, #ecfeff 0%, #ffffff 60%);
}
button.house-row[data-house="Palm Beach"] .house-row-icon {
    background: linear-gradient(135deg, #22d3ee, #0e7490);
    box-shadow: 0 4px 14px rgba(6,182,212,.30);
}
button.house-row[data-house="Palm Beach"] .house-row-name { color: #155e75; }

button.house-row[data-house="All Closets"] {
    border: 2px solid #fde68a;
    background: linear-gradient(145deg, #fffbeb, #ffffff);
}
button.house-row#allFavsBtn {
    border: 2px solid #fecaca;
    background: linear-gradient(145deg, #fff5f5, #ffffff);
}
button.house-row#allFavsBtn .house-row-name { color: #c0392b; }