/* ==========================================================
   Food Vigilant 2.0 - Clean Mobile-First Stylesheet
   Focused scanning interface, burger navigation, high readability
   ========================================================== */

:root {
    --brand: #10b981;
    --brand-dark: #059669;
    --brand-light: #d1fae5;
    --primary: #4f46e5;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --dark: #0f172a;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --danger: #ef4444;
    --warning: #f59e0b;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --radius-xl: 30px;
    --shadow: 0 10px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #0b1120;
    color: var(--text);
    line-height: 1.5;
    display: flex;
    justify-content: center;
}

.app-wrapper {
    width: 100%;
    max-width: 520px;
    height: 100vh;
    height: 100dvh;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(0,0,0,0.25);
}

/* ==========================================================
   Header: Burger Left, Centered Title, Spacer Right
   ========================================================== */
.app-header {
    height: 56px;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    position: relative;
    z-index: 40;
    flex-shrink: 0;
}

/* Burger Button */
.burger-btn {
    width: 40px;
    height: 40px;
    background: #f1f5f9;
    border: none;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.burger-btn:active {
    background: #e2e8f0;
}
.burger-btn .bar {
    width: 20px;
    height: 2.2px;
    background: #1e293b;
    border-radius: 2px;
}

/* Centered Header Brand */
.header-brand {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: none;
    white-space: nowrap;
}
.brand-icon {
    font-size: 1.35rem;
}
.brand-title {
    font-size: 1.22rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: #0f172a;
}

/* Header Spacer to keep Brand perfectly centered */
.header-spacer {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

/* Notification Bell Button */
.btn-notification-bell {
    width: 40px;
    height: 40px;
    background: #f1f5f9;
    border: none;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
    transition: background 0.15s ease, transform 0.1s ease;
    flex-shrink: 0;
}
.btn-notification-bell:active {
    background: #e2e8f0;
    transform: scale(0.95);
}
.btn-notification-bell .bell-icon {
    font-size: 1.25rem;
    line-height: 1;
}
.bell-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 800;
    min-width: 17px;
    height: 17px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.4);
}

/* ==========================================================
   Sub-Header Toolbar: User Pill & Language Toggle (Line 2)
   ========================================================== */
.app-subbar {
    height: 46px;
    min-height: 46px;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    position: relative;
    z-index: 35;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* User Pill (Left) */
.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    height: 32px;
    padding: 0 12px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #1e293b;
    cursor: pointer;
    border: 1px solid #cbd5e1;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    max-width: 170px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.15s ease;
    box-sizing: border-box;
}
.user-pill:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}
.user-pill:active {
    background: #cbd5e1;
    transform: scale(0.98);
}

/* Language Toggle Switch (Right of User Pill) */
.lang-toggle-box {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    padding: 2px 4px;
}
.lang-txt {
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    line-height: 1;
    transition: color 0.2s ease;
}
.lang-txt-en {
    color: #10b981;
    font-weight: 800;
}
.lang-txt-es {
    color: #94a3b8;
    font-weight: 600;
}
.toggle-track {
    position: relative;
    width: 44px;
    height: 24px;
    background: #cbd5e1;
    border-radius: 20px;
    padding: 2px;
    transition: background-color 0.22s ease;
    box-sizing: border-box;
    display: inline-block;
}
.toggle-circle {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}
.lang-toggle-box.is-es .toggle-track {
    background: #10b981;
}
.lang-toggle-box.is-es .toggle-circle {
    transform: translateX(20px);
}
.lang-toggle-box.is-es .lang-txt-en {
    color: #94a3b8;
    font-weight: 600;
}
.lang-toggle-box.is-es .lang-txt-es {
    color: #10b981;
    font-weight: 800;
}

/* ==========================================================
   Main Viewport: Dedicated Full-Screen Scan Window
   ========================================================== */
.main-viewport {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px;
    position: relative;
    background: #f8fafc;
    overflow: hidden;
}

/* Scan Window Card (Occupies almost the entire mobile height) */
.scan-window-card {
    width: 100%;
    height: 100%;
    max-height: 82vh;
    background: #0f172a;
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.22);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #1e293b;
}

/* Idle State (Camera is OFF at start) */
.camera-idle-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    z-index: 5;
    pointer-events: none;
}
.pulse-ring {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.15);
    border: 2px solid var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    animation: gentle-pulse 2s infinite ease-in-out;
}
@keyframes gentle-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { transform: scale(1.06); box-shadow: 0 0 0 16px rgba(16, 185, 129, 0); }
}
.scan-icon {
    font-size: 2.5rem;
}
.idle-title {
    color: #ffffff;
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.idle-subtitle {
    color: #94a3b8;
    font-size: 0.9rem;
    max-width: 240px;
    line-height: 1.4;
    margin-bottom: 22px;
}
.tap-hint-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #34d399;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(52, 211, 153, 0.3);
}

/* Active Video Layer */
.camera-video-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}
.camera-video-layer video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.camera-video-layer canvas {
    display: none;
}

/* Scanner Frame Overlay */
.scanner-frame {
    position: absolute;
    width: 78%;
    height: 52%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10;
}
.corner-bracket {
    position: absolute;
    width: 28px;
    height: 28px;
    border-color: #34d399;
    border-style: solid;
    border-width: 0;
}
.corner-bracket.tl { top: 0; left: 0; border-top-width: 3.5px; border-left-width: 3.5px; border-top-left-radius: 8px; }
.corner-bracket.tr { top: 0; right: 0; border-top-width: 3.5px; border-right-width: 3.5px; border-top-right-radius: 8px; }
.corner-bracket.bl { bottom: 0; left: 0; border-bottom-width: 3.5px; border-left-width: 3.5px; border-bottom-left-radius: 8px; }
.corner-bracket.br { bottom: 0; right: 0; border-bottom-width: 3.5px; border-right-width: 3.5px; border-bottom-right-radius: 8px; }

/* Sweeping Laser Line */
.laser-scanner {
    position: absolute;
    top: 0;
    left: 4%;
    right: 4%;
    height: 2.5px;
    background: linear-gradient(90deg, rgba(239, 68, 68, 0) 0%, #ef4444 50%, rgba(239, 68, 68, 0) 100%);
    box-shadow: 0 0 10px #ef4444;
    animation: laser-sweep 2s infinite ease-in-out alternate;
}
@keyframes laser-sweep {
    0% { top: 8%; opacity: 0.7; }
    100% { top: 92%; opacity: 1; }
}

.lock-indicator {
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(52, 211, 153, 0.4);
    backdrop-filter: blur(6px);
    color: #34d399;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.lock-indicator.locking {
    border-color: #f59e0b;
    color: #fbbf24;
}
.lock-indicator.locked {
    border-color: #10b981;
    color: #34d399;
    background: rgba(6, 95, 70, 0.95);
}
.lock-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
}

/* Floating Controls inside window */
.floating-controls {
    position: absolute;
    bottom: 20px;
    display: flex;
    gap: 12px;
    z-index: 20;
}
.float-btn {
    background: rgba(15, 23, 42, 0.75);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.float-btn.pause {
    background: rgba(239, 68, 68, 0.85);
    border-color: #ef4444;
}

/* Loading Indicator */
.loading-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(6px);
    z-index: 45;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}
.spinner-pulse {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================
   Scan Result View (Clean, structured, easy to close)
   ========================================================== */
.result-modal {
    display: none;
    position: absolute;
    inset: 0;
    background: var(--bg);
    z-index: 50;
    overflow-y: auto;
    padding: 10px 12px 28px;
}
.result-modal.active {
    display: block;
    animation: slide-up 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slide-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.result-card-inner {
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Result Top Header: Centered SCAN AGAIN Button + Barcode Badge */
.result-top-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #ffffff;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    width: 100%;
}
.barcode-badge {
    font-family: monospace;
    font-size: 0.9rem;
    font-weight: 700;
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #f1f5f9;
    padding: 3px 14px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    max-width: 100%;
}
.btn-close-result,
.btn-scan-again-top {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    border: none;
    padding: 8px 20px;
    border-radius: 22px;
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
    transition: all 0.15s ease;
    width: 100%;
    max-width: 240px;
}
.btn-close-result:active,
.btn-scan-again-top:active {
    background: #047857;
    transform: scale(0.97);
}

/* Status Banner */
.status-banner {
    padding: 6px 10px;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.status-banner.found {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.status-banner.under-review {
    background: #fef3c7;
    color: #92400e;
    border: 1.5px solid #f59e0b;
}
.status-banner.not_found {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}
.source-pill-mini {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(0,0,0,0.06);
}

.review-warning-card {
    background: #fffbeb;
    border: 1.5px dashed #f59e0b;
    border-radius: var(--radius-md);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Community Verification Action Bar */
.community-verify-bar {
    display: flex;
    gap: 8px;
    margin-top: 2px;
    margin-bottom: 2px;
}

.btn-flag-wrong {
    flex: 1;
    background: #fff5f5;
    border: 1.5px solid #f87171;
    color: #b91c1c;
    padding: 7px 10px;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-shadow: 0 1px 3px rgba(239, 68, 68, 0.08);
    transition: all 0.15s ease;
}
.btn-flag-wrong:hover, .btn-flag-wrong:active {
    background: #fee2e2;
    border-color: #dc2626;
    transform: scale(0.98);
}

.btn-confirm-acc {
    flex: 1;
    background: #f0fdf4;
    border: 1.5px solid #4ade80;
    color: #15803d;
    padding: 7px 10px;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-shadow: 0 1px 3px rgba(34, 197, 94, 0.08);
    transition: all 0.15s ease;
}
.btn-confirm-acc:hover, .btn-confirm-acc:active {
    background: #dcfce7;
    border-color: #16a34a;
    transform: scale(0.98);
}

/* ==========================================================
   Senior-Friendly Accessibility & Condition Pickers
   ========================================================== */
.senior-friendly-box {
    max-width: 440px;
}
.senior-input {
    font-size: 1.05rem !important;
    padding: 14px 16px !important;
    height: 52px;
}

.condition-picker-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 4px;
}

.cond-checkbox-card {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}
.cond-checkbox-card:hover {
    border-color: #cbd5e1;
}
.cond-checkbox-card input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: #10b981;
    margin-right: 14px;
    cursor: pointer;
    flex-shrink: 0;
}
.cond-checkbox-card:has(input:checked) {
    border-color: #10b981;
    background: #f0fdf4;
}
.cond-card-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.98rem;
    color: #1e293b;
    font-weight: 700;
}
.cond-icon {
    font-size: 1.3rem;
}

/* ==========================================================
   Personal Health Verdict Banners (Senior Friendly - Compact)
   ========================================================== */
.health-verdict-card {
    border-radius: var(--radius-md);
    padding: 9px 12px;
    border: 2px solid transparent;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}
.health-verdict-card.verdict-safe {
    background: #f0fdf4;
    border-color: #22c55e;
    color: #14532d;
}
.health-verdict-card.verdict-spike,
.health-verdict-card.verdict-danger {
    background: #fef2f2;
    border-color: #ef4444;
    color: #7f1d1d;
}
.health-verdict-card.verdict-caution {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #78350f;
}
.verdict-big-icon {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}
.verdict-content-box h3 {
    font-size: 0.94rem;
    font-weight: 900;
    letter-spacing: 0.2px;
    margin-bottom: 2px;
    line-height: 1.25;
}
.verdict-content-box p {
    font-size: 0.83rem;
    font-weight: 500;
    line-height: 1.35;
    opacity: 0.95;
    margin: 0;
}
.btn-edit-profile-inline {
    margin-top: 4px;
    background: none;
    border: none;
    color: currentColor;
    text-decoration: underline;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}

/* ==========================================================
   Locked Feature Card (When not signed in or not verified)
   ========================================================== */
.locked-feature-card {
    background: #f8fafc;
    border: 1.5px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: 10px 12px;
    text-align: center;
}
.locked-feature-card .lock-big-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 3px;
}
.locked-feature-card h3 {
    font-size: 0.94rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 3px;
}
.locked-feature-card p {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.35;
    margin-bottom: 8px;
}
.btn-unlock {
    background: #10b981;
    color: #ffffff;
    border: none;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}

/* ==========================================================
   Healthier Alternatives Section
   ========================================================== */
.alternatives-box {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}
.alternatives-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.alternatives-header h3 {
    font-size: 0.95rem;
    font-weight: 800;
    color: #065f46;
}
.alternatives-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.alternative-item-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    gap: 12px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.alternative-item-card:hover {
    background: #f1f5f9;
}
.alt-thumb {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.alt-info {
    flex: 1;
    min-width: 0;
}
.alt-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.alt-brand {
    font-size: 0.78rem;
    color: #64748b;
}
.alt-score-badge {
    background: #dcfce7;
    color: #15803d;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* Search Results in Modal */
.search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
}
.search-result-item:hover {
    background: #f8fafc;
}

/* Product Info Card */
.product-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    display: flex;
    gap: 12px;
    align-items: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}
.product-hero-thumb {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: #f8fafc;
    border: 1px solid var(--border);
    padding: 2px;
    flex-shrink: 0;
}
.product-hero-text h2 {
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.25;
    color: #0f172a;
    margin-bottom: 2px;
}
.product-hero-brand {
    font-size: 0.82rem;
    color: #64748b;
    font-weight: 600;
}

/* Health Analysis Grid */
.health-overview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.health-stat-box {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px 6px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.stat-box-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 2px;
}
.health-score-val {
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1;
}
.health-score-val.green { color: #10b981; }
.health-score-val.yellow { color: #f59e0b; }
.health-score-val.red { color: #ef4444; }

.badges-flow {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.badge-chip {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid var(--border);
}
.badge-chip.starch-none { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.badge-chip.starch-high { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

/* Alerts & Recs */
.alert-card-item {
    background: #ffffff;
    border-left: 4px solid #ef4444;
    padding: 8px 10px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    margin-bottom: 6px;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.alert-card-item.medium { border-left-color: #f59e0b; }
.rec-card-item {
    background: #ffffff;
    border-left: 4px solid #10b981;
    padding: 8px 10px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    margin-bottom: 6px;
    display: flex;
    gap: 8px;
}

/* Personalization / Diabetes Note Card */
.personal-note-card {
    background: #ffffff;
    border: 1.5px solid #d1fae5;
    border-radius: var(--radius-md);
    padding: 10px 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}
.personal-note-card h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #065f46;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.suitability-picker {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}
.suit-btn {
    flex: 1;
    padding: 5px 4px;
    border-radius: 6px;
    border: 1.5px solid var(--border);
    background: #f8fafc;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
}
.suit-btn.active.rec { background: #dcfce7; border-color: #10b981; color: #166534; }
.suit-btn.active.neu { background: #fef3c7; border-color: #f59e0b; color: #92400e; }
.suit-btn.active.avo { background: #fee2e2; border-color: #ef4444; color: #991b1b; }
.note-textarea {
    width: 100%;
    padding: 6px 8px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-size: 0.82rem;
    outline: none;
    font-family: inherit;
    resize: none;
    margin-bottom: 6px;
}
.guest-prompt-box {
    background: #f0fdf4;
    border: 1px dashed #34d399;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 0.82rem;
    color: #065f46;
}

/* Return to Home / Scan Again Bottom Button */
.btn-return-home,
.btn-scan-again-bottom {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 3px 8px rgba(16, 185, 129, 0.25);
    margin-top: 6px;
    margin-bottom: 6px;
    transition: all 0.15s ease;
}
.btn-return-home:active,
.btn-scan-again-bottom:active {
    transform: scale(0.98);
}

/* ==========================================================
   Burger Drawer Navigation
   ========================================================== */
.menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 100;
}
.menu-overlay.active { display: block; }

.burger-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 82%;
    max-width: 340px;
    background: #ffffff;
    z-index: 101;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 10px 0 30px rgba(0,0,0,0.2);
}
.burger-drawer.active {
    transform: translateX(0);
}

.drawer-header {
    padding: 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}
.user-profile-banner {
    display: flex;
    align-items: center;
    gap: 12px;
}
.avatar-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}
.close-drawer-btn {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: #64748b;
    cursor: pointer;
    padding: 6px;
}

.drawer-auth-box {
    padding: 14px 18px;
    display: flex;
    gap: 10px;
    border-bottom: 1px solid var(--border);
}
.btn-drawer-auth {
    flex: 1;
    padding: 9px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
}
.btn-drawer-auth.primary { background: var(--brand); color: #fff; }
.btn-drawer-auth.secondary { background: #f1f5f9; color: #1e293b; }
.btn-drawer-auth.danger { background: #fee2e2; color: #dc2626; width: 100%; }

.drawer-menu-list {
    list-style: none;
    padding: 12px 10px;
    flex: 1;
    overflow-y: auto;
}
.drawer-menu-list li {
    padding: 14px 16px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 14px;
    font-weight: 600;
    font-size: 0.95rem;
    color: #334155;
    cursor: pointer;
    transition: background 0.15s ease;
}
.drawer-menu-list li:active { background: #f1f5f9; }
.drawer-menu-list .item-icon { font-size: 1.25rem; }

.drawer-footer {
    padding: 16px 18px;
    border-top: 1px solid var(--border);
    background: #f8fafc;
}
.lang-selector-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.lang-toggle-pills {
    display: flex;
    background: #e2e8f0;
    border-radius: 20px;
    padding: 3px;
}
.lang-pill {
    border: none;
    background: none;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    color: #64748b;
}
.lang-pill.active {
    background: #ffffff;
    color: var(--brand-dark);
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

/* ==========================================================
   Modals (Manual input, Auth, History, Disclaimer)
   ========================================================== */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 120;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal-backdrop.active { display: flex; }

.modal-box {
    background: #ffffff;
    width: 100%;
    max-width: 440px;
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    animation: pop-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes pop-in {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.modal-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.modal-top h3 { font-size: 1.15rem; color: #0f172a; }
.modal-close {
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: 700;
}

.drawer-panel {
    background: #ffffff;
    width: 100%;
    max-width: 480px;
    height: 80vh;
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
}
.history-scroll-list {
    flex: 1;
    overflow-y: auto;
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Inputs & Form Elements */
.form-field {
    margin-bottom: 12px;
}
.form-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 4px;
}
.modern-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 0.95rem;
    outline: none;
    font-family: inherit;
    transition: border-color 0.15s ease;
}
.modern-input:focus {
    border-color: var(--brand);
}
.input-row {
    display: flex;
    gap: 8px;
}

.btn-brand {
    background: var(--brand);
    color: #ffffff;
    border: none;
    padding: 11px 20px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.15s ease;
}
.btn-brand:active { background: var(--brand-dark); }
.btn-brand.full { width: 100%; margin-top: 6px; }

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #0f172a;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 30px;
    font-size: 0.88rem;
    font-weight: 600;
    z-index: 200;
    opacity: 0;
    transition: all 0.28s ease;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    white-space: nowrap;
    max-width: 90%;
    text-overflow: ellipsis;
    overflow: hidden;
}
.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.toast.success { background: #065f46; border: 1px solid #10b981; }
.toast.error { background: #991b1b; border: 1px solid #ef4444; }
.toast.info { background: #1e293b; border: 1px solid #475569; }

/* ==========================================================
   Help, Donate, About Components (Senior Friendly)
   ========================================================== */
.freq-btn {
    padding: 12px 14px;
    border: 2px solid #cbd5e1;
    background: #f8fafc;
    color: #475569;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}
.freq-btn.active {
    border-color: var(--brand);
    background: #ecfdf5;
    color: var(--brand-dark);
}
.amount-btn {
    padding: 14px 10px;
    border: 2px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    border-radius: 12px;
    font-size: 1.15rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}
.amount-btn:hover {
    border-color: #94a3b8;
}
.amount-btn.active {
    border-color: var(--brand);
    background: #ecfdf5;
    color: var(--brand-dark);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}
.help-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.help-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* ==========================================================
   Announcement Cards (Senior Friendly)
   ========================================================== */
.announcement-card {
    border-radius: 12px;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-left: 5px solid #0284c7;
    background: #f8fafc;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
    transition: transform 0.15s ease;
}
.announcement-card.type-alert,
.announcement-card.type-recall {
    border-left-color: #ef4444;
    background: #fef2f2;
}
.announcement-card.type-tip {
    border-left-color: #10b981;
    background: #f0fdf4;
}
.announcement-card.type-update {
    border-left-color: #0284c7;
    background: #f0f9ff;
}
.announcement-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}
.announcement-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
}
.announcement-badge-pill {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 12px;
    letter-spacing: 0.5px;
}
.announcement-badge-pill.update { background: #e0f2fe; color: #0369a1; }
.announcement-badge-pill.tip { background: #dcfce7; color: #15803d; }
.announcement-badge-pill.alert,
.announcement-badge-pill.recall { background: #fee2e2; color: #b91c1c; }
.announcement-card-body {
    font-size: 0.88rem;
    color: #334155;
    line-height: 1.5;
    margin: 0;
}
.announcement-card-date {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 8px;
    display: block;
}


