/* Existing application layout and state selectors, migrated to shared tokens. */

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

        .ms-app {
 --peach:var(--ms-peach); --sage:var(--ms-sage); --sage-dark:var(--ms-green);
 --warm-brown:var(--ms-ink); --cream:var(--ms-cream); --soft-orange:var(--ms-color-warning);
 --coral:var(--ms-color-error); --deep:var(--ms-ink); --text:var(--ms-ink); --text-light:var(--ms-muted);
 --red:var(--ms-color-error); --green:var(--ms-green); --yellow:var(--ms-color-warning);
}

        body {
            font-family: var(--ms-font-body);
            color: var(--text);
            background: var(--cream);
            line-height: 1.6;
            min-height: 100vh;
        }

        /* NAV */
        .app-nav {
            position: fixed;
            top: 0;
            width: 100%;
            padding: 16px 24px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            z-index: 100;
            background: rgba(255, 249, 243, 0.95);
            backdrop-filter: blur(20px);
            border-bottom: 1px solid rgba(36,62,50,0.08);
        }

        .logo {
            font-family: var(--ms-font-display);
            font-weight: 800;
            font-size: 1.35rem;
            color: var(--warm-brown);
            text-decoration: none;
            letter-spacing: -0.5px;
        }

        .logo span { color: var(--sage-dark); }

        .nav-actions {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        /* Offline badge — shown when browser reports no connectivity */
        #offline-badge {
            display: none;
            align-items: center;
            gap: 5px;
            background: #FEF3C7;
            color: #92400E;
            border: 1.5px solid #FCD34D;
            border-radius: 100px;
            padding: 3px 10px;
            font-size: 0.73rem;
            font-weight: 700;
            white-space: nowrap;
        }

        .nav-user {
            font-size: 0.85rem;
            color: var(--text-light);
            font-weight: 500;
        }

        .btn-logout {
            font-size: 0.8rem;
            color: var(--coral);
            background: none;
            border: 1px solid var(--coral);
            padding: 6px 14px;
            border-radius: 100px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.2s;
        }

        .btn-logout:hover {
            background: var(--coral);
            color: white;
        }

        /* ── UPGRADE NAV BUTTON ──────────────────────────────── */
        .btn-nav-upgrade {
            font-size: 0.78rem;
            font-weight: 700;
            color: white;
            background: var(--coral);
            border: none;
            padding: 6px 13px;
            border-radius: 100px;
            cursor: pointer;
            font-family: inherit;
            transition: all 0.2s;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }
        .btn-nav-upgrade:hover { background: var(--ms-green-hover); transform: translateY(-1px); }

        /* ── UPGRADE BANNER (soft) ───────────────────────────── */
        .upgrade-banner {
            background: rgba(244, 162, 97, 0.12);
            border: 1.5px solid rgba(244, 162, 97, 0.35);
            border-radius: 12px;
            padding: 12px 16px;
            margin: 0 0 18px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            flex-wrap: wrap;
        }
        .upgrade-banner-text {
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--warm-brown);
            flex: 1;
        }
        .upgrade-banner-text span { color: var(--coral); }
        .btn-banner-upgrade {
            font-size: 0.8rem;
            font-weight: 700;
            color: white;
            background: var(--coral);
            border: none;
            padding: 7px 14px;
            border-radius: 100px;
            cursor: pointer;
            font-family: inherit;
            transition: all 0.2s;
            white-space: nowrap;
            text-decoration: none;
        }
        .btn-banner-upgrade:hover { background: var(--ms-green-hover); }
        .btn-banner-dismiss {
            font-size: 1.1rem;
            color: var(--text-light);
            background: none;
            border: none;
            cursor: pointer;
            padding: 2px 4px;
            line-height: 1;
            opacity: 0.6;
        }
        .btn-banner-dismiss:hover { opacity: 1; }

        /* ── PAYWALL MODAL ───────────────────────────────────── */
        #paywall-modal-bg {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(36,62,50,0.5);
            z-index: 500;
            align-items: center;
            justify-content: center;
            padding: 24px;
        }
        #paywall-modal-bg.open {
            display: flex;
        }
        .paywall-modal {
            background: white;
            border-radius: 24px;
            padding: 36px 32px;
            max-width: 480px;
            width: 100%;
            box-shadow: 0 24px 60px rgba(36,62,50,0.18);
            position: relative;
            max-height: 90vh;
            overflow-y: auto;
        }
        .paywall-close {
            position: absolute;
            top: 16px;
            right: 16px;
            background: none;
            border: none;
            font-size: 1.3rem;
            cursor: pointer;
            color: var(--text-light);
            padding: 4px 8px;
            border-radius: 8px;
            transition: all 0.15s;
        }
        .paywall-close:hover { background: var(--cream); color: var(--text); }
        .paywall-icon { font-size: 2.5rem; margin-bottom: 12px; display: block; }
        .paywall-modal h2 {
            font-family: var(--ms-font-display);
            font-size: 1.5rem;
            color: var(--deep);
            margin-bottom: 8px;
            letter-spacing: -0.5px;
        }
        .paywall-modal .paywall-sub {
            font-size: 0.9rem;
            color: var(--text-light);
            margin-bottom: 20px;
            line-height: 1.6;
        }
        .paywall-features {
            list-style: none;
            margin-bottom: 24px;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .paywall-features li {
            font-size: 0.88rem;
            color: var(--text);
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .paywall-features li::before {
            content: '✓';
            width: 18px;
            height: 18px;
            background: rgba(123, 163, 115, 0.15);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.7rem;
            color: var(--sage-dark);
            font-weight: 700;
            flex-shrink: 0;
            text-align: center;
            line-height: 18px;
        }
        .paywall-plans {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
            margin-bottom: 16px;
        }
        .paywall-plan {
            border: 2px solid rgba(36,62,50,0.12);
            border-radius: 14px;
            padding: 16px;
            text-align: center;
            text-decoration: none;
            transition: all 0.2s;
            display: block;
        }
        .paywall-plan:hover { border-color: var(--sage-dark); transform: translateY(-2px); }
        .paywall-plan.featured { border-color: var(--sage-dark); background: rgba(123, 163, 115, 0.05); }
        .paywall-plan .best-val {
            font-size: 0.65rem;
            font-weight: 700;
            color: white;
            background: var(--sage-dark);
            padding: 2px 8px;
            border-radius: 100px;
            display: inline-block;
            margin-bottom: 6px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        .paywall-plan .plan-nm {
            font-family: var(--ms-font-display);
            font-size: 0.9rem;
            font-weight: 700;
            color: var(--deep);
            margin-bottom: 2px;
        }
        .paywall-plan .plan-pr {
            font-size: 1.4rem;
            font-weight: 800;
            color: var(--sage-dark);
            line-height: 1;
            margin-bottom: 2px;
        }
        .paywall-plan .plan-per {
            font-size: 0.7rem;
            color: var(--text-light);
            margin-bottom: 10px;
        }
        .paywall-plan .btn-pw {
            display: block;
            width: 100%;
            padding: 9px 12px;
            background: var(--sage-dark);
            color: white;
            border: none;
            border-radius: 9px;
            font-size: 0.82rem;
            font-weight: 700;
            font-family: inherit;
            cursor: pointer;
            text-decoration: none;
            text-align: center;
            transition: background 0.2s;
        }
        .paywall-plan .btn-pw:hover { background: var(--ms-green-hover); }
        .paywall-plan.monthly .btn-pw {
            background: white;
            color: var(--sage-dark);
            border: 1.5px solid var(--sage-dark);
        }
        .paywall-plan.monthly .btn-pw:hover { background: var(--sage-dark); color: white; }
        .paywall-dismiss-link {
            border: 0;
            background: transparent;
            font-family: inherit;
            width: 100%;
            display: block;
            text-align: center;
            font-size: 0.8rem;
            color: var(--text-light);
            cursor: pointer;
            margin-top: 4px;
        }
        .paywall-dismiss-link:hover { color: var(--text); }
        .paywall-dismiss-link:focus-visible { outline: 2px solid var(--sage-dark); outline-offset: 3px; }

        #cardCaptureView .auth-card { max-width: 540px; padding: 32px; }
        #cardCaptureView .auth-card p { margin-bottom: 16px; line-height: 1.55; }
        #cardCaptureView .auth-card a { color: var(--sage-dark); }
        #trialSwitchAccount { display:block; margin:0 auto 20px; }
        #cardCaptureView fieldset label { border:1px solid #d6dfd2; border-radius:12px; margin:8px 0; cursor:pointer; }
        #cardCaptureView fieldset label:has(input:checked) { background:#f1f6ef; border-color:var(--sage-dark); }
        #cardCaptureView input[type=radio] { accent-color:var(--sage-dark); margin-right:8px; }
        #trialBack { margin-top:16px; }
        #trialAccountIdentity { text-align:center; overflow-wrap:anywhere; }
        @media(max-width:480px){#cardCaptureView .auth-card{padding:24px;} .auth-container{padding:16px;}}

        /* MAIN CONTENT */
        .app-content {
            padding-top: 80px;
            max-width: 900px;
            margin: 0 auto;
            padding-left: 24px;
            padding-right: 24px;
            padding-bottom: 60px;
        }

        /* AUTH SCREENS */
        .auth-container {
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 24px;
        }

        .auth-card {
            background: white;
            border-radius: 20px;
            padding: 48px 40px;
            max-width: 420px;
            width: 100%;
            box-shadow: 0 4px 24px rgba(36,62,50,0.06);
        }

        .auth-card h1 {
            font-family: var(--ms-font-display);
            font-size: 1.8rem;
            color: var(--deep);
            margin-bottom: 8px;
            letter-spacing: -0.5px;
        }

        .auth-card p {
            color: var(--text-light);
            font-size: 0.95rem;
            margin-bottom: 32px;
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-group label {
            display: block;
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--text);
            margin-bottom: 8px;
        }

        .form-group input, .form-group select, .form-group textarea {
            width: 100%;
            padding: 12px 16px;
            border: 1.5px solid rgba(36,62,50,0.15);
            border-radius: 12px;
            font-size: 0.95rem;
            font-family: inherit;
            color: var(--text);
            background: var(--cream);
            transition: border-color 0.2s;
            outline: none;
        }

        .form-group input:focus, .form-group select:focus, .form-group textarea:focus {
            border-color: var(--sage-dark);
        }

        .form-group #wizIncludeSnacks {
            width: 22px;
            height: 22px;
            padding: 0;
            flex: 0 0 22px;
            accent-color: var(--sage-dark);
        }

        .form-group #wizIncludeSnacks:focus-visible {
            outline: 3px solid var(--sage-dark);
            outline-offset: 3px;
        }

        .form-group textarea {
            resize: vertical;
            min-height: 80px;
        }

        .btn-primary {
            width: 100%;
            padding: 14px 24px;
            background: var(--sage-dark);
            color: white;
            border: none;
            border-radius: 12px;
            font-size: 1rem;
            font-weight: 700;
            font-family: inherit;
            cursor: pointer;
            transition: all 0.2s;
            margin-top: 8px;
        }

        .btn-primary:hover { background: var(--ms-green-hover); }
        .btn-primary:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }

        .btn-secondary {
            padding: 10px 20px;
            background: white;
            color: var(--sage-dark);
            border: 1.5px solid var(--sage-dark);
            border-radius: 12px;
            font-size: 0.9rem;
            font-weight: 600;
            font-family: inherit;
            cursor: pointer;
            transition: all 0.2s;
        }

        .btn-secondary:hover {
            background: var(--sage-dark);
            color: white;
        }

        .btn-coral {
            padding: 12px 24px;
            background: var(--coral);
            color: white;
            border: none;
            border-radius: 12px;
            font-size: 0.95rem;
            font-weight: 700;
            font-family: inherit;
            cursor: pointer;
            transition: all 0.2s;
        }

        .btn-coral:hover { background: var(--ms-green-hover); }
        .btn-coral:disabled { opacity: 0.6; cursor: not-allowed; }

        .auth-switch {
            text-align: center;
            margin-top: 24px;
            font-size: 0.9rem;
            color: var(--text-light);
        }

        .auth-switch button {
            font: inherit;
            border: 0;
            background: transparent;
            padding: 8px;
            color: var(--sage-dark);
            font-weight: 600;
            text-decoration: none;
            cursor: pointer;
        }

        .auth-switch button:hover { text-decoration: underline; }

        /* Google OAuth button */
        .btn-google {
            width: 100%;
            padding: 12px 20px;
            background: white;
            color: #3c4043;
            border: 1.5px solid #dadce0;
            border-radius: 12px;
            font-size: 0.95rem;
            font-weight: 600;
            font-family: inherit;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            margin-bottom: 16px;
        }
        .btn-google:hover {
            background: #f8f9fa;
            border-color: #bdc1c6;
            box-shadow: 0 1px 4px rgba(0,0,0,0.08);
        }
        .btn-google:active { transform: scale(0.99); }

        .auth-divider {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 20px;
        }
        .auth-divider::before,
        .auth-divider::after {
            content: '';
            flex: 1;
            height: 1px;
            background: rgba(36,62,50,0.15);
        }
        .auth-divider span {
            font-size: 0.78rem;
            color: var(--text-light);
            font-weight: 500;
            white-space: nowrap;
        }

        .error-msg {
            background: rgba(231, 111, 81, 0.1);
            color: var(--coral);
            padding: 12px 16px;
            border-radius: 10px;
            font-size: 0.85rem;
            font-weight: 500;
            margin-bottom: 16px;
            display: none;
        }

        .error-msg.visible { display: block; }

        /* DASHBOARD */
        .page-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 32px;
            margin-top: 24px;
        }

        .page-header h1 {
            font-family: var(--ms-font-display);
            font-size: 1.8rem;
            color: var(--deep);
            letter-spacing: -0.5px;
        }

        .empty-state {
            text-align: center;
            padding: 80px 24px;
        }

        .empty-state .emoji {
            font-size: 3.5rem;
            margin-bottom: 20px;
        }

        .empty-state h2 {
            font-family: var(--ms-font-display);
            font-size: 1.5rem;
            color: var(--deep);
            margin-bottom: 12px;
        }

        .empty-state p {
            color: var(--text-light);
            max-width: 400px;
            margin: 0 auto 28px;
        }

        /* CHILD CARDS */
        .child-card {
            display: block;
            color: inherit;
            text-decoration: none;
            background: white;
            border-radius: 16px;
            padding: 24px;
            margin-bottom: 16px;
            box-shadow: 0 2px 12px rgba(36,62,50,0.04);
            cursor: pointer;
            transition: all 0.2s;
            border: 1.5px solid transparent;
        }

        .child-card:hover {
            border-color: var(--sage);
            transform: translateY(-1px);
            box-shadow: 0 4px 20px rgba(36,62,50,0.08);
        }

        .child-card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 12px;
        }

        .child-card h3 {
            font-size: 1.15rem;
            font-weight: 700;
            color: var(--deep);
        }

        .tag {
            font-size: 0.72rem;
            font-weight: 600;
            padding: 4px 12px;
            border-radius: 100px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .tag-sage { background: rgba(54,92,66,0.2); color: var(--sage-dark); }
        .tag-peach { background: rgba(255, 232, 214, 0.5); color: var(--warm-brown); }

        .child-meta {
            display: flex;
            gap: 20px;
            font-size: 0.85rem;
            color: var(--text-light);
        }

        .child-meta span { display: flex; align-items: center; gap: 4px; }

        /* MEAL PLAN VIEW */
        .back-link {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-size: 0.9rem;
            font-weight: 600;
            color: var(--sage-dark);
            text-decoration: none;
            cursor: pointer;
            margin-bottom: 20px;
            margin-top: 16px;
        }

        .back-link:hover { text-decoration: underline; }
        .child-card:focus-visible, .back-link:focus-visible, .fav-card-name:focus-visible {
            outline: 3px solid var(--sage-dark);
            outline-offset: 4px;
        }

        .plan-header {
            background: white;
            border-radius: 16px;
            padding: 24px;
            margin-bottom: 24px;
            box-shadow: 0 2px 12px rgba(36,62,50,0.04);
        }

        .plan-header h2 {
            font-family: var(--ms-font-display);
            font-size: 1.4rem;
            color: var(--deep);
            margin-bottom: 8px;
        }

        .plan-reasoning {
            font-size: 0.9rem;
            color: var(--text-light);
            font-style: italic;
            line-height: 1.6;
        }

        .plan-stats {
            display: flex;
            gap: 16px;
            margin-top: 16px;
        }

        .stat-badge {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 0.8rem;
            font-weight: 600;
            padding: 6px 14px;
            border-radius: 100px;
        }

        .stat-loved { background: rgba(40, 167, 69, 0.1); color: var(--green); }
        .stat-some { background: rgba(244, 162, 97, 0.15); color: var(--soft-orange); }
        .stat-rejected { background: rgba(231, 111, 81, 0.1); color: var(--coral); }

        /* DAY SECTIONS */
        .day-section {
            margin-bottom: 24px;
        }

        .day-label {
            font-family: var(--ms-font-display);
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--deep);
            margin-bottom: 12px;
            padding-bottom: 8px;
            border-bottom: 2px solid rgba(54,92,66,0.3);
        }

        .meal-card {
            background: white;
            border-radius: 14px;
            padding: 20px;
            margin-bottom: 10px;
            box-shadow: 0 1px 8px rgba(36,62,50,0.03);
            transition: all 0.2s;
        }

        .meal-card-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 8px;
        }

        .meal-type-tag {
            font-size: 0.7rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.8px;
            color: var(--sage-dark);
            margin-bottom: 4px;
        }

        .meal-card h4 {
            font-size: 1rem;
            font-weight: 700;
            color: var(--deep);
        }

        .meal-desc {
            font-size: 0.85rem;
            color: var(--text-light);
            margin-bottom: 12px;
        }

        /* Time chips on meal cards */
        .meal-time-row {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
            margin-bottom: 8px;
        }
        .meal-time-chip {
            display: inline-flex;
            align-items: center;
            gap: 3px;
            font-size: 0.72rem;
            font-weight: 600;
            color: var(--sage-dark);
            background: rgba(54,92,66,0.15);
            border-radius: 100px;
            padding: 2px 9px;
            white-space: nowrap;
        }
        .meal-time-chip.total {
            color: var(--warm-brown);
            background: rgba(36,62,50,0.08);
        }

        /* Day total time badge */
        .day-total-time {
            font-size: 0.73rem;
            font-weight: 600;
            color: var(--text-light);
            background: rgba(36,62,50,0.06);
            border-radius: 100px;
            padding: 2px 10px;
            white-space: nowrap;
        }

        /* Meal plan filter/sort bar */
        .plan-filter-bar {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
            margin-bottom: 14px;
        }
        .filter-chip {
            font-size: 0.78rem;
            font-weight: 600;
            padding: 5px 14px;
            border-radius: 100px;
            border: 1.5px solid rgba(54,92,66,0.5);
            background: white;
            color: var(--text-light);
            cursor: pointer;
            transition: all 0.15s;
        }
        .filter-chip:hover { background: rgba(54,92,66,0.1); }
        .filter-chip.active {
            background: var(--sage-dark);
            color: white;
            border-color: var(--sage-dark);
        }
        .sort-chip {
            font-size: 0.78rem;
            font-weight: 600;
            padding: 5px 14px;
            border-radius: 100px;
            border: 1.5px solid rgba(36,62,50,0.2);
            background: white;
            color: var(--text-light);
            cursor: pointer;
            transition: all 0.15s;
        }
        .sort-chip:hover { background: rgba(36,62,50,0.05); }
        .sort-chip.active {
            background: var(--warm-brown);
            color: white;
            border-color: var(--warm-brown);
        }
        .meal-card.hidden-by-filter { display: none; }

        .meal-details {
            display: none;
            margin-bottom: 12px;
        }

        .meal-details.open { display: block; }

        .meal-details-label {
            font-size: 0.75rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: var(--warm-brown);
            margin-bottom: 4px;
            margin-top: 10px;
        }

        .meal-details p {
            font-size: 0.85rem;
            color: var(--text-light);
            line-height: 1.6;
        }

        .ingredients-list {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            margin-top: 4px;
        }

        .ingredient-tag {
            font-size: 0.75rem;
            background: var(--peach);
            color: var(--warm-brown);
            padding: 3px 10px;
            border-radius: 100px;
            font-weight: 500;
        }

        .toggle-details {
            font-size: 0.8rem;
            color: var(--sage-dark);
            background: none;
            border: none;
            cursor: pointer;
            font-weight: 600;
            font-family: inherit;
            padding: 0;
        }

        .toggle-details:hover { text-decoration: underline; }

        /* FEEDBACK BUTTONS */
        .feedback-row {
            display: flex;
            gap: 8px;
            margin-top: 12px;
        }

        .feedback-btn {
            flex: 1;
            padding: 10px 8px;
            border: 1.5px solid rgba(36,62,50,0.12);
            border-radius: 10px;
            background: white;
            cursor: pointer;
            font-family: inherit;
            font-size: 0.8rem;
            font-weight: 600;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }

        .feedback-btn:hover { transform: translateY(-1px); }

        .feedback-btn.loved { color: var(--green); }
        .feedback-btn.loved:hover, .feedback-btn.loved.active {
            background: rgba(40, 167, 69, 0.1);
            border-color: var(--green);
        }

        .feedback-btn.ate_some { color: var(--soft-orange); }
        .feedback-btn.ate_some:hover, .feedback-btn.ate_some.active {
            background: rgba(244, 162, 97, 0.1);
            border-color: var(--soft-orange);
        }

        .feedback-btn.rejected { color: var(--coral); }
        .feedback-btn.rejected:hover, .feedback-btn.rejected.active {
            background: rgba(231, 111, 81, 0.1);
            border-color: var(--coral);
        }

        /* SNACK CARDS — lighter visual weight than meals */
        .snack-card {
            background: rgba(54,92,66,0.07);
            border: 1.5px dashed rgba(54,92,66,0.5);
            border-radius: 12px;
            padding: 14px 16px;
            margin-bottom: 8px;
            transition: all 0.2s;
        }
        .snack-card-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 6px;
        }
        .snack-type-tag {
            font-size: 0.65rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.7px;
            color: var(--sage-dark);
            background: rgba(54,92,66,0.2);
            padding: 2px 8px;
            border-radius: 100px;
            margin-bottom: 4px;
            display: inline-block;
        }
        .snack-card h5 {
            font-size: 0.9rem;
            font-weight: 700;
            color: var(--deep);
        }
        .snack-card .meal-desc {
            font-size: 0.82rem;
        }
        .snack-toggle-bar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 14px;
            background: rgba(54,92,66,0.1);
            border-radius: 10px;
            margin-bottom: 8px;
        }
        .snack-toggle-bar span {
            font-size: 0.82rem;
            font-weight: 600;
            color: var(--text-light);
        }
        .snack-day-toggle {
            position: relative;
            width: 40px;
            height: 22px;
        }
        .snack-day-toggle input {
            position: absolute;
            inset: 0;
            margin: 0;
            opacity: 0;
            width: 100%;
            height: 100%;
            z-index: 1;
            cursor: pointer;
        }
        .snack-day-toggle .slider {
            position: absolute;
            inset: 0;
            background: rgba(36,62,50,0.18);
            border-radius: 100px;
            cursor: pointer;
            transition: background 0.2s;
        }
        .snack-day-toggle .slider:before {
            content: '';
            position: absolute;
            width: 16px;
            height: 16px;
            background: white;
            border-radius: 50%;
            top: 3px;
            left: 3px;
            transition: transform 0.2s;
        }
        .snack-day-toggle input:checked + .slider {
            background: var(--sage-dark);
        }
        .snack-day-toggle input:checked + .slider:before {
            transform: translateX(18px);
        }
        .snack-day-toggle input:focus-visible + .slider {
            outline: 3px solid var(--deep);
            outline-offset: 3px;
        }
        .snack-day-toggle input:disabled + .slider { opacity: 0.6; }

        /* PLAN GENERATION MODAL */
        #plan-modal-bg {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(36,62,50,0.5);
            z-index: 1000;
            align-items: flex-end;
            justify-content: center;
        }
        #plan-modal-bg.open { display: flex; }
        #plan-modal {
            background: white;
            border-radius: 20px 20px 0 0;
            padding: 28px 20px 36px;
            width: 100%;
            max-width: 480px;
            max-height: 90vh;
            overflow-y: auto;
            animation: slideUp 0.25s ease;
        }
        .plan-modal-title {
            font-family: var(--ms-font-display);
            font-size: 1.2rem;
            font-weight: 700;
            color: var(--deep);
            margin-bottom: 4px;
        }
        .plan-modal-sub {
            font-size: 0.85rem;
            color: var(--text-light);
            margin-bottom: 20px;
        }
        .mode-tabs {
            display: flex;
            gap: 6px;
            margin-bottom: 18px;
        }
        .mode-tab {
            flex: 1;
            padding: 9px 8px;
            border: 1.5px solid rgba(36,62,50,0.15);
            border-radius: 10px;
            background: white;
            font-family: inherit;
            font-size: 0.78rem;
            font-weight: 600;
            color: var(--text-light);
            cursor: pointer;
            text-align: center;
            transition: all 0.15s;
        }
        .mode-tab.active {
            border-color: var(--sage-dark);
            background: rgba(54,92,66,0.12);
            color: var(--sage-dark);
        }
        .mode-panel { display: none; }
        .mode-panel.active { display: block; }
        .day-checkboxes {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: 6px;
            margin-bottom: 4px;
        }
        .day-check-label {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
            cursor: pointer;
        }
        .day-check-label input { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); }
        .day-check-label input:focus-visible + .day-check-box { outline:3px solid var(--deep); outline-offset:3px; }
        .day-check-box {
            width: 36px;
            height: 36px;
            border: 1.5px solid rgba(36,62,50,0.15);
            border-radius: 10px;
            background: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.78rem;
            font-weight: 700;
            color: var(--text-light);
            transition: all 0.15s;
        }
        .day-check-label input:checked + .day-check-box {
            background: rgba(54,92,66,0.2);
            border-color: var(--sage-dark);
            color: var(--sage-dark);
        }
        .snack-option, .fav-option { width:100%; font:inherit; text-align:left; color:inherit; }
        .option-title, .option-description { display:block; }
        .snack-option {
            background:transparent;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 14px 16px;
            border: 1.5px solid rgba(36,62,50,0.12);
            border-radius: 12px;
            margin-bottom: 16px;
            cursor: pointer;
            transition: border-color 0.15s;
        }
        .snack-option.selected {
            border-color: var(--sage-dark);
            background: rgba(54,92,66,0.08);
        }
        .snack-option-info .option-title {
            font-size: 0.9rem;
            font-weight: 700;
            color: var(--deep);
            margin-bottom: 2px;
        }
        .snack-option-info .option-description {
            font-size: 0.78rem;
            color: var(--text-light);
        }
        .overwrite-notice {
            background: rgba(244,162,97,0.1);
            border-left: 3px solid var(--soft-orange);
            padding: 12px 14px;
            border-radius: 0 8px 8px 0;
            margin-bottom: 16px;
        }
        .overwrite-notice p {
            font-size: 0.83rem;
            color: var(--text);
            line-height: 1.5;
        }
        .overwrite-buttons {
            display: flex;
            gap: 8px;
            margin-bottom: 16px;
        }
        .overwrite-btn {
            flex: 1;
            padding: 10px 8px;
            border-radius: 10px;
            font-family: inherit;
            font-size: 0.82rem;
            font-weight: 600;
            cursor: pointer;
            border: 1.5px solid rgba(36,62,50,0.15);
            background: white;
            color: var(--text-light);
            transition: all 0.15s;
        }
        .overwrite-btn.selected {
            border-color: var(--sage-dark);
            background: rgba(54,92,66,0.12);
            color: var(--sage-dark);
        }

        /* MEAL SWAP */
        .swap-btn {
            font-size: 0.78rem;
            color: var(--sage-dark);
            background: none;
            border: none;
            cursor: pointer;
            font-weight: 600;
            font-family: inherit;
            padding: 0 0 0 10px;
            opacity: 0.7;
            transition: opacity 0.15s;
            white-space: nowrap;
        }
        .swap-btn:hover { opacity: 1; }
        .swap-btn:disabled { opacity: 0.35; cursor: not-allowed; }

        /* Swap modal */
        #swap-modal-bg {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(36,62,50,0.45);
            z-index: 1000;
            align-items: flex-end;
            justify-content: center;
        }
        #swap-modal-bg.open { display: flex; }
        #swap-modal {
            background: white;
            border-radius: 20px 20px 0 0;
            padding: 24px 20px 32px;
            width: 100%;
            max-width: 480px;
            max-height: 92vh;
            overflow-y: auto;
            animation: slideUp 0.25s ease;
        }
        @keyframes slideUp {
            from { transform: translateY(40px); opacity: 0; }
            to   { transform: translateY(0);    opacity: 1; }
        }
        .swap-modal-title {
            font-family: var(--ms-font-display);
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--deep);
            margin-bottom: 18px;
        }
        .swap-meal-box {
            background: var(--warm-bg);
            border-radius: 12px;
            padding: 14px 16px;
            margin-bottom: 14px;
        }
        .swap-meal-box.new-meal {
            background: rgba(54,92,66,0.15);
            border: 1.5px solid rgba(54,92,66,0.5);
        }
        .swap-label {
            font-size: 0.7rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.7px;
            color: var(--text-light);
            margin-bottom: 6px;
        }
        .swap-meal-name {
            font-weight: 700;
            color: var(--deep);
            font-size: 0.95rem;
            margin-bottom: 4px;
        }
        .swap-meal-desc {
            font-size: 0.82rem;
            color: var(--text-light);
            line-height: 1.5;
            margin-bottom: 6px;
        }
        .swap-meal-ings {
            display: flex;
            flex-wrap: wrap;
            gap: 5px;
            margin-top: 4px;
        }
        .swap-actions {
            display: flex;
            gap: 10px;
            margin-top: 18px;
        }
        .swap-confirm-btn {
            flex: 1;
            padding: 13px 16px;
            background: var(--sage-dark);
            color: white;
            border: none;
            border-radius: 12px;
            font-family: inherit;
            font-size: 0.9rem;
            font-weight: 700;
            cursor: pointer;
            transition: background 0.2s;
        }
        .swap-confirm-btn:hover { background: var(--deep); }
        .swap-confirm-btn:disabled { opacity: 0.5; cursor: not-allowed; }
        .swap-cancel-btn {
            flex: 1;
            padding: 13px 16px;
            background: white;
            color: var(--text-light);
            border: 1.5px solid rgba(36,62,50,0.15);
            border-radius: 12px;
            font-family: inherit;
            font-size: 0.9rem;
            font-weight: 600;
            cursor: pointer;
        }
        .swap-another-btn {
            display: block;
            width: 100%;
            padding: 10px;
            background: none;
            color: var(--sage-dark);
            border: none;
            font-family: inherit;
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            text-align: center;
            margin-top: 8px;
        }
        .swap-another-btn:hover { text-decoration: underline; }
        .swap-another-btn:disabled { opacity: 0.4; cursor: not-allowed; }
        .swap-loading {
            text-align: center;
            padding: 30px 0;
            color: var(--text-light);
            font-size: 0.9rem;
        }
        .swap-notice {
            font-size: 0.78rem;
            color: var(--text-light);
            margin-top: 14px;
            padding: 10px 12px;
            background: rgba(244, 162, 97, 0.1);
            border-radius: 8px;
            border-left: 3px solid var(--soft-orange);
        }

        /* STATS SECTION */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 12px;
            margin-bottom: 24px;
        }

        .stat-card {
            background: white;
            border-radius: 14px;
            padding: 20px;
            text-align: center;
            box-shadow: 0 2px 12px rgba(36,62,50,0.04);
        }

        .stat-card .stat-number {
            font-family: var(--ms-font-display);
            font-size: 2rem;
            font-weight: 800;
            line-height: 1;
            margin-bottom: 4px;
        }

        .stat-card .stat-label {
            font-size: 0.75rem;
            color: var(--text-light);
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        /* CHILD PROFILE FORM */
        .profile-form {
            background: white;
            border-radius: 16px;
            padding: 32px;
            box-shadow: 0 2px 12px rgba(36,62,50,0.04);
        }

        .profile-form h2 {
            font-family: var(--ms-font-display);
            font-size: 1.4rem;
            color: var(--deep);
            margin-bottom: 24px;
        }

        .allergy-chips {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 8px;
        }

        .allergy-chip {
            font-family: inherit;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-size: 0.82rem;
            font-weight: 500;
            padding: 6px 14px;
            border-radius: 100px;
            cursor: pointer;
            transition: all 0.2s;
            border: 1.5px solid rgba(36,62,50,0.12);
            background: white;
            color: var(--text);
        }

        .allergy-chip.selected {
            background: rgba(231, 111, 81, 0.1);
            border-color: var(--coral);
            color: var(--coral);
        }

        .texture-options {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
            margin-top: 8px;
        }

        .texture-option {
            font-family: inherit;
            text-align: left;
            padding: 14px 16px;
            border: 1.5px solid rgba(36,62,50,0.12);
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.2s;
            background: white;
        }

        .texture-option:hover {
            border-color: var(--sage);
        }

        .texture-option.selected {
            border-color: var(--sage-dark);
            background: rgba(54,92,66,0.1);
        }

        .texture-option .texture-name {
            display: block;
            font-size: 0.9rem;
            font-weight: 700;
            color: var(--deep);
            margin-bottom: 2px;
        }

        .texture-option .texture-description {
            display: block;
            font-size: 0.75rem;
            color: var(--text-light);
        }

        /* LOADING */
        .loading-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(255, 249, 243, 0.9);
            backdrop-filter: blur(8px);
            z-index: 200;
            align-items: center;
            justify-content: center;
            flex-direction: column;
            gap: 16px;
        }

        .loading-overlay.visible {
            display: flex;
        }

        .spinner {
            width: 40px;
            height: 40px;
            border: 3px solid rgba(54,92,66,0.3);
            border-top-color: var(--sage-dark);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }

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

        .loading-text {
            font-size: 1rem;
            font-weight: 600;
            color: var(--text);
        }

        .loading-sub {
            font-size: 0.85rem;
            color: var(--text-light);
        }

        /* TOAST */
        .toast {
            position: fixed;
            bottom: 24px;
            right: 24px;
            padding: 14px 24px;
            border-radius: 12px;
            font-size: 0.9rem;
            font-weight: 600;
            color: white;
            z-index: 300;
            transform: translateY(100px);
            opacity: 0;
            transition: all 0.3s;
        }

        .toast.visible {
            transform: translateY(0);
            opacity: 1;
        }

        .toast-success { background: var(--sage-dark); }
        .toast-error { background: var(--coral); }
        .toast-info { background: var(--warm-brown); }

        /* RESPONSIVE */
        @media (max-width: 640px) {
            .stats-grid { grid-template-columns: repeat(3, 1fr); }
            .texture-options { grid-template-columns: 1fr; }
            .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
            .plan-stats { flex-wrap: wrap; }
            .feedback-row { flex-wrap: nowrap; }
            .feedback-btn { font-size: 0.72rem; padding: 8px 4px; }
        }

        /* GROCERY LIST */
        .grocery-header {
            background: white;
            border-radius: 16px;
            padding: 24px;
            margin-bottom: 24px;
            box-shadow: 0 2px 12px rgba(36,62,50,0.04);
        }

        .grocery-header h2 {
            font-family: var(--ms-font-display);
            font-size: 1.4rem;
            color: var(--deep);
            margin-bottom: 8px;
        }

        .grocery-header .portion-notes {
            font-size: 0.88rem;
            color: var(--text-light);
            line-height: 1.6;
            padding: 10px 14px;
            background: rgba(54,92,66,0.1);
            border-radius: 10px;
            border-left: 3px solid var(--sage-dark);
            margin-top: 12px;
        }

        .grocery-progress {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-top: 16px;
        }

        .grocery-progress-bar {
            flex: 1;
            height: 8px;
            background: rgba(36,62,50,0.08);
            border-radius: 100px;
            overflow: hidden;
        }

        .grocery-progress-fill {
            height: 100%;
            background: var(--sage-dark);
            border-radius: 100px;
            transition: width 0.3s ease;
        }

        .grocery-progress-text {
            font-size: 0.82rem;
            font-weight: 600;
            color: var(--text-light);
            white-space: nowrap;
        }

        .grocery-actions {
            display: flex;
            gap: 8px;
            margin-top: 16px;
        }

        .btn-icon {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 8px 16px;
            border-radius: 10px;
            font-size: 0.82rem;
            font-weight: 600;
            font-family: inherit;
            cursor: pointer;
            transition: all 0.2s;
            border: 1.5px solid rgba(36,62,50,0.12);
            background: white;
            color: var(--text);
        }

        .btn-icon:hover {
            border-color: var(--sage);
            background: rgba(54,92,66,0.05);
        }

        .grocery-category {
            margin-bottom: 20px;
        }

        .grocery-category-label {
            font-size: 0.78rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.8px;
            color: var(--sage-dark);
            margin-bottom: 10px;
            padding-bottom: 6px;
            border-bottom: 2px solid rgba(54,92,66,0.2);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .grocery-category-icon {
            font-size: 1rem;
        }

        .grocery-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 16px;
            background: white;
            border-radius: 12px;
            margin-bottom: 6px;
            box-shadow: 0 1px 4px rgba(36,62,50,0.03);
            cursor: pointer;
            transition: all 0.15s;
            user-select: none;
        }

        .grocery-item:hover {
            box-shadow: 0 2px 8px rgba(36,62,50,0.06);
        }

        .grocery-item.checked {
            opacity: 0.5;
        }

        .grocery-item.checked .grocery-item-name {
            text-decoration: line-through;
        }

        .grocery-checkbox {
            width: 22px;
            height: 22px;
            border: 2px solid rgba(36,62,50,0.2);
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            transition: all 0.15s;
            background: white;
        }

        .grocery-item.checked .grocery-checkbox {
            background: var(--sage-dark);
            border-color: var(--sage-dark);
        }

        .grocery-checkbox-mark {
            display: none;
            color: white;
            font-size: 0.7rem;
            font-weight: 800;
        }

        .grocery-item.checked .grocery-checkbox-mark {
            display: block;
        }

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

        .grocery-item-name {
            font-size: 0.92rem;
            font-weight: 600;
            color: var(--deep);
        }

        .grocery-item-qty {
            font-size: 0.8rem;
            color: var(--text-light);
            margin-top: 1px;
        }

        /* Collapsible category header */
        .grocery-category-label {
            cursor: pointer;
            user-select: none;
        }
        .grocery-category-label:hover {
            opacity: 0.85;
        }
        .grocery-category-name {
            flex: 1;
        }
        .grocery-cat-count {
            font-weight: 400;
            color: var(--text-light);
            text-transform: none;
            letter-spacing: 0;
            font-size: 0.75rem;
            margin-left: 4px;
        }
        .grocery-cat-chevron {
            font-size: 0.9rem;
            color: var(--text-light);
            margin-left: 6px;
            transition: transform 0.2s;
            font-style: normal;
            font-weight: 400;
            text-transform: none;
            letter-spacing: 0;
        }

        .grocery-check-control { display:flex; align-items:center; gap:12px; flex:1; cursor:pointer; }
        .grocery-check-control input { position:absolute; width:1px; height:1px; margin:-1px; overflow:hidden; clip-path:inset(50%); }
        .grocery-check-control input:focus-visible + .grocery-checkbox { outline:3px solid var(--deep); outline-offset:3px; }
        button.grocery-category-label { width:100%; border:0; background:transparent; text-align:left; font-family:inherit; }
        /* Item main row (checkbox label and separate expand button) */
        .grocery-item-main {
            display: flex;
            align-items: center;
            gap: 12px;
            flex: 1;
            cursor: pointer;
        }

        /* Expand button to show which meals use this ingredient */
        .grocery-expand-btn {
            background: none;
            border: none;
            padding: 4px 8px;
            cursor: pointer;
            color: var(--text-light);
            font-size: 1rem;
            border-radius: 6px;
            transition: background 0.15s, color 0.15s;
            flex-shrink: 0;
        }
        .grocery-expand-btn:hover {
            background: rgba(36,62,50,0.06);
            color: var(--sage-dark);
        }
        .grocery-expand-icon {
            display: inline-block;
            transition: transform 0.2s;
            line-height: 1;
        }

        /* Meals-used expandable detail */
        .grocery-item-meals {
            padding: 6px 12px 8px 46px;
        }
        .grocery-meals-list {
            display: flex;
            flex-wrap: wrap;
            gap: 4px;
        }
        .grocery-meal-tag {
            font-size: 0.73rem;
            font-weight: 500;
            color: var(--sage-dark);
            background: rgba(54,92,66,0.15);
            border: 1px solid rgba(54,92,66,0.4);
            border-radius: 20px;
            padding: 2px 8px;
            white-space: nowrap;
        }

        /* Override old .grocery-item flex to accommodate new inner structure */
        .grocery-item {
            flex-direction: column;
            align-items: stretch;
            padding: 0;
        }
        .grocery-item .grocery-item-main {
            padding: 12px 16px;
        }
        .grocery-item.checked .grocery-item-main {
            opacity: 0.5;
        }
        .grocery-item.checked .grocery-item-name {
            text-decoration: line-through;
        }
        /* Reset old checked opacity rule (now on .grocery-item-main) */
        .grocery-item.checked {
            opacity: 1;
        }

        .btn-grocery {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 10px 18px;
            background: rgba(54,92,66,0.15);
            color: var(--sage-dark);
            border: 1.5px solid var(--sage);
            border-radius: 10px;
            font-size: 0.85rem;
            font-weight: 700;
            font-family: inherit;
            cursor: pointer;
            transition: all 0.2s;
        }

        .btn-grocery:hover {
            background: var(--sage-dark);
            color: white;
            border-color: var(--sage-dark);
        }

        /* PLAN ACTION BUTTONS ROW */
        .plan-actions {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
            margin-top: 16px;
        }

        .btn-batch {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 10px 18px;
            background: rgba(244, 162, 97, 0.12);
            color: var(--soft-orange);
            border: 1.5px solid rgba(244, 162, 97, 0.4);
            border-radius: 10px;
            font-size: 0.85rem;
            font-weight: 700;
            font-family: inherit;
            cursor: pointer;
            transition: all 0.2s;
        }

        .btn-batch:hover {
            background: var(--soft-orange);
            color: white;
            border-color: var(--soft-orange);
        }

        /* NUTRITION BALANCE BUTTON */
        .btn-nutrition {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 10px 18px;
            background: rgba(36,62,50,0.06);
            border: 1.5px solid rgba(36,62,50,0.18);
            border-radius: 10px;
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--warm-brown);
            cursor: pointer;
            transition: all 0.2s;
            font-family: inherit;
        }

        .btn-nutrition:hover {
            background: rgba(123, 163, 115, 0.15);
            border-color: var(--sage-dark);
            color: var(--sage-dark);
        }

        /* NUTRITION DASHBOARD */
        .nutrition-header {
            background: white;
            border-radius: 16px;
            padding: 24px;
            margin-bottom: 20px;
            box-shadow: 0 1px 8px rgba(36,62,50,0.04);
        }

        .nutrition-header h2 {
            font-family: var(--ms-font-display);
            font-size: 1.4rem;
            font-weight: 700;
            color: var(--deep);
            margin: 0 0 6px;
        }

        .nutrition-header p {
            font-size: 0.85rem;
            color: var(--text-light);
            margin: 0;
        }

        .nutrient-card {
            background: white;
            border-radius: 14px;
            padding: 18px 20px;
            margin-bottom: 10px;
            box-shadow: 0 1px 6px rgba(36,62,50,0.03);
        }

        .nutrient-row {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 10px;
        }

        .nutrient-icon {
            font-size: 1.4rem;
            flex-shrink: 0;
            width: 36px;
            text-align: center;
        }

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

        .nutrient-label {
            font-weight: 700;
            font-size: 0.95rem;
            color: var(--deep);
        }

        .nutrient-reason {
            font-size: 0.78rem;
            color: var(--text-light);
            margin-top: 1px;
        }

        .nutrient-pct {
            font-weight: 700;
            font-size: 1rem;
            flex-shrink: 0;
            min-width: 48px;
            text-align: right;
        }

        .nutrient-pct.status-good { color: #28A745; }
        .nutrient-pct.status-moderate { color: #F4A261; }
        .nutrient-pct.status-low { color: #E76F51; }

        .nutrient-bar-track {
            height: 8px;
            background: rgba(36,62,50,0.08);
            border-radius: 100px;
            overflow: hidden;
        }

        .nutrient-bar-fill {
            height: 100%;
            border-radius: 100px;
            transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .nutrient-bar-fill.status-good { background: #28A745; }
        .nutrient-bar-fill.status-moderate { background: #F4A261; }
        .nutrient-bar-fill.status-low { background: #E76F51; }

        .nutrient-meals-count {
            font-size: 0.78rem;
            color: var(--text-light);
            margin-top: 6px;
        }

        .nutrition-legend {
            display: flex;
            gap: 16px;
            flex-wrap: wrap;
            margin-bottom: 20px;
            padding: 14px 18px;
            background: white;
            border-radius: 12px;
            box-shadow: 0 1px 6px rgba(36,62,50,0.03);
        }

        .legend-item {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 0.78rem;
            color: var(--text-light);
        }

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

        .nutrition-no-data {
            text-align: center;
            padding: 40px 20px;
            color: var(--text-light);
            background: white;
            border-radius: 14px;
            box-shadow: 0 1px 6px rgba(36,62,50,0.03);
        }

        .nutrition-tip {
            background: rgba(54,92,66,0.12);
            border: 1.5px solid rgba(123, 163, 115, 0.2);
            border-radius: 12px;
            padding: 14px 16px;
            margin-top: 16px;
            font-size: 0.82rem;
            color: var(--warm-brown);
            line-height: 1.5;
        }

        /* BATCH COOK VIEW */
        .batch-header {
            background: white;
            border-radius: 16px;
            padding: 24px;
            margin-bottom: 20px;
            box-shadow: 0 1px 8px rgba(36,62,50,0.04);
        }

        .batch-header h2 {
            font-family: var(--ms-font-display);
            font-size: 1.4rem;
            font-weight: 700;
            color: var(--deep);
            margin-bottom: 6px;
        }

        .batch-total-time {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            background: rgba(244, 162, 97, 0.12);
            color: var(--soft-orange);
            border: 1.5px solid rgba(244, 162, 97, 0.3);
            border-radius: 100px;
            padding: 4px 14px;
            font-size: 0.82rem;
            font-weight: 700;
        }

        .batch-session {
            background: white;
            border-radius: 16px;
            padding: 24px;
            margin-bottom: 16px;
            box-shadow: 0 1px 8px rgba(36,62,50,0.04);
        }

        .batch-session-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 16px;
            padding-bottom: 12px;
            border-bottom: 2px solid rgba(54,92,66,0.25);
        }

        .batch-session-label {
            font-family: var(--ms-font-display);
            font-size: 1.05rem;
            font-weight: 700;
            color: var(--deep);
        }

        .batch-session-time {
            font-size: 0.8rem;
            font-weight: 600;
            color: var(--soft-orange);
            background: rgba(244, 162, 97, 0.1);
            padding: 3px 10px;
            border-radius: 100px;
        }

        .batch-step {
            display: flex;
            gap: 14px;
            padding: 14px 0;
            border-bottom: 1px solid rgba(36,62,50,0.06);
        }

        .batch-step:last-child { border-bottom: none; }

        .batch-step-num {
            flex-shrink: 0;
            width: 28px;
            height: 28px;
            background: var(--peach);
            color: var(--warm-brown);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.78rem;
            font-weight: 800;
            margin-top: 2px;
        }

        .batch-step-content { flex: 1; }

        .batch-step-action {
            font-size: 0.9rem;
            color: var(--deep);
            line-height: 1.6;
            margin-bottom: 8px;
        }

        .batch-step-meta {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            align-items: center;
        }

        .batch-step-time {
            font-size: 0.75rem;
            font-weight: 700;
            color: var(--soft-orange);
            background: rgba(244, 162, 97, 0.1);
            padding: 2px 10px;
            border-radius: 100px;
        }

        .batch-feeds-label {
            font-size: 0.72rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: var(--text-light);
        }

        .batch-feeds-list {
            display: flex;
            flex-wrap: wrap;
            gap: 4px;
        }

        .batch-feeds-tag {
            font-size: 0.72rem;
            background: rgba(54,92,66,0.2);
            color: var(--sage-dark);
            padding: 2px 8px;
            border-radius: 100px;
            font-weight: 500;
        }

        .batch-actions {
            margin-top: 20px;
            display: flex;
            gap: 10px;
        }

        @media print {
            .app-nav, .back-link, .grocery-actions, .btn-grocery, .btn-logout,
            .grocery-expand-btn, .grocery-item-meals, .grocery-cat-chevron,
            .export-actions, .filter-pills, .food-intro-actions, .ft-count-badge { display: none !important; }
            body { background: white; }
            .app-content { padding-top: 0; }
            .grocery-item { box-shadow: none; border: 1px solid #eee; }
            .grocery-item-main { padding: 10px 14px !important; }
            .grocery-header { box-shadow: none; border: 1px solid #eee; }
            .grocery-category-items { display: block !important; }
            .export-text { max-height: none; border: 1px solid #eee; }
            .food-intro-item { box-shadow: none; border: 1px solid #eee; }
        }

        .hidden { display: none !important; }

        /* ============================================================
           FOOD TRACKER
        ============================================================ */
        .btn-food {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 10px 18px;
            background: rgba(54,92,66,0.15);
            color: var(--sage-dark);
            border: 1.5px solid var(--sage);
            border-radius: 10px;
            font-size: 0.85rem;
            font-weight: 700;
            font-family: inherit;
            cursor: pointer;
            transition: all 0.2s;
        }
        .btn-food:hover { background: var(--sage-dark); color: white; border-color: var(--sage-dark); }

        .filter-pills {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            margin-bottom: 20px;
        }
        .filter-pill {
            padding: 6px 14px;
            border: 1.5px solid rgba(36,62,50,0.12);
            border-radius: 100px;
            background: white;
            font-size: 0.8rem;
            font-weight: 600;
            font-family: inherit;
            cursor: pointer;
            color: var(--text-light);
            transition: all 0.2s;
        }
        .filter-pill:hover { border-color: var(--sage); color: var(--sage-dark); }
        .filter-pill.active { background: var(--sage-dark); border-color: var(--sage-dark); color: white; }

        .food-intro-list { display: flex; flex-direction: column; gap: 10px; }

        .food-intro-item {
            background: white;
            border-radius: 14px;
            padding: 18px 20px;
            box-shadow: 0 1px 8px rgba(36,62,50,0.03);
            border: 1.5px solid transparent;
            transition: all 0.2s;
        }
        .food-intro-item.allergen-flagged {
            border-color: rgba(231, 111, 81, 0.3);
            background: rgba(231, 111, 81, 0.02);
        }
        .food-intro-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
        .food-intro-name { font-size: 1rem; font-weight: 700; color: var(--deep); }

        .food-intro-meta {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            align-items: center;
            margin-top: 6px;
        }
        .reaction-badge {
            font-size: 0.72rem;
            font-weight: 700;
            padding: 3px 10px;
            border-radius: 100px;
        }
        .reaction-loved { background: rgba(40, 167, 69, 0.1); color: var(--green); }
        .reaction-ate_some { background: rgba(244, 162, 97, 0.15); color: var(--soft-orange); }
        .reaction-rejected { background: rgba(231, 111, 81, 0.1); color: var(--coral); }
        .reaction-allergic_reaction { background: rgba(220, 53, 69, 0.12); color: var(--red); }

        .category-badge {
            font-size: 0.72rem;
            font-weight: 600;
            padding: 3px 10px;
            border-radius: 100px;
            background: rgba(36,62,50,0.06);
            color: var(--text-light);
            text-transform: capitalize;
        }
        .auto-badge {
            font-size: 0.68rem;
            font-weight: 600;
            padding: 2px 8px;
            border-radius: 100px;
            background: rgba(54,92,66,0.15);
            color: var(--sage-dark);
        }
        .food-intro-date { font-size: 0.8rem; color: var(--text-light); }
        .food-intro-notes { font-size: 0.82rem; color: var(--text-light); margin-top: 6px; font-style: italic; }
        .food-intro-actions { display: flex; gap: 6px; }

        .btn-tiny {
            padding: 5px 12px;
            border: 1px solid rgba(36,62,50,0.12);
            border-radius: 8px;
            background: white;
            font-size: 0.75rem;
            font-weight: 600;
            font-family: inherit;
            cursor: pointer;
            color: var(--text-light);
            transition: all 0.15s;
        }
        .btn-tiny:hover { border-color: var(--sage); color: var(--sage-dark); }
        .btn-tiny.del:hover { border-color: var(--coral); color: var(--coral); }

        /* FOOD FORM */
        .food-form-card {
            background: white;
            border-radius: 16px;
            padding: 32px;
            box-shadow: 0 2px 12px rgba(36,62,50,0.04);
            max-width: 540px;
        }
        .food-form-card h2 { font-family: var(--ms-font-display); font-size: 1.4rem; color: var(--deep); margin-bottom: 24px; }

        .reaction-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
        .reaction-option {
            padding: 11px 14px;
            border: 1.5px solid rgba(36,62,50,0.12);
            border-radius: 12px;
            cursor: pointer;
            background: white;
            font-family: inherit;
            font-size: 0.88rem;
            font-weight: 600;
            text-align: left;
            color: var(--text);
            transition: all 0.2s;
        }
        .reaction-option:hover { border-color: var(--sage); }
        .reaction-option.selected-loved { border-color: var(--green); background: rgba(40,167,69,0.07); color: var(--green); }
        .reaction-option.selected-ate_some { border-color: var(--soft-orange); background: rgba(244,162,97,0.1); color: var(--soft-orange); }
        .reaction-option.selected-rejected { border-color: var(--coral); background: rgba(231,111,81,0.08); color: var(--coral); }
        .reaction-option.selected-allergic_reaction { border-color: var(--red); background: rgba(220,53,69,0.08); color: var(--red); }

        .allergen-warning {
            background: rgba(231, 111, 81, 0.08);
            border: 1.5px solid rgba(231, 111, 81, 0.3);
            border-radius: 10px;
            padding: 12px 14px;
            font-size: 0.85rem;
            color: var(--coral);
            font-weight: 500;
            margin-top: 12px;
            display: none;
        }
        .allergen-warning.visible { display: block; }

        /* EXPORT VIEW */
        .export-card { background: white; border-radius: 16px; padding: 32px; box-shadow: 0 2px 12px rgba(36,62,50,0.04); }
        .export-card h2 { font-family: var(--ms-font-display); font-size: 1.4rem; color: var(--deep); margin-bottom: 16px; }
        .export-text {
            background: var(--cream);
            border: 1.5px solid rgba(36,62,50,0.1);
            border-radius: 12px;
            padding: 20px;
            font-family: 'Courier New', monospace;
            font-size: 0.78rem;
            line-height: 1.7;
            color: var(--text);
            white-space: pre-wrap;
            max-height: 380px;
            overflow-y: auto;
            margin-bottom: 16px;
        }
        .export-actions { display: flex; gap: 10px; flex-wrap: wrap; }

        .ft-count-badge {
            font-family: var(--ms-font-display);
            font-size: 0.85rem;
            background: var(--peach);
            color: var(--warm-brown);
            padding: 4px 12px;
            border-radius: 100px;
            font-weight: 700;
        }

        @media (max-width: 640px) {
            .reaction-options { grid-template-columns: 1fr; }
        }

        /* ============================================================
           ONBOARDING PROGRESS BAR
        ============================================================ */
        #onboarding-progress {
            display: none;
            position: sticky;
            top: 60px;
            z-index: 90;
            background: white;
            border-bottom: 1px solid rgba(36,62,50,0.08);
            padding: 10px 24px;
        }
        #onboarding-progress.visible { display: block; }
        .onboarding-steps {
            max-width: 900px;
            margin: 0 auto;
            display: flex;
            align-items: center;
            gap: 0;
        }
        .ob-step {
            display: flex;
            align-items: center;
            gap: 8px;
            flex: 1;
        }
        .ob-step-circle {
            width: 26px;
            height: 26px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.72rem;
            font-weight: 800;
            flex-shrink: 0;
            border: 2px solid rgba(36,62,50,0.15);
            color: var(--text-light);
            background: white;
            transition: all 0.3s;
        }
        .ob-step.done .ob-step-circle {
            background: var(--sage-dark);
            border-color: var(--sage-dark);
            color: white;
        }
        .ob-step.active .ob-step-circle {
            background: var(--coral);
            border-color: var(--coral);
            color: white;
        }
        .ob-step-label {
            font-size: 0.78rem;
            font-weight: 600;
            color: var(--text-light);
            transition: color 0.3s;
        }
        .ob-step.done .ob-step-label { color: var(--sage-dark); }
        .ob-step.active .ob-step-label { color: var(--coral); font-weight: 700; }
        .ob-connector {
            flex: 1;
            height: 2px;
            background: rgba(36,62,50,0.12);
            margin: 0 8px;
            transition: background 0.3s;
        }
        .ob-connector.done { background: var(--sage-dark); }

        /* ============================================================
           ONBOARDING WIZARD — 3-step guided setup
        ============================================================ */
        .onboarding-wizard {
            max-width: 480px;
            margin: 0 auto;
            padding-top: 16px;
        }

        /* ── Step progress indicator (inside wizard) ── */
        .wiz-step-progress {
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 28px;
            gap: 0;
        }
        .wiz-step-dot {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.8rem;
            font-weight: 800;
            border: 2px solid rgba(36,62,50,0.15);
            color: var(--text-light);
            background: white;
            transition: all 0.3s;
            position: relative;
            z-index: 1;
        }
        .wiz-step-dot.active {
            background: var(--coral);
            border-color: var(--coral);
            color: white;
            box-shadow: 0 0 0 4px rgba(231, 111, 81, 0.18);
        }
        .wiz-step-dot.done {
            background: var(--sage-dark);
            border-color: var(--sage-dark);
            color: white;
        }
        .wiz-step-dot.done::after {
            content: '✓';
            font-size: 0.75rem;
        }
        .wiz-step-dot.done span { display: none; }
        .wiz-step-line {
            flex: 1;
            height: 2px;
            background: rgba(36,62,50,0.12);
            max-width: 56px;
            transition: background 0.4s;
        }
        .wiz-step-line.done { background: var(--sage-dark); }
        .wiz-step-labels {
            display: flex;
            justify-content: space-between;
            padding: 0 4px;
            margin-top: -6px;
            margin-bottom: 24px;
        }
        .wiz-step-label-item {
            font-size: 0.7rem;
            font-weight: 600;
            color: var(--text-light);
            text-align: center;
            width: 32px;
            transition: color 0.3s;
        }
        .wiz-step-label-item.active { color: var(--coral); }
        .wiz-step-label-item.done { color: var(--sage-dark); }

        .wizard-card {
            background: white;
            border-radius: 20px;
            padding: 28px 28px 24px;
            box-shadow: 0 4px 24px rgba(36,62,50,0.06);
        }
        .wizard-card h2 {
            font-family: var(--ms-font-display);
            font-size: 1.15rem;
            color: var(--deep);
            margin-bottom: 6px;
            letter-spacing: -0.3px;
        }
        .wizard-card .wizard-step-hint {
            font-size: 0.82rem;
            color: var(--text-light);
            margin-bottom: 22px;
            line-height: 1.5;
        }

        /* ── Wizard nav footer ── */
        .wizard-nav {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-top: 20px;
        }
        .btn-wiz-back {
            padding: 12px 18px;
            border: 1.5px solid rgba(36,62,50,0.2);
            border-radius: 12px;
            background: white;
            font-family: inherit;
            font-size: 0.88rem;
            font-weight: 600;
            color: var(--text-light);
            cursor: pointer;
            transition: all 0.2s;
            flex-shrink: 0;
        }
        .btn-wiz-back:hover { border-color: var(--text-light); color: var(--text); }
        .btn-wiz-next {
            flex: 1;
            padding: 14px 24px;
            background: var(--coral);
            color: white;
            border: none;
            border-radius: 12px;
            font-size: 0.98rem;
            font-weight: 700;
            font-family: inherit;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }
        .btn-wiz-next:hover { background: var(--ms-green-hover); transform: translateY(-1px); }
        .btn-wiz-next:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

        /* ── Meals per day selector ── */
        .meals-per-day-selector {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 8px;
        }
        .mpd-option {
            font-family: inherit;
            border: 1.5px solid rgba(36,62,50,0.15);
            border-radius: 10px;
            padding: 12px 8px;
            text-align: center;
            cursor: pointer;
            transition: all 0.2s;
            background: white;
        }
        .mpd-option:hover { border-color: var(--sage); }
        .mpd-option.selected {
            border-color: var(--sage-dark);
            background: rgba(54,92,66,0.1);
        }
        .mpd-option .mpd-num {
            display: block;
            font-family: var(--ms-font-display);
            font-size: 1.3rem;
            font-weight: 800;
            color: var(--deep);
            line-height: 1;
        }
        .mpd-option.selected .mpd-num { color: var(--sage-dark); }
        .mpd-option .mpd-label {
            display: block;
            font-size: 0.7rem;
            color: var(--text-light);
            font-weight: 500;
            margin-top: 3px;
        }

        /* ── Diet type chips ── */
        .diet-chip-group {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }
        .diet-chip {
            font-family: inherit;
            padding: 7px 14px;
            border: 1.5px solid rgba(36,62,50,0.15);
            border-radius: 100px;
            font-size: 0.82rem;
            font-weight: 600;
            color: var(--text-light);
            cursor: pointer;
            transition: all 0.2s;
            background: white;
        }
        .diet-chip:hover { border-color: var(--sage); }
        .diet-chip.selected {
            border-color: var(--sage-dark);
            background: rgba(54,92,66,0.12);
            color: var(--sage-dark);
        }

        /* ── Step 3: Skeleton + generating ── */
        .wizard-step3-content {
            text-align: center;
        }
        .wiz-generating-header {
            margin-bottom: 24px;
        }
        .wiz-generating-header .wiz-gen-icon {
            font-size: 2.8rem;
            display: block;
            margin-bottom: 10px;
            animation: gentlePulse 1.5s ease-in-out infinite;
        }
        @keyframes gentlePulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.08); }
        }
        .wiz-generating-header h2 {
            font-family: var(--ms-font-display);
            font-size: 1.3rem;
            color: var(--deep);
            margin-bottom: 6px;
            letter-spacing: -0.3px;
        }
        .wiz-generating-header p {
            font-size: 0.85rem;
            color: var(--text-light);
            line-height: 1.5;
        }
        .wiz-progress-bar-wrap {
            background: rgba(36,62,50,0.08);
            border-radius: 100px;
            height: 6px;
            overflow: hidden;
            margin: 16px 0 24px;
        }
        .wiz-progress-bar-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--sage-dark), var(--coral));
            border-radius: 100px;
            width: 0%;
            transition: width 0.6s ease;
        }
        .wiz-status-text {
            font-size: 0.78rem;
            color: var(--text-light);
            font-weight: 500;
            margin-bottom: 20px;
            min-height: 18px;
        }

        /* Skeleton meal cards */
        .skeleton-preview {
            text-align: left;
        }
        .skeleton-day-header {
            height: 14px;
            background: rgba(36,62,50,0.08);
            border-radius: 6px;
            width: 80px;
            margin-bottom: 10px;
            animation: shimmer 1.4s ease-in-out infinite;
        }
        .skeleton-meal-card {
            background: white;
            border-radius: 12px;
            padding: 14px 16px;
            margin-bottom: 8px;
            box-shadow: 0 2px 8px rgba(36,62,50,0.04);
        }
        .skeleton-line {
            background: rgba(36,62,50,0.07);
            border-radius: 4px;
            animation: shimmer 1.4s ease-in-out infinite;
        }
        .skeleton-line.title { height: 13px; width: 70%; margin-bottom: 8px; }
        .skeleton-line.sub { height: 10px; width: 45%; }
        .skeleton-line.tag { height: 10px; width: 55px; border-radius: 100px; }
        .skeleton-card-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        @keyframes shimmer {
            0% { opacity: 0.5; }
            50% { opacity: 1; }
            100% { opacity: 0.5; }
        }

        /* ── First week ready screen ── */
        .first-week-ready {
            max-width: 440px;
            margin: 0 auto;
            padding-top: 20px;
            text-align: center;
        }
        .fwr-emoji {
            font-size: 3.5rem;
            display: block;
            margin-bottom: 16px;
            animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }
        .fwr-title {
            font-family: var(--ms-font-display);
            font-size: 1.7rem;
            color: var(--deep);
            letter-spacing: -0.5px;
            margin-bottom: 10px;
        }
        .fwr-subtitle {
            color: var(--text-light);
            font-size: 0.9rem;
            line-height: 1.6;
            margin-bottom: 28px;
        }
        .fwr-stats {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 12px;
            margin-bottom: 28px;
        }
        .fwr-stat {
            background: white;
            border-radius: 14px;
            padding: 16px 12px;
            box-shadow: 0 2px 12px rgba(36,62,50,0.05);
        }
        .fwr-stat-num {
            font-family: var(--ms-font-display);
            font-size: 1.8rem;
            font-weight: 800;
            color: var(--sage-dark);
            line-height: 1;
            margin-bottom: 4px;
        }
        .fwr-stat-label {
            font-size: 0.72rem;
            color: var(--text-light);
            font-weight: 600;
            line-height: 1.3;
        }
        .btn-view-plan {
            width: 100%;
            padding: 16px 24px;
            background: var(--coral);
            color: white;
            border: none;
            border-radius: 14px;
            font-size: 1.05rem;
            font-weight: 700;
            font-family: inherit;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }
        .btn-view-plan:hover { background: var(--ms-green-hover); transform: translateY(-1px); }

        /* ── Wizard slide animation ── */
        .wizard-step-panel {
            animation: fadeSlideIn 0.25s ease;
        }
        @keyframes fadeSlideIn {
            from { opacity: 0; transform: translateX(12px); }
            to { opacity: 1; transform: translateX(0); }
        }
        .wizard-step-panel.slide-back {
            animation: fadeSlideInBack 0.25s ease;
        }
        @keyframes fadeSlideInBack {
            from { opacity: 0; transform: translateX(-12px); }
            to { opacity: 1; transform: translateX(0); }
        }
        .age-input-group {
            display: flex;
            gap: 8px;
            align-items: flex-start;
        }
        .age-input-group .form-group {
            flex: 1;
            margin-bottom: 0;
        }
        .age-type-toggle {
            display: flex;
            gap: 6px;
            margin-bottom: 10px;
        }
        .age-toggle-btn {
            flex: 1;
            padding: 7px 10px;
            border: 1.5px solid rgba(36,62,50,0.15);
            border-radius: 8px;
            background: white;
            font-family: inherit;
            font-size: 0.8rem;
            font-weight: 600;
            cursor: pointer;
            color: var(--text-light);
            transition: all 0.2s;
        }
        .age-toggle-btn.active {
            border-color: var(--sage-dark);
            background: rgba(54,92,66,0.12);
            color: var(--sage-dark);
        }
        .smart-default-hint {
            font-size: 0.78rem;
            color: var(--sage-dark);
            background: rgba(54,92,66,0.1);
            border-radius: 8px;
            padding: 8px 12px;
            margin-top: 8px;
            font-weight: 500;
        }
        .btn-generate-plan {
            width: 100%;
            padding: 16px 24px;
            background: var(--coral);
            color: white;
            border: none;
            border-radius: 14px;
            font-size: 1.05rem;
            font-weight: 700;
            font-family: inherit;
            cursor: pointer;
            transition: all 0.2s;
            margin-top: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }
        .btn-generate-plan:hover { background: var(--ms-green-hover); transform: translateY(-1px); }
        .btn-generate-plan:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

        /* ============================================================
           CELEBRATION OVERLAY
        ============================================================ */
        #celebration-overlay {
            display: none;
            position: fixed;
            inset: 0;
            z-index: 2000;
            pointer-events: none;
            align-items: center;
            justify-content: center;
        }
        #celebration-overlay.active {
            display: flex;
        }
        .confetti-container {
            position: fixed;
            inset: 0;
            overflow: hidden;
            pointer-events: none;
        }
        .confetti-piece {
            position: absolute;
            width: 10px;
            height: 10px;
            top: -20px;
            border-radius: 2px;
            animation: confetti-fall linear forwards;
        }
        @keyframes confetti-fall {
            0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
            80% { opacity: 1; }
            100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
        }
        .celebration-msg-card {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: white;
            border-radius: 20px;
            padding: 36px 40px;
            text-align: center;
            box-shadow: 0 20px 60px rgba(36,62,50,0.18);
            max-width: 340px;
            width: 90%;
            pointer-events: auto;
            z-index: 2001;
            animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }
        @keyframes popIn {
            0% { transform: translate(-50%, -50%) scale(0.7); opacity: 0; }
            100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
        }
        .celebration-emoji {
            font-size: 3.5rem;
            display: block;
            margin-bottom: 12px;
        }
        .celebration-msg-card h2 {
            font-family: var(--ms-font-display);
            font-size: 1.4rem;
            color: var(--deep);
            margin-bottom: 8px;
        }
        .celebration-msg-card p {
            color: var(--text-light);
            font-size: 0.9rem;
            line-height: 1.5;
        }

        /* ============================================================
           WALKTHROUGH OVERLAY
        ============================================================ */
        #walkthrough-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(36,62,50,0.7);
            z-index: 1500;
            align-items: flex-end;
            justify-content: center;
        }
        #walkthrough-overlay.open { display: flex; }
        .walkthrough-card {
            background: white;
            border-radius: 20px 20px 0 0;
            padding: 28px 24px 36px;
            width: 100%;
            max-width: 480px;
            animation: slideUp 0.3s ease;
        }
        .walkthrough-steps-indicator {
            display: flex;
            gap: 6px;
            margin-bottom: 20px;
        }
        .wt-dot {
            flex: 1;
            height: 4px;
            border-radius: 2px;
            background: rgba(36,62,50,0.12);
            transition: background 0.3s;
        }
        .wt-dot.active { background: var(--coral); }
        .wt-dot.done { background: var(--sage-dark); }
        .walkthrough-step {
            display: none;
        }
        .walkthrough-step.active { display: block; }
        .walkthrough-step-icon {
            font-size: 2.5rem;
            margin-bottom: 14px;
            display: block;
        }
        .walkthrough-step h3 {
            font-family: var(--ms-font-display);
            font-size: 1.2rem;
            color: var(--deep);
            margin-bottom: 8px;
        }
        .walkthrough-step p {
            color: var(--text-light);
            font-size: 0.9rem;
            line-height: 1.5;
            margin-bottom: 20px;
        }
        .walkthrough-actions {
            display: flex;
            gap: 10px;
        }
        .wt-next-btn {
            flex: 1;
            padding: 13px 20px;
            background: var(--sage-dark);
            color: white;
            border: none;
            border-radius: 12px;
            font-family: inherit;
            font-size: 0.9rem;
            font-weight: 700;
            cursor: pointer;
            transition: background 0.2s;
        }
        .wt-next-btn:hover { background: var(--ms-green-hover); }
        .wt-skip-btn {
            padding: 13px 16px;
            background: none;
            color: var(--text-light);
            border: 1.5px solid rgba(36,62,50,0.15);
            border-radius: 12px;
            font-family: inherit;
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
        }

        /* ============================================================
           TEXTURE PROMPT MODAL
        ============================================================ */
        #texture-prompt-bg {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(36,62,50,0.5);
            z-index: 1200;
            align-items: center;
            justify-content: center;
            padding: 24px;
        }
        #texture-prompt-bg.open { display: flex; }
        .texture-prompt-card {
            background: white;
            border-radius: 20px;
            padding: 32px 28px;
            max-width: 420px;
            width: 100%;
            box-shadow: 0 20px 60px rgba(36,62,50,0.15);
            animation: popIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }
        .texture-prompt-card .emoji-header {
            font-size: 2.5rem;
            margin-bottom: 14px;
        }
        .texture-prompt-card h3 {
            font-family: var(--ms-font-display);
            font-size: 1.2rem;
            color: var(--deep);
            margin-bottom: 8px;
        }
        .texture-prompt-card p {
            color: var(--text-light);
            font-size: 0.88rem;
            line-height: 1.5;
            margin-bottom: 20px;
        }
        .texture-prompt-options {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
            margin-bottom: 16px;
        }
        .texture-prompt-option {
            padding: 11px 10px;
            border: 1.5px solid rgba(36,62,50,0.15);
            border-radius: 12px;
            cursor: pointer;
            background: white;
            font-family: inherit;
            font-size: 0.82rem;
            font-weight: 600;
            text-align: left;
            color: var(--text);
            transition: all 0.15s;
        }
        .texture-prompt-option .tp-name {
            color: var(--deep);
            font-weight: 700;
            display: block;
            margin-bottom: 2px;
        }
        .texture-prompt-option .tp-desc {
            color: var(--text-light);
            font-size: 0.75rem;
        }
        .texture-prompt-option:hover { border-color: var(--sage-dark); }
        .texture-prompt-option.selected {
            border-color: var(--sage-dark);
            background: rgba(54,92,66,0.12);
        }
        .texture-prompt-actions {
            display: flex;
            gap: 8px;
        }
        .btn-texture-save {
            flex: 1;
            padding: 12px 16px;
            background: var(--sage-dark);
            color: white;
            border: none;
            border-radius: 12px;
            font-family: inherit;
            font-size: 0.9rem;
            font-weight: 700;
            cursor: pointer;
        }
        .btn-texture-skip {
            padding: 12px 16px;
            background: none;
            color: var(--text-light);
            border: 1.5px solid rgba(36,62,50,0.12);
            border-radius: 12px;
            font-family: inherit;
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
        }

        /* ============================================================
           START HERE INDICATOR
        ============================================================ */
        .start-here-badge {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            background: var(--coral);
            color: white;
            font-size: 0.72rem;
            font-weight: 700;
            padding: 4px 10px;
            border-radius: 100px;
            letter-spacing: 0.3px;
            animation: pulse-badge 2s ease-in-out infinite;
        }
        @keyframes pulse-badge {
            0%, 100% { box-shadow: 0 0 0 0 rgba(231, 111, 81, 0.4); }
            50% { box-shadow: 0 0 0 6px rgba(231, 111, 81, 0); }
        }

        /* Recipe Detail Page */
        .recipe-detail {
            max-width: 680px;
            margin: 0 auto;
        }
        .recipe-header {
            background: var(--peach);
            border-radius: 16px;
            padding: 24px;
            margin-bottom: 20px;
        }
        .recipe-header h2 {
            font-family: var(--ms-font-display);
            font-size: 1.5rem;
            color: var(--deep);
            margin: 0 0 8px;
        }
        .recipe-meta {
            display: flex;
            gap: 12px;
            flex-wrap: wrap;
            margin-top: 10px;
        }
        .recipe-meta-chip {
            background: white;
            border-radius: 20px;
            padding: 4px 12px;
            font-size: 0.82rem;
            color: var(--text);
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 4px;
        }
        .recipe-section {
            background: white;
            border: 1px solid rgba(36,62,50,0.1);
            border-radius: 14px;
            padding: 20px;
            margin-bottom: 16px;
        }
        .recipe-section-title {
            font-family: var(--ms-font-display);
            font-size: 0.85rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: var(--sage-dark);
            margin: 0 0 12px;
        }
        .recipe-ingredients {
            list-style: none;
            padding: 0;
            margin: 0;
        }
        .recipe-ingredients li {
            padding: 6px 0;
            border-bottom: 1px solid rgba(36,62,50,0.06);
            font-size: 0.93rem;
            color: var(--text);
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .recipe-ingredients li:last-child { border-bottom: none; }
        .recipe-ingredients li::before {
            content: '·';
            color: var(--sage-dark);
            font-weight: 700;
            font-size: 1.2em;
        }
        .recipe-steps {
            list-style: none;
            padding: 0;
            margin: 0;
            counter-reset: step-counter;
        }
        .recipe-steps li {
            counter-increment: step-counter;
            padding: 10px 0 10px 44px;
            border-bottom: 1px solid rgba(36,62,50,0.06);
            font-size: 0.93rem;
            color: var(--text);
            position: relative;
            line-height: 1.5;
        }
        .recipe-steps li:last-child { border-bottom: none; }
        .recipe-steps li::before {
            content: counter(step-counter);
            position: absolute;
            left: 0;
            top: 10px;
            width: 28px;
            height: 28px;
            background: var(--sage-dark);
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.8rem;
            font-weight: 700;
        }
        .recipe-texture-note {
            background: linear-gradient(135deg, var(--ms-cream) 0%, #F0F7EE 100%);
            border: 1px solid rgba(54,92,66,0.4);
            border-radius: 12px;
            padding: 14px 16px;
            font-size: 0.9rem;
            color: var(--text);
            line-height: 1.5;
        }
        .recipe-texture-note strong {
            color: var(--sage-dark);
        }
        .allergen-badges {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }
        .allergen-badge {
            background: #FEE2E2;
            color: #B91C1C;
            border-radius: 20px;
            padding: 4px 12px;
            font-size: 0.8rem;
            font-weight: 600;
        }

        /* RECIPE — top action bar */
        .recipe-top-actions {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 16px;
        }
        .btn-recipe-print {
            background: none;
            border: 1.5px solid rgba(36,62,50,0.15);
            border-radius: 100px;
            padding: 6px 14px;
            font-size: 0.8rem;
            font-weight: 600;
            font-family: inherit;
            color: var(--text-light);
            cursor: pointer;
            transition: all 0.15s;
        }
        .btn-recipe-print:hover { border-color: var(--sage-dark); color: var(--sage-dark); }

        /* RECIPE — portion guide */
        .recipe-portion-note {
            background: linear-gradient(135deg, var(--ms-cream) 0%, #F0F7EE 100%);
            border: 1px solid rgba(54,92,66,0.4);
            border-radius: 12px;
            padding: 14px 16px;
            font-size: 0.92rem;
            color: var(--text);
            line-height: 1.6;
        }

        /* RECIPE — substitutions */
        .recipe-substitutions { display: flex; flex-direction: column; gap: 10px; }
        .substitution-row {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            padding: 10px 12px;
            background: rgba(54,92,66,0.06);
            border-radius: 10px;
            border: 1px solid rgba(54,92,66,0.2);
        }
        .sub-original {
            font-size: 0.88rem;
            font-weight: 600;
            color: var(--text);
            min-width: 110px;
            flex-shrink: 0;
            padding-top: 1px;
        }
        .sub-arrow {
            color: var(--sage-dark);
            font-weight: 700;
            font-size: 1rem;
            padding-top: 1px;
        }
        .sub-swap { flex: 1; }
        .sub-swap-name {
            display: block;
            font-size: 0.88rem;
            font-weight: 600;
            color: var(--sage-dark);
        }
        .sub-reason {
            display: block;
            font-size: 0.78rem;
            color: var(--text-light);
            margin-top: 2px;
            font-style: italic;
        }

        /* RECIPE — print styles */
        @media print {
            .recipe-top-actions, .btn-recipe-print, .no-print { display: none !important; }
            .recipe-detail { max-width: 100%; }
            .recipe-header { background: #f5f5f5; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
            .recipe-section { box-shadow: none; border: 1px solid #ddd; }
            .recipe-steps li::before { background: #7BA373; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
            .recipe-texture-note, .recipe-portion-note { background: #f9f9f9; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
            .substitution-row { background: #f9faf9; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
            body { background: white; }
            .app-nav { display: none !important; }
            .app-content { padding-top: 0; }
            @page { margin: 0.6in; }
        }
        /* ── ALLERGEN SAFETY BADGES ──────────────────────────────── */
        .allergen-warn-badge-btn {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            background: #FEF9C3;
            color: #854D0E;
            border: 1.5px solid #FDE047;
            border-radius: 20px;
            padding: 3px 10px;
            font-size: 0.73rem;
            font-weight: 600;
            cursor: pointer;
            transition: opacity 0.15s;
            line-height: 1.4;
        }
        .allergen-warn-badge-btn:hover { opacity: 0.8; }
        .allergen-new-badge-btn {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            background: #FFF7ED;
            color: #C2410C;
            border: 1.5px solid #FB923C;
            border-radius: 20px;
            padding: 3px 10px;
            font-size: 0.73rem;
            font-weight: 600;
            cursor: pointer;
            transition: opacity 0.15s;
            line-height: 1.4;
        }
        .allergen-new-badge-btn:hover { opacity: 0.8; }
        .meal-allergen-row {
            display: flex;
            flex-wrap: wrap;
            gap: 5px;
            margin: 5px 0 4px 0;
        }
        /* Allergen detail modal */
        #allergen-modal-bg {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.45);
            z-index: 2000;
            align-items: center;
            justify-content: center;
            padding: 16px;
        }
        #allergen-modal-bg.open { display: flex; }
        #allergen-modal {
            background: white;
            border-radius: 16px;
            padding: 24px 22px 18px;
            max-width: 420px;
            width: 100%;
            box-shadow: 0 8px 32px rgba(0,0,0,0.18);
        }
        .allergen-modal-title {
            font-size: 1.05rem;
            font-weight: 700;
            color: var(--text);
            margin-bottom: 6px;
        }
        .allergen-modal-status-chip {
            display: inline-block;
            border-radius: 20px;
            padding: 2px 10px;
            font-size: 0.75rem;
            font-weight: 600;
            margin-bottom: 14px;
        }
        .allergen-modal-status-chip.introducing { background:#FEF9C3; color:#854D0E; border:1.5px solid #FDE047; }
        .allergen-modal-status-chip.not_introduced { background:#FFF7ED; color:#C2410C; border:1.5px solid #FB923C; }
        .allergen-modal-aap {
            background: #F0FDF4;
            border: 1px solid #86EFAC;
            border-radius: 10px;
            padding: 12px 14px;
            font-size: 0.83rem;
            color: #166534;
            line-height: 1.6;
            margin-bottom: 16px;
        }
        .allergen-modal-actions { display: flex; gap: 10px; flex-wrap: wrap; }
        .allergen-modal-disclaimer {
            font-size: 0.72rem;
            color: var(--text-light);
            margin-top: 12px;
            text-align: center;
            line-height: 1.5;
        }
        /* Allergen intro tracker (child profile) */
        .allergen-tracker-section {
            background: var(--card-bg);
            border-radius: 14px;
            padding: 16px;
            border: 1px solid rgba(36,62,50,0.08);
            margin-bottom: 20px;
        }
        .allergen-tracker-title {
            font-size: 0.9rem;
            font-weight: 700;
            color: var(--text);
            margin-bottom: 3px;
        }
        .allergen-tracker-sub {
            font-size: 0.78rem;
            color: var(--text-light);
            margin-bottom: 14px;
            line-height: 1.5;
        }
        .allergen-tracker-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
            gap: 10px;
        }
        .allergen-tracker-item label {
            font-size: 0.78rem;
            font-weight: 600;
            color: var(--text);
            display: block;
            margin-bottom: 4px;
        }
        .allergen-tracker-select {
            width: 100%;
            font-size: 0.75rem;
            padding: 5px 8px;
            border: 1.5px solid rgba(36,62,50,0.2);
            border-radius: 8px;
            background: white;
            color: var(--text);
            cursor: pointer;
            outline: none;
        }
        .allergen-tracker-select:focus { border-color: var(--sage-dark); }
        .meal-name-link { background:none; border:0; padding:0; color:inherit; font:inherit; text-align:inherit; cursor:pointer; }
        .meal-name-link:focus-visible { outline:2px solid var(--sage-dark); outline-offset:4px; border-radius:3px; }
        .meal-name-link:hover { text-decoration: underline; text-decoration-color: var(--sage-dark); }

        /* ── TEXTURE PROGRESSION TIMELINE ───────────────────────── */
        .texture-timeline-section {
            background: white;
            border-radius: 14px;
            padding: 18px 20px;
            border: 1px solid rgba(36,62,50,0.08);
            margin-bottom: 20px;
        }
        .texture-timeline-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 16px;
        }
        .texture-timeline-title {
            font-size: 0.9rem;
            font-weight: 700;
            color: var(--text);
        }
        .texture-timeline-sub {
            font-size: 0.75rem;
            color: var(--text-light);
            margin-top: 2px;
        }
        .texture-stages-row {
            display: flex;
            align-items: flex-start;
            gap: 0;
            overflow-x: auto;
            padding-bottom: 4px;
        }
        .texture-stage-node {
            display: flex;
            flex-direction: column;
            align-items: center;
            flex: 1;
            min-width: 72px;
            position: relative;
        }
        .texture-stage-node:not(:last-child)::after {
            content: '';
            position: absolute;
            top: 14px;
            left: 50%;
            width: 100%;
            height: 2px;
            background: rgba(36,62,50,0.12);
            z-index: 0;
        }
        .texture-stage-node.reached:not(:last-child)::after {
            background: var(--sage);
        }
        .texture-stage-dot {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            border: 2.5px solid rgba(36,62,50,0.15);
            background: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.75rem;
            font-weight: 700;
            position: relative;
            z-index: 1;
            color: var(--text-light);
            transition: all 0.2s;
        }
        .texture-stage-node.reached .texture-stage-dot {
            border-color: var(--sage-dark);
            background: rgba(54,92,66,0.15);
            color: var(--sage-dark);
        }
        .texture-stage-node.current .texture-stage-dot {
            border-color: var(--sage-dark);
            background: var(--sage-dark);
            color: white;
            box-shadow: 0 0 0 4px rgba(123,163,115,0.2);
        }
        .texture-stage-node.next-up .texture-stage-dot {
            border-color: var(--soft-orange);
            color: var(--soft-orange);
            border-style: dashed;
        }
        .texture-stage-label {
            font-size: 0.65rem;
            font-weight: 600;
            color: var(--text-light);
            text-align: center;
            margin-top: 6px;
            line-height: 1.3;
            max-width: 72px;
        }
        .texture-stage-node.current .texture-stage-label,
        .texture-stage-node.reached .texture-stage-label {
            color: var(--text);
        }
        .texture-stage-date {
            font-size: 0.6rem;
            color: var(--text-light);
            text-align: center;
            margin-top: 2px;
        }
        .texture-stage-node.current .texture-stage-badge {
            display: inline-block;
            background: var(--sage-dark);
            color: white;
            font-size: 0.55rem;
            font-weight: 700;
            padding: 1px 5px;
            border-radius: 4px;
            margin-top: 2px;
            text-transform: uppercase;
            letter-spacing: 0.03em;
        }
        .texture-stage-node.next-up .texture-stage-badge {
            display: inline-block;
            background: rgba(244,162,97,0.15);
            color: var(--soft-orange);
            font-size: 0.55rem;
            font-weight: 700;
            padding: 1px 5px;
            border-radius: 4px;
            margin-top: 2px;
            text-transform: uppercase;
            letter-spacing: 0.03em;
        }
        .texture-history-list {
            margin-top: 14px;
            border-top: 1px solid rgba(36,62,50,0.06);
            padding-top: 12px;
        }
        .texture-history-item {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.78rem;
            color: var(--text-light);
            padding: 4px 0;
        }
        .texture-history-item:first-child { color: var(--text); font-weight: 500; }
        .texture-history-dot {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background: var(--sage);
            flex-shrink: 0;
        }
        .texture-history-item:first-child .texture-history-dot { background: var(--sage-dark); }

        /* ── HEART / FAVORITE BUTTON ─────────────────────────────── */
        .btn-heart {
            background: none;
            border: none;
            cursor: pointer;
            font-size: 1.15rem;
            line-height: 1;
            padding: 4px 6px;
            border-radius: 50%;
            transition: transform 0.15s, opacity 0.15s;
            opacity: 0.55;
            flex-shrink: 0;
        }
        .btn-heart:hover { transform: scale(1.25); opacity: 1; }
        .btn-heart.favorited { opacity: 1; }

        /* ── FAVORITES PAGE ──────────────────────────────────────── */
        .favorites-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
            gap: 14px;
            margin-top: 16px;
        }
        .fav-card {
            background: white;
            border-radius: 14px;
            padding: 16px;
            border: 1.5px solid rgba(36,62,50,0.1);
            position: relative;
            display: flex;
            flex-direction: column;
            gap: 8px;
            transition: box-shadow 0.2s;
        }
        .fav-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.07); }
        .fav-card-name {
            display: block;
            text-decoration: none;
            font-weight: 700;
            font-size: 0.95rem;
            color: var(--text);
            cursor: pointer;
            flex: 1;
        }
        .fav-card-name:hover { text-decoration: underline; text-decoration-color: var(--sage-dark); }
        .fav-card-meta {
            font-size: 0.78rem;
            color: var(--text-light);
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            align-items: center;
        }
        .fav-card-remove {
            position: absolute;
            top: 10px;
            right: 10px;
            background: none;
            border: none;
            cursor: pointer;
            color: rgba(36,62,50,0.3);
            font-size: 0.85rem;
            padding: 2px 5px;
            border-radius: 6px;
            transition: color 0.15s, background 0.15s;
        }
        .fav-card-remove:hover { color: var(--coral); background: rgba(231,111,81,0.07); }
        .fav-filter-row {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            margin: 12px 0 4px;
            align-items: center;
        }
        .fav-filter-btn {
            font-size: 0.8rem;
            font-weight: 600;
            padding: 5px 14px;
            border-radius: 100px;
            border: 1.5px solid rgba(36,62,50,0.15);
            background: white;
            color: var(--text-light);
            cursor: pointer;
            transition: all 0.15s;
            font-family: inherit;
        }
        .fav-filter-btn.active {
            background: var(--sage-dark);
            color: white;
            border-color: var(--sage-dark);
        }
        /* ── INCLUDE FAVORITES OPTION (plan modal) ───────────────── */
        .fav-option {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 12px 14px;
            border-radius: 10px;
            border: 1.5px solid rgba(36,62,50,0.1);
            background: rgba(255,249,243,0.7);
            margin-top: 10px;
            cursor: pointer;
            transition: background 0.15s, border-color 0.15s;
        }
        .fav-option.selected {
            background: rgba(54,92,66,0.15);
            border-color: var(--sage-dark);
        }
        .fav-option-info .option-title { font-size: 0.88rem; font-weight: 700; margin: 0 0 2px; }
        .fav-option-info .option-description { font-size: 0.78rem; color: var(--text-light); margin: 0; }
    :where(a,button,input,select,textarea):focus-visible{outline:3px solid var(--ms-ink);outline-offset:3px;box-shadow:0 0 0 6px var(--ms-cream);}

        @media (max-width: 900px) {
            .app-nav { position: relative; flex-wrap: wrap; gap: 12px; padding: 16px; }
            .app-nav .logo { white-space: nowrap; }
            .nav-actions { width: 100%; min-width: 0; flex-wrap: wrap; gap: 8px; }
            .nav-actions > * { max-width: 100%; }
            #navUser { flex-basis: 100%; overflow-wrap: anywhere; }
            .app-content { padding-top: 24px; }
            #onboarding-progress { position: static; }
        }
