/* CalorieScale.ai — Clean UI */
:root {
  --ink: #1a1f1e;
  --muted: #6b7280;
  --bg: #f9fafb;
  --card: #ffffff;
  --line: #e5e7eb;
  --green: #176b49;
  --green-light: #14b8a6;
  --green-dark: #0e4f35;
  --lime: #d9ef92;
  --amber: #f59e0b;
  --red: #dc2626;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.beta-banner {
  align-items: center;
  background: linear-gradient(90deg, #103f2f, #176b49);
  color: #e9fff4;
  display: flex;
  font-size: 13px;
  gap: 8px;
  justify-content: center;
  line-height: 1.35;
  padding: 8px 18px;
  text-align: center;
}
.beta-banner strong { color: #ffffff; font-weight: 850; letter-spacing: .02em; text-transform: uppercase; }
.beta-banner a { color: #ffffff; font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }
.beta-banner a:focus-visible { border-radius: 4px; outline: 2px solid rgba(255,255,255,.8); outline-offset: 2px; }

.topbar {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; text-decoration: none; color: var(--ink); }
.brand-lockup { display: inline-flex; align-items: center; gap: 7px; width: 164px; height: 46px; }
.brand-icon { display: block; width: 36px; height: 36px; object-fit: cover; }
.brand-wordmark { display: block; width: 118px; height: 24px; object-fit: contain; }
nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-link { border: none; background: transparent; color: var(--muted); padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.15s; }
.nav-link { text-align: center; width: auto; }
.nav-link:hover { background: #f3f4f6; color: var(--ink); }
.nav-link.active { background: var(--green); color: white; }
.auth-actions { align-items: center; display: flex; gap: 6px; min-width: 0; }
.auth-open { font-size: 13px; min-height: 38px; padding: 7px 12px; white-space: nowrap; }
.auth-user { color: var(--muted); font-size: 12px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-sign-out { color: var(--green-dark); font-size: 13px; padding: 6px 8px; }
.verification-banner { align-items: center; background: #ecfdf5; border-bottom: 1px solid #a7f3d0; color: #065f46; display: flex; font-size: 13px; gap: 12px; justify-content: center; padding: 8px 20px; text-align: center; }
.verification-actions { display: flex; gap: 4px; }
.verification-actions .text-button { color: #065f46; font-size: 13px; padding: 4px 7px; text-decoration: underline; }

main { max-width: 1180px; margin: 0 auto; padding: 48px 32px 80px; }
.mobile-nav { display: none; }
#analyze { max-width: 760px; margin: 0 auto; }
#history, #agent, #profile { max-width: 1120px; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.capture-intro { max-width: 680px; margin: 0 auto; padding: 20px 0 28px; text-align: center; }
.capture-intro h1 { color: var(--ink); font-size: clamp(30px, 6vw, 40px); font-weight: 750; letter-spacing: -0.035em; line-height: 1.15; }
.capture-intro p { color: var(--muted); font-size: 16px; margin-top: 8px; }

.capture { max-width: 680px; margin: 0 auto; }
#food-image, #gallery-image { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.drop-zone {
  align-items: center;
  background: var(--card);
  border: 1px solid #cfd8d4;
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 276px;
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  color: var(--ink);
  font: inherit;
  transition: all 0.2s;
  width: 100%;
}
.capture-choices { background: var(--card); border: 1px solid #cfd8d4; border-radius: 20px; box-shadow: var(--shadow-sm); overflow: hidden; }
.capture-choices .drop-zone { border: 0; border-radius: 0; box-shadow: none; min-height: 232px; }
.capture-choices .drop-zone:hover { border-color: transparent; box-shadow: none; }
.drop-zone:hover { background: #f7fbf9; border-color: var(--green); box-shadow: var(--shadow); }
.drop-zone:focus-visible { outline: 3px solid rgba(23,107,73,0.32); outline-offset: 3px; }
.camera-icon { color: var(--green); height: 52px; margin-bottom: 16px; width: 52px; }
.drop-zone-title { color: var(--ink); font-size: 18px; font-weight: 700; }
.drop-zone-copy { color: var(--muted); font-size: 14px; margin-top: 4px; }
.capture-divider { align-items: center; color: #8a9891; display: flex; font-size: 11px; gap: 12px; justify-content: center; letter-spacing: .08em; text-transform: uppercase; }
.capture-divider::before, .capture-divider::after { background: #e5ebe8; content: ""; height: 1px; width: 64px; }
.gallery-button { align-items: center; background: #f7fbf9; border: 0; color: var(--green); cursor: pointer; display: flex; font: inherit; font-size: 14px; font-weight: 700; gap: 7px; justify-content: center; padding: 13px 12px 15px; width: 100%; }
.gallery-button svg { height: 18px; width: 18px; }
.gallery-button:hover { background: #edf7f1; color: var(--green-dark); }
.gallery-button:focus-visible { border-radius: 8px; outline: 3px solid rgba(23,107,73,0.25); outline-offset: 2px; }

.preview-wrap { border-radius: 20px; box-shadow: var(--shadow-lg); cursor: pointer; display: block; overflow: hidden; }
.preview-wrap img { width: 100%; height: auto; display: block; }
.preview-fallback { align-items: center; background: linear-gradient(145deg, #edf7f1, #f7faf8); color: var(--green-dark); display: flex; flex-direction: column; gap: 6px; min-height: 220px; justify-content: center; padding: 32px; text-align: center; }
.preview-fallback strong { font-size: 18px; }
.preview-fallback > span:last-child { color: var(--muted); font-size: 13px; }
.preview-fallback-icon { align-items: center; background: #dff2e7; border-radius: 50%; display: flex; font-size: 24px; height: 52px; justify-content: center; width: 52px; }
.capture-status { color: var(--muted); font-size: 14px; margin-top: 14px; text-align: center; }
.photo-details { background: rgba(255,255,255,.92); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); display: grid; gap: 7px; margin: 12px auto 0; padding: 12px; }
.photo-details label { color: var(--ink); font-size: 12px; font-weight: 800; letter-spacing: .02em; }
.photo-details input { background: #fff; border: 0; border-bottom: 2px solid #e8edf0; color: var(--ink); font: inherit; font-size: 15px; outline: none; padding: 4px 2px 7px; width: 100%; }
.photo-details input:focus { border-color: var(--green); }
.photo-details input:disabled { color: var(--muted); }
.photo-details label span { color: var(--muted); font-weight: 500; }

.primary, .secondary, .text-button { border: none; border-radius: 10px; font-weight: 600; font-size: 15px; cursor: pointer; transition: all 0.15s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.primary { width: 100%; padding: 14px 24px; background: var(--green); color: white; box-shadow: var(--shadow-sm); }
.primary:hover:not(:disabled) { background: var(--green-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.primary:disabled { background: #d1d5db; cursor: not-allowed; }
.secondary { padding: 10px 18px; background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.secondary:hover { background: #f3f4f6; border-color: var(--green-light); }
.text-button { background: transparent; color: var(--muted); padding: 8px 12px; }
.text-button:hover { color: var(--ink); background: #f3f4f6; }
.text-button.danger { color: var(--red); }
.text-button.danger:hover { background: #fee2e2; }
.result { max-width: 820px; margin-left:auto; margin-right:auto; background: var(--card); border-radius: 26px; padding: 22px; margin-top: 32px; box-shadow: var(--shadow-lg); animation: slideUp 0.4s ease; }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.coach-result { background: linear-gradient(135deg, #ecfdf5, #ffffff); border: 1px solid #cdeee0; border-radius: 22px; margin-bottom: 18px; padding: 22px; }
.coach-result h2 { color: var(--ink); font-size: clamp(24px, 5vw, 36px); letter-spacing: -.035em; line-height: 1.05; margin: 8px 0 8px; }
.coach-result p { color: #385147; font-size: 15px; line-height: 1.45; max-width: 620px; }
.coach-label { background: rgba(255,255,255,.78); border: 1px solid rgba(255,255,255,.9); border-radius: 999px; color: var(--green-dark); display: inline-flex; font-size: 12px; font-weight: 850; letter-spacing: .05em; padding: 6px 10px; text-transform: uppercase; }
.coach-light { background: linear-gradient(135deg, #eef7ff, #ffffff); border-color: #c9e7ff; }.coach-light .coach-label { color: #075985; }
.coach-treat,.coach-watch { background: linear-gradient(135deg, #fff7ed, #ffffff); border-color: #fed7aa; }.coach-treat .coach-label,.coach-watch .coach-label { color: #9a3412; }
.coach-avoid { background: linear-gradient(135deg, #fff1f2, #ffffff); border-color: #fecdd3; }.coach-avoid .coach-label { color: #9f1239; }
.coach-needs { background: linear-gradient(135deg, #f8fafc, #ffffff); border-color: #e2e8f0; }.coach-needs .coach-label { color: #475569; }
.coach-strong { background: linear-gradient(135deg, #ecfdf5, #f8fffb); border-color: #bbf7d0; }
.result-calories { font-size: clamp(48px, 12vw, 64px); font-weight: 800; color: var(--green); line-height: 1; text-align: center; margin-bottom: 4px; }
.result-label { text-align: center; color: var(--muted); font-size: 15px; margin-bottom: 20px; }
.result-range { display: block; text-align: center; margin: 0 auto 24px; padding: 6px 14px; background: var(--bg); border-radius: 999px; font-size: 13px; color: var(--muted); font-weight: 600; }
.result-meal-heading { margin: 0 0 14px; padding: 2px 4px 0; }
.result-meal-heading h1 { color: var(--ink); font-size: clamp(24px, 6vw, 34px); line-height: 1.08; letter-spacing: -.03em; margin: 6px 0 0; max-width: 32ch; }
.rating { display: inline-block; padding: 5px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; margin-bottom: 16px; }
.rating-good { background: #d1fae5; color: var(--green-dark); }
.rating-limit { background: #fef3c7; color: #92400e; }
.rating-avoid { background: #fee2e2; color: #991b1b; }
.nutrition-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 20px 0; padding: 14px; background: #f5f7f8; border-radius: var(--radius); }
.nutrition-item { --dial-color:#176b49; --dial-soft:#e4ece8; min-width:0; padding:10px 6px; text-align:center; animation:dialPop .38s ease both; }
.nutrition-item:nth-child(2) { animation-delay:.04s; }.nutrition-item:nth-child(3) { animation-delay:.08s; }.nutrition-item:nth-child(4) { animation-delay:.12s; }.nutrition-item:nth-child(5) { animation-delay:.16s; }
.macro-good { --dial-color:#12824f; --dial-soft:#dcefe5; }.macro-warn { --dial-color:#d28a14; --dial-soft:#f6ead1; }.macro-high { --dial-color:#c2413a; --dial-soft:#f5dddd; }.macro-low { --dial-color:#2563b8; --dial-soft:#dfe9f8; }.macro-neutral { --dial-color:#667085; --dial-soft:#e5e7eb; }
.macro-dial { --macro-progress:0%; width:64px; height:64px; margin:0 auto 7px; border-radius:50%; display:grid; place-items:center; background:conic-gradient(var(--dial-color) var(--macro-progress), var(--dial-soft) 0); box-shadow:inset 0 0 0 1px rgba(255,255,255,.75), 0 8px 18px rgba(15,23,42,.08); position:relative; }
.macro-dial::before { content:""; position:absolute; inset:6px; background:#fff; border-radius:50%; }
.macro-dial span { position:relative; z-index:1; font-size:15px; font-weight:850; color:var(--ink); }
.macro-status { color:var(--dial-color); font-size:11px; font-weight:800; margin-top:4px; }
.dial-caption { color:var(--muted); font-size:10px; line-height:1.25; margin:4px auto 0; max-width:104px; }
@keyframes dialPop { from { opacity:0; transform:translateY(8px) scale(.96); } to { opacity:1; transform:translateY(0) scale(1); } }
.nutrition-value { font-size: 24px; font-weight: 800; color: var(--ink); line-height: 1; }
.nutrition-label { font-size: 11px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.coach-cues { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; }
.coach-cue { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 16px; padding: 12px; }
.coach-cue strong { color: var(--ink); display: block; font-size: 13px; margin-bottom: 4px; }
.coach-cue span { color: var(--muted); display: block; font-size: 12px; line-height: 1.35; }
.coach-cue.green { background: #effcf5; border-color: #bbf7d0; }.coach-cue.green strong { color: #166534; }
.coach-cue.blue { background: #eff6ff; border-color: #bfdbfe; }.coach-cue.blue strong { color: #1d4ed8; }
.coach-cue.warm { background: #fff7ed; border-color: #fed7aa; }.coach-cue.warm strong { color: #9a3412; }
.quick-check { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: var(--radius); color: #1e3a8a; font-size: 13px; line-height: 1.5; margin-top: 14px; padding: 12px 14px; }
.quick-check strong { display: block; font-size: 13px; margin-bottom: 4px; }
.quick-check ul { margin: 0; padding-left: 18px; }
.refinement-status { align-items:center; background:#eef7ff; border:1px solid #bfdbfe; border-radius:999px; color:#075985; display:inline-flex; font-size:12px; font-weight:800; gap:8px; margin:0 0 12px; padding:7px 11px; }
.refinement-status span { animation:pulseDot 1s ease-in-out infinite; background:#0ea5e9; border-radius:50%; height:7px; width:7px; }
@keyframes pulseDot { 0%,100% { opacity:.35; transform:scale(.85); } 50% { opacity:1; transform:scale(1.2); } }
.quality-warning { background:#fff7ed; border:1px solid #fed7aa; border-radius:var(--radius); color:#9a3412; font-size:13px; line-height:1.45; margin-top:14px; padding:12px 14px; }
.quality-warning strong { color:#7c2d12; display:block; font-size:13px; margin-bottom:4px; }
.quality-warning p { margin:0; }
.quality-warning ul { margin:8px 0 0; padding-left:18px; }
.nutrition-label-card { background:#fff; border:1px solid var(--line); border-radius:18px; margin:16px 0 0; padding:16px; }
.nutrition-label-card h3 { font-size:18px; line-height:1.2; margin:8px 0 12px; }
.label-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(120px,1fr)); gap:8px; }
.label-grid div { background:#f8fafc; border:1px solid #eef2f7; border-radius:12px; padding:10px; }
.label-grid span { color:var(--muted); display:block; font-size:11px; text-transform:uppercase; letter-spacing:.04em; }
.label-grid strong { color:var(--ink); display:block; font-size:15px; margin-top:2px; }
.label-ingredients { color:#43534b; font-size:13px; line-height:1.45; margin-top:12px; }
.label-warning { background:#fff7ed; border:1px solid #fed7aa; border-radius:12px; color:#9a3412; font-size:13px; line-height:1.4; margin-top:12px; padding:10px; }
.estimate-note { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: var(--radius); color: #166534; font-size: 13px; line-height: 1.5; margin-top: 16px; padding: 12px 14px; }
.estimate-note ul { margin: 8px 0 0; padding-left: 18px; }
.estimate-note details { display: inline; margin-left: 6px; }
.estimate-note summary { color: #166534; cursor: pointer; display: inline; font-weight: 700; }
.result-review { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 20px; }
.result-review-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.result-review-copy { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.edit-results { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); margin-top: 14px; padding: 16px; }
.edit-results-intro { color: var(--muted); font-size: 13px; line-height: 1.5; margin-bottom: 14px; }
.edit-food { background: var(--card); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; padding: 14px; }
.edit-food-header { align-items: center; display: flex; justify-content: space-between; margin-bottom: 10px; }
.edit-food-header strong { font-size: 14px; }
.edit-food .field { margin-bottom: 10px; }
.edit-food label, .edit-food input { display: block; width: 100%; }
.edit-food label { color: var(--muted); font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.edit-food input { background: #fff; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); font-size: 14px; padding: 9px 10px; }
.edit-results-actions { display: flex; gap: 10px; margin-top: 14px; }
.edit-results-actions .primary { width: auto; }
.edit-results-actions .secondary { flex: 1; }

.history-grid { display: grid; gap: 12px; padding-bottom: 60px; }
.history-item { align-items: stretch; background: var(--card); border: 1px solid var(--line); border-radius: 16px; cursor: pointer; display: flex; gap: 14px; min-height: 112px; overflow: hidden; padding: 10px; transition: box-shadow .2s, transform .2s; }
.history-item:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.history-item:focus-visible { outline: 3px solid rgba(23,107,73,.28); outline-offset: 3px; }
.history-thumb { align-items: center; background: linear-gradient(145deg, #edf7f1, #f4f6f5); border-radius: 11px; color: var(--green); display: flex; flex: 0 0 92px; height: 92px; justify-content: center; overflow: hidden; }
.history-photo { display: block; height: 100%; object-fit: cover; width: 100%; }
.history-thumb-placeholder { font-size: 25px; opacity: .72; }
.history-body { display: flex; flex: 1; flex-direction: column; justify-content: center; min-width: 0; padding: 2px 4px 2px 0; }
.history-heading { align-items: flex-start; display: flex; gap: 12px; justify-content: space-between; }
.history-title { color: var(--ink); font-size: 16px; font-weight: 750; line-height: 1.25; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-date { color: var(--muted); font-size: 12px; margin-top: 3px; }
.history-macros { align-items: center; display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 12px; }
.history-macros span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.history-macros .history-calories { color: var(--green); font-size: 14px; font-weight: 800; }
.history-empty { text-align: center; color: var(--muted); padding: 48px 20px; }

.section-heading { display:flex; justify-content:space-between; align-items:flex-end; gap:20px; margin-bottom:28px; }
.profile-hero { display:flex; justify-content:space-between; align-items:center; gap:24px; margin:0 auto 26px; padding:30px 34px; max-width:980px; background:linear-gradient(120deg,#124d38,#1b7853); border-radius:24px; color:#fff; box-shadow:0 18px 38px rgba(18,77,56,.16); }
.profile-hero .eyebrow { color:#bdebd0; }.profile-hero h1 { color:#fff; font-size:clamp(28px,4vw,42px); margin:8px 0; }.profile-hero p { color:#d8f2e3; max-width:590px; margin:0; line-height:1.5; }
.profile-progress { flex:0 1 270px; min-width:210px; }.profile-progress-label { align-items:baseline; display:flex; justify-content:space-between; margin-bottom:9px; }.profile-progress-label span { font-size:28px; font-weight:800; }.profile-progress-label small { color:#d8f2e3; font-size:11px; letter-spacing:.04em; text-transform:uppercase; }.profile-progress-track { background:rgba(255,255,255,.2); border:1px solid rgba(255,255,255,.35); border-radius:999px; height:12px; overflow:hidden; }.profile-progress-track span { background:#bdebd0; border-radius:inherit; display:block; height:100%; min-width:0; transition:width .35s ease; width:0; }
.section-subtitle,.card-intro { color:var(--muted); max-width:620px; line-height:1.55; }
.eyebrow { color:var(--green); font-size:11px; font-weight:800; letter-spacing:.13em; }
.privacy-note,.ai-status { color:var(--muted); font-size:12px; background:#f1f7f3; border:1px solid #d8eade; border-radius:999px; padding:8px 12px; white-space:nowrap; }
.ai-status i { display:inline-block; width:7px; height:7px; background:#26a269; border-radius:50%; margin-right:6px; }
.agent-layout { display:grid; grid-template-columns:minmax(220px,280px) minmax(0,640px); gap:20px; max-width:980px; margin:0 auto; }
.agent-context h2,.profile-card h2 { margin:8px 0 6px; font-size:20px; }
.agent-context p { color:var(--muted); font-size:13px; line-height:1.5; }
.agent-card { min-width:0; }
.prompt-list { display:grid; gap:8px; margin-top:20px; }
.prompt-chip { background:#fff; border:1px solid var(--line); border-radius:10px; color:var(--ink); cursor:pointer; font:inherit; font-size:12px; padding:10px; text-align:left; }
.prompt-chip:hover { border-color:var(--green); color:var(--green); }
.chat-empty { margin:auto; max-width:340px; text-align:center; color:var(--muted); }
.chat-empty h2 { color:var(--ink); font-size:18px; margin:12px 0 6px; }
.chat-orb { display:grid; place-items:center; width:44px; height:44px; margin:auto; border-radius:14px; background:#e5f3eb; color:var(--green); font-size:24px; }
.profile-layout { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.profile-card { padding:24px; }
.card-topline { display:flex; align-items:center; gap:9px; min-height:22px; }.step { display:grid; place-items:center; width:24px; height:24px; border-radius:8px; background:#e7f3ec; color:var(--green); font-size:11px; font-weight:800; }.optional-pill, .required-pill { margin-left:auto; color:var(--muted); font-size:11px; background:var(--bg); border-radius:999px; padding:5px 9px; }.required-pill { color:var(--green); background:#ecfdf5; }.field-hint { display:block; color:var(--muted); font-size:11px; margin-top:5px; }.target-suggestion { display:flex; gap:8px; align-items:flex-start; margin:4px 0 16px; padding:12px 14px; border-radius:12px; background:#f1f8f4; color:var(--green-dark); font-size:12px; line-height:1.4; }.target-suggestion strong { font-weight:700; }.target-suggestion span { color:var(--muted); }
.profile-card:first-child { grid-column:1/-1; }
.profile-card .card-intro { font-size:13px; margin:0 0 20px; }
.field label span { color:var(--muted); font-size:11px; font-weight:400; }
.field textarea { width:100%; border:1px solid var(--line); border-radius:10px; padding:11px 12px; font:inherit; resize:vertical; }
.goal-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }
.choice { display:flex; gap:10px; align-items:flex-start; border:1px solid var(--line); border-radius:12px; padding:12px; cursor:pointer; }
.choice:has(input:checked) { border-color:var(--green); background:#f1f8f4; }
.choice input { margin-top:3px; accent-color:var(--green); }
.choice b,.choice small,.consent-row b,.consent-row small { display:block; }
.choice b { font-size:13px; }.choice small,.consent-row small { color:var(--muted); font-size:11px; margin-top:3px; }
.consent-row { display:flex; gap:10px; align-items:flex-start; background:#f8faf9; border-radius:10px; padding:12px; font-size:13px; }
.consent-row input { margin-top:3px; accent-color:var(--green); }
.profile-actions { background:#f6faf7; border-top:1px solid #e0ece5; display:grid; grid-column:1/-1; grid-template-columns:1fr auto; align-items:center; gap:16px 20px; padding:22px 24px; }
.profile-actions .primary,.profile-actions .secondary { width:auto; }
.field { min-width:0; }
.field label { display:block; margin-bottom:7px; color:var(--ink); font-size:12px; font-weight:700; letter-spacing:.01em; }
.info-tip { display:inline-grid; place-items:center; width:17px; height:17px; margin-left:4px; border:1px solid var(--green); border-radius:50%; background:#eff8f3; color:var(--green); cursor:help; font-size:11px; font-weight:800; vertical-align:middle; }
.pattern-methodology { margin:10px 0 12px; padding:14px 16px; border:1px solid #d8e9df; border-radius:14px; background:#f5fbf7; color:var(--ink); font-size:13px; line-height:1.5; }
.pattern-methodology p { margin:7px 0; color:var(--muted); }
.pattern-methodology ol { margin:8px 0; padding-left:20px; }
.pattern-methodology li { margin:6px 0; }
.field input, .field select, .field textarea { width:100%; appearance:none; background:#fbfcfb; border:1px solid #dce5df; border-radius:11px; color:var(--ink); font:inherit; font-size:14px; outline:none; padding:12px 13px; transition:border-color .15s, box-shadow .15s, background .15s; }
.field select { background-image:linear-gradient(45deg,transparent 50%,#6b7280 50%),linear-gradient(135deg,#6b7280 50%,transparent 50%); background-position:calc(100% - 17px) 18px,calc(100% - 12px) 18px; background-repeat:no-repeat; background-size:5px 5px,5px 5px; padding-right:34px; }
.field input::placeholder, .field textarea::placeholder { color:#a4ada8; }
.field input:focus, .field select:focus, .field textarea:focus { background:#fff; border-color:var(--green); box-shadow:0 0 0 3px rgba(23,107,73,.12); }
.activity-field { border:0; padding:0; margin:4px 0 0; }.activity-field legend { color:var(--ink); font-size:12px; font-weight:700; margin-bottom:8px; }.activity-field legend span { color:var(--muted); font-weight:400; }.activity-options { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }.activity-options label { cursor:pointer; }.activity-options input { position:absolute; opacity:0; }.activity-options label span { display:block; border:1px solid #dce5df; border-radius:11px; padding:11px 10px; background:#fbfcfb; min-height:67px; transition:.15s; }.activity-options label:hover span,.activity-options input:checked + span { border-color:var(--green); background:#eff8f3; box-shadow:0 0 0 2px rgba(23,107,73,.08); }.activity-options b,.activity-options small { display:block; }.activity-options b { font-size:12px; }.activity-options small { color:var(--muted); font-size:10px; margin-top:4px; }
.profile-actions-copy strong,.profile-actions-copy small { display:block; }.profile-actions-copy strong { font-size:16px; }.profile-actions-copy small { color:var(--muted); font-size:12px; margin-top:3px; }.profile-action-cluster { align-items:center; display:flex; gap:10px; justify-content:flex-end; }.profile-action-cluster .secondary { order:1; padding:8px 14px; }.profile-action-cluster .danger { order:2; }.profile-action-cluster .primary { order:3; }
.agent-actions { margin-bottom: 16px; }
.field-select { width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; background: white; }
.chat-thread { min-height: 300px; max-height: 480px; overflow-y: auto; padding: 20px; background: var(--bg); border-radius: var(--radius); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.chat-bubble { max-width: 85%; padding: 12px 16px; border-radius: 16px; font-size: 14px; line-height: 1.5; }
.chat-bubble.assistant { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-bubble.user { align-self: flex-end; background: var(--green); color: white; border-bottom-right-radius: 4px; }
.chat-composer { display: flex; gap: 10px; }
.chat-composer input { flex: 1; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; }
.chat-composer .primary { width: auto; padding: 12px 24px; }
.section-heading { display:flex; justify-content:space-between; align-items:end; gap:20px; margin-bottom:20px; }
.analytics-range { max-width:180px; }
.label-capture-card { display:flex; justify-content:space-between; align-items:center; gap:20px; margin-bottom:18px; }
.label-capture-card h2 { margin:6px 0; }.label-capture-card p { max-width:680px; color:var(--muted); font-size:13px; line-height:1.5; margin:0; }
.label-capture-button { width:auto; white-space:nowrap; cursor:pointer; }.label-capture-button input { display:none; }
.ingredient-highlights { margin-top:8px; padding-left:20px; color:var(--muted); }.ingredient-highlights li { margin:9px 0; }.ingredient-line { display:block; margin-top:3px; font-size:12px; }.ingredient-line b { color:var(--ink); }.ingredient-line.possible { color:#8a5a00; }
.analytics-summary { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:18px; }.analytics-kpi { padding:18px; border:1px solid var(--line); border-radius:14px; background:var(--card); }.analytics-kpi strong { display:block; font-size:25px; }.analytics-kpi span { color:var(--muted); font-size:12px; }
.analytics-card { margin-bottom:18px; }.analytics-card h2 { margin-top:0; }.analytics-table { width:100%; border-collapse:collapse; font-size:13px; }.analytics-table th,.analytics-table td { padding:10px 8px; border-bottom:1px solid var(--line); text-align:left; }.analytics-table th { color:var(--muted); font-weight:600; }
@media (max-width:700px) { .section-heading,.label-capture-card { align-items:stretch; flex-direction:column; }.analytics-summary { grid-template-columns:repeat(2,1fr); }.analytics-range { max-width:none; } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.form-group { margin-bottom: 24px; }
.form-group h3 { font-size: 16px; font-weight: 700; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.form-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.form-actions .primary { width: auto; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); cursor: pointer; }
.check input { width: auto; }

.legal-gate { position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(8px); z-index: 100; display: grid; place-items: center; padding: 20px; }
.legal-card { max-width: 440px; background: var(--card); border-radius: 20px; padding: 32px; box-shadow: var(--shadow-lg); text-align: center; }
.legal-card h2 { font-size: 24px; margin-bottom: 8px; }
.legal-card p { color: var(--muted); margin-bottom: 20px; }
.legal-check { display: flex; align-items: flex-start; gap: 10px; text-align: left; margin-bottom: 12px; font-size: 14px; line-height: 1.5; }
.legal-check input { margin-top: 3px; }

.auth-gate { background: #f6faf7; border: 1px solid #d8e9df; border-radius: 18px; margin: 0 auto 18px; max-width: 980px; padding: 20px; }
.auth-card { background: var(--card); border-radius: 14px; box-shadow: 0 8px 24px rgba(18,77,56,.08); margin: 0 auto; max-width: 460px; padding: 24px; position: relative; width: 100%; }
.auth-card-heading { align-items: flex-start; display: flex; justify-content: space-between; }
.auth-close { align-items: center; background: transparent; border: 0; border-radius: 50%; color: var(--muted); cursor: pointer; display: flex; font-size: 26px; height: 36px; justify-content: center; line-height: 1; padding: 0; position: absolute; right: 14px; top: 14px; width: 36px; }
.auth-close:hover { background: #f3f4f6; color: var(--ink); }
.auth-card h2 { font-size: 24px; margin-bottom: 8px; }
.auth-card > p { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.auth-form { display: grid; gap: 8px; }
.auth-form label { color: var(--ink); font-size: 13px; font-weight: 600; margin-top: 4px; }
.auth-form input { -webkit-appearance: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); font: inherit; min-height: 44px; padding: 11px 12px; pointer-events: auto; touch-action: manipulation; width: 100%; }
.auth-form input:focus { border-color: var(--green); outline: 2px solid rgba(23,107,73,0.18); }
.google-auth-button { align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); cursor: pointer; display: flex; font: inherit; font-weight: 700; gap: 10px; justify-content: center; min-height: 44px; padding: 10px 14px; width: 100%; }
.google-auth-button:hover { border-color: #9ca3af; background: #fafafa; }
.google-auth-button:disabled { cursor: wait; opacity: .65; }
.google-auth-mark { align-items: center; border: 1px solid #dadce0; border-radius: 50%; color: #4285f4; display: inline-flex; font-family: Arial, sans-serif; font-size: 15px; font-weight: 700; height: 22px; justify-content: center; width: 22px; }
.auth-divider { align-items: center; color: var(--muted); display: flex; font-size: 12px; gap: 10px; margin: 16px 0 4px; text-transform: uppercase; }
.auth-divider::before, .auth-divider::after { background: var(--line); content: ""; flex: 1; height: 1px; }
.auth-error { background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; color: #991b1b; font-size: 13px; line-height: 1.4; margin: 12px 0 4px; padding: 9px 10px; }
.auth-switch { align-items: center; display: grid; gap: 8px; margin-top: 18px; text-align: center; }
.auth-switch span { color: var(--muted); font-size: 13px; }
.auth-switch-button { background: transparent; border: 0; color: var(--green-dark); font-size: 13px; min-height: 0; padding: 2px 4px; text-decoration: underline; width: auto; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); padding: 12px 24px; background: var(--ink); color: white; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); z-index: 100; animation: slideUp 0.3s ease; }
.hidden { display: none !important; }

@media (max-width: 768px) {
  .beta-banner { align-items:flex-start; flex-direction:column; gap:2px; padding:8px 14px; text-align:left; }
  .topbar { padding: 0 16px; }
  .topbar nav { display: none; }
  .brand-lockup { width: 126px; height: 42px; gap: 5px; }
  .brand-icon { width: 30px; height: 30px; }
  .brand-wordmark { width: 91px; height: 20px; }
  nav { right: 16px; }
  .auth-user { display: none; }
  .auth-open { font-size: 12px; min-height: 36px; padding: 6px 9px; }
  .verification-banner { align-items: flex-start; flex-direction: column; gap: 2px; }
  .verification-actions { align-self: center; }
  main { padding-top: 24px; padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
  .mobile-nav { align-items: end; background: rgba(255,255,255,.94); backdrop-filter: blur(18px); border-top: 1px solid var(--line); bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); left: 0; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); position: fixed; right: 0; z-index: 30; }
  .mobile-nav .nav-link { align-items: center; background: transparent; border-radius: 12px; color: var(--muted); display: flex; flex-direction: column; font-size: 10px; gap: 3px; justify-content: center; min-height: 42px; padding: 4px 2px; text-align: center; width: auto; }
  .mobile-nav .nav-link.active { background: transparent; color: var(--green); }
  .mobile-nav-icon { font-size: 21px; font-weight: 700; line-height: 1; }
  .mobile-nav-camera { align-items: center; background: var(--green); border: 4px solid var(--card); border-radius: 50%; box-shadow: 0 5px 16px rgba(23,107,73,.28); color: #fff; display: flex; font-size: 27px; height: 58px; justify-content: center; line-height: 1; margin-top: -29px; width: 58px; }
  .mobile-camera { color: var(--green) !important; }
  .mobile-camera span:last-child { color: var(--muted); font-size: 10px; margin-top: 1px; }
  .capture-intro { padding: 12px 0 24px; }
  .capture-intro h1 { font-size: 30px; }
  .capture-intro p { font-size: 15px; }
  .capture-choices .drop-zone { min-height: 210px; }
  .nutrition-grid { grid-template-columns: repeat(3, 1fr); }
  .coach-cues { grid-template-columns: 1fr; }
  .result { padding: 16px; }
  .coach-result { padding: 18px; }
  .result { margin-top: 14px; padding: 10px; }
  .coach-result { border-radius: 16px; margin-bottom: 10px; padding: 13px 14px; }
  .coach-result h2 { font-size: 23px; margin: 6px 0 4px; }
  .coach-result p { font-size: 13px; line-height: 1.3; }
  .result-calories { font-size: 48px; }
  .result-meal-heading { margin-bottom: 10px; }
  .result-meal-heading h1 { font-size: 27px; }
  .result-label { margin-bottom: 8px; }
  .result-range { margin-bottom: 10px; padding: 5px 10px; }
  .nutrition-grid { gap: 4px; margin: 10px 0; padding: 8px 4px; }
  .nutrition-item { padding: 5px 2px; }
  .macro-dial { height: 54px; width: 54px; }
  .dial-caption { font-size: 9px; }
  .coach-cues { gap: 0; margin-top: 8px; }
  .coach-cue { border-radius: 12px; padding: 9px 10px; }
  .coach-cue:not(:first-child) { display: none; }
  .quick-check { border-radius: 12px; margin-top: 8px; overflow: hidden; padding: 8px 10px; text-overflow: ellipsis; white-space: nowrap; }
  .quick-check strong { display: inline; margin-right: 4px; }
  .quick-check ul { display: inline; padding: 0; }
  .quick-check li { display: inline; }
  .quick-check li::before { content: ""; }
  .quick-check li:not(:first-child) { display: none; }
  .estimate-note { font-size: 11px; line-height: 1.3; margin-top: 8px; padding: 8px 10px; }
  .estimate-note ul { display: none; }
  .result-review { margin-top: 10px; padding-top: 10px; }
  .result-review-copy { display: none; }
  .result-review-title { display: inline; font-size: 13px; margin-right: 8px; }
  .result-review .secondary { padding: 7px 10px; }
  .result-review .text-button { font-size: 11px; padding: 6px; }
  .form-row { grid-template-columns: 1fr; }
  .section-heading { align-items:flex-start; flex-direction:column; }
  .profile-hero { align-items:flex-start; flex-direction:column; padding:24px; }.profile-progress { align-self:stretch; flex:0 0 auto; min-width:0; }
  .profile-layout { gap:12px; }
  .profile-card { border-radius:18px; padding:18px; }
  .profile-card .card-intro { margin-bottom:14px; }
  .card-topline { gap:8px; }
  .required-pill { font-size:10px; padding:5px 8px; }
  .activity-options { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .activity-options label span { min-height:62px; padding:10px; }
  .goal-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .choice { gap:8px; min-height:68px; padding:10px; }
  .choice b { font-size:12px; line-height:1.25; }
  .choice small { font-size:10px; line-height:1.25; }
  .profile-layout { background:var(--card); border:1px solid var(--line); border-radius:20px; display:block; overflow:hidden; }
  .profile-layout .profile-card { border:0; border-bottom:1px solid var(--line); border-radius:0; }
  .profile-layout .profile-card:last-of-type { border-bottom:0; }
  .profile-card .form-row:has(.check) { gap:8px; grid-template-columns:repeat(2,minmax(0,1fr)); margin-bottom:10px; }
  .profile-card .check { background:#fbfcfb; border:1px solid var(--line); border-radius:10px; font-size:12px; min-height:42px; padding:10px; }
  .profile-card .check:has(input:checked) { background:#f1f8f4; border-color:var(--green); }
  .profile-card .check input { margin:0 7px 0 0; }
  .profile-actions { gap:12px; grid-template-columns:1fr; padding:20px 18px; }
  .profile-actions-copy,.profile-action-cluster { grid-column:1; }
  .profile-action-cluster { flex-wrap:wrap; justify-content:stretch; }
  .profile-action-cluster .primary { flex:1 0 100%; order:0; width:100%; }
  .profile-action-cluster .secondary { flex:1; }
  .profile-action-cluster .danger { flex:1; }
  .history-item { gap: 11px; }
  .history-thumb { flex-basis: 76px; height: 76px; }
  .history-title { font-size: 15px; }
  .history-macros { gap: 5px 9px; margin-top: 9px; }
  .history-macros span { font-size: 11px; }
  .history-heading .history-delete { font-size: 11px; padding: 3px 0; }
  .agent-layout,.profile-layout { grid-template-columns:1fr; }
  .profile-card:first-child { grid-column:auto; }
  .goal-grid { grid-template-columns:1fr; }
  .form-actions { flex-direction: column; }
  .form-actions .primary, .form-actions .secondary { width: 100%; }
  .edit-results-actions { flex-direction: column; }
  .edit-results-actions .primary { width: 100%; }
}
