@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;800;900&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface2: #1e1e1e;
  --border: #2a2a2a;
  --border2: #333;
  --text: #ffffff;
  --text2: #eeeeee;
  --text3: #bbbbbb;
  --cal: #f5e642;
  --protein: #3ecfff;
  --carbs: #ff9500;
  --fat: #ff4d6d;
  --sugar: #bf5af2;
  --fiber: #30d158;
  --green: #30d158;
  --orange: #ff9500;
  --red: #ff453a;
}

html, body {
  background: #0a0a0a !important;
  color: #ffffff !important;
}

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

body {
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  max-width: 390px;
  margin: 0 auto;
  padding-bottom: 100px;
  -webkit-font-smoothing: antialiased;
}

input, textarea, button, select {
  font-family: 'Inter', sans-serif;
  -webkit-appearance: none;
  appearance: none;
}

/* ── HEADER ── */
header {
  padding: 48px 20px 14px;
  background: #141414;
  border-bottom: 1px solid #2a2a2a;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-top { display: flex; justify-content: space-between; align-items: flex-start; }
.header-title { font-family: 'Montserrat', sans-serif; font-size: 26px; font-weight: 900; letter-spacing: -0.5px; color: #ffffff; line-height: 1; }
.header-title span { color: #f5e642; }
.window-pill { background: rgba(48,209,88,0.15); border: 1px solid rgba(48,209,88,0.3); color: #30d158; font-size: 11px; font-weight: 600; padding: 5px 10px; border-radius: 20px; margin-top: 2px; }
.header-date { font-size: 12px; color: #bbbbbb; margin-top: 5px; }

/* ── TABS ── */
.tabs { display: flex; background: #141414; border-bottom: 1px solid #2a2a2a; position: sticky; top: 94px; z-index: 99; }
.tab { flex: 1; padding: 12px 2px; text-align: center; font-size: 11px; font-weight: 700; cursor: pointer; color: #bbbbbb; border-bottom: 2px solid transparent; transition: all 0.2s; text-transform: uppercase; font-family: 'Montserrat', sans-serif; letter-spacing: 0.3px; background: #141414; }
.tab.active { color: #f5e642; border-bottom-color: #f5e642; }

/* ── PANELS ── */
.panel { display: none; padding: 14px; background: #0a0a0a; }
.panel.active { display: block; }

/* ── CALORIE HERO ── */
.cal-hero-card { background: #1a1a1a; border: 1px solid #333; border-radius: 20px; padding: 18px; margin-bottom: 12px; }
.cal-top-row { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.cal-eyebrow { font-size: 10px; font-weight: 600; color: #bbbbbb; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 4px; }
.cal-number { font-family: 'Montserrat', sans-serif; font-size: 68px; font-weight: 900; line-height: 0.9; letter-spacing: -2px; color: #f5e642; }
.cal-unit { font-size: 16px; font-weight: 600; color: #aaaaaa; margin-left: 3px; vertical-align: super; font-family: 'Inter', sans-serif; }
.cal-right-block { text-align: right; }
.cal-goal-label { font-size: 10px; font-weight: 700; color: #cccccc; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.cal-goal-range { font-size: 15px; font-weight: 800; color: #ffffff; margin-bottom: 6px; font-family: 'Montserrat', sans-serif; }
.cal-remaining-badge { display: inline-block; padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; font-family: 'Montserrat', sans-serif; }
.badge-green { background: rgba(48,209,88,0.15); color: #30d158; border: 1px solid rgba(48,209,88,0.25); }
.badge-orange { background: rgba(255,149,0,0.15); color: #ff9500; border: 1px solid rgba(255,149,0,0.25); }
.badge-red { background: rgba(255,69,58,0.15); color: #ff453a; border: 1px solid rgba(255,69,58,0.25); }
.cal-pbar { height: 6px; background: #333; border-radius: 3px; overflow: hidden; margin-bottom: 6px; }
.cal-pbar-fill { height: 100%; border-radius: 3px; transition: width 0.7s cubic-bezier(.4,0,.2,1); }
.cal-pbar-labels { display: flex; justify-content: space-between; font-size: 10px; color: #cccccc; font-weight: 500; }

/* ── MACRO GRID ── */
.macro-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.macro-card { background: #141414; border: 1px solid #333; border-radius: 16px; padding: 12px; position: relative; overflow: hidden; }
.macro-card-accent { position: absolute; top: 0; left: 0; right: 0; height: 3px; border-radius: 16px 16px 0 0; }
.macro-name-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.macro-name { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; font-family: 'Montserrat', sans-serif; }
.macro-goal-tag { font-size: 9px; font-weight: 600; color: #cccccc; background: #1e1e1e; padding: 2px 6px; border-radius: 6px; }
.macro-value { font-family: 'Montserrat', sans-serif; font-size: 34px; font-weight: 900; line-height: 1; letter-spacing: -1px; margin-bottom: 8px; }
.macro-pbar { height: 3px; background: #333; border-radius: 2px; overflow: hidden; margin-bottom: 5px; }
.macro-pbar-fill { height: 100%; border-radius: 2px; transition: width 0.7s ease; }
.macro-status { font-size: 10px; font-weight: 700; font-family: 'Montserrat', sans-serif; }
.macro-wide { grid-column: span 2; }

/* ── ACTIVITY ── */
.activity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.activity-card { background: #141414; border: 1px solid #333; border-radius: 16px; padding: 12px; }
.activity-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #cccccc; margin-bottom: 8px; font-family: 'Montserrat', sans-serif; }
.steps-input { width: 100%; background: #1e1e1e !important; border: 1px solid #333 !important; border-radius: 10px; color: #ffffff !important; font-family: 'Montserrat', sans-serif; font-size: 20px; font-weight: 800; padding: 8px 10px; outline: none; text-align: center; margin-bottom: 8px; }
.check-row { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check-box { width: 26px; height: 26px; border-radius: 8px; border: 2px solid #333; background: #1e1e1e; display: flex; align-items: center; justify-content: center; transition: all 0.2s; flex-shrink: 0; font-size: 13px; font-weight: 700; color: #ffffff; }
.check-box.on { background: #30d158; border-color: #30d158; color: #000; }
.check-main { font-size: 12px; font-weight: 600; color: #ffffff; }
.check-sub { font-size: 10px; color: #bbbbbb; margin-top: 1px; }
.check-sub.on { color: #30d158; }

/* ── MEAL CARDS ── */
.section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: #bbbbbb; margin: 14px 0 8px; font-family: 'Montserrat', sans-serif; }
.meal-card { background: #141414; border: 1px solid #333; border-radius: 14px; padding: 12px; margin-bottom: 8px; }
.meal-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.meal-type-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #f5e642; font-family: 'Montserrat', sans-serif; }
.meal-time { font-size: 11px; color: #bbbbbb; font-weight: 500; }
.del-btn { background: #1e1e1e !important; border: 1px solid #333 !important; color: #bbbbbb !important; width: 24px; height: 24px; border-radius: 6px; cursor: pointer; font-size: 11px; display: flex; align-items: center; justify-content: center; }
.meal-desc { font-size: 11px; color: #bbbbbb; margin-bottom: 8px; line-height: 1.5; font-style: italic; }
.meal-pills { display: flex; gap: 4px; flex-wrap: wrap; }
.pill { font-size: 10px; font-weight: 700; padding: 3px 7px; border-radius: 8px; font-family: 'Montserrat', sans-serif; }
.p-cal { background: rgba(245,230,66,0.12); color: #f5e642; }
.p-pro { background: rgba(62,207,255,0.12); color: #3ecfff; }
.p-carbs { background: rgba(255,149,0,0.12); color: #ff9500; }
.p-fat { background: rgba(255,77,109,0.12); color: #ff4d6d; }
.p-sugar { background: rgba(191,90,242,0.12); color: #bf5af2; }
.p-fiber { background: rgba(48,209,88,0.12); color: #30d158; }
.empty-state { text-align: center; padding: 28px 16px; color: #bbbbbb; }
.empty-icon { font-size: 36px; margin-bottom: 10px; }
.empty-text { font-size: 13px; line-height: 1.7; }
.empty-text strong { color: #eeeeee; }

/* ── LOG TAB ── */
.notes-card { background: #141414; border: 2px solid #666; border-radius: 16px; padding: 10px 12px; margin-bottom: 12px; }
.notes-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.notes-title { font-size: 13px; font-weight: 800; color: #ffffff; font-family: 'Montserrat', sans-serif; }
.clear-btn { background: #1e1e1e !important; border: 1px solid #444 !important; border-radius: 8px; color: #cccccc !important; font-size: 11px; font-weight: 700; padding: 4px 10px; cursor: pointer; font-family: 'Montserrat', sans-serif; }
textarea { width: 100%; background: #2a2a2a !important; border: 1.5px solid #666 !important; border-radius: 10px; color: #ffffff !important; font-family: 'Inter', sans-serif; font-size: 14px; line-height: 1.7; padding: 10px 12px; resize: none; min-height: 72px; max-height: 72px; outline: none; overflow-y: auto; }
textarea:focus { border-color: #f5e642 !important; }
textarea::placeholder { color: #888; font-size: 13px; }

/* ── DICTATE BUTTON ── */
.dictate-btn { width: 100%; padding: 15px; background: #ff453a !important; color: #ffffff !important; border: none !important; border-radius: 12px; font-family: 'Montserrat', sans-serif; font-size: 14px; font-weight: 900; letter-spacing: 1.5px; cursor: pointer; text-transform: uppercase; display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 12px; }
.dictate-btn:active { opacity: 0.85; transform: scale(0.98); }

/* ── LOG CARD ── */
.log-card { background: #141414; border: 1px solid #333; border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.log-section-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #bbbbbb; margin-bottom: 8px; font-family: 'Montserrat', sans-serif; }
.meal-type-row { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 14px; }
.meal-btn { padding: 6px 12px; border-radius: 20px; border: 1.5px solid #555 !important; background: #1e1e1e !important; color: #bbbbbb !important; font-size: 11px; font-weight: 700; cursor: pointer; font-family: 'Montserrat', sans-serif; }
.meal-btn.active { background: #f5e642 !important; color: #000000 !important; border-color: #f5e642 !important; }
.macro-inputs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.input-field { text-align: center; }
.macro-input { width: 100%; background: #1e1e1e !important; border: 1.5px solid #444 !important; border-radius: 10px; color: #ffffff !important; font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: 800; padding: 10px 4px; outline: none; text-align: center; }
.macro-input:focus { border-color: #f5e642 !important; }
.input-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-top: 4px; font-family: 'Montserrat', sans-serif; }
.desc-input { width: 100%; background: #1e1e1e !important; border: 1.5px solid #444 !important; border-radius: 10px; color: #ffffff !important; font-family: 'Inter', sans-serif; font-size: 13px; padding: 10px 12px; outline: none; margin-bottom: 12px; }
.desc-input::placeholder { color: #888; }
.add-btn { width: 100%; padding: 15px; background: #f5e642 !important; color: #000000 !important; border: none !important; border-radius: 12px; font-family: 'Montserrat', sans-serif; font-size: 14px; font-weight: 900; letter-spacing: 1.5px; cursor: pointer; text-transform: uppercase; }
.add-btn:active { transform: scale(0.98); opacity: 0.9; }

/* ── DICTATE OVERLAY ── */
.dictate-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 200; align-items: flex-end; justify-content: center; }
.dictate-overlay.open { display: flex; }
.dictate-panel { background: #181818; border: 1px solid #444; border-radius: 24px 24px 0 0; padding: 24px 20px 44px; width: 100%; max-width: 390px; }
.dictate-panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.dictate-panel-title { font-family: 'Montserrat', sans-serif; font-size: 17px; font-weight: 900; color: #ffffff; letter-spacing: -0.3px; }
.dictate-close-btn { background: #2a2a2a !important; border: 1px solid #444 !important; color: #bbbbbb !important; width: 32px; height: 32px; border-radius: 10px; cursor: pointer; font-size: 15px; display: flex; align-items: center; justify-content: center; font-family: 'Inter', sans-serif; }
.mic-circle-wrap { display: flex; flex-direction: column; align-items: center; margin-bottom: 22px; gap: 14px; }
.mic-circle { width: 88px; height: 88px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; transition: all 0.25s; border: none !important; }
.mic-circle.idle { background: #2a2a2a !important; }
.mic-circle.recording { background: rgba(255,69,58,0.18) !important; border: 2px solid #ff453a !important; }
.mic-circle.recording::before { content: ''; position: absolute; inset: -10px; border-radius: 50%; border: 2px solid rgba(255,69,58,0.25); animation: ripple 1.4s ease-out infinite; }
.mic-circle.recording::after { content: ''; position: absolute; inset: -20px; border-radius: 50%; border: 2px solid rgba(255,69,58,0.12); animation: ripple 1.4s ease-out 0.4s infinite; }
@keyframes ripple { 0% { transform: scale(0.95); opacity: 1; } 100% { transform: scale(1.1); opacity: 0; } }
.mic-circle.processing { background: rgba(245,230,66,0.1) !important; border: 2px solid #f5e642 !important; }
.dictate-status-line { font-family: 'Montserrat', sans-serif; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; text-align: center; }
.dictate-status-line.idle { color: #888; }
.dictate-status-line.recording { color: #ff453a; }
.dictate-status-line.processing { color: #f5e642; }
.dictate-status-line.done { color: #30d158; }
.start-rec-btn { padding: 10px 24px; background: #ff453a !important; color: #ffffff !important; border: none !important; border-radius: 24px; font-family: 'Montserrat', sans-serif; font-size: 12px; font-weight: 900; letter-spacing: 1px; cursor: pointer; text-transform: uppercase; }
.start-rec-btn:active { transform: scale(0.97); }
.transcript-section { margin-bottom: 18px; }
.transcript-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #888; margin-bottom: 8px; font-family: 'Montserrat', sans-serif; }
.transcript-textarea { width: 100%; background: #242424 !important; border: 1.5px solid #444 !important; border-radius: 14px; color: #ffffff !important; font-family: 'Inter', sans-serif; font-size: 14px; line-height: 1.7; padding: 14px; min-height: 90px; max-height: 90px; outline: none; resize: none; }
.transcript-textarea:focus { border-color: rgba(255,69,58,0.5) !important; }
.transcript-textarea.has-text { border-color: rgba(48,209,88,0.4) !important; }
.transcript-textarea::placeholder { color: #555; font-size: 13px; font-style: italic; }
.dictate-meal-type-row { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 16px; }
.dictate-action-row { display: flex; gap: 8px; }
.btn-add-meal { flex: 1; padding: 14px; background: #30d158 !important; color: #000000 !important; border: none !important; border-radius: 12px; font-family: 'Montserrat', sans-serif; font-size: 12px; font-weight: 900; letter-spacing: 1px; cursor: pointer; text-transform: uppercase; opacity: 0.35; transition: opacity 0.2s; }
.btn-add-meal.ready { opacity: 1; }
.btn-record-again { flex: 1; padding: 14px; background: #ff453a !important; color: #ffffff !important; border: none !important; border-radius: 12px; font-family: 'Montserrat', sans-serif; font-size: 12px; font-weight: 900; letter-spacing: 1px; cursor: pointer; text-transform: uppercase; opacity: 0.35; transition: opacity 0.2s; }
.btn-record-again.ready { opacity: 1; }
.btn-cancel { padding: 14px 16px; background: #1e1e1e !important; color: #bbbbbb !important; border: 1px solid #444 !important; border-radius: 12px; font-family: 'Montserrat', sans-serif; font-size: 12px; font-weight: 700; cursor: pointer; text-transform: uppercase; }

/* ── WEEK TAB ── */
.week-banner { background: #141414; border: 1px solid #333; border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.banner-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.banner-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #cccccc; font-family: 'Montserrat', sans-serif; }
.banner-nums { font-family: 'Montserrat', sans-serif; font-size: 20px; font-weight: 900; color: #f5e642; }
.banner-denom { font-size: 13px; font-weight: 600; color: #cccccc; }
.banner-status { font-size: 11px; color: #dddddd; margin-top: 6px; font-weight: 500; }
.week-card { background: #141414; border: 1px solid #333; border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.week-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.week-card-title { font-family: 'Montserrat', sans-serif; font-size: 13px; font-weight: 800; color: #ffffff; }
.week-range-label { font-size: 10px; color: #cccccc; font-weight: 500; }
.metric-row { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 14px; }
.m-btn { padding: 5px 10px; border-radius: 20px; border: 1.5px solid #333 !important; background: #1e1e1e !important; color: #bbbbbb !important; font-size: 10px; font-weight: 700; cursor: pointer; font-family: 'Montserrat', sans-serif; text-transform: uppercase; }
.m-btn.mc { background: rgba(245,230,66,0.12) !important; color: #f5e642 !important; border-color: rgba(245,230,66,0.4) !important; }
.m-btn.mp { background: rgba(62,207,255,0.12) !important; color: #3ecfff !important; border-color: rgba(62,207,255,0.4) !important; }
.m-btn.mcb { background: rgba(255,149,0,0.12) !important; color: #ff9500 !important; border-color: rgba(255,149,0,0.4) !important; }
.m-btn.mf { background: rgba(255,77,109,0.12) !important; color: #ff4d6d !important; border-color: rgba(255,77,109,0.4) !important; }
.m-btn.ms { background: rgba(191,90,242,0.12) !important; color: #bf5af2 !important; border-color: rgba(191,90,242,0.4) !important; }
.m-btn.mfb { background: rgba(48,209,88,0.12) !important; color: #30d158 !important; border-color: rgba(48,209,88,0.4) !important; }
.bars-wrap { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-bottom: 26px; position: relative; }
.goal-line { position: absolute; left: 0; right: 0; border-top: 1px dashed rgba(245,230,66,0.25); pointer-events: none; }
.goal-line-label { position: absolute; right: 0; top: -14px; font-size: 9px; color: #f5e642; font-weight: 700; font-family: 'Montserrat', sans-serif; }
.bw { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; position: relative; }
.bar { width: 100%; border-radius: 5px 5px 0 0; transition: height 0.5s cubic-bezier(.4,0,.2,1); min-height: 3px; }
.bv { font-size: 8px; font-weight: 800; position: absolute; top: -15px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-family: 'Montserrat', sans-serif; }
.bd { position: absolute; bottom: -21px; font-size: 9px; color: #bbbbbb; text-transform: uppercase; font-weight: 700; font-family: 'Montserrat', sans-serif; }
.bw.today .bd { color: #f5e642; }
.sum-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid #2a2a2a; }
.sum-row:last-child { border-bottom: none; }
.sum-label { color: #cccccc; font-weight: 500; font-size: 11px; }
.sum-val { font-weight: 700; font-family: 'Montserrat', sans-serif; font-size: 12px; color: #ffffff; }
.nav-btn { background: #1e1e1e !important; border: 1px solid #333 !important; color: #cccccc !important; width: 28px; height: 28px; border-radius: 8px; font-size: 14px; cursor: pointer; }

/* ── WEIGHT TAB ── */
.wt-log-btn { padding: 12px 16px; background: #f5e642 !important; color: #000 !important; border: none !important; border-radius: 12px; font-family: 'Montserrat', sans-serif; font-size: 12px; font-weight: 900; cursor: pointer; white-space: nowrap; }

/* ── GOALS TAB ── */
.goals-hero { background: #1a1a1a; border: 1px solid #333; border-radius: 20px; padding: 16px; margin-bottom: 12px; }
.goals-hero-title { font-family: 'Montserrat', sans-serif; font-size: 15px; font-weight: 900; color: #ffffff; margin-bottom: 4px; }
.goals-hero-sub { font-size: 11px; color: #cccccc; line-height: 1.6; margin-bottom: 12px; }
.goal-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #2a2a2a; }
.goal-row:last-child { border-bottom: none; }
.goal-name { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 2px; font-family: 'Montserrat', sans-serif; }
.goal-range { font-size: 13px; font-weight: 700; color: #eeeeee; font-family: 'Montserrat', sans-serif; }
.goal-why { font-size: 10px; color: #cccccc; text-align: right; max-width: 130px; line-height: 1.4; }

/* ── TOAST ── */
.toast { position: fixed; bottom: 110px; left: 50%; transform: translateX(-50%); background: #ffffff; color: #000; padding: 10px 20px; border-radius: 20px; font-weight: 700; font-size: 13px; opacity: 0; transition: opacity 0.25s; pointer-events: none; z-index: 999; white-space: nowrap; font-family: 'Montserrat', sans-serif; }
.toast.show { opacity: 1; }

/* ── DOTS ANIMATION ── */
.dots { display: inline-flex; gap: 4px; margin-left: 4px; vertical-align: middle; }
.dot { width: 5px; height: 5px; border-radius: 50%; background: #f5e642; animation: db 1s ease-in-out infinite; }
.dot:nth-child(2) { animation-delay: 0.15s; }
.dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes db { 0%, 100% { transform: translateY(0); opacity: 0.4; } 50% { transform: translateY(-4px); opacity: 1; } }
