/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Syne', sans-serif;
  background: #0a0a0a;
  color: #f0ede8;
  min-height: 100dvh;
  overflow: hidden;
  position: relative;
}
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select { font-family: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── CSS Variables ── */
:root {
  --green: #b5f23d;
  --green-dim: #8fc42d;
  --surface: #161616;
  --surface2: #202020;
  --border: #2a2a2a;
  --text-muted: #666;
  --protein: #f97316;
  --carbs: #3b82f6;
  --fat: #a855f7;
  --nav-h: 72px;
  --header-h: 80px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── Screens ── */
.screen {
  position: fixed; inset: 0;
  display: none;
  flex-direction: column;
  background: #0a0a0a;
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom));
}
.screen.active { display: flex; }

/* ── Splash ── */
#splash {
  background: #0a0a0a;
  align-items: center;
  justify-content: center;
  padding: 0 32px;
}
.splash-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 80%, rgba(181,242,61,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.splash-content { text-align: center; z-index: 1; }
.logo-mark {
  width: 80px; height: 80px;
  background: var(--green);
  color: #0a0a0a;
  font-family: 'Instrument Serif', serif;
  font-size: 48px;
  border-radius: 24px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
  box-shadow: 0 0 40px rgba(181,242,61,0.3);
}
.splash-title {
  font-family: 'Syne', sans-serif;
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
  margin-bottom: 12px;
}
.splash-title em { color: var(--green); font-style: normal; }
.splash-sub { color: var(--text-muted); font-size: 15px; margin-bottom: 48px; line-height: 1.5; }

/* ── Bottom Nav ── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(16,16,16,0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: none;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
}
.bottom-nav.visible { display: flex; }
.nav-btn {
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 8px 12px;
  transition: color 0.2s;
  flex: 1;
}
.nav-btn svg { width: 22px; height: 22px; }
.nav-btn.active { color: var(--green); }
.scan-btn { color: var(--green); }
.scan-ring {
  width: 52px; height: 52px;
  background: var(--green);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-top: -20px;
  box-shadow: 0 4px 20px rgba(181,242,61,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
}
.scan-ring svg { stroke: #0a0a0a; width: 24px; height: 24px; }
.scan-btn:active .scan-ring { transform: scale(0.93); box-shadow: 0 2px 10px rgba(181,242,61,0.3); }

/* ── Page Header ── */
.page-header {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 20px 20px 12px;
  min-height: var(--header-h);
  flex-shrink: 0;
}
.header-sub { font-size: 12px; color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase; }
.header-title { font-size: 28px; font-weight: 800; letter-spacing: -1px; }

/* ── Scroll Content ── */
.scroll-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 16px 24px;
  -webkit-overflow-scrolling: touch;
}
.scroll-content::-webkit-scrollbar { display: none; }

/* ── Avatar Btn ── */
.avatar-btn {
  width: 44px; height: 44px;
  background: var(--surface2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
  color: var(--green);
  border: 2px solid var(--border);
  flex-shrink: 0;
}

/* ── Calorie Ring Card ── */
.calorie-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-bottom: 12px;
}
.ring-wrap { position: relative; width: 180px; height: 180px; }
.ring-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { stroke: var(--surface2); stroke-width: 16; fill: none; }
.ring-fill {
  stroke: var(--green); stroke-width: 16; fill: none;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.34,1.56,0.64,1);
  filter: drop-shadow(0 0 8px rgba(181,242,61,0.5));
}
.ring-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.ring-number {
  font-family: 'DM Mono', monospace;
  font-size: 36px; font-weight: 500;
  letter-spacing: -1px;
  color: #fff;
}
.ring-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.macro-pills { display: flex; gap: 12px; width: 100%; }
.macro-pill {
  flex: 1;
  background: var(--surface2);
  border-radius: 14px;
  padding: 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.macro-val { font-family: 'DM Mono', monospace; font-size: 16px; font-weight: 500; }
.macro-key { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.macro-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; margin-top: 4px; }
.macro-fill { height: 100%; border-radius: 2px; width: 0%; transition: width 0.6s ease; }
.macro-fill.protein { background: var(--protein); }
.macro-fill.carbs { background: var(--carbs); }
.macro-fill.fat { background: var(--fat); }

/* ── Stats Row ── */
.stats-row {
  display: flex; gap: 10px;
  margin-bottom: 20px;
}
.stat-box {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 10px;
  text-align: center;
}
.stat-num { font-family: 'DM Mono', monospace; font-size: 20px; color: var(--green); }
.stat-lbl { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }

/* ── Section Head ── */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.section-head h3 { font-size: 16px; font-weight: 700; }
.text-btn { font-size: 13px; color: var(--green); font-weight: 600; }

/* ── Meal List ── */
.meal-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.meal-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
}
.meal-icon {
  width: 36px; height: 36px;
  background: var(--surface2);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.meal-info { flex: 1; min-width: 0; }
.meal-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meal-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.meal-cal { font-family: 'DM Mono', monospace; font-size: 14px; color: var(--green); font-weight: 500; flex-shrink: 0; }
.meal-delete { color: var(--text-muted); font-size: 16px; padding: 4px 8px; }
.meal-delete:hover { color: #ef4444; }

.empty-state {
  text-align: center; padding: 40px 20px;
  color: var(--text-muted); font-size: 14px;
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }

/* ── FAB Inline ── */
.fab-inline {
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  width: 100%;
  background: var(--green);
  color: #0a0a0a;
  font-family: 'Syne', sans-serif;
  font-size: 15px;
  font-weight: 700;
  padding: 16px;
  border-radius: 16px;
  transition: opacity 0.2s, transform 0.15s;
  margin-top: 8px;
}
.fab-inline svg { width: 20px; height: 20px; stroke: #0a0a0a; }
.fab-inline:active { opacity: 0.85; transform: scale(0.98); }

/* ── Buttons ── */
.btn-primary {
  background: var(--green);
  color: #0a0a0a;
  font-family: 'Syne', sans-serif;
  font-size: 16px;
  font-weight: 700;
  padding: 16px 36px;
  border-radius: 14px;
  transition: opacity 0.2s;
}
.btn-primary:active { opacity: 0.85; }
.btn-primary.full-width { width: 100%; }
.btn-outline {
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 14px;
  padding: 12px 24px;
  border-radius: 12px;
}
.btn-danger {
  background: #ef444420;
  color: #ef4444;
  border: 1px solid #ef444440;
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
}

/* ── Search ── */
.search-box {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0 16px;
  margin-bottom: 16px;
}
.search-box svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.search-box input {
  flex: 1; background: none; border: none; outline: none;
  color: #f0ede8; font-size: 15px; padding: 14px 0;
}
.search-box input::placeholder { color: var(--text-muted); }
#searchClear { color: var(--text-muted); font-size: 16px; }
.search-results { display: flex; flex-direction: column; gap: 8px; }
.search-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  transition: border-color 0.15s;
}
.search-item:active { border-color: var(--green); }
.search-item-info { flex: 1; min-width: 0; }
.search-item-name { font-size: 14px; font-weight: 600; }
.search-item-brand { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.search-item-cal { font-family: 'DM Mono', monospace; font-size: 14px; color: var(--green); flex-shrink: 0; }
.search-loading { text-align: center; color: var(--text-muted); padding: 40px; }
.search-loading .spinner { width: 32px; height: 32px; border: 2px solid var(--border); border-top-color: var(--green); border-radius: 50%; animation: spin 0.7s linear infinite; margin: 0 auto 12px; }

/* ── Diary Sections ── */
.diary-section { margin-bottom: 16px; }
.diary-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 4px;
}
.diary-section-name { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }
.diary-section-cal { font-family: 'DM Mono', monospace; font-size: 13px; color: var(--text-muted); }
.diary-add-btn { color: var(--green); font-size: 20px; font-weight: 300; padding: 0 4px; }

/* ── Date Nav ── */
.date-nav { display: flex; gap: 4px; }
.date-nav button {
  width: 36px; height: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: #f0ede8;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}

/* ── Profile ── */
.profile-avatar { text-align: center; padding: 24px 0 20px; }
.big-avatar {
  width: 90px; height: 90px;
  background: var(--surface2);
  border: 2px solid var(--green);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; font-weight: 700;
  color: var(--green);
  margin: 0 auto 16px;
}
.profile-name-input {
  background: none; border: none; border-bottom: 1px solid var(--border);
  color: #f0ede8; font-size: 22px; font-weight: 700;
  text-align: center; width: 200px; outline: none;
  padding-bottom: 6px;
}
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 12px;
}
.settings-title { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 12px; }
.settings-row {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }
.settings-row label { font-size: 14px; color: #f0ede8; }
.settings-row input, .settings-row select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--green);
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  padding: 6px 10px;
  width: 100px;
  text-align: right;
  outline: none;
}
.footer-note { font-size: 12px; color: var(--text-muted); text-align: center; padding: 20px 0; line-height: 1.6; }

/* ── Scanner Overlay ── */
.overlay {
  position: fixed; inset: 0;
  background: #000;
  z-index: 200;
  display: flex; flex-direction: column;
}
.scanner-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 20px 12px;
  color: #fff;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(10px);
}
.scanner-header h3 { font-size: 17px; font-weight: 700; }
.back-btn { font-size: 18px; color: #fff; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; }
.scanner-body { flex: 1; position: relative; overflow: hidden; }
#scannerVideo { width: 100%; height: 100%; object-fit: cover; }
.scan-frame {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -55%);
  width: 260px; height: 160px;
}
.corner {
  position: absolute;
  width: 28px; height: 28px;
  border-color: var(--green);
  border-style: solid;
}
.corner.tl { top: 0; left: 0; border-width: 3px 0 0 3px; border-radius: 4px 0 0 0; }
.corner.tr { top: 0; right: 0; border-width: 3px 3px 0 0; border-radius: 0 4px 0 0; }
.corner.bl { bottom: 0; left: 0; border-width: 0 0 3px 3px; border-radius: 0 0 0 4px; }
.corner.br { bottom: 0; right: 0; border-width: 0 3px 3px 0; border-radius: 0 0 4px 0; }
.scan-line {
  position: absolute;
  top: 50%; left: 4px; right: 4px;
  height: 2px;
  background: var(--green);
  box-shadow: 0 0 8px rgba(181,242,61,0.8);
  animation: scanMove 2s ease-in-out infinite;
}
@keyframes scanMove {
  0%, 100% { top: 10%; }
  50% { top: 90%; }
}
.scan-hint { position: absolute; bottom: 30%; left: 0; right: 0; text-align: center; color: rgba(255,255,255,0.7); font-size: 13px; }
.scanner-footer {
  padding: 16px 20px calc(16px + var(--safe-bottom));
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(10px);
  display: flex; justify-content: center;
}

/* ── Food Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 300;
  display: flex; flex-direction: column;
  justify-content: flex-end;
  backdrop-filter: blur(4px);
}
.modal-sheet {
  background: #161616;
  border-radius: 28px 28px 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  max-height: 85dvh;
  display: flex; flex-direction: column;
}
.modal-drag {
  width: 40px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 12px auto 0;
}
.modal-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 17px; font-weight: 700; flex: 1; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px; }
.modal-body::-webkit-scrollbar { display: none; }
.food-brand { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.nutrient-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; margin-bottom: 20px;
}
.nutrient-tile {
  background: var(--surface2);
  border-radius: 12px;
  padding: 12px;
}
.nutrient-tile.full { grid-column: 1 / -1; background: var(--green); }
.nutrient-tile.full .nt-val, .nutrient-tile.full .nt-key { color: #0a0a0a; }
.nt-val { font-family: 'DM Mono', monospace; font-size: 22px; font-weight: 500; }
.nt-key { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
.serving-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.serving-row label { font-size: 14px; }
.serving-controls { display: flex; gap: 8px; }
.serving-controls input {
  width: 70px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #f0ede8;
  font-family: 'DM Mono', monospace;
  font-size: 15px;
  padding: 8px 10px;
  outline: none;
  text-align: center;
}
.serving-controls select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #f0ede8;
  font-size: 14px;
  padding: 8px 10px;
  outline: none;
}
.modal-total-cal {
  font-family: 'DM Mono', monospace;
  font-size: 32px;
  font-weight: 500;
  color: var(--green);
  text-align: center;
  padding: 12px 0;
  letter-spacing: -1px;
}
.meal-selector { margin-top: 16px; }
.meal-selector label { font-size: 13px; color: var(--text-muted); display: block; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.meal-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  transition: all 0.15s;
}
.chip.active { background: var(--green); border-color: var(--green); color: #0a0a0a; }
.modal-footer {
  padding: 12px 20px calc(20px + var(--safe-bottom));
  border-top: 1px solid var(--border);
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
  left: 50%; transform: translateX(-50%) translateY(20px);
  background: #f0ede8;
  color: #0a0a0a;
  font-size: 14px; font-weight: 600;
  padding: 12px 24px;
  border-radius: 100px;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
  z-index: 999;
  white-space: nowrap;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Spinner ── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 28px; height: 28px; border: 2px solid var(--border); border-top-color: var(--green); border-radius: 50%; animation: spin 0.7s linear infinite; margin: 0 auto; }

/* ── v2 additions ── */

/* Tabs */
.tab-bar { display:flex; gap:6px; margin-bottom:14px; overflow-x:auto; padding-bottom:2px; }
.tab-bar::-webkit-scrollbar { display:none; }
.tab-btn { flex-shrink:0; background:var(--surface); border:1px solid var(--border); border-radius:20px; color:var(--text-muted); font-size:13px; font-weight:600; padding:8px 16px; white-space:nowrap; transition:all 0.15s; }
.tab-btn.active { background:var(--green); border-color:var(--green); color:#0a0a0a; }
.tab-panel { display:none; }
.tab-panel.active { display:block; }

/* Search hint */
.search-hint { padding:16px 4px; display:flex; flex-direction:column; gap:10px; }
.search-hint p { font-size:13px; color:var(--text-muted); }
.search-hint strong { color:#f0ede8; }

/* Entry tags */
.entry-tag { font-size:10px; font-weight:700; letter-spacing:0.5px; padding:2px 6px; border-radius:4px; text-transform:uppercase; vertical-align:middle; }
.entry-tag.custom { background:#f97316; color:#fff; }
.entry-tag.recipe { background:#3b82f6; color:#fff; }

/* Fav star */
.fav-star { font-size:20px; color:var(--text-muted); line-height:1; }
.fav-star.on { color:#f59e0b; }

/* Fav btn in modal header */
.fav-btn { font-size:12px; font-weight:700; color:var(--text-muted); border:1px solid var(--border); border-radius:20px; padding:6px 12px; white-space:nowrap; }
.fav-btn.fav-active { color:#f59e0b; border-color:#f59e0b; }

/* Modal header fix for 3 items */
.modal-header { display:flex; align-items:center; gap:8px; padding:16px 20px 12px; border-bottom:1px solid var(--border); }
.modal-header h3 { font-size:15px; font-weight:700; flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* Custom food form */
.form-group { display:flex; flex-direction:column; gap:6px; margin-bottom:14px; }
.form-group label { font-size:12px; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.5px; }
.form-group input, .form-group select { background:var(--surface2); border:1px solid var(--border); border-radius:10px; color:#f0ede8; font-family:'Syne',sans-serif; font-size:15px; padding:12px 14px; outline:none; width:100%; }
.form-group input::placeholder { color:var(--text-muted); }
.form-row { display:flex; gap:10px; }
.form-group.half { flex:1; }
.form-divider { font-size:11px; text-transform:uppercase; letter-spacing:1px; color:var(--text-muted); border-top:1px solid var(--border); padding-top:12px; margin-bottom:12px; }

/* Recipe preview */
.recipe-preview { background:var(--surface2); border:1px solid var(--green); border-radius:16px; padding:16px; }
.recipe-preview-name { font-size:16px; font-weight:700; margin-bottom:6px; }
.recipe-preview-cal { font-family:'DM Mono',monospace; font-size:28px; color:var(--green); margin-bottom:4px; }
.recipe-preview-macros { font-size:13px; color:var(--text-muted); margin-bottom:4px; }
.recipe-preview-servings { font-size:12px; color:var(--text-muted); }

/* Progress screen */
.prog-controls { display:flex; flex-direction:column; gap:10px; margin-bottom:12px; }
.prog-mode-row { display:flex; gap:8px; }
.prog-mode-btn { flex:1; background:var(--surface); border:1px solid var(--border); border-radius:10px; color:var(--text-muted); font-size:14px; font-weight:700; padding:10px; transition:all 0.15s; }
.prog-mode-btn.active { background:var(--green); border-color:var(--green); color:#0a0a0a; }
.prog-nav { display:flex; align-items:center; justify-content:space-between; background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:4px; }
.prog-nav button { width:40px; height:36px; font-size:20px; color:#f0ede8; display:flex; align-items:center; justify-content:center; border-radius:8px; }
.prog-nav button:active { background:var(--surface2); }
.prog-nav span { font-size:13px; font-weight:600; color:#f0ede8; }

.metric-chips { display:flex; gap:6px; overflow-x:auto; margin-bottom:14px; padding-bottom:2px; }
.metric-chips::-webkit-scrollbar { display:none; }
.metric-chip { flex-shrink:0; background:var(--surface); border:1px solid var(--border); border-radius:20px; color:var(--text-muted); font-size:12px; font-weight:700; padding:7px 14px; transition:all 0.15s; }
.metric-chip.active { background:var(--surface2); border-color:var(--green); color:var(--green); }

.chart-card { background:var(--surface); border:1px solid var(--border); border-radius:20px; padding:16px; height:220px; margin-bottom:12px; }
#progressChart { width:100%; height:100%; display:block; }

.prog-summary { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:4px; }
.prog-card { background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:14px; text-align:center; }
.prog-val { font-family:'DM Mono',monospace; font-size:16px; color:var(--green); font-weight:500; }
.prog-lbl { font-size:10px; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.5px; margin-top:4px; }

.weight-row { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; }
.weight-current { font-family:'DM Mono',monospace; font-size:24px; color:var(--green); }
.btn-small-green { background:var(--green); color:#0a0a0a; font-weight:700; font-size:13px; padding:8px 16px; border-radius:8px; }

/* Back close btn on profile */
.back-close { font-size:18px; color:var(--text-muted); width:36px; height:36px; display:flex; align-items:center; justify-content:center; }

/* Bottom nav - 5 items */
.bottom-nav { justify-content:space-around; }

/* ── v3: Auth, Workout, Misc ── */

/* Auth overlay */
.auth-overlay { position:fixed;inset:0;background:#0a0a0a;z-index:500;display:flex;align-items:center;justify-content:center;padding:20px; }
.auth-card { background:var(--surface);border:1px solid var(--border);border-radius:28px;padding:28px 24px;width:100%;max-width:380px; }
.auth-logo { display:flex;align-items:center;gap:12px;margin-bottom:24px; }
.logo-mark-sm { width:40px;height:40px;background:var(--green);color:#0a0a0a;font-family:'Instrument Serif',serif;font-size:24px;border-radius:12px;display:flex;align-items:center;justify-content:center;flex-shrink:0; }
.auth-brand { font-size:22px;font-weight:800;letter-spacing:-0.5px; }
.auth-tabs { display:flex;gap:6px;margin-bottom:20px; }
.auth-tab-btn { flex:1;background:var(--surface2);border:1px solid var(--border);border-radius:10px;color:var(--text-muted);font-size:14px;font-weight:700;padding:10px;transition:all 0.15s; }
.auth-tab-btn.active { background:var(--green);border-color:var(--green);color:#0a0a0a; }
.auth-panel { display:none; }
.auth-panel.active { display:block; }
.auth-error { font-size:13px;color:#ef4444;min-height:18px;margin-bottom:10px; }
.guest-btn { width:100%;text-align:center;color:var(--text-muted);font-size:13px;padding:12px;margin-top:12px; }
.auth-note { font-size:11px;color:var(--text-muted);text-align:center;margin-top:8px;line-height:1.5; }

/* Workout screen */
.exercise-results { display:flex;flex-direction:column;gap:6px;max-height:180px;overflow-y:auto;margin-bottom:10px; }
.exercise-results::-webkit-scrollbar { display:none; }
.exercise-item { background:var(--surface2);border:1px solid var(--border);border-radius:10px;padding:10px 14px;text-align:left;display:flex;flex-direction:column;gap:2px;transition:border-color 0.15s; }
.exercise-item:active { border-color:var(--green); }
.exercise-name { font-size:14px;font-weight:600; }
.exercise-meta { font-size:11px;color:var(--text-muted); }
.selected-exercises { display:flex;flex-wrap:wrap;gap:6px;margin-bottom:12px;min-height:0; }
.selected-ex { background:var(--green);border-radius:20px;padding:6px 12px;display:flex;align-items:center;gap:6px;font-size:12px;font-weight:700;color:#0a0a0a; }
.selected-ex button { color:#0a0a0a;font-size:14px;line-height:1; }
.calorie-estimate-row { display:flex;justify-content:space-between;align-items:center;background:var(--surface2);border-radius:12px;padding:12px 16px;margin-bottom:14px; }
.calorie-estimate-row span { font-size:13px;color:var(--text-muted); }
.estimate-val { font-family:'DM Mono',monospace;font-size:18px;color:#f97316;font-weight:500; }

/* Profile email */
#profileEmail { font-size:12px;color:var(--text-muted);margin-top:4px; }
