/* ========================================================
   CalVis V2.0 Design System - Master Stylesheet
   Crafted with Google Stitch (M3) + Apple Health (HIG) + Impeccable
   ======================================================== */

:root {
    /* Color Palette - Google Stitch & Health Wellness */
    --primary: #10b981;
    --primary-rgb: 16, 185, 129;
    --primary-dark: #059669;
    --primary-light: #34d399;
    --primary-container: #d1fae5;
    --on-primary-container: #064e3b;
    
    --accent-blue: #0ea5e9;
    --accent-blue-rgb: 14, 165, 233;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    --accent-purple: #8b5cf6;

    /* Light Theme (M3 Surface Tones) */
    --bg-base: #f8fafc;
    --surface-1: #ffffff;
    --surface-2: #f1f5f9;
    --surface-3: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-subtle: rgba(226, 232, 240, 0.8);
    --border-glass: rgba(255, 255, 255, 0.4);

    /* Apple-style Elevation & Glass Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 8px 24px -4px rgba(16, 185, 129, 0.35);

    /* Glassmorphism Blur */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-blur: blur(16px);

    /* Radius & Spacing */
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    /* Dark Theme (OLED Black + Tonal Elevation) */
    --bg-base: #0a0f1d;
    --surface-1: #131b2e;
    --surface-2: #1e293b;
    --surface-3: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border-subtle: rgba(51, 65, 85, 0.6);
    --border-glass: rgba(255, 255, 255, 0.08);

    --primary-container: rgba(16, 185, 129, 0.15);
    --on-primary-container: #34d399;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 8px 24px -4px rgba(16, 185, 129, 0.25);

    --glass-bg: rgba(19, 27, 46, 0.88);
}

/* Base Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: 'Prompt', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    transition: background-color 0.3s ease;
}

/* Mobile Frame (Centered responsive canvas) */
.mobile-frame {
    width: 100%;
    max-width: 440px;
    height: 100vh;
    height: 100dvh;
    background: var(--bg-base);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.1);
}

@media (min-width: 480px) {
    .mobile-frame {
        height: 92vh;
        border-radius: 36px;
        border: 1px solid var(--border-subtle);
    }
}

/* App Header (Sticky Glassmorphic - Compact Two-Row Layout) */
.app-header {
    position: sticky;
    top: 0;
    z-index: 40;
    padding: calc(10px + env(safe-area-inset-top)) 18px 10px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.header-main-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.brand-greeting-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-logo-lockup {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 0.9;
}

.brand-logo-text {
    font-size: 21px;
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 0.9;
}

.brand-swoosh-svg {
    width: 84px;
    height: 10px;
    margin-top: -2px;
}

.header-dot-sep {
    color: var(--text-muted);
    opacity: 0.4;
    font-weight: 700;
    font-size: 15px;
}

.header-greeting-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.header-sub-row {
    width: 100%;
}

.header-encouragement-txt {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

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

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
    background: var(--surface-1);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.icon-btn:active {
    transform: scale(0.92);
}

.user-avatar-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    border: 2px solid var(--primary);
    background-size: cover;
    background-position: center;
    cursor: pointer;
    box-shadow: var(--shadow-xs);
}

/* Scroll Content */
.scroll-content {
    flex: 1;
    overflow-y: auto;
    padding: 18px 18px calc(110px + env(safe-area-inset-bottom));
    scroll-behavior: smooth;
}
.scroll-content::-webkit-scrollbar {
    display: none;
}

/* Views Management */
.view {
    display: none;
    animation: fadeIn 0.3s ease-in-out forwards;
}
.view.active {
    display: block;
}

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

/* Hero Glanceable Card (Apple-style Activity Dashboard) */
.hero-cal-card {
    background: linear-gradient(145deg, var(--surface-1) 0%, var(--surface-2) 100%);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 14px 16px 12px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

/* Greeting & Encouragement Banner */
.greeting-banner {
    margin-bottom: 14px;
    padding: 0 4px;
}
.greeting-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    line-height: 1.2;
}
.greeting-subtext {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.45;
    font-weight: 400;
}

/* Share Button on Hero Card */
.btn-share-hero {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}
.btn-share-hero:active {
    transform: scale(0.92);
    background: var(--primary);
    color: white;
}

/* Integrated Water Strip inside Hero Card */
.hero-water-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 10px 0 8px;
}
.hero-water-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.hero-water-info {
    flex: 1;
    min-width: 0;
}
.hero-water-label-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.hero-water-amount {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}
.hero-water-bar-bg {
    height: 6px;
    border-radius: var(--radius-full);
    background: var(--surface-3);
    overflow: hidden;
}
.hero-water-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, #38bdf8, var(--accent-blue));
    transition: width 0.4s ease;
}
.hero-water-chips {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.btn-water-micro {
    padding: 6px 10px;
    border-radius: var(--radius-full);
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition-fast);
}
.btn-water-micro:active {
    transform: scale(0.94);
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent-blue);
    border-color: rgba(56, 189, 248, 0.3);
}

/* Trio Veggie Shop Shopee Banner */
.shop-banner-trio {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    margin: 16px 0;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.shop-banner-trio:active {
    transform: scale(0.98);
}
.shop-banner-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.shop-banner-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.shop-banner-title {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -0.2px;
    line-height: 1.2;
}
.shop-banner-subtitle {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 2px;
}
.shop-banner-badge {
    background: rgba(255, 255, 255, 0.25);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.hero-cal-card::after {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.hero-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.badge-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    background: var(--primary-container);
    color: var(--on-primary-container);
}

.hero-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.metric-big {
    font-size: 34px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -1px;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.metric-unit {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 4px;
}

.metric-label {
    font-size: 11.5px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 500;
}

/* Activity Ring (SVG Radial Progress) */
.activity-ring-box {
    position: relative;
    width: 78px;
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.activity-ring-svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.ring-bg {
    stroke: var(--surface-3);
    stroke-width: 8;
    fill: transparent;
}

.ring-progress {
    stroke: var(--primary);
    stroke-width: 8;
    stroke-linecap: round;
    fill: transparent;
    stroke-dasharray: 251.2;
    stroke-dashoffset: 60;
    transition: stroke-dashoffset 0.8s ease;
}

.ring-center-icon {
    position: absolute;
    font-size: 20px;
}

/* Macros Pill Grid (Carbs, Protein, Fat) */
.macros-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.macro-pill {
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px 10px;
    text-align: center;
    box-shadow: var(--shadow-xs);
    transition: var(--transition);
}

.macro-pill:active {
    transform: scale(0.96);
}

.macro-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    display: inline-block;
    margin-right: 4px;
}
.dot-carb { background: var(--accent-amber); }
.dot-pro { background: var(--accent-rose); }
.dot-fat { background: var(--accent-blue); }

.macro-title {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.macro-val {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}

.macro-bar-bg {
    width: 100%;
    height: 4px;
    background: var(--surface-3);
    border-radius: var(--radius-full);
    margin-top: 8px;
    overflow: hidden;
}

.macro-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.6s ease;
}

/* Health Feature Cards (Water & IF) */
.feature-card {
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-xs);
    transition: var(--transition);
}

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

.feature-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.feature-icon-badge {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.badge-water {
    background: rgba(14, 165, 233, 0.15);
    color: var(--accent-blue);
}

.badge-if {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
}

.feature-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Water Tracker UI */
.water-display {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
}

.water-amount {
    font-size: 26px;
    font-weight: 700;
    color: var(--accent-blue);
    font-variant-numeric: tabular-nums;
}

.water-target-txt {
    font-size: 12px;
    color: var(--text-muted);
}

.liquid-progress-bg {
    width: 100%;
    height: 10px;
    background: var(--surface-2);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 14px;
}

.liquid-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #38bdf8 0%, #0284c7 100%);
    border-radius: var(--radius-full);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.water-quick-buttons {
    display: flex;
    gap: 8px;
}

.btn-water-chip {
    flex: 1;
    height: 42px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--surface-2);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-water-chip:active {
    transform: scale(0.94);
    background: var(--primary-container);
    color: var(--on-primary-container);
}

/* IF Timer UI */
.if-timer-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.if-time-digits {
    font-size: 26px;
    font-weight: 700;
    color: var(--accent-purple);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.5px;
}

.if-sub-status {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.btn-if-toggle {
    padding: 10px 18px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-if-toggle.start {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-if-toggle.stop {
    background: rgba(244, 63, 94, 0.15);
    color: var(--accent-rose);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.btn-if-toggle:active {
    transform: scale(0.95);
}

/* Food List Section */
.section-headline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 22px 0 12px;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.food-item-card {
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-xs);
    transition: var(--transition);
    cursor: pointer;
}

.food-item-card:active {
    transform: scale(0.98);
}

.food-thumb {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--surface-2);
}

.food-info {
    flex: 1;
}

.food-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

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

.food-cal-badge {
    text-align: right;
}

.food-cal-num {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

.food-cal-unit {
    font-size: 10px;
    color: var(--text-muted);
}

/* Modern Bottom Navigation (Ergonomic Thumb Bar) */
.bottom-nav-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(72px + env(safe-area-inset-bottom));
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 35;
}

.nav-tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 48px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    gap: 3px;
}

.nav-tab-item.active {
    color: var(--primary);
}

.nav-tab-icon {
    font-size: 20px;
}

.nav-tab-label {
    font-size: 10px;
    font-weight: 600;
}

/* Floating Action Button (FAB - Thumb Center) */
.fab-scan-btn {
    position: absolute;
    bottom: calc(40px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    width: 58px;
    height: 58px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.45);
    border: 3px solid var(--surface-1);
    cursor: pointer;
    z-index: 38;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fab-scan-btn:active {
    transform: translateX(-50%) scale(0.90);
}

/* Modals & Overlays */
.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100;
    display: none;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.modal-overlay.active {
    display: flex;
}

.modal-sheet {
    background: var(--surface-1);
    width: 100%;
    max-height: 85vh;
    border-radius: 28px 28px 0 0;
    padding: 24px;
    overflow-y: auto;
    border-top: 1px solid var(--border-glass);
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--surface-3);
    border-radius: var(--radius-full);
    margin: 0 auto 16px;
}

/* Google Sign-in Splash Screen */
.auth-splash-view {
    position: absolute;
    inset: 0;
    background: var(--bg-base);
    z-index: 90;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    text-align: center;
}

.auth-splash-logo {
    width: 80px;
    height: 80px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
    box-shadow: var(--shadow-glow);
    margin-bottom: 24px;
}

.auth-splash-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.auth-splash-desc {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 280px;
    margin-bottom: 32px;
    line-height: 1.5;
}

/* Primary Button */
.btn-primary-action {
    width: 100%;
    height: 50px;
    border-radius: var(--radius-md);
    background: var(--primary);
    color: white;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-glow);
    transition: var(--transition);
}

.btn-primary-action:active {
    transform: scale(0.98);
}

/* Toast */
.toast-bar {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--text-primary);
    color: var(--bg-base);
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    z-index: 120;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast-bar.show {
    transform: translateX(-50%) translateY(0);
}

/* ========================================================
   AI Meal Advisor Banner (Home Screen Smart Pill)
   ======================================================== */
.ai-coach-banner {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(14, 165, 233, 0.12) 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.ai-coach-banner:active {
    transform: scale(0.98);
}

.ai-coach-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.ai-pulse-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}

.ai-coach-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
}

.ai-coach-msg {
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.3;
}

.ai-coach-cta {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    background: var(--surface-1);
    padding: 6px 10px;
    border-radius: var(--radius-full);
    white-space: nowrap;
    box-shadow: var(--shadow-xs);
}

/* ========================================================
   Segmented Control (7 / 15 / 30 Days & Admin Tabs)
   ======================================================== */
.segmented-control {
    display: flex;
    background: var(--surface-2);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    margin-bottom: 16px;
}

.seg-btn {
    flex: 1;
    padding: 8px 10px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    border-radius: calc(var(--radius-md) - 4px);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.seg-btn.active {
    background: var(--surface-1);
    color: var(--primary);
    box-shadow: var(--shadow-xs);
}

/* ========================================================
   Quick Meals Tab (Category Chips & 1-Tap Add)
   ======================================================== */
.chip-filter-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    margin-bottom: 14px;
}
.chip-filter-bar::-webkit-scrollbar {
    display: none;
}

.chip-btn {
    padding: 7px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
    background: var(--surface-1);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.chip-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-quick-plus {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    border: none;
    background: var(--primary-container);
    color: var(--on-primary-container);
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-quick-plus:active {
    transform: scale(0.88);
    background: var(--primary);
    color: white;
}

/* ========================================================
   Unified Vector SVG Icon System (Theme-Adaptive Light/Dark)
   ======================================================== */
.svg-icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

.svg-icon-xs {
    width: 14px;
    height: 14px;
}

.svg-icon-sm {
    width: 16px;
    height: 16px;
}

.svg-icon-md {
    width: 22px;
    height: 22px;
}

.svg-icon-lg {
    width: 26px;
    height: 26px;
}

.food-vector-badge {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--border-subtle);
}

.food-vector-badge.cat-protein {
    background: rgba(244, 63, 94, 0.12);
    color: var(--accent-rose);
}

.food-vector-badge.cat-thai {
    background: rgba(16, 185, 129, 0.12);
    color: var(--primary);
}

.food-vector-badge.cat-drink {
    background: rgba(14, 165, 233, 0.12);
    color: var(--accent-blue);
}

.nav-tab-item .svg-icon {
    width: 22px;
    height: 22px;
    transition: transform 0.2s ease, stroke-width 0.2s ease;
}

.nav-tab-item.active .svg-icon {
    stroke-width: 2.4;
    transform: translateY(-1px);
}


