/* ============================================================
   NutriSnap — styles.css
   ============================================================ */

:root {
  --c-red:     #3d6b4a;
  --c-orange:  #c67b4d;
  --c-yellow:  #d4a843;
  --c-teal:    #5a9668;
  --c-blue:    #3A7BD5;
  --c-purple:  #a18cd1;
  --c-green:   #88b87a;
  --c-pink:    #fd79a8;
  --c-danger:  #c67b4d;

  --grad-header:  linear-gradient(135deg, #3d6b4a 0%, #5a9668 55%, #88b87a 100%);
  --grad-teal:    linear-gradient(135deg, #5a9668, #3d6b4a);
  --grad-blue:    linear-gradient(135deg, #3A7BD5, #00D2FF);
  --grad-green:   linear-gradient(135deg, #3d6b4a, #88b87a);
  --grad-purple:  linear-gradient(135deg, #a18cd1, #fbc2eb);
  --grad-card:    linear-gradient(135deg, #f5faf4, #fff);

  --bg:         #edf2e9;
  --card:       #FFFFFF;
  --border:     rgba(61,107,74,0.12);
  --shadow:     0 4px 24px rgba(61,107,74,0.09);
  --shadow-lg:  0 8px 40px rgba(61,107,74,0.16);
  --radius:     20px;
  --radius-sm:  12px;
  --radius-xs:  8px;
  --font:       'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --text:       #2d4e35;
  --text-2:     #5a7a62;
  --text-3:     #8aba96;
  --nav-h:      68px;
  --header-h:   60px;
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { height:100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button { cursor:pointer; border:none; background:none; font-family:inherit; }
input, select, textarea { font-family:inherit; }
img { max-width:100%; display:block; }
a { color:inherit; text-decoration:none; }

/* ── App shell ────────────────────────────────────────────── */
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background: var(--bg);
}

/* ── Splash ───────────────────────────────────────────────── */
.splash {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  gap: 12px;
  background: var(--grad-header);
}
.splash-logo  { font-size: 72px; animation: bounce 0.8s ease infinite alternate; }
.splash-name  { font-size: 32px; font-weight: 800; color: #fff; letter-spacing: -0.5px; }
.splash-spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-top: 12px;
}
@keyframes spin   { to { transform: rotate(360deg); } }
@keyframes bounce { to { transform: translateY(-10px); } }
@keyframes fadeIn { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:none; } }
@keyframes slideUp { from { transform:translateY(100%); } to { transform:none; } }
@keyframes pop { 0%{transform:scale(0.8);opacity:0} 60%{transform:scale(1.05)} 100%{transform:scale(1);opacity:1} }

/* ── Header ───────────────────────────────────────────────── */
.header {
  position: sticky; top:0; z-index:100;
  background: var(--grad-header);
  height: var(--header-h);
  display: flex; align-items: center;
  padding: 0 16px;
  gap: 10px;
  border-radius: 0 0 20px 20px;
  box-shadow: 0 4px 16px rgba(61,107,74,0.25);
}
.header-back {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.25);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
  flex-shrink: 0;
}
.header-back:active { opacity:0.7; }
.header-title { font-size: 18px; font-weight: 700; color:#fff; flex:1; }
.header-action {
  background: rgba(255,255,255,0.25);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px; font-weight: 600; color:#fff;
}
.lang-btn {
  background: rgba(255,255,255,0.25);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 24px; font-weight: 900; color:#fff;
  letter-spacing: 0.5px;
}

/* ── Bottom Nav ───────────────────────────────────────────── */
.nav {
  position: fixed; bottom:0; left:50%; transform:translateX(-50%);
  width: 100%; max-width: 480px;
  height: var(--nav-h);
  background: #fff;
  display: flex; align-items: stretch;
  box-shadow: 0 -2px 20px rgba(29,83,53,0.08);
  z-index: 200;
  border-top: 1px solid rgba(29,83,53,0.09);
  padding: 8px 6px 0;
}
.nav-item {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px;
  font-size: 10px; font-weight: 500;
  color: #b3ccb8;
  transition: color 0.2s;
  padding-bottom: 10px;
  background: none; border: none; cursor: pointer;
}
.nav-item.active { color: var(--c-red); }
.nav-center-btn {
  background: var(--grad-header);
  border-radius: 50%;
  width: 52px; height: 52px;
  margin-top: -14px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(61,107,74,0.45);
  flex-shrink: 0;
  transition: transform 0.15s;
}
.nav-center-btn:active { transform: scale(0.93); }

/* ── Screen container ─────────────────────────────────────── */
.screen {
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + 16px);
  animation: fadeIn 0.3s ease;
}
.screen-full {
  min-height: 100vh;
  animation: fadeIn 0.3s ease;
}

/* ── Welcome screen ───────────────────────────────────────── */
.welcome-hero {
  background: var(--grad-header);
  padding: 40px 24px 36px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.welcome-hero::after {
  content:'';
  position:absolute; bottom:-20px; left:0; right:0;
  height:40px;
  background: var(--bg);
  border-radius: 50% 50% 0 0 / 40px 40px 0 0;
}
.welcome-emoji { font-size: 64px; margin-bottom: 12px; display:block; }
.welcome-title { font-size: 32px; font-weight: 900; color:#fff; letter-spacing:-1px; }
.welcome-sub   { font-size: 15px; color:rgba(255,255,255,0.85); margin-top:6px; }
.welcome-body  { padding: 32px 20px 20px; }
.section-title {
  font-size: 13px; font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 12px;
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.profile-card {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 18px 12px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.profile-card:active { transform: scale(0.96); }
.profile-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 900; color:#fff;
  margin: 0 auto 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.profile-name { font-size: 14px; font-weight: 700; }
.profile-meta { font-size: 11px; color:var(--text-2); margin-top:2px; }
.add-profile-card {
  background: linear-gradient(135deg, #f0f7ee, #e4f0df);
  border: 2px dashed var(--c-red);
  border-radius: var(--radius-sm);
  padding: 18px 12px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s;
}
.add-profile-card:active { transform:scale(0.96); }
.add-profile-icon { font-size: 28px; margin-bottom:6px; }
.add-profile-text { font-size: 13px; font-weight: 600; color:var(--c-red); }

/* ── API Key setup ────────────────────────────────────────── */
.api-setup-card {
  background: linear-gradient(135deg, #fff9e6, #fff3cd);
  border: 1.5px solid #ffc107;
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
}
.api-setup-title { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.api-setup-sub   { font-size: 12px; color:var(--text-2); margin-bottom: 10px; line-height:1.5; }

/* ── Forms ────────────────────────────────────────────────── */
.form-screen {
  background: var(--bg);
  min-height: 100vh;
  padding-bottom: 40px;
}
.form-body { padding: 20px; display:flex; flex-direction:column; gap:14px; }
.form-group { display:flex; flex-direction:column; gap:6px; }
.form-label { font-size:13px; font-weight:600; color:var(--text-2); }
.form-input {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 12px 14px;
  font-size: 15px; color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  width: 100%;
}
.form-input:focus {
  border-color: var(--c-red);
  box-shadow: 0 0 0 3px rgba(61,107,74,0.12);
}
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237F8C8D' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.form-hint { font-size:11px; color:var(--text-3); margin-top:-4px; }

.goal-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.goal-option { display:none; }
.goal-label {
  display:flex; flex-direction:column; align-items:center; gap:6px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 8px;
  cursor:pointer;
  transition: all 0.2s;
  text-align:center;
}
.goal-label .goal-emoji { font-size:28px; }
.goal-label .goal-text  { font-size:11px; font-weight:600; color:var(--text-2); line-height:1.3; }
.goal-option:checked + .goal-label {
  border-color: var(--c-red);
  background: #f0f7ee;
  box-shadow: 0 0 0 3px rgba(61,107,74,0.12);
}
.goal-option:checked + .goal-label .goal-text { color: var(--c-red); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: flex; align-items:center; justify-content:center; gap:8px;
  border-radius: 50px;
  padding: 14px 24px;
  font-size: 15px; font-weight: 700;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  width: 100%;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--grad-header);
  color: #fff;
  box-shadow: 0 4px 20px rgba(61,107,74,0.3);
}
.btn-primary:active { box-shadow: none; }
.btn-secondary {
  background: var(--card);
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-danger {
  background: #fff3ee;
  color: var(--c-danger);
  border: 1.5px solid rgba(198,123,77,0.3);
}
.btn-teal {
  background: var(--grad-teal);
  color: #fff;
  box-shadow: 0 4px 20px rgba(90,150,104,0.35);
}
.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  width: auto;
}
.btn:disabled { opacity:0.5; pointer-events:none; }

/* ── Login screen ─────────────────────────────────────────── */
.login-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: var(--grad-header);
}
.login-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  display: flex; align-items:center; justify-content:center;
  font-size: 36px; font-weight:900; color:#fff;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  margin-bottom: 12px;
  border: 3px solid rgba(255,255,255,0.4);
}
.login-name { font-size:22px; font-weight:800; color:#fff; margin-bottom:4px; }
.login-sub  { font-size:14px; color:rgba(255,255,255,0.8); margin-bottom:30px; }
.login-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}
.login-error {
  background: #fff3ee;
  color: var(--c-danger);
  font-size:13px; font-weight:600;
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  margin-bottom: 12px;
  text-align:center;
}

/* ── Dashboard ────────────────────────────────────────────── */
.dash-header {
  background: var(--grad-header);
  padding: 20px 20px 56px;
  position: relative;
}
.dash-header::after {
  content:'';
  position:absolute; bottom:-1px; left:0; right:0;
  height:40px;
  background: var(--bg);
  border-radius: 50% 50% 0 0 / 40px 40px 0 0;
}
.dash-greeting { font-size:13px; color:rgba(255,255,255,0.8); font-weight:500; }
.dash-name     { font-size:24px; font-weight:900; color:#fff; letter-spacing:-0.5px; }
.dash-date     { font-size:13px; color:rgba(255,255,255,0.75); margin-top:2px; }
.dash-top-row  { display:flex; justify-content:space-between; align-items:center; }
.dash-avatar   {
  width:44px; height:44px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:20px; font-weight:900; color:#fff;
  border:2px solid rgba(255,255,255,0.5);
  flex-shrink:0;
}
.dash-body { padding: 0 16px 16px; margin-top:-20px; }

/* Calorie ring card */
.calorie-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  display:flex; align-items:center; gap:20px;
}
.ring-wrap { position:relative; flex-shrink:0; }
.ring-svg  { transform:rotate(-90deg); }
.ring-center {
  position:absolute; top:50%; left:50%;
  transform:translate(-50%,-50%);
  text-align:center;
}
.ring-cal   { font-size:22px; font-weight:900; color:var(--text); line-height:1; }
.ring-label { font-size:10px; color:var(--text-2); font-weight:600; text-transform:uppercase; letter-spacing:0.5px; }
.ring-right { flex:1; }
.ring-stat  { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
.ring-stat-name  { font-size:12px; font-weight:600; color:var(--text-2); }
.ring-stat-val   { font-size:12px; font-weight:700; color:var(--text); }
.ring-remain { font-size:11px; color:var(--text-3); margin-top:4px; }

/* Macro bars */
.macro-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.macro-title { font-size:14px; font-weight:700; margin-bottom:14px; }
.macro-row   { display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; }
.macro-item  { text-align:center; }
.macro-bar-wrap {
  height: 6px; background:#f0f0f0; border-radius:3px;
  overflow:hidden; margin-bottom:4px;
}
.macro-bar { height:100%; border-radius:3px; transition:width 0.6s ease; }
.macro-name  { font-size:10px; font-weight:600; color:var(--text-2); text-transform:uppercase; letter-spacing:0.3px; }
.macro-val   { font-size:14px; font-weight:800; }
.macro-pct   { font-size:10px; color:var(--text-3); }

/* Meals list */
.meals-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  overflow:hidden;
}
.meals-card-header {
  display:flex; justify-content:space-between; align-items:center;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
}
.meals-card-title { font-size:15px; font-weight:700; }
.meal-item {
  display:flex; align-items:center; gap:12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}
.meal-item:last-child { border-bottom:none; }
.meal-emoji {
  width:40px; height:40px; border-radius:12px;
  background: linear-gradient(135deg, #eaf3e6, #d4e8ce);
  display:flex; align-items:center; justify-content:center;
  font-size:20px; flex-shrink:0;
}
.meal-name { font-size:14px; font-weight:600; }
.meal-time { font-size:11px; color:var(--text-2); }
.meal-cal  { font-size:13px; font-weight:700; color:var(--c-teal); margin-left:auto; }
.meal-delete { font-size:16px; color:var(--text-3); padding:4px 0 4px 8px; }
.no-meals {
  padding: 30px 20px;
  text-align:center;
  color:var(--text-3);
  font-size:13px;
}
.no-meals-emoji { font-size:36px; margin-bottom:8px; display:block; }

/* Quick stats strip */
.stats-strip {
  display:grid; grid-template-columns:repeat(3,1fr); gap:10px;
  margin-bottom:14px;
}
.stat-mini {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  text-align:center;
  box-shadow: var(--shadow);
}
.stat-mini-val   { font-size:18px; font-weight:900; }
.stat-mini-label { font-size:10px; color:var(--text-2); font-weight:600; text-transform:uppercase; letter-spacing:0.3px; margin-top:2px; }

/* ── Log Meal screen ──────────────────────────────────────── */
.log-body { padding:16px; }
.upload-zone {
  border: 2.5px dashed var(--c-orange);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #f5faf4, #eaf3e6);
  min-height: 200px;
  display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  gap:10px; cursor:pointer; position:relative;
  overflow:hidden; transition: background 0.2s;
  margin-bottom:14px;
}
.upload-zone:hover { background: linear-gradient(135deg, #eaf3e6, #ddecd8); }
.upload-zone input { position:absolute; inset:0; opacity:0; cursor:pointer; }
.upload-icon { font-size:48px; }
.upload-text { font-size:15px; font-weight:700; color:var(--c-red); }
.upload-sub  { font-size:12px; color:var(--text-2); }
.upload-preview {
  width:100%; height:100%;
  position:absolute; inset:0;
  object-fit:cover;
}
.upload-overlay {
  position:absolute; inset:0;
  background:rgba(0,0,0,0.45);
  display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  gap:8px; color:#fff;
}
.upload-overlay .upload-icon { font-size:36px; }
.upload-overlay .upload-text { font-size:14px; }

/* Analysis result */
.analysis-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom:14px;
  animation: pop 0.4s ease;
}
.analysis-title { font-size:16px; font-weight:800; margin-bottom:4px; }
.analysis-sub   { font-size:12px; color:var(--text-2); margin-bottom:14px; }
.nutrient-section-title {
  font-size:12px; font-weight:700; color:var(--text-2);
  text-transform:uppercase; letter-spacing:0.8px;
  margin: 14px 0 8px;
}
.nutrient-row {
  display:flex; justify-content:space-between; align-items:center;
  padding: 7px 0; border-bottom: 1px solid var(--border);
}
.nutrient-row:last-child { border-bottom:none; }
.nutrient-name { font-size:13px; font-weight:500; }
.nutrient-val  { font-size:13px; font-weight:700; }
.nutrient-pct  {
  font-size:10px; font-weight:700; padding:2px 6px;
  border-radius:20px; margin-left:6px;
}
.pct-good { background:#e8faf0; color:#27ae60; }
.pct-ok   { background:#fef9e7; color:#f39c12; }
.pct-low  { background:#fdecea; color:#e74c3c; }
.big-nutrients {
  display:grid; grid-template-columns:repeat(3,1fr); gap:8px;
  margin-bottom:6px;
}
.big-nutrient {
  background: var(--bg);
  border-radius: var(--radius-xs);
  padding:10px 6px; text-align:center;
}
.big-nutrient-val   { font-size:17px; font-weight:900; }
.big-nutrient-name  { font-size:10px; color:var(--text-2); font-weight:600; text-transform:uppercase; letter-spacing:0.3px; margin-top:2px; }
.calorie-highlight {
  background: linear-gradient(135deg, #f0f7ee, #e4f0df);
  border-radius: var(--radius-xs);
  padding:12px; text-align:center; margin-bottom:10px;
}
.calorie-highlight-val   { font-size:32px; font-weight:900; color:var(--c-red); }
.calorie-highlight-label { font-size:12px; color:var(--text-2); font-weight:600; text-transform:uppercase; }
.accordion-header {
  display:flex; justify-content:space-between; align-items:center;
  cursor:pointer; padding: 6px 0;
}
.accordion-arrow { font-size:14px; color:var(--text-2); transition:transform 0.3s; }
.accordion-arrow.open { transform:rotate(180deg); }
.accordion-body { overflow:hidden; max-height:0; transition:max-height 0.35s ease; }
.accordion-body.open { max-height:800px; }

/* Analyzing overlay */
.analyzing-overlay {
  display:flex; flex-direction:column; align-items:center;
  justify-content:center; gap:12px; padding:30px;
  background:var(--card); border-radius:var(--radius);
  box-shadow:var(--shadow); margin-bottom:14px;
  animation: fadeIn 0.3s ease;
}
.analyzing-spinner {
  width:48px; height:48px;
  border: 4px solid #f0f0f0;
  border-top-color: var(--c-orange);
  border-radius:50%;
  animation:spin 0.9s linear infinite;
}
.analyzing-text { font-size:15px; font-weight:700; color:var(--text-2); }
.analyzing-sub  { font-size:12px; color:var(--text-3); text-align:center; }

/* ── History screen ───────────────────────────────────────── */
.period-tabs {
  display:flex; gap:0;
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 4px;
  box-shadow: var(--shadow);
  margin-bottom:14px;
}
.period-tab {
  flex:1; padding:9px 6px;
  border-radius: 10px;
  font-size:13px; font-weight:600; color:var(--text-2);
  text-align:center; cursor:pointer;
  transition: all 0.2s;
}
.period-tab.active {
  background: var(--grad-header);
  color:#fff;
  box-shadow: 0 2px 10px rgba(61,107,74,0.3);
}
.history-body { padding:16px; }

.summary-card {
  background:var(--card); border-radius:var(--radius);
  padding:18px; box-shadow:var(--shadow); margin-bottom:14px;
}
.summary-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:14px; }
.summary-title  { font-size:15px; font-weight:800; }
.summary-sub    { font-size:12px; color:var(--text-2); }
.summary-grid   { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.summary-stat {
  background:var(--bg); border-radius:var(--radius-xs); padding:12px;
  text-align:center;
}
.summary-stat-val  { font-size:20px; font-weight:900; }
.summary-stat-name { font-size:11px; color:var(--text-2); font-weight:600; margin-top:2px; }

.history-meal-item {
  background:var(--card); border-radius:var(--radius-sm);
  padding:14px 16px; box-shadow:var(--shadow);
  margin-bottom:10px; display:flex; gap:12px; align-items:center;
}
.history-meal-date { font-size:11px; color:var(--text-3); margin-left:auto; text-align:right; }

/* ── Feedback screen ──────────────────────────────────────── */
.feedback-body { padding:16px; }
.feedback-hero {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px; margin-bottom:14px;
  border: 2.5px solid #e4f0e7;
  display:flex; align-items:center; gap:14px;
}
.feedback-hero-emoji {
  font-size:44px; flex-shrink:0;
  animation: brain-rotate 3s linear infinite;
}
@keyframes brain-rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.feedback-hero-badge {
  background:#fff3cd; border-radius:99px;
  padding:2px 10px; font-size:10px; font-weight:700; color:#b8860b;
  display:inline-block; margin-bottom:5px;
}
.feedback-hero-title  { font-size:16px; font-weight:800; color:var(--text); }
.feedback-hero-sub    { font-size:11px; color:var(--text-2); margin-top:3px; line-height:1.4; }
.feedback-card {
  background:var(--card); border-radius:var(--radius);
  padding:18px; box-shadow:var(--shadow); margin-bottom:12px;
  animation: pop 0.4s ease;
}
.feedback-card-header { display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.feedback-card-icon   { font-size:28px; }
.feedback-card-title  { font-size:14px; font-weight:800; }
.feedback-card-body   { font-size:13px; color:var(--text); line-height:1.65; }
.feedback-loading {
  display:flex; flex-direction:column; align-items:center;
  gap:12px; padding:40px 20px;
}
.feedback-loading-spinner {
  width:48px; height:48px;
  border:4px solid #e4f0df;
  border-top-color:var(--c-red);
  border-radius:50%; animation:spin 0.9s linear infinite;
}
.feedback-generate-btn {
  background: var(--grad-green);
  color:#fff;
  box-shadow: 0 4px 20px rgba(61,107,74,0.35);
}

/* ── Settings screen ──────────────────────────────────────── */
.settings-body { padding:16px; }
.settings-section { margin-bottom:20px; }
.settings-group {
  background:var(--card); border-radius:var(--radius);
  box-shadow:var(--shadow); overflow:hidden;
}
.settings-item {
  display:flex; align-items:center; gap:12px;
  padding:11px 16px; border-bottom:1px solid var(--border);
  cursor:pointer; transition:background 0.15s;
}
.settings-item:last-child { border-bottom:none; }
.settings-item:active { background:#f5f9f6; }
.settings-item-icon  { font-size:22px; width:32px; text-align:center; flex-shrink:0; }
.settings-item-label { font-size:14px; font-weight:500; flex:1; color:var(--text); }
.settings-item-value { font-size:13px; color:var(--text-3); }
.settings-item-arrow { font-size:18px; color:#b3ccb8; }
.settings-item.danger .settings-item-label { color:var(--c-danger); }

/* ── Progress/nutrient bars ───────────────────────────────── */
.progress-row {
  display:flex; align-items:center; gap:10px; margin-bottom:8px;
}
.progress-label { font-size:12px; font-weight:600; color:var(--text); width:90px; flex-shrink:0; }
.progress-bar-wrap { flex:1; height:8px; background:#f0f0f0; border-radius:4px; overflow:hidden; }
.progress-bar      { height:100%; border-radius:4px; transition:width 0.6s ease; }
.progress-val { font-size:11px; font-weight:600; color:var(--text-2); width:50px; text-align:right; flex-shrink:0; }

/* ── Vitamin/mineral badge grid ───────────────────────────── */
.badge-grid { display:flex; flex-wrap:wrap; gap:6px; }
.badge {
  background:var(--bg); border-radius:20px;
  padding:4px 10px; font-size:11px; font-weight:600;
  display:flex; align-items:center; gap:4px;
}
.badge-dot { width:6px; height:6px; border-radius:50%; flex-shrink:0; }

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  position:fixed; inset:0; z-index:500;
  background:rgba(0,0,0,0.5);
  display:flex; align-items:flex-end;
  justify-content:center;
}
.modal-overlay.hidden { display:none; }
.modal {
  background:#fff; border-radius:var(--radius) var(--radius) 0 0;
  width:100%; max-width:480px;
  padding:24px 20px 36px;
  animation: slideUp 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
.modal-title  { font-size:18px; font-weight:800; margin-bottom:6px; }
.modal-body   { font-size:14px; color:var(--text-2); line-height:1.6; margin-bottom:20px; }
.modal-actions{ display:flex; gap:10px; }

/* ── Chips/tags ───────────────────────────────────────────── */
.chip {
  display:inline-flex; align-items:center; gap:4px;
  background:rgba(61,107,74,0.1); color:var(--c-red);
  border-radius:20px; padding:3px 10px;
  font-size:11px; font-weight:700;
}
.chip-teal   { background:rgba(90,150,104,0.12); color:var(--c-teal); }
.chip-blue   { background:rgba(58,123,213,0.1);  color:var(--c-blue); }
.chip-yellow { background:rgba(212,168,67,0.15);  color:#8a6020; }

/* ── Toast notification ───────────────────────────────────── */
.toast {
  position:fixed; bottom:calc(var(--nav-h) + 14px); left:50%;
  transform:translateX(-50%); z-index:999;
  background:#2C3E50; color:#fff;
  padding:10px 20px; border-radius:50px;
  font-size:13px; font-weight:600;
  box-shadow:var(--shadow-lg);
  animation: fadeIn 0.3s ease;
  white-space:nowrap;
}
.toast.success { background:#27ae60; }
.toast.error   { background:var(--c-red); }

/* ── Weight tracking ──────────────────────────────────────── */
.weight-card {
  background: var(--card); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 14px;
}
.weight-card-header {
  display:flex; justify-content:space-between; align-items:center; margin-bottom:14px;
}
.weight-card-title { font-size:15px; font-weight:700; }
.weight-stats-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 8px; margin-bottom: 12px;
}
.weight-stat {
  background: var(--bg); border-radius: var(--radius-xs);
  padding: 10px 6px; text-align: center;
}
.weight-stat-val  { font-size:18px; font-weight:900; }
.weight-stat-name { font-size:10px; color:var(--text-2); font-weight:600; text-transform:uppercase; letter-spacing:0.3px; margin-top:2px; }
.weight-chart-wrap { margin: 4px 0 8px; overflow: hidden; }
.weight-change-pos { color: #27ae60; }
.weight-change-neg { color: var(--c-danger); }
.weight-history-screen { padding: 16px; }
.weight-history-item {
  background: var(--card); border-radius: var(--radius-sm);
  padding: 12px 16px; box-shadow: var(--shadow);
  margin-bottom: 8px; display:flex; align-items:center; gap:12px;
}
.weight-history-val  { font-size:20px; font-weight:900; flex:1; }
.weight-history-date { font-size:12px; color:var(--text-2); }
.weight-history-del  { font-size:16px; color:var(--text-3); padding:4px; }
.weight-empty {
  text-align:center; padding:24px 16px; color:var(--text-2); font-size:13px;
}
.weight-empty-icon { font-size:36px; display:block; margin-bottom:8px; }
.chart-empty { font-size:12px; color:var(--text-3); text-align:center; padding:16px 0; }

/* ── Daily report card ────────────────────────────────────── */
.report-card {
  background: var(--card); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 14px;
}
.report-header { display:flex; align-items:center; gap:14px; margin-bottom:14px; }
.report-grade {
  font-size: 44px; font-weight:900; line-height:1;
  width:60px; height:60px;
  border-radius:16px;
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0;
}
.report-grade-info { flex:1; }
.report-grade-title { font-size:15px; font-weight:800; }
.report-grade-sub   { font-size:12px; color:var(--text-2); margin-top:2px; }
.report-checks { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:12px; }
.report-check {
  display:flex; align-items:center; gap:4px;
  background:var(--bg); border-radius:20px;
  padding:4px 10px; font-size:11px; font-weight:600;
}
.report-tip {
  background: linear-gradient(135deg, #f0f7ee, #e4f0df);
  border-left: 3px solid var(--c-red);
  border-radius: var(--radius-xs);
  padding: 10px 12px;
  font-size: 12px; color: var(--text); line-height: 1.55;
}
.report-tip-label { font-weight:700; color:var(--c-red); margin-bottom:2px; font-size:11px; text-transform:uppercase; letter-spacing:0.5px; }

/* ── Barcode scanner ──────────────────────────────────────── */
.scanner-overlay {
  position: fixed; inset: 0; z-index: 900;
  background: #000;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
#scanner-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.scanner-ui {
  position: relative; z-index: 2;
  display: flex; flex-direction: column;
  align-items: center; width: 100%; padding: 20px;
}
.scanner-frame {
  width: 260px; height: 150px;
  border: 3px solid rgba(255,255,255,0.9);
  border-radius: 16px;
  position: relative;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.55);
  overflow: hidden;
}
.scanner-frame::after {
  content: '';
  position: absolute; left: 0; right: 0; height: 2px;
  background: var(--c-orange);
  box-shadow: 0 0 8px 2px var(--c-orange);
  animation: scan-line 1.8s ease-in-out infinite;
}
@keyframes scan-line {
  0%   { top: 0; }
  50%  { top: calc(100% - 2px); }
  100% { top: 0; }
}
.scanner-corners::before,
.scanner-corners::after {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  border-color: var(--c-orange);
  border-style: solid;
}
.scanner-photo-area {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; margin-bottom: 8px;
}
.scanner-barcode-icon { font-size: 64px; line-height: 1; }
.scanner-photo-btn {
  background: var(--grad-header);
  color: #fff; font-weight: 700; font-size: 16px;
  padding: 14px 28px; border-radius: 99px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  letter-spacing: .3px;
}
.scanner-hint {
  color: rgba(255,255,255,0.85); font-size: 13px; font-weight: 500;
  text-align: center;
  text-shadow: 0 1px 6px rgba(0,0,0,0.8);
}
.scanner-status {
  color: rgba(255,255,255,0.8); font-size: 12px;
  margin-top: 8px; text-align: center; min-height: 18px;
}
.scanner-close {
  position: absolute; top: 20px; right: 20px; z-index: 3;
  width: 44px; height: 44px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff;
  backdrop-filter: blur(4px);
  border: 1.5px solid rgba(255,255,255,0.3);
}
.scanner-divider {
  color: rgba(255,255,255,0.5);
  font-size: 12px; margin: 16px 0; font-weight: 600;
}
.scanner-manual-input {
  background: rgba(255,255,255,0.15);
  border: 1.5px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-xs);
  padding: 11px 14px;
  font-size: 15px; color: #fff;
  width: 100%; text-align: center;
  backdrop-filter: blur(4px);
}
.scanner-manual-input::placeholder { color: rgba(255,255,255,0.5); }
.scanner-manual-input:focus { outline: none; border-color: var(--c-orange); }
.scanner-lookup-btn {
  background: var(--grad-header);
  color: #fff; font-weight: 700; font-size: 14px;
  padding: 12px; border-radius: var(--radius-xs);
  width: 100%; margin-top: 10px;
  box-shadow: 0 4px 16px rgba(255,107,107,0.4);
}
.barcode-badge {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, #e8f4fd, #d6eaf8);
  border: 1.5px solid #3A7BD5;
  border-radius: var(--radius-sm);
  padding: 10px 14px; margin-bottom: 12px;
}
.barcode-badge-label { font-size: 13px; font-weight: 600; color: #3A7BD5; }
.barcode-badge-clear { font-size: 12px; color: var(--text-2); font-weight: 600; padding: 4px 8px; }

/* ── Utility ──────────────────────────────────────────────── */
.hidden  { display:none !important; }
.mt-8    { margin-top:8px; }
.mt-12   { margin-top:12px; }
.mt-16   { margin-top:16px; }
.mb-8    { margin-bottom:8px; }
.mb-12   { margin-bottom:12px; }
.mb-16   { margin-bottom:16px; }
.flex-center { display:flex; align-items:center; justify-content:center; }
.text-center { text-align:center; }
.text-muted  { color:var(--text-2); }
.font-bold   { font-weight:700; }
.full-width  { width:100%; }
.divider     { height:1px; background:var(--border); margin:8px 0; }

/* ── Responsive ───────────────────────────────────────────── */
@media (min-width:481px) {
  #app {
    box-shadow: 0 0 60px rgba(0,0,0,0.15);
    min-height: 100vh;
  }
}
