/* ==========================================================================
   Know Your Food (KYF) - Master Unified CSS Design System
   Single Master Stylesheet for ALL 7 Website Pages
   ========================================================================== */

:root {
  /* Dark Mode Palette (Default Obsidian Canvas) */
  --bg-canvas: #0b0f19;
  --bg-canvas-subtle: #0f172a;
  --bg-surface: #1e293b;
  
  --card-bg: #1e293b;
  --card-bg-hover: #1e293b;
  --card-border: rgba(255, 255, 255, 0.12);
  --card-border-hover: rgba(16, 185, 129, 0.5);
  
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-green: #10b981;
  --accent-green-hover: #059669;
  --accent-green-glow: rgba(16, 185, 129, 0.35);
  
  --accent-indigo: #6366f1;

  /* Grade Tiers */
  --grade-a: #10b981;
  --grade-b: #84cc16;
  --grade-c: #eab308;
  --grade-d: #d97706;
  --grade-e: #ea580c;
  --grade-f: #ef4444;

  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 35px rgba(16, 185, 129, 0.25);
  
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

/* Light Theme Overrides - High Contrast WCAG AAA Compliant */
[data-theme="light"] {
  --bg-canvas: #f8fafc;
  --bg-canvas-subtle: #f1f5f9;
  --bg-surface: #ffffff;
  
  --card-bg: #ffffff;
  --card-bg-hover: #ffffff;
  --card-border: #e2e8f0;
  --card-border-hover: #10b981;
  
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --accent-green: #059669;
  --accent-green-hover: #047857;
  --accent-green-glow: rgba(5, 150, 105, 0.2);

  --shadow-card: 0 8px 25px rgba(15, 23, 42, 0.08);
}

/* ─── 1. Global Reset & Utilities ────────────────────────────────────────────── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

ul, ol, li {
  list-style: none !important;
  list-style-type: none !important;
  padding-left: 0 !important;
  margin-left: 0 !important;
}

html {
  background-color: var(--bg-canvas);
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  max-width: 100%;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

a {
  color: var(--accent-green);
  text-decoration: none;
  font-weight: 600;
}

a:hover { color: var(--accent-green-hover); }

/* Accessible Focus States (UI UX Pro Max Rule §Interaction) */
:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 3px var(--accent-green-glow) !important;
  border-color: var(--accent-green) !important;
}

/* Micro-Interaction Pressed States (UI UX Pro Max Rule §App Interaction) */
.btn:active,
.scanner-tab:active,
.preset-chip:active,
.sample-photo-chip:active,
.theme-toggle-btn:active {
  transform: scale(0.97);
  transition: transform 0.1s cubic-bezier(0.16, 1, 0.3, 1);
}

.kyf-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  width: 100%;
}

.text-center { text-align: center; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mb-5 { margin-bottom: 40px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.d-block { display: block; }

/* Reusable Design Token Color Classes (Clean CSS Parity) */
.text-carcinogenic { color: #dc2626 !important; }
.text-hazard { color: #ea580c !important; }
.text-pediatric { color: #6366f1 !important; }
.text-safe { color: #10b981 !important; }

/* ─── 2. Header Navbar ──────────────────────────────────────────────────────── */
.kyf-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(11, 15, 25, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1.5px solid var(--card-border);
}

[data-theme="light"] .kyf-header {
  background: rgba(255, 255, 255, 0.92);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(99, 102, 241, 0.25));
  border: 1.5px solid rgba(16, 185, 129, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-green);
  font-size: 18px;
}

.brand-name {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 900;
  color: var(--text-primary);
  white-space: nowrap;
}

.mobile-auth-links {
  display: none !important;
}

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

.nav-link {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.nav-link i {
  font-size: 14px;
  flex-shrink: 0;
  opacity: 0.85;
}

.nav-link:hover {
  color: var(--accent-green);
  background: rgba(16, 185, 129, 0.08);
}

.nav-link.active {
  color: var(--accent-green);
  background: rgba(16, 185, 129, 0.14);
  font-weight: 800;
}

.nav-link.active i {
  opacity: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.theme-toggle-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.theme-toggle-btn:hover {
  border-color: var(--accent-green);
}

.sun-icon { display: none; }
.moon-icon { display: block; }
[data-theme="light"] .sun-icon { display: block; color: #d97706; }
[data-theme="light"] .moon-icon { display: none; }

.mobile-nav-toggle {
  display: none !important;
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-sm);
  width: 42px;
  height: 42px;
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* ─── 3. Global Buttons ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-full);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-sm { padding: 8px 18px; font-size: 13px; white-space: nowrap; flex-shrink: 0; }
.btn-lg { padding: 14px 32px; font-size: 16px; white-space: nowrap; flex-shrink: 0; }

.btn-primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff !important;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.btn-outline {
  background: var(--card-bg);
  color: var(--text-primary);
  border: 1.5px solid var(--card-border);
}

.btn-outline:hover {
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.btn-outline-danger {
  background: transparent;
  color: #ef4444;
  border: 1.5px solid #ef4444;
  border-radius: var(--radius-full);
  padding: 10px 22px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.btn-outline-danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* ─── 4. Home Landing Page & AI Food Scanner (index.php) ─────────────────────── */
.hero-section { padding: 60px 0 40px; text-align: center; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.12);
  border: 1.5px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-green);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 20px;
}

.hero-title {
  font-size: 48px;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.hero-title .highlight { color: var(--accent-green); }

.hero-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0 auto 40px;
  font-weight: 500;
}

.scanner-card {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-card);
  text-align: left;
  margin-bottom: 60px;
}

.scanner-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--card-border);
  padding-bottom: 12px;
}

.scanner-tab {
  padding: 10px 20px;
  min-height: 44px;
  border-radius: var(--radius-full);
  background: var(--bg-canvas-subtle);
  border: 1.5px solid var(--card-border);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.scanner-tab:hover {
  border-color: var(--accent-green);
  color: var(--text-primary);
}

.scanner-tab.active {
  background: var(--accent-green);
  color: #ffffff;
  border-color: var(--accent-green);
  box-shadow: 0 4px 14px var(--accent-green-glow);
}

.photo-dropzone {
  border: 2.5px dashed var(--accent-green);
  border-radius: var(--radius-md);
  padding: 40px 24px;
  text-align: center;
  background: rgba(16, 185, 129, 0.04);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.photo-dropzone:hover, .photo-dropzone.drag-over {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--accent-green-hover);
  box-shadow: inset 0 0 20px rgba(16, 185, 129, 0.15);
}

.dropzone-icon { font-size: 44px; color: var(--accent-green); margin-bottom: 12px; }
.dropzone-title { font-size: 18px; font-weight: 800; color: var(--text-primary); margin-bottom: 6px; }
.dropzone-sub { font-size: 13px; color: var(--text-secondary); }
.hidden-file-input { display: none; }

.sample-photos-group { margin-top: 16px; }

.sample-photo-chip {
  padding: 8px 16px;
  min-height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-canvas-subtle);
  border: 1.5px solid var(--card-border);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  margin-right: 8px;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}
  background: var(--bg-canvas-subtle);
  border: 1.5px solid var(--card-border);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  margin-right: 8px;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sample-photo-chip:hover { border-color: var(--accent-green); color: var(--accent-green); }

.photo-preview-box { display: none; text-align: center; margin-top: 20px; position: relative; }
.preview-img { max-height: 240px; border-radius: var(--radius-md); border: 2px solid var(--accent-green); box-shadow: var(--shadow-card); }

.scan-beam {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  height: 4px;
  background: var(--accent-green);
  box-shadow: 0 0 15px var(--accent-green);
  animation: scanBeamAnim 2s infinite ease-in-out;
  display: none;
}

@keyframes scanBeamAnim {
  0% { top: 10%; }
  50% { top: 85%; }
  100% { top: 10%; }
}

.scanner-textarea {
  width: 100%;
  min-height: 120px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--bg-canvas-subtle);
  border: 1.5px solid var(--card-border);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  resize: vertical;
  outline: none;
}

.results-container {
  display: none;
  margin-top: 32px;
  padding-top: 32px;
  border-top: 2px solid var(--card-border);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 40px 0 80px;
  width: 100%;
}

.feature-card {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 32px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  transition: all var(--transition-fast);
}

.feature-card:hover {
  border-color: var(--accent-green);
  transform: translateY(-4px);
}

.feature-icon-wrapper {
  margin-bottom: 20px;
  display: inline-block;
}

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(16, 185, 129, 0.15);
  border: 1.5px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-green);
  font-size: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.feature-card h3 { font-size: 20px; margin-bottom: 10px; }
.feature-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

/* ─── 5. E-Number Directory Page (dictionary.php) ───────────────────────────── */
.preset-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chip-label {
  font-weight: 800;
  font-size: 13px;
  color: var(--text-primary);
}

.preset-chip, .dict-filter-pill {
  padding: 8px 18px;
  min-height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-canvas-subtle);
  border: 1.5px solid var(--card-border);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.preset-chip:hover, .dict-filter-pill:hover {
  border-color: var(--accent-green);
  color: var(--text-primary);
}

.dict-filter-pill.active {
  background: var(--accent-green);
  color: #ffffff !important;
  border-color: var(--accent-green) !important;
  box-shadow: 0 4px 12px var(--accent-green-glow);
}

.dict-filter-pill.filter-pill-carcinogenic { color: #dc2626; border-color: rgba(220, 38, 38, 0.3); }
.dict-filter-pill.filter-pill-hazard { color: #ea580c; border-color: rgba(234, 88, 12, 0.3); }
.dict-filter-pill.filter-pill-child { color: #6366f1; border-color: rgba(99, 102, 241, 0.3); }
.dict-filter-pill.filter-pill-safe { color: #10b981; border-color: rgba(16, 185, 129, 0.3); }

.dict-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.additive-card-bento {
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.enumber-pill {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
  display: inline-block;
  margin-bottom: 6px;
}

.additive-title { font-size: 18px; font-weight: 800; color: var(--text-primary); }
.additive-cat { font-size: 12px; color: var(--text-secondary); display: block; margin-top: 2px; }

.hazard-badge-pill {
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 900;
}

.hazard-carcinogenic, .hazard-extreme { background: rgba(220, 38, 38, 0.15); color: #dc2626; border: 1px solid rgba(220, 38, 38, 0.3); }
.hazard-high { background: rgba(234, 88, 12, 0.15); color: #ea580c; border: 1px solid rgba(234, 88, 12, 0.3); }
.hazard-moderate { background: rgba(234, 179, 8, 0.15); color: #eab308; border: 1px solid rgba(234, 179, 8, 0.3); }
.hazard-safe { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }

.additive-desc { font-size: 13.5px; color: var(--text-secondary); margin: 12px 0 16px; line-height: 1.6; }

.health-risks-group { margin-top: auto; }
.risks-label { font-size: 10px; font-weight: 900; color: var(--text-muted); letter-spacing: 0.05em; display: block; margin-bottom: 6px; }
.risks-flex { display: flex; flex-wrap: wrap; gap: 6px; }

.risk-tag {
  background: var(--bg-canvas-subtle);
  border: 1px solid var(--card-border);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}

/* ─── 6. User Auth & Verification Pages (login.php & signup.php) ────────────── */
.auth-page-container {
  min-height: calc(100vh - 180px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-card);
}

.auth-header { text-align: center; margin-bottom: 24px; }
.auth-header h2 { font-size: 24px; margin-bottom: 4px; }
.auth-header p { font-size: 13px; color: var(--text-secondary); }

.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 12px; font-weight: 800; color: var(--text-secondary); margin-bottom: 6px; letter-spacing: 0.04em; }

.form-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--bg-canvas-subtle);
  border: 1.5px solid var(--card-border);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  outline: none;
}

.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.otp-inputs {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 24px 0;
  width: 100%;
}

.otp-box {
  width: 48px;
  height: 56px;
  font-size: 24px;
  font-weight: 900;
  text-align: center;
  border-radius: var(--radius-md);
  background: var(--bg-canvas-subtle);
  border: 2px solid var(--card-border);
  color: var(--text-primary);
  outline: none;
}

/* ─── 7. High-End Web Profile Dashboard Layout (profile.php) ──────────────── */
.profile-dashboard { padding: 40px 0 60px; }

/* Hero Banner */
.profile-hero-banner {
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: 20px;
  padding: 24px 32px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 24px;
}

.profile-hero-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.profile-avatar-lg {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-size: 28px;
  font-weight: 900;
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.35);
}

.profile-user-name {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 900;
  color: var(--text-primary);
}

.badge-verified {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
}

.profile-user-email { font-size: 14px; color: var(--text-secondary); margin-top: 2px; }
.profile-hero-actions { display: flex; gap: 12px; }

/* Personalized Health Goal Banner */
.health-goal-banner {
  background: rgba(16, 185, 129, 0.08);
  border: 1.5px solid rgba(16, 185, 129, 0.3);
  border-radius: 16px;
  padding: 16px 24px;
  box-shadow: var(--shadow-card);
  margin-bottom: 28px;
  transition: all 0.3s ease;
}

.goal-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.15);
  border: 1.5px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

/* 4 Bento Health Metrics Grid - Clean Gaps */
.health-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

.metric-card {
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 145px;
}

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

.metric-card-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.bmi-badge {
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 900;
  border: 1.5px solid transparent;
}

.metric-value-lg {
  font-family: 'Outfit', sans-serif;
  font-size: 34px;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.1;
}

.metric-value-lg .unit {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.metric-sub-detail {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
}

.body-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat-mini {
  background: var(--bg-canvas-subtle);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 8px;
  text-align: center;
}

.stat-mini-val { font-family: 'Outfit', sans-serif; font-size: 15px; font-weight: 800; color: var(--text-primary); display: block; }
.stat-mini-lbl { font-size: 9px; font-weight: 800; color: var(--text-secondary); letter-spacing: 0.04em; }

/* 2-Column Analytics Section */
.profile-analytics-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 28px;
  margin-bottom: 32px;
}

.analytics-card {
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow-card);
}

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

.stat-label-text {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.calorie-fraction-display {
  font-family: 'Outfit', sans-serif;
  font-size: 28px;
  font-weight: 900;
  color: var(--text-primary);
}

.calorie-fraction-display .goal-sub {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 600;
}

.pct-badge {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 900;
}

.progress-bar-track {
  width: 100%;
  height: 10px;
  background: var(--bg-canvas-subtle);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 20px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  border-radius: 99px;
  transition: width 0.6s ease;
}

.quick-log-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.quick-log-input {
  flex: 1;
  background: var(--bg-canvas-subtle);
  border: 1.5px solid var(--card-border);
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}

.quick-log-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 0 20px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
}

.chart-card-title { font-size: 18px; font-weight: 800; color: var(--text-primary); margin-top: 2px; }

.chart-legend-row {
  display: flex;
  gap: 14px;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.green { background: #10b981; }
.dot.orange { background: #ea580c; }
.dot.blue { background: #3b82f6; }

/* Empty Bar Capsules + Green Fill + Numeric Labels */
.chart-flex-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.chart-target-line {
  border-bottom: 1.5px dashed var(--accent-green);
  position: relative;
  margin-bottom: 12px;
  padding-bottom: 4px;
}

.chart-target-lbl {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-green);
}

.chart-bars-flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: 190px;
  padding-top: 24px;
  border-bottom: 1.5px solid var(--card-border);
}

.chart-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar-val {
  font-size: 11px;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 6px;
  min-height: 16px;
}

/* Empty Capsule Container (Always Visible) */
.chart-bar-capsule {
  width: 32px;
  height: 130px;
  background: rgba(16, 185, 129, 0.05);
  border: 1.5px solid var(--card-border);
  border-radius: 10px 10px 4px 4px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

[data-theme="light"] .chart-bar-capsule {
  background: rgba(15, 23, 42, 0.03);
  border-color: #cbd5e1;
}

/* Green Fill Bar showing logged calories */
.chart-bar-fill {
  width: 100%;
  background: linear-gradient(180deg, #10b981, #059669);
  border-radius: 8px 8px 0 0;
  transition: height 0.6s ease;
}

.chart-bar-fill.exceeded {
  background: linear-gradient(180deg, #ef4444, #b91c1c);
}

.chart-bar-day {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-secondary);
  margin-top: 10px;
}

.chart-bar-day.today { color: var(--accent-green); font-weight: 900; }

/* Logged Meals Feed List */
.meal-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--card-border);
}

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

.meal-grade-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
}

.meal-grade-text {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 900;
  color: #ffffff;
}

.meal-info-col { flex: 1; }
.meal-name-text { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.meal-time-text { font-size: 12px; color: var(--text-secondary); }

.delete-meal-btn {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 16px;
  cursor: pointer;
  padding: 6px;
}

.empty-meals-msg { font-size: 13px; color: var(--text-secondary); font-style: italic; padding: 10px 0; }

/* Modals & Inputs */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-card {
  width: 100%;
  max-width: 500px;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 20px;
  padding: 32px;
  box-shadow: var(--shadow-card);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  border-bottom: 1.5px solid var(--card-border);
  padding-bottom: 16px;
}

.modal-close-btn { background: none; border: none; font-size: 28px; color: var(--text-secondary); cursor: pointer; }

/* ─── 8. Footer Component ───────────────────────────────────────────────────── */
.kyf-footer {
  margin-top: auto;
  background: var(--bg-canvas-subtle);
  border-top: 2px solid var(--card-border);
  padding-top: 60px;
  width: 100%;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 40px;
  margin-bottom: 40px;
  width: 100%;
}

.footer-col { display: flex !important; flex-direction: column !important; gap: 10px !important; }
.footer-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.footer-title { font-size: 15px; font-weight: 800; margin-bottom: 14px; color: var(--text-primary); }

.footer-links, .footer-links li { list-style: none !important; padding: 0 !important; margin: 0 !important; }
.footer-links { display: flex !important; flex-direction: column !important; gap: 10px !important; }
.footer-links a { font-size: 13.5px; color: var(--text-secondary); font-weight: 600; }
.footer-links a:hover { color: var(--accent-green); }

.playstore-teaser-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-radius: 14px;
  background: var(--bg-canvas-subtle);
  border: 1.5px solid var(--card-border);
  transition: all var(--transition-fast);
}

.playstore-teaser-badge:hover {
  border-color: var(--accent-green);
}

.bottom-links {
  display: flex;
  gap: 20px;
  align-items: center;
}

.footer-bottom { border-top: 1px solid var(--card-border); padding: 20px 0; font-size: 12px; color: var(--text-muted); }
.bottom-flex { display: flex; align-items: center; justify-content: space-between; }

@media (max-width: 1100px) {
  .nav-menu { gap: 6px; }
  .nav-link { font-size: 13px; padding: 6px 10px; }
  .dict-cards-grid { grid-template-columns: 1fr; }
  .health-metrics-grid { grid-template-columns: 1fr 1fr; }
  .profile-analytics-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .kyf-container {
    padding: 0 16px;
  }

  .nav-wrapper {
    height: 64px;
    gap: 8px;
  }

  .brand-logo {
    gap: 8px;
  }

  .brand-name {
    font-size: 16px;
    white-space: nowrap;
  }

  .logo-icon {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }

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

  .header-actions .btn {
    display: none !important;
  }

  .mobile-nav-toggle {
    display: flex !important;
    width: 40px;
    height: 40px;
    font-size: 20px;
    flex-shrink: 0;
    margin-left: 4px;
  }

  .mobile-auth-links {
    display: block !important;
  }

  .nav-menu {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    width: 100%;
    background: var(--bg-canvas);
    border-bottom: 2px solid var(--card-border);
    flex-direction: column;
    align-items: stretch;
    padding: 20px 20px;
    gap: 10px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    z-index: 999;
  }

  .nav-menu.active {
    display: flex !important;
    animation: mobileNavSlide 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

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

  .nav-link {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-canvas-subtle);
    border: 1px solid var(--card-border);
    font-size: 14.5px;
    width: 100%;
  }

  .mobile-nav-toggle {
    display: flex !important;
    width: 38px;
    height: 38px;
    font-size: 18px;
  }

  /* Hero Section Mobile Polish */
  .hero-section {
    padding: 24px 0 20px;
  }

  .hero-title {
    font-size: 26px;
    line-height: 1.25;
    margin-bottom: 12px;
  }

  .hero-subtitle {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 24px;
    padding: 0 4px;
  }

  .hero-badge {
    font-size: 10.5px;
    padding: 4px 12px;
    margin-bottom: 14px;
  }

  /* Scanner Widget Mobile Polish */
  .scanner-card {
    padding: 20px 14px;
    margin-bottom: 40px;
    border-radius: var(--radius-md);
  }

  .scanner-tabs {
    flex-direction: column;
    gap: 8px;
    border-bottom: none;
    padding-bottom: 0;
  }

  .scanner-tab {
    width: 100%;
    justify-content: center;
  }

  .photo-dropzone {
    padding: 28px 16px;
  }

  .dropzone-icon {
    font-size: 36px;
    margin-bottom: 8px;
  }

  .dropzone-title {
    font-size: 15px;
  }

  .dropzone-sub {
    font-size: 12px;
  }

  .sample-photo-chip {
    width: 100%;
    justify-content: center;
    margin-right: 0;
  }

  /* 1-Column Responsive Grids */
  .features-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    margin: 24px 0 40px !important;
  }

  .feature-card {
    padding: 24px 20px;
  }

  .dict-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .health-metrics-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
    text-align: center;
  }

  .footer-col {
    align-items: center !important;
    text-align: center !important;
  }

  .footer-links {
    align-items: center !important;
  }

  .form-row-2 {
    grid-template-columns: 1fr;
  }

  .bottom-flex {
    flex-direction: column;
    gap: 12px;
    text-align: center;
    width: 100%;
  }

  .bottom-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    max-width: 100%;
  }

  .preset-chips {
    flex-wrap: wrap;
    max-width: 100%;
  }

  .scanner-card, .feature-card, .additive-card-bento, .auth-card, .modal-card, .health-goal-banner, .analytics-card, .metric-card {
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .scan-beam {
    max-width: 90%;
  }
}
