/* ═══════════════════════════════════════════════════════════
   CALI56 FOODTRACK — style.css
   Light · Apple-minimal · Whoop data cards · tall bold display
   ═══════════════════════════════════════════════════════════ */

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

:root {
  /* surfaces */
  --bg:        #f1f1f4;
  --bg-grad:   linear-gradient(180deg, #f6f6f8 0%, #f1f1f4 100%);
  --surface:   #ffffff;
  --surface-2: #f5f5f8;
  --glass:     #ffffff;
  --glass-hi:  #f5f5f8;
  --border:    rgba(17,17,26,0.07);
  --hair:      rgba(17,17,26,0.06);

  /* shadows — Apple soft layered */
  --shadow-sm: 0 1px 2px rgba(17,17,26,.04), 0 2px 6px rgba(17,17,26,.04);
  --shadow:    0 1px 2px rgba(17,17,26,.04), 0 10px 28px rgba(17,17,26,.07);
  --shadow-lg: 0 8px 24px rgba(17,17,26,.10), 0 24px 60px rgba(17,17,26,.12);

  /* brand + data accents */
  --lime:      #c4e500;       /* brand electric lime, deepened for white legibility */
  --lime-glow: #d4f500;
  --lime-dim:  rgba(196,229,0,0.14);
  --lime-bdr:  rgba(150,180,0,0.40);
  --ink-accent:#0b0b0f;
  --red:       #ff3b30;
  --amber:     #f59e0b;
  --blue:      #2f6bff;
  --purple:    #a855f7;
  --green:     #34c759;

  /* text */
  --text:      #0b0b0f;
  --sub:       #6a7180;
  --muted:     #9aa0ad;

  --nav-h:     70px;
  --radius:    24px;

  --font-display: 'Oswald', 'Inter', sans-serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html, body { height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* tall bold display utility (was .bebas) */
.bebas { font-family: var(--font-display); font-weight: 600; letter-spacing: .005em; }

/* ── Splash ──────────────────────────────────────────────── */
#splash {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--bg); background-image: var(--bg-grad);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .5s ease, visibility .5s;
}
#splash.hide { opacity: 0; visibility: hidden; }
.splash-inner { text-align: center; animation: splashIn .8s cubic-bezier(.22,1,.36,1) both; }
@keyframes splashIn { from { opacity: 0; transform: scale(.92) translateY(16px); } to { opacity: 1; transform: none; } }
.splash-logo svg { width: 196px; height: auto; }
.splash-lottie { width: 132px; height: 132px; margin: 4px auto 0; }
.splash-name {
  font-family: var(--font-display); font-weight: 700; font-size: 40px; letter-spacing: .14em;
  margin: 18px 0 6px; padding-left: .14em; color: var(--text); text-transform: uppercase;
}
.splash-tag { font-size: 11px; font-weight: 700; letter-spacing: .34em; color: var(--sub); text-transform: uppercase; padding-left: .34em; }
.splash-loader { display: flex; gap: 8px; justify-content: center; margin-top: 34px; }
.splash-loader span {
  width: 8px; height: 8px; border-radius: 50%; background: var(--lime);
  animation: pulse 1.2s ease-in-out infinite;
}
.splash-loader span:nth-child(2) { animation-delay: .2s; }
.splash-loader span:nth-child(3) { animation-delay: .4s; }
@keyframes pulse { 0%,100% { opacity: .25; transform: scale(.7);} 50% { opacity: 1; transform: scale(1.1);} }

/* ── Layout shell ────────────────────────────────────────── */
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; position: relative; background: var(--bg); }
.screen { padding: 16px 16px calc(var(--nav-h) + 92px); animation: screenIn .3s cubic-bezier(.22,1,.36,1) both; min-height: 100vh; }
@keyframes screenIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── Header ──────────────────────────────────────────────── */
.appbar { display: flex; align-items: center; justify-content: space-between; margin: 6px 2px 18px; }
.appbar-title { font-family: var(--font-display); font-weight: 700; font-size: 30px; letter-spacing: .01em; }
.appbar-sub { font-size: 11px; color: var(--sub); text-transform: uppercase; letter-spacing: .14em; font-weight: 600; margin-top: 4px; }
.appbar-logo { height: 30px; width: auto; display: block; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 16px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: .15s; position: relative; box-shadow: var(--shadow-sm);
}
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .dot { position: absolute; top: 10px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); border: 2px solid var(--surface); }
.avatar-sm { width: 44px; height: 44px; border-radius: 16px; object-fit: cover; box-shadow: var(--shadow-sm); }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 14px;
}
.card-title {
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between;
}
.card-lime { background: var(--surface); border-color: var(--border); position: relative; overflow: hidden; }
.card-lime::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--lime-glow), var(--lime)); }

/* ── Welcome card ────────────────────────────────────────── */
.welcome { display: flex; align-items: center; gap: 14px; }
.welcome img { width: 56px; height: 56px; border-radius: 20px; object-fit: cover; box-shadow: var(--shadow-sm); }
.welcome-ph { width: 56px; height: 56px; border-radius: 20px; background: var(--ink-accent); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 600; font-size: 26px; color: #fff; }
.welcome h2 { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.welcome p { font-size: 12px; color: var(--sub); margin-top: 3px; font-weight: 500; }
.goal-chip {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 8px;
  background: var(--ink-accent); color: #fff;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  padding: 5px 11px; border-radius: 99px;
}

/* ── Progress ring (Whoop-style) ─────────────────────────── */
.ring-wrap { display: flex; align-items: center; gap: 22px; }
.ring-box { position: relative; width: 134px; height: 134px; flex-shrink: 0; }
.ring-box svg { transform: rotate(-90deg); }
.ring-track { fill: none; stroke: #ececef; stroke-width: 12; }
.ring-fill { fill: none; stroke: var(--lime); stroke-width: 12; stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.22,1,.36,1); }
.ring-fill.over { stroke: var(--red); }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-num { font-family: var(--font-display); font-weight: 600; font-size: 38px; line-height: 1; color: var(--text); }
.ring-lbl { font-size: 9px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; margin-top: 4px; }
.ring-stats { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.rs-row { display: flex; justify-content: space-between; align-items: baseline; }
.rs-lbl { font-size: 11px; font-weight: 600; color: var(--sub); text-transform: uppercase; letter-spacing: .06em; }
.rs-val { font-family: var(--font-display); font-weight: 600; font-size: 24px; color: var(--text); }

/* ── Macro bars ──────────────────────────────────────────── */
.macro-row { margin-bottom: 15px; }
.macro-row:last-child { margin-bottom: 0; }
.macro-head { display: flex; justify-content: space-between; margin-bottom: 7px; }
.macro-name { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--sub); }
.macro-val { font-size: 12px; font-weight: 600; color: var(--text); }
.bar { height: 8px; border-radius: 99px; background: #ececef; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; transition: width .8s cubic-bezier(.22,1,.36,1); }

/* ── Meal type cards ─────────────────────────────────────── */
.mt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mt-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 18px; padding: 14px; cursor: pointer; transition: .15s; }
.mt-card:active { transform: scale(.96); }
.mt-emoji { font-size: 21px; }
.mt-name { font-size: 12px; font-weight: 700; margin-top: 8px; color: var(--text); }
.mt-cal { font-family: var(--font-display); font-weight: 600; font-size: 21px; color: var(--text); margin-top: 2px; }
.mt-count { font-size: 10px; color: var(--muted); font-weight: 500; }

/* ── Water tracker ───────────────────────────────────────── */
.water-row { display: flex; align-items: center; gap: 16px; }
.water-glasses { flex: 1; display: flex; gap: 5px; flex-wrap: wrap; }
.glass-ic { width: 24px; height: 30px; border-radius: 4px 4px 7px 7px; border: 2px solid rgba(47,107,255,.28); position: relative; overflow: hidden; background: #fff; }
.glass-ic.full { border-color: var(--blue); }
.glass-ic.full::after { content: ''; position: absolute; inset: 30% 0 0 0; background: linear-gradient(180deg, rgba(47,107,255,.55), rgba(47,107,255,.9)); }
.water-btns { display: flex; gap: 8px; }
.wbtn { width: 40px; height: 40px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); color: var(--blue); font-size: 20px; font-weight: 700; cursor: pointer; transition: .15s; }
.wbtn:active { transform: scale(.9); }

/* ── Insights ────────────────────────────────────────────── */
.insight { display: flex; gap: 11px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--hair); }
.insight:last-child { border: none; padding-bottom: 0; }
.insight:first-of-type { padding-top: 0; }
.insight .ic { font-size: 17px; flex-shrink: 0; }
.insight p { font-size: 13px; color: var(--sub); line-height: 1.55; }
.insight b { color: var(--text); font-weight: 700; }

/* ── Bottom nav ──────────────────────────────────────────── */
.bnav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; height: var(--nav-h); z-index: 90;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--border);
  display: flex; align-items: stretch;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bnav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  border: none; background: none; color: var(--muted); cursor: pointer;
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  transition: color .15s; font-family: var(--font-body);
}
.bnav-item svg { width: 23px; height: 23px; }
.bnav-item.active { color: var(--text); }
.bnav-fab-slot { flex: 1; position: relative; }
.fab {
  position: absolute; left: 50%; top: -24px; transform: translateX(-50%);
  width: 62px; height: 62px; border-radius: 50%;
  background: linear-gradient(135deg, var(--lime-glow), var(--lime));
  border: 4px solid var(--bg); cursor: pointer; color: var(--ink-accent);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(150,180,0,.4), var(--shadow-sm);
  transition: transform .15s;
}
.fab:active { transform: translateX(-50%) scale(.9); }
.fab svg { width: 27px; height: 27px; }
.fab-lbl { position: absolute; left: 50%; transform: translateX(-50%); bottom: 8px; font-size: 9px; font-weight: 700; letter-spacing: .06em; color: var(--sub); }

/* ── Chat FAB ────────────────────────────────────────────── */
.chat-fab {
  position: fixed; right: max(16px, calc(50% - 224px)); bottom: calc(var(--nav-h) + 20px); z-index: 80;
  width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--ink-accent); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow); transition: transform .15s;
}
.chat-fab:active { transform: scale(.9); }
.chat-fab svg { width: 22px; height: 22px; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 16px; border-radius: 16px; border: none; cursor: pointer;
  font-family: var(--font-body); font-size: 15px; font-weight: 700; letter-spacing: -.01em;
  transition: transform .15s, opacity .15s; box-shadow: var(--shadow-sm);
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn-lime { background: var(--ink-accent); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: #fff; color: var(--red); border: 1px solid rgba(255,59,48,.3); box-shadow: none; }
.btn-sm { padding: 11px 16px; width: auto; font-size: 13px; border-radius: 12px; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* ── Forms ───────────────────────────────────────────────── */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--sub); margin-bottom: 8px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 15px 16px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font-family: var(--font-body); font-size: 15px; outline: none; transition: border .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none; box-shadow: var(--shadow-sm);
}
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239aa0ad' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; }
.field select option { background: #fff; color: var(--text); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--lime-bdr); box-shadow: 0 0 0 3px var(--lime-dim); }
.field textarea { resize: none; min-height: 98px; line-height: 1.5; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }

/* ── Choice grid (onboarding) ────────────────────────────── */
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice-grid.cols-1 { grid-template-columns: 1fr; }
.choice {
  background: var(--surface); border: 2px solid var(--border); border-radius: 18px;
  padding: 18px 14px; cursor: pointer; text-align: center; transition: .15s; box-shadow: var(--shadow-sm);
}
.choice:active { transform: scale(.96); }
.choice.sel { border-color: var(--lime); background: var(--lime-dim); }
.choice .em { font-size: 26px; }
.choice .nm { font-size: 13px; font-weight: 700; margin-top: 9px; color: var(--text); }
.choice .ds { font-size: 10px; color: var(--muted); margin-top: 3px; font-weight: 500; }
.choice.sel .nm { color: var(--text); }

/* ── Onboarding ──────────────────────────────────────────── */
.ob-wrap { padding: 30px 22px 40px; max-width: 480px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.ob-progress { height: 6px; border-radius: 99px; background: #e6e6ea; margin-bottom: 30px; overflow: hidden; }
.ob-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--lime-glow), var(--lime)); border-radius: 99px; transition: width .35s ease; }
.ob-step-lbl { font-size: 10px; font-weight: 700; color: var(--sub); text-transform: uppercase; letter-spacing: .18em; margin-bottom: 10px; }
.ob-title { font-family: var(--font-display); font-weight: 700; font-size: 42px; letter-spacing: .005em; line-height: 1.02; margin-bottom: 10px; text-transform: uppercase; }
.ob-sub { font-size: 14px; color: var(--sub); line-height: 1.55; margin-bottom: 28px; }
.ob-body { flex: 1; animation: screenIn .3s ease both; }
.ob-foot { margin-top: 28px; display: flex; gap: 10px; }
.ob-back { width: 58px; flex-shrink: 0; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font-size: 20px; box-shadow: var(--shadow-sm); }
.photo-up { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 16px 0; }
.photo-prev { width: 132px; height: 132px; border-radius: 38px; object-fit: cover; box-shadow: var(--shadow); }
.photo-empty { width: 132px; height: 132px; border-radius: 38px; border: 2px dashed var(--border); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 40px; background: var(--surface); }
.result-stat { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--hair); }
.result-stat:last-child { border: none; }
.result-stat .k { font-size: 12px; font-weight: 600; color: var(--sub); text-transform: uppercase; letter-spacing: .06em; }
.result-stat .v { font-family: var(--font-display); font-weight: 600; font-size: 26px; color: var(--text); }

/* ── Modals ──────────────────────────────────────────────── */
.modal-veil {
  position: fixed; inset: 0; z-index: 200; background: rgba(17,17,26,.32);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: veilIn .2s ease both;
}
@keyframes veilIn { from { opacity: 0; } to { opacity: 1; } }
.modal-sheet {
  width: 100%; max-width: 480px; max-height: 88vh; overflow-y: auto;
  background: var(--surface); border: none;
  border-radius: 30px 30px 0 0; padding: 14px 20px 36px;
  box-shadow: var(--shadow-lg);
  animation: sheetUp .34s cubic-bezier(.22,1,.36,1) both;
}
@keyframes sheetUp { from { transform: translateY(60px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-grab { width: 42px; height: 5px; border-radius: 99px; background: #d8d8de; margin: 0 auto 20px; }
.sheet-title { font-family: var(--font-display); font-weight: 600; font-size: 28px; letter-spacing: .005em; margin-bottom: 18px; }
.modal-center { align-items: center; padding: 20px; }
.modal-box { width: 100%; max-width: 360px; background: var(--surface); border: none; border-radius: 26px; padding: 26px; box-shadow: var(--shadow-lg); animation: sheetUp .25s ease both; }

/* ── Scan tabs ───────────────────────────────────────────── */
.scan-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.scan-tab {
  flex: 1; padding: 12px 6px; border-radius: 15px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--sub); cursor: pointer;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  display: flex; flex-direction: column; align-items: center; gap: 6px; transition: .15s; font-family: var(--font-body);
}
.scan-tab.active { border-color: var(--ink-accent); background: var(--ink-accent); color: #fff; }
.scan-tab .em { font-size: 20px; }
.scan-prev { width: 100%; max-height: 230px; object-fit: cover; border-radius: 16px; border: 1px solid var(--border); margin-bottom: 16px; }
.scan-drop {
  border: 2px dashed var(--border); border-radius: 18px; padding: 38px 16px;
  text-align: center; color: var(--muted); cursor: pointer; margin-bottom: 16px; transition: .15s; background: var(--surface-2);
}
.scan-drop:active { border-color: var(--lime-bdr); }
.scan-drop .em { font-size: 36px; display: block; margin-bottom: 10px; }
.scan-drop b { color: var(--text); font-size: 14px; }
.scan-drop p { font-size: 11px; margin-top: 5px; }
.scan-lottie { width: 120px; height: 120px; margin: 0 auto 8px; }
.voice-orb {
  width: 96px; height: 96px; border-radius: 50%; margin: 16px auto;
  background: var(--lime-dim); border: 2px solid var(--lime-bdr); color: var(--text);
  display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 34px; transition: .2s;
}
.voice-orb.rec { background: rgba(255,59,48,.1); border-color: var(--red); color: var(--red); animation: recPulse 1.1s infinite; }
@keyframes recPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,59,48,.3);} 50% { box-shadow: 0 0 0 16px rgba(255,59,48,0);} }
.voice-hint { text-align: center; font-size: 12px; color: var(--muted); margin-bottom: 16px; line-height: 1.6; }
.scan-quota-hint { text-align: center; font-size: 11px; color: var(--muted); margin: -6px 0 12px; }

/* ── Analysis result ─────────────────────────────────────── */
.ai-result { animation: screenIn .3s ease both; }
.ai-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--lime-dim); border: 1px solid var(--lime-bdr); color: #5a6b00; font-size: 10px; font-weight: 700; letter-spacing: .1em; padding: 6px 12px; border-radius: 99px; margin-bottom: 14px; text-transform: uppercase; }
.ai-items { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.ai-item { background: var(--surface-2); border: 1px solid var(--border); padding: 7px 13px; border-radius: 99px; font-size: 12px; font-weight: 600; color: var(--text); }
.macro-pills { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-bottom: 18px; }
.mp { background: var(--surface-2); border: 1px solid var(--border); border-radius: 15px; padding: 12px 6px; text-align: center; }
.mp .n { font-family: var(--font-display); font-weight: 600; font-size: 22px; color: var(--text); }
.mp .l { font-size: 9px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 3px; }

/* ── Spinner / skeleton ──────────────────────────────────── */
.spinner { width: 38px; height: 38px; border-radius: 50%; border: 3px solid #e6e6ea; border-top-color: var(--ink-accent); animation: spin .8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-box { text-align: center; padding: 36px 16px; }
.loading-box p { font-size: 13px; color: var(--sub); margin-top: 16px; font-weight: 500; }
.skel { border-radius: 14px; background: linear-gradient(90deg, #ececf0 25%, #f4f4f7 50%, #ececf0 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { from { background-position: 200% 0;} to { background-position: -200% 0;} }

/* ── Meal log cards ──────────────────────────────────────── */
.filter-tabs { display: flex; gap: 8px; margin-bottom: 16px; overflow-x: auto; padding-bottom: 3px; scrollbar-width: none; }
.filter-tabs::-webkit-scrollbar { display: none; }
.ftab { flex-shrink: 0; padding: 10px 18px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--sub); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; cursor: pointer; font-family: var(--font-body); transition: .15s; box-shadow: var(--shadow-sm); }
.ftab.active { background: var(--ink-accent); border-color: var(--ink-accent); color: #fff; }
.search-box { position: relative; margin-bottom: 16px; }
.search-box input { width: 100%; padding: 14px 16px 14px 44px; border-radius: 15px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-family: var(--font-body); font-size: 14px; outline: none; box-shadow: var(--shadow-sm); }
.search-box svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); }
.day-head { font-family: var(--font-display); font-weight: 600; font-size: 16px; letter-spacing: .04em; color: var(--sub); padding: 16px 2px 10px; text-transform: uppercase; }
.meal-log { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; margin-bottom: 10px; overflow: hidden; box-shadow: var(--shadow-sm); }
.ml-main { display: flex; gap: 12px; padding: 14px; cursor: pointer; align-items: center; }
.ml-img { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; flex-shrink: 0; }
.ml-emoji { width: 56px; height: 56px; border-radius: 14px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.ml-body { flex: 1; min-width: 0; }
.ml-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ml-type { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 4px 10px; border-radius: 99px; }
.t-breakfast { background: rgba(245,158,11,.12); color: #b97400; }
.t-lunch { background: rgba(47,107,255,.12); color: var(--blue); }
.t-dinner { background: rgba(168,85,247,.12); color: var(--purple); }
.t-snacks { background: rgba(17,17,26,.07); color: var(--sub); }
.ml-time { font-size: 10px; color: var(--muted); font-weight: 500; }
.ml-desc { font-size: 13px; font-weight: 600; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.ml-cal { font-family: var(--font-display); font-weight: 600; font-size: 22px; color: var(--text); flex-shrink: 0; }
.ml-detail { border-top: 1px solid var(--hair); padding: 14px; animation: screenIn .2s ease both; }
.ml-detail .macro-pills { margin-bottom: 12px; }
.empty-state { text-align: center; padding: 50px 24px; color: var(--muted); }
.empty-state .em { font-size: 46px; display: block; margin-bottom: 14px; }
.empty-lottie { width: 130px; height: 130px; margin: 0 auto 6px; }
.empty-state b { color: var(--text); font-size: 16px; display: block; margin-bottom: 6px; font-weight: 700; }
.empty-state p { font-size: 12px; line-height: 1.6; }

/* ── Chat ────────────────────────────────────────────────── */
.chat-screen { display: flex; flex-direction: column; height: 100vh; padding-bottom: 0; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 6px 2px 16px; }
.bubble { max-width: 80%; padding: 13px 16px; border-radius: 20px; font-size: 14px; line-height: 1.5; margin-bottom: 10px; animation: screenIn .25s ease both; }
.bub-user { margin-left: auto; background: var(--ink-accent); color: #fff; font-weight: 500; border-bottom-right-radius: 7px; }
.bub-coach { margin-right: auto; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 7px; color: var(--text); box-shadow: var(--shadow-sm); }
.bub-time { font-size: 9px; opacity: .5; margin-top: 6px; font-weight: 600; }
.coach-head { display: flex; align-items: center; gap: 11px; padding-bottom: 16px; border-bottom: 1px solid var(--hair); margin-bottom: 16px; }
.coach-head img { width: 46px; height: 46px; border-radius: 16px; box-shadow: var(--shadow-sm); }
.coach-head .nm { font-weight: 800; font-size: 16px; }
.coach-head .st { font-size: 11px; color: var(--green); font-weight: 600; display: flex; align-items: center; gap: 5px; }
.coach-head .st::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.chat-input-bar { display: flex; gap: 9px; padding: 12px 0 calc(var(--nav-h) + 14px); }
.chat-input-bar input { flex: 1; padding: 15px 18px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-family: var(--font-body); font-size: 14px; outline: none; box-shadow: var(--shadow-sm); }
.chat-send { width: 50px; height: 50px; border-radius: 50%; border: none; background: var(--ink-accent); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: var(--shadow-sm); }
.chat-send svg { width: 20px; height: 20px; }
.typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: pulse 1.1s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }

/* ── Reports ─────────────────────────────────────────────── */
.chart-box { position: relative; height: 190px; }
.chart-box-sm { position: relative; height: 150px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.stat-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 16px; box-shadow: var(--shadow-sm); }
.stat-tile .v { font-family: var(--font-display); font-weight: 600; font-size: 30px; color: var(--text); }
.stat-tile .l { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin-top: 4px; }
.report-item { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--hair); cursor: pointer; }
.report-item:last-child { border: none; }
.report-item .wk { font-size: 13px; font-weight: 700; color: var(--text); }
.report-item .mt { font-size: 11px; color: var(--muted); margin-top: 3px; font-weight: 500; }
.report-item .sc { font-family: var(--font-display); font-weight: 600; font-size: 28px; color: var(--text); }

/* ── Profile ─────────────────────────────────────────────── */
.prof-hero { text-align: center; padding: 12px 0 24px; }
.prof-hero img { width: 96px; height: 96px; border-radius: 30px; object-fit: cover; box-shadow: var(--shadow); }
.prof-hero .ph { width: 96px; height: 96px; border-radius: 30px; background: var(--ink-accent); display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 600; font-size: 40px; color: #fff; }
.prof-hero h2 { font-family: var(--font-display); font-weight: 700; font-size: 32px; letter-spacing: .005em; margin-top: 14px; text-transform: uppercase; }
.prof-hero p { font-size: 11px; color: var(--sub); font-weight: 600; text-transform: uppercase; letter-spacing: .1em; margin-top: 5px; }
.prof-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--hair); }
.prof-row:last-child { border: none; }
.prof-row .k { font-size: 12px; font-weight: 600; color: var(--sub); text-transform: uppercase; letter-spacing: .05em; }
.prof-row .v { font-size: 14px; font-weight: 700; color: var(--text); }
.prof-row .v.lime { color: var(--text); font-family: var(--font-display); font-weight: 600; font-size: 22px; }

/* ── Toasts ──────────────────────────────────────────────── */
#toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 500; width: calc(100% - 32px); max-width: 420px; display: flex; flex-direction: column; gap: 9px; pointer-events: none; }
.toast {
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--lime);
  border-radius: 16px; padding: 14px 16px; font-size: 13px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow);
  animation: toastIn .3s cubic-bezier(.22,1,.36,1) both;
}
.toast.out { animation: toastOut .3s ease both; }
.toast.warn { border-left-color: var(--amber); }
.toast.err { border-left-color: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-18px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-14px) scale(.95); } }

/* ── Misc ────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--hair); margin: 16px 0; }
.hidden { display: none !important; }
.brand-foot { text-align: center; font-family: var(--font-display); font-weight: 600; font-size: 11px; letter-spacing: .28em; color: var(--muted); padding: 20px 0 6px; text-transform: uppercase; }
::-webkit-scrollbar { width: 0; height: 0; }

@media (min-width: 481px) {
  body { background: #e8e8ec; }
  #app { box-shadow: var(--shadow-lg); }
  .bnav { box-shadow: var(--shadow-lg); }
}
