/* ============================================================================
   Family Command Center - Complete Stylesheet
   ============================================================================ */

:root {
    /* Theme colors */
    --bg-primary: #fafbfc;
    --bg-secondary: #ffffff;
    --bg-warm: #fff6db;
    --text-primary: #1a1d29;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    
    /* User colors */
    --color-steve: #2E86AB;
    --color-angie: #F18F01;
    --color-simon: #5C946E;
    --color-family: #888888;
    
    /* Accent colors */
    --accent-blue: #4d96ff;
    --accent-coral: #ff6f59;
    --accent-green: #06d6a0;
    --accent-yellow: #ffd166;
    --accent-purple: #8b5cf6;
    --accent-pink: #ec4899;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-warm: 0 14px 30px rgba(255, 111, 89, 0.18);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Page background — dark for MC home view */
body {
    font-family: 'Work Sans', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* When home view is active, the mc-body handles its own dark bg */

/* Kid Mode Styles */
body.kid-mode {
    font-family: 'Fredoka', sans-serif;
    background: radial-gradient(circle at 8% 12%, #f2e3b4 0%, rgba(242, 227, 180, 0) 42%),
                radial-gradient(circle at 92% 18%, #dcecf7 0%, rgba(220, 236, 247, 0) 48%),
                linear-gradient(120deg, #f1e4c8 0%, #efe0d0 55%, #e6eef5 100%);
}

/* ============================================================================
   Top bar — slim identity strip (time + user only, no nav)
   ============================================================================ */

.header { display: none; } /* legacy — hidden */

.top-bar {
    display: none;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.current-time {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #94a3b8;
    white-space: nowrap;
}

body.kid-mode .current-time {
    font-size: 1rem;
    color: var(--accent-yellow);
}

/* Nav toggle — hidden, replaced by hamburger drawer */
.view-toggle {
    display: none;
}

.view-btn {
    padding: 0.3rem 0.85rem;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.15s;
    font-size: 0.78rem;
    color: #94a3b8;
    font-family: 'Work Sans', sans-serif;
}

.view-btn:hover {
    background: #1e293b;
    color: #e2e8f0;
}

.view-btn.active {
    background: #1e293b;
    color: #e2e8f0;
    box-shadow: none;
}

body.kid-mode .view-btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 7px;
    color: #cbd5e1;
}

body.kid-mode .view-btn.active {
    background: #334155;
    color: white;
}

/* Right side of header */
.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.profile-switcher {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.profile-avatar {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s;
    border: 2px solid #0f172a;
    color: white;
    overflow: hidden;
}

body.kid-mode .profile-avatar {
    width: 34px;
    height: 34px;
    font-size: 0.8rem;
}

.profile-avatar:hover {
    transform: scale(1.1);
}

.profile-avatar.active {
    border-color: #60a5fa;
    box-shadow: 0 0 0 1px #60a5fa;
}

.mode-toggle {
    padding: 0.2rem 0.65rem;
    background: #1e293b;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.72rem;
    color: #94a3b8;
    font-family: 'Work Sans', sans-serif;
    transition: all 0.2s;
    white-space: nowrap;
}

.mode-toggle:hover {
    background: #334155;
    color: #e2e8f0;
}

/* ============================================================================
   Container & Layout
   ============================================================================ */

.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 1.5rem;
}

body.kid-mode .container {
    padding: 2rem;
    position: relative;
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

body.kid-mode .main-grid {
    gap: 2rem;
}

.primary-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.home-main-grid {
    grid-template-columns: 360px 1fr;
    align-items: start;
}

.home-primary-column {
    gap: 1.25rem;
}

.home-lower-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.home-day-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.home-day-toggle .btn-secondary {
    margin-right: 0;
}

/* ============================================================================
   Mission Control Home View — Concept A (dark 3-column layout)
   ============================================================================ */

.mc-body {
    background: #0f172a;
    display: grid;
    grid-template-columns: 220px 1fr 220px;
    height: calc(100vh - 44px);
    overflow: hidden;
}

.mc-col {
    border-right: 1px solid #1e293b;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mc-col:last-child {
    border-right: none;
}

.mc-col-header {
    padding: 0.6rem 0.85rem;
    background: #1e293b;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    border-bottom: 1px solid #0f172a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.mc-col-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mc-col-body::-webkit-scrollbar {
    width: 4px;
}
.mc-col-body::-webkit-scrollbar-track { background: transparent; }
.mc-col-body::-webkit-scrollbar-thumb { background: #334155; border-radius: 2px; }

.mc-home-card {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 0.6rem;
}

.mc-home-card-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.mc-home-card .events-list .event-item {
    background: #1e293b;
}

.home-week-nav {
    margin-left: auto;
    display: flex;
    gap: 0.35rem;
}

.home-week-nav-btn {
    min-width: 3.1rem;
}

/* Alert row */
.mc-alert {
    background: #1e293b;
    border-left: 3px solid;
    border-radius: 0 6px 6px 0;
    padding: 0.5rem 0.65rem;
    font-size: 0.75rem;
    color: #94a3b8;
    line-height: 1.4;
}

.mc-alert strong {
    color: #e2e8f0;
    font-weight: 600;
    display: block;
    margin-bottom: 0.15rem;
    font-size: 0.72rem;
}

.mc-alert-source {
    margin-top: 0.2rem;
    font-size: 0.66rem;
    color: #64748b;
}

.mc-story-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.mc-story-header-actions {
    display: flex;
    gap: 0.45rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.mc-story-item {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 0.45rem 0.55rem;
    cursor: pointer;
}

.mc-story-row {
    display: flex;
    gap: 0.45rem;
    align-items: flex-start;
}

.mc-story-headline {
    flex: 1;
    font-size: 0.74rem;
    color: #e2e8f0;
    line-height: 1.35;
    font-weight: 600;
}

.mc-story-selected-pill {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.05rem 0.35rem;
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.22);
    color: #7dd3fc;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.mc-story-actions {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}

.mc-story-btn {
    padding: 0.2rem 0.45rem;
    min-width: 4.1rem;
    font-size: 0.66rem;
}

.mc-story-remove {
    border-color: rgba(220, 38, 38, 0.55);
    color: #fca5a5;
}

.mc-story-details {
    margin-top: 0.45rem;
    padding-top: 0.4rem;
    border-top: 1px solid #334155;
}

.mc-story-summary {
    font-size: 0.7rem;
    color: #cbd5e1;
    line-height: 1.45;
}

.mc-story-link {
    display: inline-block;
    margin-top: 0.4rem;
    font-size: 0.68rem;
    font-weight: 700;
    color: #7dd3fc;
    text-decoration: none;
}

.mc-story-link:hover {
    text-decoration: underline;
}

.mc-story-modal-summary {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.55;
    white-space: pre-wrap;
}

/* Weather strip in left col */
.mc-weather {
    background: #1e293b;
    border-radius: 6px;
    padding: 0.5rem 0.65rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: #94a3b8;
    flex-shrink: 0;
}

.mc-weather .temp {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #e2e8f0;
}

.mc-weather-detail {
    font-size: 0.62rem;
    color: #64748b;
}

/* Goals progress bar */
.mc-goals-footer {
    position: sticky;
    bottom: 0;
    margin-top: 0.5rem;
    padding: 0.5rem 0 0.25rem;
    border-top: 1px solid #334155;
    background: linear-gradient(to bottom, rgba(15,23,42,0.9), rgba(15,23,42,1));
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex-shrink: 0;
    z-index: 2;
}

.mc-goals-count {
    font-size: 0.7rem;
    color: #64748b;
    white-space: nowrap;
}

.mc-goals-bar {
    flex: 1;
    height: 4px;
    background: #1e293b;
    border-radius: 2px;
    overflow: hidden;
}

.mc-goals-bar-fill {
    height: 4px;
    background: #16a34a;
    border-radius: 2px;
    transition: width 0.3s;
}

/* Week view — center column */
.mc-week-grid {
    padding: 0.6rem 0.75rem;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}



/* ============================================================================
   Widgets & Cards
   ============================================================================ */

.widget {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 1.85rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    animation: fadeIn 0.4s ease-out;
}

body.kid-mode .widget {
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-warm);
    border: 3px solid var(--accent-yellow);
}

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

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.widget-title {
    font-size: 1.35rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

body.kid-mode .widget-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.widget-icon {
    width: 20px;
    height: 20px;
}

body.kid-mode .widget-icon {
    width: 28px;
    height: 28px;
}

/* Summary Bar */
.summary-bar {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

body.kid-mode .summary-bar {
    background: linear-gradient(135deg, var(--accent-coral), var(--accent-yellow));
    border-radius: 20px;
    padding: 1.75rem 2rem;
}

.summary-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-align: center;
}

.goals-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.goals-metrics-grid .summary-stat {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.9rem;
}

.summary-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
}

body.kid-mode .summary-value {
    font-size: 2rem;
}

/* ============================================================================
   Meal Cards
   ============================================================================ */

.meal-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

body.kid-mode .meal-cards-grid {
    gap: 1.5rem;
}

.meal-card {
    background: var(--bg-primary);
    padding: 1.25rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
}

.meal-person-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    z-index: 10;
}

body.kid-mode .meal-card {
    padding: 1.5rem;
    border-radius: 16px;
    border: 2px solid var(--accent-yellow);
}

.meal-card:hover {
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-sm);
}

.meal-card-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

body.kid-mode .meal-card-label {
    font-size: 0.875rem;
    color: var(--accent-coral);
}

.meal-card-emoji {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

body.kid-mode .meal-card-emoji {
    font-size: 2.5rem;
}

.meal-card-value {
    font-size: 1rem;
    font-weight: 600;
}

body.kid-mode .meal-card-value {
    font-size: 1.5rem;
}

.meal-card-cost {
    font-size: 0.875rem;
    color: var(--accent-green);
    font-weight: 600;
    margin-top: 0.25rem;
}

/* ============================================================================
   Schedule
   ============================================================================ */

.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.schedule-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 8px;
    border-left: 3px solid var(--accent-blue);
}

body.kid-mode .schedule-item {
    padding: 1.25rem;
    border-radius: 12px;
    border-left: 4px solid var(--accent-coral);
}

.schedule-time {
    font-weight: 600;
    color: var(--accent-blue);
    min-width: 70px;
}

body.kid-mode .schedule-time {
    font-size: 1.125rem;
    color: var(--accent-coral);
}

.schedule-event {
    flex: 1;
}

/* ============================================================================
   Goals
   ============================================================================ */

.goals-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.goal-item {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1.1rem;
    background: var(--bg-primary);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

body.kid-mode .goal-item {
    padding: 1.25rem;
    border-radius: 12px;
}

.goal-item:hover {
    background: #f0f1f3;
}

.goal-checkbox {
    width: 32px;
    height: 32px;
    border: 2.5px solid var(--border-color);
    border-radius: 8px;
    flex-shrink: 0;
    transition: all 0.2s;
    position: relative;
}

body.kid-mode .goal-checkbox {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.goal-item.completed .goal-checkbox {
    background: var(--accent-green);
    border-color: var(--accent-green);
}

.goal-item.completed .goal-checkbox::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
}

.goal-label {
    flex: 1;
    font-size: 1.05rem;
    line-height: 1.35;
}

body.kid-mode .goal-label {
    font-size: 1.125rem;
}

.goal-item.completed .goal-label {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.goal-person {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    overflow: hidden;
}

/* ============================================================================
   Weather Widget
   ============================================================================ */

.weather-current {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--accent-blue) 0%, #667eea 100%);
    border-radius: 12px;
    color: white;
    margin-bottom: 1rem;
}

.weather-icon {
    font-size: 3rem;
    line-height: 1;
}

.weather-temp {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.weather-desc {
    font-size: 0.875rem;
    opacity: 0.9;
    text-transform: capitalize;
}

.weather-forecast {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.weather-day {
    display: grid;
    grid-template-columns: 3fr 2fr 3fr;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-primary);
    border-radius: 6px;
    font-size: 0.875rem;
}

.weather-day span:first-child {
    font-weight: 500;
}

.weather-day span:nth-child(2) {
    text-align: center;
    font-size: 1.25rem;
}

.weather-day span:last-child {
    text-align: right;
    color: var(--text-secondary);
}

body.kid-mode .weather-current {
    padding: 1.5rem;
    border-radius: 16px;
}

body.kid-mode .weather-icon {
    font-size: 4rem;
}

body.kid-mode .weather-temp {
    font-size: 2.5rem;
}

body.kid-mode .weather-day {
    padding: 0.75rem;
    border-radius: 10px;
    font-size: 1rem;
}

.weather-status-bar {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1rem 1.25rem;
    align-items: center;
    margin-bottom: 1rem;
    background: linear-gradient(120deg, #0d4f7a 0%, #2e86ab 45%, #4db6d6 100%);
    color: #ffffff;
}

.weather-status-current {
    display: grid;
    grid-template-columns: auto auto 1fr;
    align-items: center;
    gap: 0.75rem;
}

.weather-status-icon {
    font-size: 2.25rem;
    line-height: 1;
}

.weather-status-temp {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.weather-status-location {
    font-size: 0.95rem;
    opacity: 0.95;
}

.weather-status-detail {
    font-size: 0.95rem;
    line-height: 1.35;
    opacity: 0.95;
}

.weather-status-forecast {
    grid-column: 1 / -1;
    font-size: 0.9rem;
    line-height: 1.4;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    opacity: 0.95;
}

body.kid-mode .weather-status-bar {
    border-radius: 20px;
    border: 3px solid var(--accent-yellow);
}

/* ============================================================================
   Shopping List
   ============================================================================ */

.shopping-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.shopping-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-primary);
    border-radius: 6px;
}

.shopping-item > span {
    flex: 1;
}

body.kid-mode .shopping-item {
    padding: 1rem;
    border-radius: 10px;
    font-size: 1.125rem;
}

.shopping-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s;
}

body.kid-mode .shopping-checkbox {
    width: 28px;
    height: 28px;
    border-radius: 6px;
}

.shopping-checkbox.checked {
    background: var(--accent-green);
    border-color: var(--accent-green);
}

.shopping-checkbox.checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 0.875rem;
}

/* ============================================================================
   Alerts
   ============================================================================ */

.inventory-alerts {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.alert {
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    align-items: start;
    gap: 0.75rem;
}

body.kid-mode .alert {
    padding: 1.25rem;
    border-radius: 12px;
    font-size: 1.125rem;
}

.alert-warning {
    background: #fef3c7;
    border-left: 3px solid var(--accent-yellow);
}

.alert-info {
    background: #dbeafe;
    border-left: 3px solid var(--accent-blue);
}

.alert-primary {
    background: #e0e7ff;
    border-left: 3px solid var(--accent-purple);
}

/* ============================================================================
   Calendar View
   ============================================================================ */

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.day-label {
    text-align: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding: 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.calendar-day {
    aspect-ratio: 1;
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.25rem;
    border: 1px solid transparent;
    background: var(--bg-primary);
    overflow: hidden;
}

.calendar-day:not(.empty):hover {
    background: white;
    border-color: var(--border-color);
    box-shadow: var(--shadow-sm);
}

.calendar-day.today {
    background: var(--accent-blue);
    color: white;
}

.calendar-day.has-events::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent-green);
}

.calendar-day.today.has-events::after {
    background: white;
}

.day-number {
    font-weight: 500;
    font-size: 0.875rem;
}

.calendar-day-meta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    width: 100%;
}

.calendar-day-meta.compact {
    margin-top: 0.15rem;
}

.calendar-day-weather {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-day-meal {
    font-size: 0.68rem;
    line-height: 1.2;
    padding: 0.12rem 0.3rem;
    border-radius: 4px;
    background: rgba(46, 134, 171, 0.12);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-day-more {
    font-size: 0.67rem;
    color: var(--text-secondary);
}

.calendar-day.empty {
    opacity: 0.3;
    cursor: default;
}

.calendar-week-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(180px, 1fr));
    gap: 0.85rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.calendar-week-day {
    min-height: 240px;
    padding: 0.9rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.calendar-week-day:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--accent-blue);
}

.calendar-week-day.today {
    border-color: var(--accent-blue);
    background: #eaf2ff;
}

.calendar-week-day-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.calendar-week-day-num {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.calendar-week-events {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.25rem;
}

.calendar-week-day .calendar-day-meta {
    margin-top: 0.15rem;
}

.calendar-week-event {
    font-size: 0.82rem;
    line-height: 1.3;
    padding: 0.35rem 0.45rem;
    border-radius: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.calendar-week-event-time {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent-blue);
}

.calendar-week-event-title {
    font-weight: 600;
    margin-top: 0.1rem;
    white-space: normal;
}

.calendar-week-event-location {
    margin-top: 0.15rem;
    font-size: 0.74rem;
    color: var(--text-secondary);
    white-space: normal;
}

.calendar-week-event-empty {
    color: var(--text-secondary);
    font-style: italic;
}

.home-week-meal-action {
    cursor: pointer;
}

.home-week-meal-action:hover {
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-sm);
}

.home-week-event-action {
    cursor: pointer;
}

.home-week-event-action:hover {
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-sm);
}

.calendar-week-event-meal.meal-type-breakfast {
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.35);
}

.calendar-week-event-meal.meal-type-lunch {
    background: rgba(59, 130, 246, 0.13);
    border-color: rgba(59, 130, 246, 0.35);
}

.calendar-week-event-meal.meal-type-dinner {
    background: rgba(16, 185, 129, 0.13);
    border-color: rgba(16, 185, 129, 0.35);
}

.calendar-week-event-meal.meal-type-snack {
    background: rgba(139, 92, 246, 0.13);
    border-color: rgba(139, 92, 246, 0.35);
}

.home-week-quick-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.home-week-meal-grid {
    margin-top: 0.8rem;
    display: grid;
    grid-template-columns: repeat(7, minmax(180px, 1fr));
    gap: 0.85rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.home-week-meal-card {
    min-height: 220px;
    padding: 0.85rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.home-week-meal-card-day {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.home-quick-meal-btn {
    border: none;
    color: #ffffff;
    border-radius: 6px;
    padding: 0.52rem 0.65rem;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.home-quick-meal-btn:hover {
    filter: brightness(1.06);
}

.home-quick-meal-btn.breakfast {
    background: #f59e0b;
}

.home-quick-meal-btn.lunch {
    background: #3b82f6;
}

.home-quick-meal-btn.dinner {
    background: #10b981;
}

.home-quick-meal-btn.snack {
    background: #8b5cf6;
}

.calendar-week-more {
    font-size: 0.74rem;
    color: var(--text-secondary);
}

.calendar-main-week {
    grid-template-columns: 1fr;
}

.calendar-main-week .sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.events-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.event-item {
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 8px;
    border-left: 3px solid var(--accent-blue);
    cursor: pointer;
    transition: all 0.2s;
}

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

.calendar-forecast-note {
    font-size: 0.78rem;
    margin: 0.5rem 0 0.25rem;
}

.event-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.event-time {
    font-size: 0.875rem;
    color: var(--accent-blue);
    font-weight: 600;
}

.event-title {
    font-weight: 600;
    margin-top: 0.25rem;
}

.event-person {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.event-detail {
    cursor: pointer;
}

.event-details-grid {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-top: 0.75rem;
}

.event-detail-row {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 0.9rem;
    line-height: 1.35;
}

.budget-row {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.1rem 1.3rem;
    margin-bottom: 0.75rem;
}

.budget-row-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 1.05rem;
}

.budget-row-sub {
    margin-top: 0.4rem;
    font-size: 0.92rem;
    color: var(--text-secondary);
}

.progress-bar {
    margin-top: 0.5rem;
    width: 100%;
    height: 10px;
    border-radius: 99px;
    background: #e5e7eb;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-green), #34d399);
}

.text-danger {
    color: #b91c1c;
}

.financial-lock-panel {
    max-width: 420px;
}

/* ============================================================================
   Meal Planning View
   ============================================================================ */

.meal-plan-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.week-day-column {
    background: var(--bg-primary);
    border-radius: 8px;
    overflow: hidden;
}

.week-day-header {
    background: var(--accent-blue);
    color: white;
    padding: 0.75rem;
    text-align: center;
}

.day-name {
    font-weight: 600;
    font-size: 0.875rem;
}

.day-num {
    font-size: 1.25rem;
    font-weight: 700;
}

.meal-slot {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
}

.meal-slot:last-child {
    border-bottom: none;
}

.meal-slot:hover {
    background: white;
}

.meal-slot.filled {
    background: white;
}

.meal-type-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.meal-name {
    font-size: 0.875rem;
    font-weight: 500;
}

.meal-slot.empty .meal-name {
    color: var(--text-secondary);
    font-style: italic;
}

/* ============================================================================
   Inventory View
   ============================================================================ */

.location-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.location-tab {
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.location-tab.active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.inventory-sections {
    position: relative;
}

.inventory-section {
    display: none;
}

.inventory-section.active {
    display: block;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.inventory-item-card {
    padding: 1.25rem;
    background: var(--bg-primary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.inventory-item-card:hover {
    box-shadow: var(--shadow-sm);
}

.inventory-item-card.expiring {
    border-color: var(--accent-yellow);
    background: #fef3c7;
}

.inventory-item-card.low {
    border-color: var(--accent-coral);
    background: #fee2e2;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.5rem;
}

.item-name {
    font-weight: 700;
    font-size: 1.1rem;
}

.item-quantity {
    font-weight: 600;
    color: var(--accent-blue);
}

.item-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.item-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.badge-warning {
    background: var(--accent-yellow);
    color: #92400e;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

/* ============================================================================
   Recipes View
   ============================================================================ */

.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.recipe-card {
    background: var(--bg-primary);
    border-radius: 14px;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
    overflow: hidden;
}

.recipe-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.recipe-card-content {
    padding: 1.25rem;
}

.recipe-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.recipe-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.recipe-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.recipe-ingredients {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.recipe-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.recipe-filter-chip {
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: 999px;
    padding: 0.4rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.recipe-filter-chip:hover {
    box-shadow: var(--shadow-sm);
}

.recipe-filter-chip.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #ffffff;
}

.recipe-category-groups {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.recipe-category-section {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
}

.recipe-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.6rem;
}

.recipe-category-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

.recipe-category-count {
    min-width: 1.8rem;
    height: 1.8rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-blue);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 700;
}

/* ============================================================================
   Settings View
   ============================================================================ */

.settings-sections {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.settings-section h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.1rem;
}

.people-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.person-card {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    padding: 1.2rem;
    background: var(--bg-primary);
    border-radius: 12px;
}

.person-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.person-name {
    font-weight: 600;
}

.person-color {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.form-help {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.form-help a {
    color: var(--accent-blue);
    text-decoration: none;
}

.form-help a:hover {
    text-decoration: underline;
}

.integration-status {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.button-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.calendar-config-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.calendar-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.calendar-name {
    font-weight: 600;
}

.badge-primary {
    padding: 0.25rem 0.5rem;
    background: var(--accent-blue);
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.calendars-list {
    max-height: 400px;
    overflow-y: auto;
    margin: 1rem 0;
}

.calendar-person-select {
    width: 150px;
}

/* ============================================================================
   iCloud / ICS Calendar Sources
   ============================================================================ */

.ics-sources-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.ics-source-row {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    background: var(--bg-primary);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: box-shadow 0.15s;
}

.ics-source-row:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.ics-source-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

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

.ics-source-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ics-source-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

.ics-source-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

.btn-sm {
    padding: 0.3rem 0.65rem !important;
    font-size: 0.78rem !important;
    border-radius: 6px !important;
}

.ics-add-form {
    background: var(--bg-primary);
    border: 1px dashed var(--border-color);
    border-radius: 10px;
    padding: 1.25rem;
}

.ics-add-form .form-group:last-of-type {
    margin-bottom: 1rem;
}

/* ── Kid mode variants ── */

body.kid-mode .ics-source-row {
    border-radius: 14px;
    padding: 1rem 1.25rem;
}

body.kid-mode .ics-source-name {
    font-size: 1rem;
}

body.kid-mode .ics-add-form {
    border-radius: 14px;
    padding: 1.5rem;
}

/* ── iCloud badge on calendar events ── */

.event-item[data-source="ics"] .event-title::after {
    content: " ☁️";
    font-size: 0.7em;
    opacity: 0.7;
}

/* ============================================================================
   Manage Rows (Chores / Goals in Settings)
   ============================================================================ */

.manage-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
    transition: box-shadow 0.15s;
}

.manage-row:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.manage-row-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.manage-row-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.manage-row-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.manage-row-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.manage-row-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

body.kid-mode .manage-row {
    padding: 1rem 1.25rem;
    border-radius: 12px;
}

body.kid-mode .manage-row-name {
    font-size: 1rem;
}

/* ============================================================================
   Forms
   ============================================================================ */

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.form-input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(77, 150, 255, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

textarea.form-input {
    resize: vertical;
}

/* ============================================================================
   Buttons
   ============================================================================ */

.btn-save {
    background: var(--accent-blue);
    color: white;
    border: none;
    padding: 0.8rem 1.6rem;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

body.kid-mode .btn-save {
    padding: 1rem 2rem;
    border-radius: 16px;
    font-size: 1.125rem;
}

.btn-save:hover {
    background: #2f7ef7;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-add {
    background: var(--accent-green);
    color: white;
    border: none;
    padding: 0.7rem 1.3rem;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-add:hover {
    background: #059669;
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.7rem 1.3rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    margin-right: 0.5rem;
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
}

.btn-secondary.active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.btn-danger {
    background: #dc2626;
    color: white;
    border: none;
    padding: 0.7rem 1.3rem;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-danger:hover {
    background: #991b1b;
}

/* ============================================================================
   Modal
   ============================================================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem 2rem 2rem 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.modal-close {
    position: sticky;
    top: 0;
    float: right;
    margin: -0.5rem -0.5rem 0.5rem 0.5rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
    flex-shrink: 0;
}

.modal-close:hover {
    background: var(--bg-primary);
}

#modalBody h2 {
    margin-bottom: 1.5rem;
}

.recipe-picker {
    display: grid;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
}

.recipe-option {
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.recipe-option:hover {
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-sm);
    transform: translateX(4px);
}

.recipe-option-photo {
    font-size: 2.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.recipe-option-info {
    flex: 1;
}

.recipe-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.recipe-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.recipe-cost {
    color: var(--accent-green);
    font-weight: 600;
}

/* Meal Builder */
.meal-builder {
    padding: 1rem 0;
}

.builder-section {
    margin-bottom: 1.5rem;
}

.builder-section h4 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.builder-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
}

.builder-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.builder-option:hover {
    border-color: var(--accent-blue);
    background: white;
}

.builder-option input[type="radio"] {
    margin: 0;
}

.builder-option input[type="radio"]:checked + span {
    font-weight: 600;
    color: var(--accent-blue);
}

.builder-option:has(input:checked) {
    border-color: var(--accent-blue);
    background: #eff6ff;
}

.day-events {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.event-detail {
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 8px;
}

.event-time {
    font-weight: 600;
    color: var(--accent-blue);
    margin-bottom: 0.25rem;
}

.event-summary {
    font-size: 1rem;
}

.recipe-details {
    margin-top: 1rem;
}

.recipe-stats {
    display: flex;
    gap: 1.5rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.recipe-details h3 {
    margin: 1.5rem 0 0.75rem;
}

.ingredients-list {
    list-style: none;
    padding: 0;
}

.ingredients-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.ingredients-list li:last-child {
    border-bottom: none;
}

/* ============================================================================
   Notifications
   ============================================================================ */

.notification {
    position: fixed;
    top: -100px;
    right: 2rem;
    background: var(--bg-secondary);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    transition: all 0.3s;
    border-left: 3px solid var(--accent-blue);
}

.notification.show {
    top: 2rem;
}

.notification-success {
    border-left-color: var(--accent-green);
}

.notification-error {
    border-left-color: #dc2626;
}

.notification-warning {
    border-left-color: var(--accent-yellow);
}

/* ============================================================================
   Utilities
   ============================================================================ */

.text-muted {
    color: var(--text-secondary);
    font-style: italic;
}

/* ============================================================================
   Cooking Show Modal
   ============================================================================ */

/* Meal card enhancements */
.meal-card-photo {
    font-size: 4rem;
    line-height: 1;
    margin-bottom: 0.75rem;
}

.meal-card-clickable {
    cursor: pointer;
    position: relative;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.meal-card-clickable:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-color: var(--accent-blue);
}

.meal-card-arrow {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    font-size: 1.25rem;
    color: var(--accent-blue);
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
}

.meal-card-clickable:hover .meal-card-arrow {
    opacity: 1;
    transform: translateY(-50%) translateX(4px);
}

/* Cooking modal initial choice screen */
.cooking-modal {
    background: rgba(0,0,0,0.85) !important;
}

.cooking-modal .modal-content {
    max-width: 600px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    padding: 3rem;
}

.cooking-modal-choice {
    text-align: center;
}

.cooking-hero-photo {
    font-size: 8rem;
    line-height: 1;
    margin-bottom: 1rem;
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.photo-upload-options {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

@keyframes bounceIn {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.cooking-hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.cooking-hero-meta {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

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

.btn-cooking-start {
    background: #f59e0b;
    color: white;
    border: none;
    padding: 1.5rem 2rem;
    border-radius: 16px;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
}

.btn-cooking-start:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 24px rgba(245, 158, 11, 0.6);
}

.btn-cooking-icon {
    font-size: 1.5rem;
}

.btn-cooking-time {
    font-size: 0.875rem;
    opacity: 0.9;
    background: rgba(255,255,255,0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
}

.btn-cooking-complete {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cooking-complete:hover {
    background: rgba(255,255,255,0.25);
}

/* Full-screen cooking show interface */
.cooking-show-container {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #1e3a8a 0%, #7c2d12 100%);
    color: white;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    z-index: 9999;
}

.cooking-show-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(255,255,255,0.2);
}

.cooking-close {
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.cooking-close:hover {
    background: rgba(255,255,255,0.2);
    transform: rotate(90deg);
}

.cooking-show-title {
    flex: 1;
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.cooking-phase {
    background: rgba(255,255,255,0.2);
    padding: 0.75rem 1.5rem;
    border-radius: 24px;
    font-size: 1.125rem;
    font-weight: 600;
    white-space: nowrap;
    backdrop-filter: blur(8px);
}

/* Giant countdown timer */
.cooking-show-timer {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 0 auto;
}

.cooking-timer-ring {
    transform: rotate(-90deg);
}

.cooking-timer-bg {
    fill: none;
    stroke: rgba(255,255,255,0.1);
    stroke-width: 12;
}

.cooking-timer-progress {
    fill: none;
    stroke: #fbbf24;
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s linear;
    filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.6));
}

.cooking-timer-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.cooking-timer-numbers {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.cooking-timer-label {
    font-size: 1rem;
    opacity: 0.8;
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Ingredients and steps columns */
.cooking-show-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    flex: 1;
}

.cooking-show-column {
    background: rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(8px);
}

.cooking-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(255,255,255,0.2);
}

.cooking-ingredients-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cooking-ingredient {
    padding: 0.75rem;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.125rem;
}

.cooking-qty {
    font-weight: 700;
    color: #fbbf24;
}

.cooking-steps-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    counter-reset: step;
}

.cooking-step {
    padding: 1rem;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    line-height: 1.5;
}

.cooking-step-num {
    background: #fbbf24;
    color: #1e3a8a;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

/* Controls */
.cooking-show-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding-top: 1rem;
}

.btn-cooking-control {
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cooking-control:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-2px);
}

.btn-cooking-finish {
    background: #10b981;
    border: none;
    color: white;
    padding: 1.25rem 3rem;
    border-radius: 16px;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

.btn-cooking-finish:hover {
    background: #059669;
    transform: scale(1.05);
}

/* Responsive cooking show */
@media (max-width: 768px) {
    .cooking-show-content {
        grid-template-columns: 1fr;
    }
    
    .cooking-show-timer {
        width: 220px;
        height: 220px;
    }
    
    .cooking-timer-numbers {
        font-size: 3rem;
    }
    
    .cooking-show-title {
        font-size: 1.5rem;
    }
    
    .cooking-phase {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }
}

/* Updated cooking workspace layout */
.cooking-show-container {
    overflow: hidden;
    padding: 1rem;
}

.cooking-show-layout {
    height: calc(100vh - 2rem);
    display: grid;
    grid-template-columns: minmax(320px, 42vw) 1fr;
    grid-template-rows: 1fr 1fr;
    grid-template-areas:
        "ingredients steps"
        "timer steps";
    gap: 1rem;
}

.cooking-panel-ingredients { grid-area: ingredients; }
.cooking-panel-timer { grid-area: timer; }
.cooking-panel-steps { grid-area: steps; }

.cooking-show-column {
    height: 100%;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cooking-panel-photo-wrap {
    width: 100%;
    height: clamp(110px, 22vh, 220px);
    border-radius: 12px;
    margin-bottom: 0.85rem;
    background: rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cooking-panel-photo-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.cooking-panel-photo-emoji {
    font-size: clamp(2.6rem, 5vw, 6rem);
    line-height: 1;
}

.cooking-show-header {
    border-bottom: none;
    padding-bottom: 0;
}

.cooking-show-title {
    text-align: left;
    font-size: clamp(1.1rem, 1.3vw + 0.6rem, 1.85rem);
}

.cooking-phase {
    font-size: clamp(0.75rem, 0.5vw + 0.55rem, 1.1rem);
}

.cooking-show-timer {
    margin: 0.5rem auto 0;
}

.cooking-ingredients-list {
    overflow: auto;
    min-height: 0;
}

.cooking-panel-steps .cooking-steps-list {
    flex: 1;
    overflow: auto;
    min-height: 0;
    padding-right: 0.25rem;
}

.cooking-steps-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.cooking-steps-header .cooking-section-title {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.cooking-step {
    align-items: flex-start;
}

.cooking-step-text {
    font-size: clamp(1rem, 0.65rem + 1.05vw, 1.85rem);
    line-height: 1.45;
}

.cooking-step-num {
    width: clamp(28px, 2vw + 20px, 40px);
    height: clamp(28px, 2vw + 20px, 40px);
    font-size: clamp(0.9rem, 0.35vw + 0.7rem, 1.2rem);
}

.cooking-panel-timer .cooking-show-controls {
    margin-top: auto;
    justify-content: center;
}

@media (max-width: 900px) {
    .cooking-show-layout {
        height: auto;
        min-height: calc(100vh - 2rem);
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        grid-template-areas:
            "ingredients"
            "timer"
            "steps";
    }

    .cooking-panel-steps .cooking-steps-list {
        max-height: 45vh;
    }
}

/* ============================================================================
   Responsive Design
   ============================================================================ */

/* Ultra-wide displays (maximize horizontal space) */
@media (min-width: 1600px) {
    .main-grid {
        grid-template-columns: 1fr 400px;
        gap: 2rem;
    }

    .home-main-grid {
        grid-template-columns: 380px 1fr;
    }
    
    .meal-cards-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .container {
        max-width: 2200px;
    }
}

/* Landscape tablets (keep 2-column layout) */
@media (max-width: 1200px) and (min-width: 769px) {
    .mc-body {
        grid-template-columns: 180px 1fr 180px;
    }

    .main-grid {
        grid-template-columns: 1fr 300px;
        gap: 1rem;
    }

    .home-main-grid {
        grid-template-columns: 280px 1fr;
    }

    .home-lower-grid {
        grid-template-columns: 1fr;
    }

    .calendar-week-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    
    .meal-plan-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Portrait tablets / large phones (single column) */
@media (max-width: 768px) and (min-width: 481px) {
    .calendar-main-week .sidebar {
        grid-template-columns: 1fr;
    }

    .mc-body {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }

    .mc-col {
        border-right: none;
        border-bottom: 1px solid #1e293b;
        min-height: 220px;
    }

    .mc-col:last-child {
        border-bottom: none;
    }

    .main-grid {
        grid-template-columns: 1fr;
    }

    .home-lower-grid {
        grid-template-columns: 1fr;
    }

    .sidebar-left {
        order: 2;
    }

    .home-primary-column {
        order: 1;
    }

    .weather-status-bar {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .calendar-week-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .header {
        height: auto;
        min-height: 48px;
        padding: 0.875rem 1rem;
        flex-wrap: wrap;
        row-gap: 0.5rem;
    }

    .header-right {
        margin-left: auto;
    }

    .view-toggle {
        order: 3;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .meal-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .meal-plan-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .recipes-grid,
    .inventory-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Small phones (very compact) */
@media (max-width: 480px) {
    .calendar-main-week .sidebar {
        grid-template-columns: 1fr;
    }

    .header {
        height: auto;
        min-height: 48px;
        flex-wrap: wrap;
        gap: 0.5rem;
        align-items: center;
        padding: 0.75rem;
    }

    .current-time {
        min-width: 0;
        font-size: 0.8rem;
    }

    .header-right {
        margin-left: auto;
    }

    .view-toggle {
        order: 3;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.25rem;
        white-space: nowrap;
    }

    .view-btn {
        flex: 0 0 auto;
    }

    .mc-body {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }

    .mc-col {
        border-right: none;
        border-bottom: 1px solid #1e293b;
        min-height: 200px;
    }

    .mc-col:last-child {
        border-bottom: none;
    }
    
    .main-grid {
        grid-template-columns: 1fr;
    }

    .home-lower-grid {
        grid-template-columns: 1fr;
    }

    .sidebar-left {
        order: 2;
    }

    .home-primary-column {
        order: 1;
    }

    .weather-status-bar {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .calendar-week-grid {
        grid-template-columns: 1fr;
    }
    
    .meal-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .meal-plan-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .recipes-grid,
    .inventory-grid {
        grid-template-columns: 1fr;
    }
    
    .widget {
        padding: 1rem;
    }
    
    .summary-bar {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .summary-stat {
        width: 100%;
    }
}

@media (max-width: 1200px) {
    .home-week-meal-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .home-week-meal-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .home-week-meal-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
   Typography + Mission Control Overrides
   ============================================================================ */

/* 1.5x global scale */
html { font-size: 21px; }
body { font-size: 1rem; }

.mc-col-header { font-size: 0.8rem; }

.mc-task {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.7rem;
    background: #1e293b;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #cbd5e1;
    cursor: pointer;
    transition: background 0.15s;
}

.mc-task:hover { background: #263348; }

.mc-task.completed .mc-task-label {
    text-decoration: line-through;
    color: #64748b;
}

.mc-task-check {
    width: 14px;
    height: 14px;
    border: 2px solid #475569;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mc-task-check.done {
    background: #16a34a;
    border-color: #16a34a;
}

.mc-task-check.done::after {
    content: '?';
    font-size: 0.55rem;
    color: white;
    font-weight: 900;
}

.mc-task-label { flex: 1; }

.mc-task-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-left: auto;
}

.mc-alert { font-size: 0.86rem; }
.mc-alert strong { font-size: 0.8rem; }
.mc-weather-detail { font-size: 0.78rem; }
.mc-goals-count { font-size: 0.8rem; }

.mc-empty-state {
    font-size: 0.86rem;
    color: #64748b;
    padding: 0.45rem 0;
}

.mc-weather {
    background: linear-gradient(135deg, #1e293b 0%, #253650 48%, #1d4f6d 100%);
    background-size: 200% 200%;
    position: relative;
    overflow: hidden;
    animation: mcWeatherGradient 12s ease-in-out infinite;
}

.mc-weather::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 20%, rgba(255,255,255,0.08) 45%, transparent 70%);
    transform: translateX(-120%);
    animation: mcWeatherShimmer 5s linear infinite;
}

.mc-weather-icon {
    display: inline-block;
    position: relative;
    z-index: 1;
    animation: mcWeatherIconBob 2.2s ease-in-out infinite;
}

.mc-weather .temp {
    font-size: 1.2rem;
    position: relative;
    z-index: 1;
}

.mc-weather-detail {
    position: relative;
    z-index: 1;
}

@keyframes mcWeatherGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes mcWeatherShimmer {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(120%); }
}

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

@media (max-width: 480px) {
    html { font-size: 16px; }
}

body[data-ui-scale-resolved="android_landscape"] .mc-body {
    grid-template-columns: 240px 1fr 240px;
}

body[data-ui-scale-resolved="android_landscape"] .mc-col-header {
    font-size: 0.88rem;
}

body[data-ui-scale-resolved="android_portrait"] .mc-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
}

body[data-ui-scale-resolved="android_portrait"] .mc-col {
    border-right: none;
    border-bottom: 1px solid #1e293b;
    min-height: 220px;
}

body[data-ui-scale-resolved="android_portrait"] .mc-col:last-child {
    border-bottom: none;
}


.smart-subhead {
    margin-bottom: 0.85rem;
}

.smart-help-list {
    margin: 0;
    padding-left: 1rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.smart-devices-container {
    min-height: 140px;
}

.smart-grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0.85rem;
}

.smart-card {
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    padding: 0.85rem;
    background: rgba(15, 23, 42, 0.22);
}

.smart-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.smart-card-title {
    font-weight: 700;
}

.smart-card-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.smart-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.smart-inline-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.smart-inline-control label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    min-width: 110px;
}

.smart-inline-control input[type="range"] {
    flex: 1;
}

.smart-inline-control .form-input {
    width: 95px;
}

/* ============================================================================
   AUTH — Login screen
   ============================================================================ */

.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1d29 0%, #2e3150 50%, #1a2a3a 100%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.login-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.login-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 48px 40px 40px;
    max-width: 440px;
    width: 90%;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0,0,0,0.45);
    animation: loginCardIn 0.4s cubic-bezier(0.22,1,0.36,1);
}

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

.login-logo {
    font-size: 56px;
    margin-bottom: 12px;
}

.login-title {
    font-size: 26px;
    font-weight: 700;
    color: #1a1d29;
    margin-bottom: 10px;
}

.login-subtitle {
    font-size: 15px;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 28px;
}

.login-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fca5a5;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    margin-bottom: 16px;
    text-align: left;
}

/* Google sign-in button — follows official Google branding guidelines */
.google-signin-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    border: 1px solid #dadce0;
    border-radius: 4px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    color: #3c4043;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, box-shadow 0.15s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    font-family: 'Google Sans', Roboto, Arial, sans-serif;
    width: 100%;
    justify-content: center;
}

.google-signin-btn:hover {
    background: #f8f8f8;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    color: #3c4043;
    text-decoration: none;
}

.google-signin-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.login-footer {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 20px;
    line-height: 1.6;
}

/* ============================================================================
   AUTH — Header user display (avatar + name + dropdown + sync)
   ============================================================================ */

.header-user-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 10px 4px 4px;
    border-radius: 30px;
    transition: background 0.15s;
}

.user-avatar-wrap:hover {
    background: rgba(255,255,255,0.12);
}

.user-avatar-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.3);
    flex-shrink: 0;
}

.user-avatar-fallback {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.user-display-name {
    color: white;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
}

.user-role-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.role-admin {
    background: rgba(253,186,116,0.25);
    color: #fcd34d;
    border: 1px solid rgba(253,186,116,0.4);
}

/* Dropdown */
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: #1f2937;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    color: white;
    text-align: center;
    z-index: 2000;
    display: none;
    animation: dropdownIn 0.18s ease;
}

.user-dropdown.open {
    display: block;
}

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

.user-dropdown-info {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.user-dropdown-btn {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    padding: 8px 4px;
    cursor: pointer;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
    font-family: inherit;
}

.user-dropdown-btn:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    text-decoration: none;
}

/* Sync status */
.sync-status {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    white-space: nowrap;
    padding-right: 4px;
}

/* Kid mode toggle button in header */
.kid-mode-toggle { display: none; } /* removed */

/* ============================================================================
   ONBOARDING — Wizard overlay
   ============================================================================ */

.onboarding-overlay {
    position: fixed;
    inset: 0;
    z-index: 9500;
    background: rgba(10, 14, 30, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    animation: fadeIn 0.3s ease;
}

.onboarding-overlay.onboarding-closing {
    animation: fadeOut 0.5s ease forwards;
}

@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

.onboarding-modal {
    background: #ffffff;
    border-radius: 24px;
    width: min(860px, 95vw);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 32px 80px rgba(0,0,0,0.5);
}

.onboarding-progress-bar {
    height: 5px;
    background: #e5e7eb;
    flex-shrink: 0;
}

.onboarding-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4d96ff, #06d6a0);
    border-radius: 0 3px 3px 0;
    transition: width 0.4s cubic-bezier(0.22,1,0.36,1);
}

.onboarding-step-label {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 12px 0 0;
    flex-shrink: 0;
}

.onboarding-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 40px;
}

.onboarding-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 40px 24px;
    border-top: 1px solid #f3f4f6;
    flex-shrink: 0;
    gap: 12px;
}

.onboarding-dots {
    display: flex;
    gap: 6px;
}

.onboarding-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d1d5db;
    transition: background 0.2s, transform 0.2s;
}

.onboarding-dot.active {
    background: #4d96ff;
    transform: scale(1.3);
}

.onboarding-dot.done {
    background: #06d6a0;
}

.onboarding-btn-skip {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
}

.onboarding-btn-skip:hover { background: #f3f4f6; color: #6b7280; }

.onboarding-btn-next {
    background: linear-gradient(135deg, #4d96ff, #3b82f6);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 28px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(77,150,255,0.35);
    transition: transform 0.15s, box-shadow 0.15s;
    font-family: inherit;
}

.onboarding-btn-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(77,150,255,0.45);
}

/* ── Step content ── */
.ob-step { max-width: 680px; margin: 0 auto; }

.ob-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1d29;
    margin-bottom: 10px;
    line-height: 1.25;
}

.ob-subtitle {
    font-size: 16px;
    color: #6b7280;
    line-height: 1.7;
    margin-bottom: 24px;
}

.ob-hint {
    font-size: 14px;
    color: #9ca3af;
    line-height: 1.6;
}

/* Welcome step */
.ob-step-welcome { text-align: center; }

.ob-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: block;
    border: 4px solid #e5e7eb;
}

.ob-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 20px 0;
    text-align: left;
}

.ob-feature {
    background: #f9fafb;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
    color: #374151;
    border: 1px solid #e5e7eb;
}

/* Schedule step */
.ob-schedule-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
}

.ob-day-column {
    min-width: 80px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ob-day-header {
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    padding: 4px 0;
    background: #f3f4f6;
    border-radius: 6px;
}

.ob-schedule-block {
    background: #eff6ff;
    border-radius: 8px;
    padding: 6px 8px;
    font-size: 11px;
    color: #1e40af;
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: relative;
}

.ob-remove-block {
    position: absolute;
    top: 2px;
    right: 4px;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 10px;
    padding: 0;
    line-height: 1;
}

.ob-add-block-btn {
    background: none;
    border: 1.5px dashed #d1d5db;
    border-radius: 8px;
    padding: 6px 4px;
    font-size: 11px;
    color: #9ca3af;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s, color 0.15s;
}

.ob-add-block-btn:hover { border-color: #4d96ff; color: #4d96ff; }

.ob-add-block-form {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 18px;
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ob-add-block-form h4 {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

/* Shared input style for onboarding forms */
.ob-input {
    background: white;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 14px;
    font-family: inherit;
    color: #1a1d29;
    width: 100%;
    transition: border-color 0.15s;
}

.ob-input:focus { outline: none; border-color: #4d96ff; }

.ob-input.ob-color { padding: 4px; height: 38px; width: 38px; cursor: pointer; }

.ob-btn-primary {
    background: #4d96ff;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}

.ob-btn-primary:hover { background: #3b82f6; }

.ob-btn-ghost {
    background: none;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    padding: 9px 18px;
    font-size: 14px;
    color: #6b7280;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s;
}

.ob-btn-ghost:hover { border-color: #9ca3af; color: #374151; }

/* Chore step */
.ob-chore-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    max-height: 280px;
    overflow-y: auto;
}

.ob-chore-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: background 0.12s;
}

.ob-chore-row:hover { background: #eff6ff; }

.ob-chore-check { width: 18px; height: 18px; cursor: pointer; accent-color: #4d96ff; }

.ob-chore-label { flex: 1; font-size: 14px; color: #374151; }

.ob-chore-freq {
    font-size: 11px;
    color: #9ca3af;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 10px;
}

.ob-add-chore-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.ob-empty { color: #9ca3af; font-size: 14px; padding: 16px 0; }

/* Goals step */
.ob-goal-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.ob-remove-goal {
    background: none;
    border: none;
    color: #d1d5db;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 6px;
    transition: color 0.12s;
}

.ob-remove-goal:hover { color: #ef4444; }

.ob-suggestions {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}

.ob-suggestion-chip {
    display: inline-block;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    color: #1d4ed8;
    cursor: pointer;
    margin: 4px;
    transition: background 0.12s;
    font-family: inherit;
}

.ob-suggestion-chip:hover { background: #dbeafe; }

/* Recipe step */
.ob-recipe-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 8px;
}

.ob-recipe-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.12s;
}

.ob-recipe-row:hover { background: #fff7ed; }

.ob-recipe-emoji { font-size: 24px; flex-shrink: 0; }

.ob-recipe-name { flex: 1; font-size: 14px; font-weight: 500; color: #374151; }

.ob-recipe-time { font-size: 12px; color: #9ca3af; }

.ob-recipe-heart {
    font-size: 20px;
    color: #d1d5db;
    transition: color 0.15s;
}

.ob-recipe-check:checked ~ .ob-recipe-heart,
.ob-recipe-heart.hearted { color: #ef4444; }

.ob-recipe-starter {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 8px;
}

.ob-add-recipe-btn {
    background: #4d96ff;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}

.ob-add-recipe-btn:hover { background: #3b82f6; }

/* All Done step */
.ob-step-done { text-align: center; position: relative; }

.ob-confetti-canvas-wrap {
    position: absolute;
    inset: -40px -40px 0;
    pointer-events: none;
    overflow: hidden;
}

#confettiCanvas {
    width: 100%;
    height: 300px;
}

.ob-done-emoji {
    font-size: 64px;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.ob-done-summary {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 20px auto;
    max-width: 360px;
    text-align: left;
}

.ob-done-item {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 15px;
    color: #166534;
}

/* ============================================================================
   AUTH — Apple sign-in button + Apple identification form
   ============================================================================ */

/* "or" divider between Google and Apple */
.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 14px;
    color: #d1d5db;
    font-size: 13px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

/* Apple sign-in button — follows official Apple Human Interface Guidelines */
.apple-signin-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #000000;
    border: none;
    border-radius: 4px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, box-shadow 0.15s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    width: 100%;
    justify-content: center;
}

.apple-signin-btn:hover {
    background: #1a1a1a;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

/* Subtle indication that the form is expanded */
.apple-signin-btn.apple-btn-active {
    background: #1d1d1f;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.apple-signin-icon {
    width: 18px;
    height: 22px;
    flex-shrink: 0;
}

/* Apple identification form */
.apple-identify-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
    text-align: left;
    animation: loginCardIn 0.25s ease;
}

.apple-form-input {
    width: 100%;
    background: #f9fafb;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    padding: 11px 14px;
    font-size: 15px;
    font-family: inherit;
    color: #1a1d29;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
    resize: none;
}

.apple-form-input:focus {
    outline: none;
    border-color: #374151;
    box-shadow: 0 0 0 3px rgba(55,65,81,0.1);
}

.apple-form-input::placeholder { color: #9ca3af; }

.apple-ical-input {
    font-size: 13px;
    resize: vertical;
    min-height: 54px;
}

.apple-ical-hint {
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.55;
    margin: 0;
}

.apple-form-submit {
    width: 100%;
    background: #000000;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 13px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
    margin-top: 4px;
}

.apple-form-submit:hover { background: #1a1a1a; }

/* ============================================================================
   ONBOARDING — iCal URL step (Apple users)
   ============================================================================ */

/* Avatar fallback for Apple users (no OAuth photo) */
.ob-avatar-fallback {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: 700;
    color: white;
    border: 4px solid #e5e7eb;
}

/* iCal URL list */
.ob-ical-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 4px;
    max-height: 200px;
    overflow-y: auto;
}

.ob-ical-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 10px 14px;
}

.ob-ical-url {
    flex: 1;
    font-size: 12px;
    color: #065f46;
    word-break: break-all;
    font-family: monospace;
}

.ob-remove-ical {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.12s, background 0.12s;
    flex-shrink: 0;
}

.ob-remove-ical:hover { color: #ef4444; background: #fee2e2; }

.ob-ical-add {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Provider badge shown inside the user dropdown */
.user-provider-badge {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    margin-top: 2px;
}

/* ============================================================
   HOME TASK BOARD — .hb-* classes
   ============================================================ */

.hb-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 0.75rem;
    align-items: start;
    padding: 0.6rem 0.85rem;
    min-height: 100vh;
}

.hb-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: sticky;
    top: 0.6rem;
    max-height: calc(100vh - 1.2rem);
    overflow-y: auto;
    scrollbar-width: none;
}
.hb-sidebar::-webkit-scrollbar { display: none; }

/* Schedule list */
.hb-schedule-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.hb-schedule-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 0.75rem;
    border-left: 3px solid var(--border-color);
    border-radius: 0 6px 6px 0;
    background: var(--bg-primary);
}

.hb-schedule-time {
    font-weight: 700;
    font-size: 0.8rem;
    min-width: 72px;
    color: var(--text-secondary);
}

.hb-schedule-label {
    flex: 1;
    font-size: 0.88rem;
    line-height: 1.3;
}

/* Alerts */
.hb-alerts-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.hb-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    font-size: 0.95rem;
    line-height: 1.45;
}

.hb-alert-blue  { background: #eff6ff; border: 1px solid #bfdbfe; }
.hb-alert-yellow{ background: #fffbeb; border: 1px solid #fde68a; }
.hb-alert-red   { background: #fef2f2; border: 1px solid #fecaca; }

/* Low-stock expanded card */
.hb-low-stock-card { flex-direction: column; gap: 0.4rem; }
.hb-alert-header   { display: flex; align-items: center; gap: 0.5rem; width: 100%; }
.hb-alert-header strong { flex: 1; }
.hb-btn-link { background: none; border: none; cursor: pointer; font-size: 0.8rem;
               color: var(--text-secondary); text-decoration: underline; padding: 0; }
.hb-btn-link:hover { color: var(--text-primary); }
.hb-low-stock-list { list-style: none; padding: 0; margin: 0.25rem 0 0; width: 100%; }
.hb-low-stock-list li { display: flex; justify-content: space-between; padding: 2px 0;
                         font-size: 0.875rem; }
.ls-name { font-weight: 500; }
.ls-qty  { color: var(--text-secondary); font-size: 0.8rem; }
.ls-more { color: var(--text-secondary); font-style: italic; }

/* Scan review rows */
.scan-review-row {
    display: grid;
    grid-template-columns: auto 1fr 70px 80px 90px;
    gap: 4px 6px;
    align-items: center;
    padding: 4px 2px;
    border-bottom: 1px solid var(--border-color);
}
.scan-review-row input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }

/* Meal cooked state */
.meal-cooked      { opacity: 0.6; }
.meal-cooked-badge{ font-size: 1rem; margin-left: auto; }
.btn-mark-cooked  { background: none; border: 1px solid var(--border-color); border-radius: 6px;
                    cursor: pointer; font-size: 0.85rem; padding: 1px 6px; margin-left: 4px; }
.btn-mark-cooked:hover { background: var(--bg-secondary); }

/* Board */
.hb-board {
    min-width: 0;
}

/* Columns */
.hb-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 0.75rem;
    align-items: start;
}

.hb-person-col {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 1.4rem 1.15rem;
    border: 1px solid var(--border-color);
    animation: hb-col-enter 0.35s ease both;
}

.hb-person-col:nth-child(1) { animation-delay: 0.05s; }
.hb-person-col:nth-child(2) { animation-delay: 0.12s; }
.hb-person-col:nth-child(3) { animation-delay: 0.19s; }
.hb-person-col:nth-child(4) { animation-delay: 0.26s; }

@keyframes hb-col-enter {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hb-person-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.85rem;
}

.hb-person-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 2.2rem;
    flex-shrink: 0;
    overflow: hidden;
}

.hb-person-name {
    flex: 1;
    font-weight: 700;
    font-size: 1.25rem;
}

.hb-person-count {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.hb-progress-bar {
    height: 9px;
    background: var(--border-color);
    border-radius: 4px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.hb-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Tasks */
.hb-task-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 0.85rem;
    min-height: 60px;
}

.hb-task {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 0.9rem;
    background: var(--bg-primary);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.12s, opacity 0.2s, transform 0.1s, box-shadow 0.12s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    min-height: 58px;
    border: 2px solid transparent;
}

.hb-task:hover {
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.08);
}

/* Satisfying press-down feel on tap/click */
.hb-task:active {
    transform: scale(0.96);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.35);
}

.hb-task.done {
    opacity: 0.45;
}

.hb-task.done .hb-task-label {
    text-decoration: line-through;
}

/* Checkbox — bigger and round for little fingers */
.hb-task-check {
    width: 30px;
    height: 30px;
    border: 2.5px solid var(--border-color);
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    background: var(--bg-secondary);
    transition: background 0.18s, border-color 0.18s, transform 0.15s;
}

.hb-task-check.checked {
    background: var(--accent-green);
    border-color: var(--accent-green);
    transform: scale(1.15);
}

.hb-task-check.checked::after {
    content: "\2713";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: 900;
    font-size: 1rem;
}

.hb-task-emoji {
    font-size: 1.65rem;
    flex-shrink: 0;
    line-height: 1;
}

.hb-task-label {
    flex: 1;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.35;
    word-break: break-word;
}

/* Badge no longer rendered in HTML — kept hidden in case of legacy data */
.hb-task-badge {
    display: none;
}

.hb-add-task-btn {
    width: 100%;
    padding: 0.7rem;
    background: var(--bg-primary);
    border: 1.5px dashed var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.hb-add-task-btn:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    background: #eff6ff;
}

/* Confetti particles */
.hb-confetti-particle {
    position: fixed;
    width: 9px;
    height: 9px;
    border-radius: 2px;
    pointer-events: none;
    z-index: 9999;
    animation: hb-confetti-fall 1.1s ease-in forwards;
}

@keyframes hb-confetti-fall {
    0%   { transform: translateY(0) rotate(0deg) scale(1);    opacity: 1; }
    80%  { opacity: 1; }
    100% { transform: translateY(200px) rotate(560deg) scale(0.3); opacity: 0; }
}

/* ── 30-day calendar grid ── */
.calendar-30-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-30-grid .calendar-day {
    min-height: 72px;
    border-radius: 6px;
    padding: 0.3rem 0.4rem;
    font-size: 0.78rem;
}

.cal30-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.cal30-day-name {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.calendar-30-grid .calendar-day.weekend {
    background: color-mix(in srgb, var(--bg-primary) 60%, var(--border-color));
}

/* 7-day: add month label under number */
.calendar-week-day-month {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-top: -2px;
    margin-bottom: 4px;
}

/* ── Responsive ── */

/* Landscape tablet (1024px and below): tighten sidebar, let columns wrap */
@media (max-width: 1024px) {
    .hb-layout {
        grid-template-columns: 260px 1fr;
        gap: 1rem;
    }
    .hb-columns {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

/* Portrait tablet (900px and below): stack sidebar above board */
@media (max-width: 900px) {
    .hb-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .hb-sidebar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    .hb-columns {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Large phone / small tablet (600px and below) */
@media (max-width: 600px) {
    .hb-sidebar {
        grid-template-columns: 1fr;
    }
    .hb-columns {
        grid-template-columns: 1fr 1fr;
    }
    .hb-board-title {
        font-size: 1.15rem;
    }
    .calendar-30-grid {
        grid-template-columns: repeat(7, 1fr);
        font-size: 0.7rem;
    }
}

/* Phone (400px and below): single column task cards */
@media (max-width: 400px) {
    .hb-columns {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   CALENDAR 7-DAY MEAL ROW  (separate cards below day cards)
   ============================================================ */

.cal-week-scroll-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Meal row shares the same column widths as the day grid above it */
.cal-meal-row {
    display: grid;
    grid-template-columns: repeat(7, minmax(180px, 1fr));
    gap: 0.85rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.cal-meal-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Filled meal card */
.cal-meal-card.filled {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0.5rem 0.65rem;
    background: var(--bg-secondary);
    border: 2px solid var(--meal-color, var(--border-color));
    border-radius: 8px;
    overflow: hidden;
}

.cal-meal-photo {
    width: 100%;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 2px;
}

.cal-meal-type-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--meal-color, var(--text-secondary));
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cal-meal-recipe-name {
    font-size: 0.78rem;
    line-height: 1.25;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cal-meal-remove {
    position: absolute;
    top: 3px;
    right: 5px;
    font-size: 0.9rem;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
}

.cal-meal-card.filled:hover .cal-meal-remove {
    opacity: 1;
}

/* Add meal button */
.cal-meal-add-btn {
    width: 100%;
    padding: 0.55rem 0.65rem;
    background: var(--meal-color, var(--accent-blue));
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    text-align: left;
    transition: filter 0.15s, transform 0.1s;
}

.cal-meal-add-btn:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
}

.cal-meal-add-btn:active {
    transform: translateY(0);
}

/* ============================================================
   WEATHER CARD — structured today + forecast
   ============================================================ */
.wx-today-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.wx-today-icon { font-size: 3.2rem; line-height: 1; flex-shrink: 0; }
.wx-today-temp { font-size: 2.4rem; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.wx-today-desc { font-size: 1rem; color: var(--text-secondary); margin-top: 0.2rem; }
.wx-today-meta { font-size: 0.82rem; color: var(--text-secondary); margin-top: 0.3rem; line-height: 1.5; }

.wx-forecast-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
}
.wx-fc-card {
    background: var(--bg-primary);
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.wx-fc-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); }
.wx-fc-emoji { font-size: 1.6rem; line-height: 1.1; }
.wx-fc-temps { font-size: 1.15rem; font-weight: 700; }
.wx-fc-low   { color: var(--text-secondary); font-weight: 400; }
.wx-fc-desc  { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.3; }
.wx-fc-precip{ font-size: 0.78rem; color: #3b82f6; font-weight: 600; }


/* ============================================================================
   UNIFIED SIDEBAR CARD — date + weather + schedule in one seamless card
   ============================================================================ */

.hb-unified-card {
    padding: 1.35rem !important;
    display: flex;
    flex-direction: column;
    gap: 0;
    border-radius: 20px !important;
}

.hb-date-block {
    padding-bottom: 1rem;
}

.hb-day-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.hb-date-str {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.15;
    margin-top: 0.1rem;
}

.hb-unified-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.9rem 0;
    flex-shrink: 0;
}

.hb-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 0.65rem;
}

.hb-schedule-section,
.hb-alerts-section {
    flex-shrink: 0;
}

/* Override weather widget padding inside unified card */
.hb-unified-card #weatherStatusBar {
    padding: 0 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

/* ============================================================================
   HAMBURGER FAB + NAV DRAWER
   ============================================================================ */

.hamburger-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: #1e293b;
    border: 2px solid #334155;
    color: #e2e8f0;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.hamburger-fab:hover {
    background: #334155;
    transform: scale(1.08);
}

.hamburger-fab:active {
    transform: scale(0.94);
}

/* Drawer overlay */
.nav-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 800;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    backdrop-filter: blur(2px);
}

.nav-drawer-overlay.open {
    opacity: 1;
    pointer-events: all;
}

/* Drawer panel — slides up from bottom right */
.nav-drawer {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 300px;
    max-height: 85vh;
    background: #0f172a;
    border-radius: 20px 20px 0 0;
    z-index: 900;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    overflow-y: auto;
    box-shadow: -4px 0 40px rgba(0,0,0,0.5);
    border-top: 1px solid #1e293b;
    border-left: 1px solid #1e293b;
}

.nav-drawer.open {
    transform: translateY(0);
}

.nav-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 1.5rem 0.75rem;
    border-bottom: 1px solid #1e293b;
}

.nav-drawer-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748b;
}

.nav-drawer-close {
    background: none;
    border: none;
    color: #64748b;
    font-size: 1rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.15s;
}

.nav-drawer-close:hover { background: #1e293b; color: #e2e8f0; }

.nav-drawer-items {
    padding: 0.5rem 0.75rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    background: none;
    border: none;
    border-radius: 12px;
    color: #94a3b8;
    font-size: 1rem;
    font-weight: 500;
    font-family: 'Work Sans', sans-serif;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, color 0.15s;
    -webkit-tap-highlight-color: transparent;
    min-height: 52px;
}

.nav-item:hover {
    background: #1e293b;
    color: #e2e8f0;
}

.nav-item.active {
    background: #1e293b;
    color: #f1f5f9;
    font-weight: 700;
}

/* Safe area padding for iPhone home indicator */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .nav-drawer-items {
        padding-bottom: calc(2rem + env(safe-area-inset-bottom));
    }
    .hamburger-fab {
        bottom: calc(1.5rem + env(safe-area-inset-bottom));
    }
}

/* ============================================================
   FULL-SCREEN CONFETTI KEYFRAMES
   ============================================================ */
@keyframes hb-particle-fall {
    0%   { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 1; }
    70%  { opacity: 1; }
    100% { transform: translate(var(--ex), var(--ey)) rotate(var(--rot)) scale(0.5); opacity: 0; }
}
@keyframes hb-flash {
    0%   { opacity: 1; }
    100% { opacity: 0; }
}
@keyframes hb-msg-pop {
    0%   { opacity: 0; transform: translateX(-50%) scale(0.5); }
    12%  { opacity: 1; transform: translateX(-50%) scale(1.15); }
    22%  { transform: translateX(-50%) scale(1.0); }
    70%  { opacity: 1; }
    100% { opacity: 0; transform: translateX(-50%) scale(0.95) translateY(-20px); }
}

/* ============================================================
   GLOBAL VIEW ENTRANCE ANIMATION
   All widgets and cards get a staggered slide-up
   ============================================================ */
.widget {
    animation: view-enter 0.35s ease both;
}
.widget:nth-child(1) { animation-delay: 0.04s; }
.widget:nth-child(2) { animation-delay: 0.10s; }
.widget:nth-child(3) { animation-delay: 0.16s; }
.widget:nth-child(4) { animation-delay: 0.22s; }

@keyframes view-enter {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   CALENDAR — bigger day cards, bolder text
   ============================================================ */
.calendar-week-day {
    min-height: 280px;
    padding: 1.15rem;
    font-size: 1rem;
}
.calendar-week-day-name {
    font-size: 0.95rem;
    letter-spacing: 0.07em;
}
.calendar-week-day-num {
    font-size: 2rem;
    font-weight: 800;
}
.calendar-week-event {
    font-size: 0.9rem;
    padding: 0.3rem 0.4rem;
    background: var(--bg-secondary);
    border-radius: 5px;
}

/* ============================================================
   GOALS — bigger checkboxes, more breathing room
   ============================================================ */
.goal-item.completed .goal-checkbox::after {
    font-size: 1.05rem;
}
.goals-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.goals-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.summary-stat {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    text-align: center;
}
.summary-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.3rem;
}
.summary-value {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
}

/* ============================================================
   INVENTORY — badge sizing
   ============================================================ */
.badge-warning, .badge-danger {
    font-size: 0.82rem;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
}
.location-tab {
    padding: 0.65rem 1.3rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
}
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

/* ============================================================
   FINANCIALS — progress bar, spend row
   ============================================================ */
.progress-bar {
    height: 10px;
    border-radius: 99px;
}
.progress-fill {
    height: 100%;
    border-radius: 99px;
    background: var(--accent-blue);
    transition: width 0.5s ease;
}

/* ============================================================
   SETTINGS — section dividers, form labels
   ============================================================ */
.settings-section {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.75rem;
}
.settings-section:last-child {
    border-bottom: none;
}
.form-group label {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    display: block;
}
.form-group {
    margin-bottom: 1.1rem;
}
.form-help {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.3rem;
    display: block;
    line-height: 1.45;
}

/* ============================================================
   PROFILE PICKER OVERLAY  (.pp-*)
   Netflix-style "Who's here?" screen shown on first visit /
   after sign-out, before any profile is selected.
   ============================================================ */

.pp-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(160deg, #0f172a 0%, #1e293b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    padding: 1.5rem;
    overflow-y: auto;
}

.pp-inner {
    text-align: center;
    max-width: 760px;
    width: 100%;
}

.pp-logo {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.pp-title {
    font-family: 'Fredoka', sans-serif;
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    color: #f1f5f9;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.pp-subtitle {
    font-size: 1.1rem;
    color: #94a3b8;
    margin-bottom: 2.5rem;
}

.pp-profiles-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.pp-profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    cursor: pointer;
    padding: 1rem 0.75rem 0.85rem;
    border-radius: 16px;
    border: 2px solid transparent;
    transition: border-color 0.18s, transform 0.18s, background 0.18s;
    min-width: 110px;
}
.pp-profile-card:hover,
.pp-profile-card:focus {
    border-color: #4d96ff;
    background: rgba(255,255,255,0.06);
    transform: translateY(-4px);
    outline: none;
}

.pp-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
    font-weight: 700;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.pp-initial {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    user-select: none;
}

.pp-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e2e8f0;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pp-role {
    font-size: 0.72rem;
    color: #94a3b8;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* "New Profile" add card */
.pp-add-card .pp-avatar-add {
    background: rgba(255,255,255,0.1);
    border: 2px dashed rgba(255,255,255,0.3);
    font-size: 1.8rem;
    color: #94a3b8;
}
.pp-add-card:hover .pp-avatar-add {
    background: rgba(77,150,255,0.15);
    border-color: #4d96ff;
    color: #4d96ff;
}
.pp-add-card .pp-name { color: #94a3b8; }
.pp-add-card:hover .pp-name { color: #4d96ff; }

/* Inline new-profile form inside picker */
.pp-new-form {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    max-width: 380px;
    margin: 0 auto;
    text-align: left;
}

.pp-input {
    width: 100%;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.08);
    color: #f1f5f9;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.18s;
    margin-bottom: 0.75rem;
}
.pp-input:focus { border-color: #4d96ff; }
.pp-input::placeholder { color: #64748b; }

.pp-colors {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.pp-color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
}
.pp-color-swatch:hover { transform: scale(1.15); }
.pp-color-swatch.selected {
    border-color: #fff;
    transform: scale(1.2);
}

.pp-error {
    color: #f87171;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.pp-form-btns {
    display: flex;
    gap: 0.75rem;
}

.pp-btn-primary {
    padding: 0.65rem 1.4rem;
    border-radius: 10px;
    border: none;
    background: #4d96ff;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, transform 0.12s;
}
.pp-btn-primary:hover { background: #3b82f6; transform: translateY(-1px); }
.pp-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.pp-btn-secondary {
    padding: 0.65rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.2);
    background: transparent;
    color: #94a3b8;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.18s;
}
.pp-btn-secondary:hover { background: rgba(255,255,255,0.06); }

/* ── Sign-in screen ── */
.pp-browse-btn {
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
}

.pp-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.3);
    font-size: 0.8rem;
    margin: 0.5rem 0;
    max-width: 280px;
    width: 100%;
}
.pp-divider::before,
.pp-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.15);
}

.pp-auth-error {
    background: rgba(239,68,68,0.15);
    border: 1px solid rgba(239,68,68,0.4);
    color: #fca5a5;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    max-width: 280px;
    width: 100%;
    text-align: left;
}


/* ============================================================
   SETTINGS — PROFILES SECTION  (.settings-profile-*)
   ============================================================ */

.profile-cards-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.settings-profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.2rem 1rem 1rem;
    border-radius: 14px;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    min-width: 140px;
    max-width: 160px;
    text-align: center;
    transition: border-color 0.18s, box-shadow 0.18s;
}
.settings-profile-card:hover {
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-md);
}
.settings-profile-card-active {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(77,150,255,0.15);
}

.settings-profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.settings-profile-initial {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    user-select: none;
    line-height: 1;
}

.settings-profile-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-profile-role {
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.settings-profile-active-badge {
    font-size: 0.7rem;
    background: rgba(77,150,255,0.12);
    color: var(--accent-blue);
    border-radius: 20px;
    padding: 0.2rem 0.6rem;
    font-weight: 600;
}

.settings-profile-actions {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    width: 100%;
    margin-top: 0.25rem;
}

.spc-photo-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    cursor: pointer;
}

/* Color swatches in the add-profile form inside Settings */
.profile-color-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.3rem;
}

.settings-color-swatch {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
}
.settings-color-swatch:hover { transform: scale(1.15); }
.settings-color-swatch.selected {
    border-color: #1a1d29;
    outline: 2px solid #4d96ff;
    transform: scale(1.2);
}

/* Danger dropdown button (sign out) */
.user-dropdown-btn-danger {
    color: #f87171 !important;
}


/* ============================================================================
   iPHONE & MOBILE OPTIMIZATIONS
   Replaces previous mobile blocks — optimized for iPhone viewport
   ============================================================================ */

/* ── Base iPhone setup ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    html { font-size: 18px; }

    body {
        -webkit-text-size-adjust: 100%;
    }

    .top-bar {
        height: 48px;
        padding: 0 1rem;
    }

    /* Full-width single column layout on mobile */
    .hb-layout {
        grid-template-columns: 1fr !important;
        padding: 0.4rem;
        gap: 0.5rem;
        min-height: unset;
    }

    /* Unified sidebar card — compact on mobile */
    .hb-unified-card {
        padding: 1rem !important;
    }

    .hb-sidebar {
        position: static;
        max-height: none;
        overflow-y: visible;
    }

    .hb-date-str {
        font-size: 1.25rem;
    }

    /* Columns stack vertically */
    .hb-columns {
        grid-template-columns: 1fr !important;
        gap: 0.45rem;
    }

    .hb-person-col {
        padding: 1.1rem;
    }

    .hb-person-avatar {
        width: 90px;
        height: 90px;
        font-size: 1.8rem;
    }

    .hb-person-name { font-size: 1.1rem; }

    /* Task cards — big touch targets */
    .hb-task {
        min-height: 52px;
        padding: 0.75rem 0.8rem;
    }

    .hb-task-check {
        width: 30px;
        height: 30px;
    }

    .hb-task-emoji { font-size: 1.5rem; }
    .hb-task-label { font-size: 0.95rem; }

    /* FAB — above iPhone home indicator */
    .hamburger-fab {
        width: 58px;
        height: 58px;
        bottom: 1.25rem;
        right: 1.25rem;
        font-size: 1.4rem;
    }

    /* Nav drawer full-width on mobile */
    .nav-drawer {
        width: 100%;
        border-radius: 24px 24px 0 0;
    }

    .nav-item {
        font-size: 1.1rem;
        min-height: 58px;
        padding: 1rem 1.25rem;
    }

    /* Weather widget compact */
    .wx-today-icon { font-size: 2.6rem; }
    .wx-today-temp { font-size: 2rem; }
    .wx-today-desc { font-size: 0.85rem; }
    .wx-today-meta { font-size: 0.72rem; }
    .wx-forecast-row { grid-template-columns: repeat(2, 1fr); gap: 0.4rem; }
    .wx-fc-card { padding: 0.5rem 0.6rem; }
    .wx-fc-emoji { font-size: 1.3rem; }
    .wx-fc-temps { font-size: 0.95rem; }
    .wx-fc-desc { display: none; }

    /* Container padding */
    .container { padding: 0.75rem; }

    /* Modal full-width */
    .modal-content {
        width: 96%;
        padding: 1rem 1rem 1.5rem;
        max-height: 90vh;
        border-radius: 18px;
    }

    /* Main grid single col */
    .main-grid,
    .home-main-grid,
    .home-lower-grid {
        grid-template-columns: 1fr;
    }

    /* Mission Control stacked */
    .mc-body {
        grid-template-columns: 1fr !important;
        height: auto;
        overflow-y: auto;
    }

    .mc-col {
        border-right: none !important;
        border-bottom: 1px solid #1e293b;
        min-height: 160px;
    }

    .mc-col:last-child { border-bottom: none; }
}

/* ── Small iPhone (SE, mini) ───────────────────────────────────────── */
@media (max-width: 390px) {
    html { font-size: 16px; }

    .hb-layout { padding: 0.6rem; gap: 0.65rem; }

    .hb-person-col { padding: 1rem; }

    .hb-task { min-height: 56px; padding: 0.85rem 0.9rem; }

    .hb-task-check { width: 34px; height: 34px; }

    .wx-forecast-row { grid-template-columns: 1fr 1fr; }

    .hamburger-fab { width: 54px; height: 54px; right: 1rem; bottom: 1rem; }
}

/* ── Landscape iPhone ──────────────────────────────────────────────── */
@media (max-width: 896px) and (orientation: landscape) {
    .hb-layout {
        grid-template-columns: 260px 1fr !important;
        padding: 0.6rem 0.75rem;
        gap: 0.75rem;
    }

    .hb-sidebar {
        position: sticky;
        top: 0.6rem;
        max-height: calc(100vh - 1.2rem);
        overflow-y: auto;
    }

    .hb-columns {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .hamburger-fab {
        bottom: calc(0.75rem + env(safe-area-inset-bottom));
        right: calc(0.75rem + env(safe-area-inset-right));
    }
}

/* ── iPad / tablet (769px–1024px) ─────────────────────────────────── */
@media (min-width: 769px) and (max-width: 1024px) {
    html { font-size: 19px; }

    .hb-layout {
        grid-template-columns: 300px 1fr;
        padding: 1rem 1.25rem;
    }

    .hb-columns {
        grid-template-columns: repeat(2, 1fr);
    }

    .nav-drawer {
        width: 340px;
    }
}

/* ── Prevent horizontal overflow everywhere ────────────────────────── */
html, body { max-width: 100%; overflow-x: hidden; }

/* ── Buttons: 44px minimum tap target on touch ─────────────────────── */
@media (max-width: 1024px) {
    .btn, .btn-primary, .btn-secondary, .btn-danger,
    .btn-add, .btn-save {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* ── Tables scroll on mobile ───────────────────────────────────────── */
@media (max-width: 768px) {
    .finances-table-wrap,
    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table { min-width: 480px; }
}

/* ============================================================================
   iPhone 16 Pro — Mobile-first overrides
   Target: 393 × 852 CSS px (3× scale), Dynamic Island, home indicator
   ============================================================================ */

@media (max-width: 768px) {

    /* ── Safe area: Dynamic Island top clearance ─────────────────────────── */

    /* PWA mode (added-to-homescreen): status bar overlaps content */
    body {
        padding-top: env(safe-area-inset-top, 0px);
    }

    /* Home view dark bg — extend into Dynamic Island area */
    .mc-body, .hb-layout {
        padding-top: max(0.5rem, env(safe-area-inset-top, 0px));
    }

    /* ── Modal → iOS-style bottom sheet ─────────────────────────────────── */

    .modal-overlay {
        align-items: flex-end;
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        border-radius: 22px 22px 0 0;
        padding: 0 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
        margin: 0;
        max-height: 93vh;
        transform: translateY(30px);
        transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1),
                    opacity 0.32s ease;
    }

    .modal-overlay.active .modal-content {
        transform: translateY(0);
    }

    /* Drag handle pill */
    .modal-content::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        background: var(--border-color);
        border-radius: 2px;
        margin: 12px auto 16px;
        flex-shrink: 0;
    }

    /* Close button — absolute top-right */
    .modal-close {
        position: absolute;
        top: 12px;
        right: 14px;
        margin: 0;
        float: none;
    }

    /* ── iOS zoom prevention — all inputs must be ≥ 16px ────────────────── */

    .form-input,
    input[type="text"],
    input[type="number"],
    input[type="password"],
    input[type="email"],
    input[type="date"],
    input[type="time"],
    input[type="url"],
    input[type="search"],
    select,
    textarea {
        font-size: 16px !important;
    }

    /* ── Momentum scrolling on all scroll containers ─────────────────────── */

    #viewContainer,
    .modal-content,
    .nav-drawer,
    .hb-board,
    .mc-col-body,
    .inventory-grid,
    .meal-plan-grid,
    .recipes-grid,
    .settings-sections {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    /* ── Widget — tighter on small screens ───────────────────────────────── */

    .widget {
        padding: 1.1rem 1.1rem 1.25rem;
        border-radius: 18px;
    }

    .widget-header {
        margin-bottom: 1rem;
    }

    .widget-title {
        font-size: 1.1rem;
    }

    /* ── View container top padding ──────────────────────────────────────── */

    .container {
        padding: 0.75rem 0.75rem calc(54px + env(safe-area-inset-bottom, 0px) + 0.75rem);
    }

    /* ── Buttons: full-width on mobile for primary actions ───────────────── */

    .modal-content .btn-save,
    .modal-content .btn-secondary {
        width: 100%;
        justify-content: center;
        min-height: 48px;
        font-size: 16px;
    }

    .modal-content .button-group {
        flex-direction: column;
    }

    /* ── Nav drawer — full width bottom sheet on mobile ──────────────────── */

    .nav-drawer {
        width: 100%;
        border-radius: 24px 24px 0 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .nav-item {
        font-size: 1rem;
        min-height: 54px;
        padding: 0.9rem 1.25rem;
        border-radius: 14px;
    }

    /* ── Inventory grid — single column on very small screens ───────────── */

    .inventory-grid {
        grid-template-columns: 1fr;
    }

    /* ── Scan review rows — stack on narrow screens ──────────────────────── */

    .scan-review-row {
        grid-template-columns: auto 1fr !important;
        row-gap: 6px;
    }

    .scan-review-row .scan-qty,
    .scan-review-row .scan-unit,
    .scan-review-row .scan-loc,
    .scan-review-row .scan-exp {
        grid-column: 2;
    }

    /* ── Home board tasks — generous touch targets ───────────────────────── */

    .hb-task {
        min-height: 54px;
        border-radius: 14px;
    }

    /* ── Calendar — more compact header on narrow screens ───────────────── */

    .calendar-header-actions {
        gap: 0.4rem;
    }

    /* ── Meals grid — single day column width ────────────────────────────── */

    .meal-plan-grid {
        grid-template-columns: repeat(7, minmax(130px, 1fr));
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* ── Settings sections — remove excess whitespace ────────────────────── */

    .settings-section {
        padding: 1.1rem;
        border-radius: 14px;
    }

    /* ── Form rows stack on narrow ───────────────────────────────────────── */

    .form-row {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
    }

} /* end @media (max-width: 768px) */

/* ── iPhone 16 Pro specific (393px) ──────────────────────────────────────── */
@media (max-width: 430px) {

    .hb-person-col { padding: 0.9rem; }

    .hb-task { min-height: 52px; }

    /* Slightly more compact widget header */
    .widget-header { margin-bottom: 0.75rem; }

    /* Tighter modal padding */
    .modal-content {
        padding: 0 1rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
    }
}

/* ── Avatar photo support — images fill their circle everywhere ── */
.hb-person-avatar img,
.profile-avatar img,
.goal-person img,
.person-avatar img,
.meal-person img,
.settings-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

/* ============================================================================
   Financials — Full Rebuild
   ============================================================================ */

.fin-layout {
    padding: 1rem 1.25rem;
    max-width: 1100px;
    margin: 0 auto;
}

/* ── Top bar: month nav + income + PIN ──────────────────────────────────── */
.fin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.fin-month-nav {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.fin-month-label {
    font-weight: 600;
    font-size: 1.05rem;
    min-width: 170px;
    text-align: center;
    color: var(--text-primary);
}

.fin-month-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s;
}
.fin-month-btn:hover:not(:disabled) { background: var(--border-color); }
.fin-month-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.fin-topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.fin-income-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.fin-income-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.fin-income-input {
    width: 115px;
    padding: 0.3rem 0.55rem;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
}

/* ── Summary card ───────────────────────────────────────────────────────── */
.fin-summary-card {
    background: var(--bg-secondary);
    border-radius: 14px;
    padding: 1.1rem 1.4rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.fin-summary-card.fin-summary-warn {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.06);
}

.fin-summary-card.fin-summary-over {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.06);
}

.fin-summary-main {
    display: flex;
    align-items: flex-end;
    gap: 1.25rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.fin-summary-block {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.fin-summary-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.fin-summary-amount {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text-primary);
}

.fin-summary-muted { color: var(--text-secondary); }
.fin-summary-blue  { color: #3b82f6; }

.fin-summary-sep {
    font-size: 1.4rem;
    color: var(--text-secondary);
    align-self: flex-end;
    padding-bottom: 0.1rem;
}

.fin-summary-sub {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.fin-over-budget {
    color: #ef4444;
    font-weight: 600;
}

.fin-income-note {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
}

/* ── Main two-column grid ───────────────────────────────────────────────── */
.fin-main-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.25rem;
    align-items: start;
}

.fin-primary,
.fin-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ── Budget overview: ring + category list ─────────────────────────────── */
.fin-budget-overview {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.fin-health-ring-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.fin-health-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-align: center;
}

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

.fin-cat-row {
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border-color);
}
.fin-cat-row:last-child { border-bottom: none; }

.fin-cat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.3rem;
}

.fin-cat-name {
    font-weight: 600;
    font-size: 0.88rem;
}

.fin-cat-actions {
    display: flex;
    gap: 0.2rem;
    opacity: 0;
    transition: opacity 0.15s;
}
.fin-cat-row:hover .fin-cat-actions,
.fin-cat-row:focus-within .fin-cat-actions { opacity: 1; }

/* Small icon buttons */
.btn-icon-sm {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 24px;
    height: 24px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
    vertical-align: middle;
}
.btn-icon-sm:hover { background: var(--border-color); }

.fin-cat-quick-add {
    color: #22c55e;
    border-color: #22c55e;
    font-weight: 700;
    font-size: 1rem;
}
.fin-cat-quick-add:hover { background: rgba(34, 197, 94, 0.1); }

.fin-icon-red { color: #ef4444; border-color: #ef4444; }
.fin-icon-red:hover { background: rgba(239, 68, 68, 0.1); }

.fin-cat-bar-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.fin-cat-bar-track {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.fin-cat-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}
.fin-bar-green { background: #22c55e; }
.fin-bar-amber { background: #f59e0b; }
.fin-bar-red   { background: #ef4444; }

.fin-cat-pct {
    font-size: 0.73rem;
    color: var(--text-secondary);
    width: 30px;
    text-align: right;
    flex-shrink: 0;
}

.fin-cat-amounts {
    display: flex;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    align-items: center;
}
.fin-cat-limit { color: #9ca3af; }
.fin-cat-rem   { margin-left: auto; }
.fin-over      { color: #ef4444; font-weight: 600; }

.fin-widget-footer {
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    margin-top: 0.25rem;
}

/* ── Expense list ───────────────────────────────────────────────────────── */
.fin-exp-group {
    border-bottom: 1px solid var(--border-color);
}
.fin-exp-group:last-child { border-bottom: none; }

.fin-exp-group-hdr {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.2rem;
    cursor: pointer;
    list-style: none;
    font-weight: 600;
    font-size: 0.88rem;
    user-select: none;
}
.fin-exp-group-hdr::-webkit-details-marker { display: none; }

.fin-exp-group-cat  { flex: 1; }
.fin-exp-group-total { font-weight: 600; color: var(--text-primary); }
.fin-exp-count      { font-size: 0.76rem; color: var(--text-secondary); font-weight: 400; }

.fin-exp-items { padding: 0 0.25rem 0.5rem; }

.fin-exp-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.35rem;
    border-radius: 6px;
    font-size: 0.84rem;
    transition: background 0.12s;
}
.fin-exp-item:hover { background: #f1f5f9; }

.fin-exp-date {
    color: #9ca3af;
    font-size: 0.76rem;
    width: 46px;
    flex-shrink: 0;
}
.fin-exp-desc   { flex: 1; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-exp-amount { font-weight: 600; white-space: nowrap; }
.fin-exp-del    { margin-left: 0.2rem; flex-shrink: 0; }

/* ── Savings goal cards ─────────────────────────────────────────────────── */
.fin-savings-card {
    display: flex;
    gap: 1rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
}
.fin-savings-card:last-child { border-bottom: none; }

.fin-savings-ring { flex-shrink: 0; }

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

.fin-savings-name {
    font-weight: 700;
    font-size: 0.92rem;
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fin-savings-amounts {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 0.15rem;
}

.fin-savings-proj {
    font-size: 0.76rem;
    color: #3b82f6;
    margin-bottom: 0.35rem;
}

.fin-savings-actions {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .fin-main-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .fin-layout { padding: 0.75rem; }

    .fin-budget-overview {
        flex-direction: column;
        align-items: center;
    }
    .fin-cat-list { width: 100%; }

    /* Always show action buttons on mobile (no hover) */
    .fin-cat-actions { opacity: 1 !important; }

    .fin-summary-amount { font-size: 1.5rem; }

    .fin-month-label { min-width: 140px; }
}

/* ============================================================================
   Grocery List View
   ============================================================================ */

.glist-widget {
    max-width: 680px;
    margin: 1.5rem auto;
}

/* ── Quick-add form ─────────────────────────────────────────────────────── */
.glist-add-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    align-items: center;
    flex-wrap: wrap;
}

.glist-add-input {
    flex: 1;
    min-width: 160px;
}

.glist-qty-input {
    width: 110px;
    flex-shrink: 0;
}

.glist-add-btn {
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── List items ─────────────────────────────────────────────────────────── */
.glist-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 0.5rem;
}

.glist-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.5rem;
    border-radius: 8px;
    transition: background 0.12s;
}
.glist-row:hover { background: var(--bg-primary, #f8fafc); }

.glist-row.glist-done {
    opacity: 0.55;
}
.glist-row.glist-done .glist-label {
    text-decoration: line-through;
    color: var(--text-secondary);
}

/* Custom checkbox */
.glist-check-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}
.glist-check-wrap input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.glist-check-box {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-color, #e5e7eb);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary, #fff);
    transition: border-color 0.15s, background 0.15s;
    flex-shrink: 0;
}
.glist-check-wrap input:checked ~ .glist-check-box {
    background: #22c55e;
    border-color: #22c55e;
}
.glist-check-wrap input:checked ~ .glist-check-box::after {
    content: '✓';
    font-size: 13px;
    color: #fff;
    font-weight: 700;
    line-height: 1;
}

.glist-label {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.glist-qty {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--bg-primary, #f1f5f9);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    padding: 0.1rem 0.5rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.glist-del {
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s;
}
.glist-row:hover .glist-del { opacity: 1; }

.glist-empty {
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 1.25rem 0.5rem;
    text-align: center;
}

/* ── In-cart section with storage buttons ───────────────────────────────── */
.glist-incart-section {
    margin-top: 1.25rem;
    border-top: 2px solid var(--border-color, #e5e7eb);
    padding-top: 0.75rem;
}

.glist-incart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    padding: 0 0.25rem;
}

.glist-incart-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Cart rows have a two-line layout: name/qty/delete on top, store buttons below */
.glist-cart-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.glist-cart-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}
.glist-cart-top .glist-label { flex: 1; }

/* "Store in:" prompt + location buttons */
.glist-store-prompt {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.glist-store-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    font-weight: 500;
}

.glist-loc-btn {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    border: 1.5px solid var(--border-color, #e5e7eb);
    background: var(--bg-secondary, #fff);
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}
.glist-loc-btn:hover  { background: #f0fdf4; border-color: #22c55e; color: #16a34a; }
.glist-loc-btn:active { transform: scale(0.93); }

/* Specific accent colours on hover */
.glist-loc-btn[data-location="fridge"]:hover  { background: #eff6ff; border-color: #3b82f6; color: #1d4ed8; }
.glist-loc-btn[data-location="freezer"]:hover { background: #f0f9ff; border-color: #0ea5e9; color: #0369a1; }

/* ── Mobile: always show delete, stack store buttons ────────────────────── */
@media (max-width: 768px) {
    .glist-del { opacity: 1 !important; }
    .glist-qty-input { width: 80px; }
    .glist-widget { margin: 0.75rem; }
    .glist-store-prompt { gap: 0.3rem; }
    .glist-loc-btn { font-size: 0.74rem; padding: 0.22rem 0.45rem; }
}
