/* TwinVital — full app stylesheet */

:root {
  --bg: #F4F2EC;
  --surface: #FFFFFF;
  --surface-2: #F1EFE8;
  --surface-3: #F8F6F0;
  --ink: #2C2C2A;
  --ink-2: #5F5E5A;
  --ink-3: #888780;
  --line: rgba(0,0,0,0.08);
  --line-2: rgba(0,0,0,0.15);
  --brand: #1D9E75;
  --brand-dark: #0F6E56;
  --brand-tint: #F0FBF5;
  --good: #639922;
  --good-bg: #EAF3DE;
  --good-ink: #173404;
  --warn: #EF9F27;
  --warn-bg: #FAEEDA;
  --warn-ink: #633806;
  --bad: #E24B4A;
  --bad-bg: #FCEBEB;
  --bad-ink: #501313;
  --blue: #378ADD;
  --blue-bg: #E6F1FB;
  --blue-ink: #042C53;
  --purple: #7F77DD;
  --purple-bg: #EEEDFE;
  --purple-ink: #26215C;
  --coral: #D85A30;
  --coral-bg: #FAECE7;
  --coral-ink: #4A1B0C;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-pill: 999px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
}
body { display: flex; justify-content: center; align-items: stretch; }

.frame {
  width: 100%;
  max-width: 420px;
  height: 100%;
  background: var(--surface);
  position: relative;
  overflow: hidden;
}
@media (min-width: 500px) {
  html, body { height: 100vh; overflow: hidden; }
  body { background: #DDD9D0; padding: 24px 0; align-items: center; }
  .frame {
    max-width: 390px;
    height: 820px;
    flex-shrink: 0;
    border-radius: 44px;
    border: 9px solid #1a1a1a;
    box-shadow: 0 24px 70px rgba(0,0,0,0.28), 0 0 0 2px rgba(255,255,255,0.05) inset;
  }
}

.screen {
  display: none;
  flex-direction: column;
  position: absolute;
  inset: 0;
  animation: fadeIn 0.22s ease;
  background: var(--surface);
}
.screen.active { display: flex; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }

.content { flex: 1; overflow-y: auto; padding: 16px 18px calc(96px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
.content.no-nav { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }

/* ===== TOP BAR ===== */
.topbar { display: flex; align-items: center; gap: 10px; padding: 14px 18px 6px; position: sticky; top: 0; z-index: 10; background: var(--surface); }
.topbar h1 { margin: 0; font-size: 16px; font-weight: 600; flex: 1; }
.topbar .step-label { flex: 1; }
.topbar .step-label .step { margin: 0; font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.6px; }
.topbar .step-label .title { margin: 1px 0 0; font-size: 14px; font-weight: 500; }
.topbar .icon-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); flex-shrink: 0; }
.topbar.dark { background: transparent; }
.topbar.dark h1 { color: white; }
.topbar.dark .icon-btn { background: rgba(255,255,255,0.15); color: white; }
.topbar .icon-btn:active { transform: scale(0.94); }

.progress-bar { display: flex; gap: 4px; padding: 0 18px 4px; }
.progress-bar .seg { flex: 1; height: 3px; background: rgba(0,0,0,0.1); border-radius: 2px; }
.progress-bar .seg.done { background: var(--brand); }
.progress-bar.dark .seg { background: rgba(255,255,255,0.2); }
.progress-bar.dark .seg.done { background: var(--brand); }

/* ===== BOTTOM NAV ===== */
.nav { position: absolute; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-around; background: var(--surface); padding: 6px 6px calc(12px + env(safe-area-inset-bottom)); border-top: 0.5px solid var(--line); z-index: 20; }
.nav button { background: transparent; border: none; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--ink-3); font-size: 10px; font-weight: 500; padding: 6px 6px; cursor: pointer; transition: color 0.15s; font-family: inherit; }
.nav button i { font-size: 22px; }
.nav button.active { color: var(--brand-dark); }
.nav .scan-btn { width: 58px; height: 58px; border-radius: 50%; background: var(--ink); color: white; margin-top: -22px; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(0,0,0,0.2); }
.nav .scan-btn i { font-size: 26px; color: white; }
.nav .scan-btn:active { transform: scale(0.95); }

/* ===== UTILITY ===== */
.lead { margin: 8px 0 6px; font-size: 22px; font-weight: 600; }
.lead-sub { margin: 0 0 18px; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.section-label { margin: 14px 0 8px; font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; }
.btn { border: none; border-radius: var(--r-pill); padding: 14px; font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit; }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--ink); color: white; }
.btn.brand { background: var(--brand); color: white; }
.btn.secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); }
.btn.full { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn.full i { font-size: 20px; }
.action-row { display: flex; gap: 8px; }

#screen-stats .content > .btn.brand.full:last-child,
#screen-reveal .action-row {
  position: sticky;
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 12;
  box-shadow: 0 10px 24px rgba(0,0,0,0.14);
}

/* ===== WELCOME ===== */
#screen-welcome { background: linear-gradient(180deg, var(--brand-tint) 0%, var(--surface) 60%); }
.welcome-hero { text-align: center; margin-top: 36px; }
.welcome-logo { width: 88px; height: 88px; margin: 0 auto 18px; background: var(--brand); border-radius: 26px; display: flex; align-items: center; justify-content: center; box-shadow: 0 12px 30px rgba(29,158,117,0.3); }
.welcome-logo i { font-size: 46px; color: white; }
.welcome-hero h1 { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: -0.6px; }
.welcome-hero p { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); }
.feature { display: flex; gap: 14px; margin-bottom: 14px; align-items: flex-start; }
.feature .ic { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.feature .ic i { font-size: 18px; }
.feature .ic.scan { background: var(--blue-bg); color: var(--blue-ink); }
.feature .ic.twin { background: var(--good-bg); color: var(--good-ink); }
.feature .ic.heart { background: var(--bad-bg); color: var(--bad-ink); }
.feature .ic.move { background: var(--coral-bg); color: var(--coral-ink); }
.feature .name { margin: 0; font-size: 14px; font-weight: 600; }
.feature .desc { margin: 1px 0 0; font-size: 12px; color: var(--ink-2); line-height: 1.45; }
.privacy-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; background: var(--surface-2); border-radius: var(--r-pill); font-size: 11px; color: var(--ink-2); margin: 0 auto; }

/* ===== CAMERA / PHOTOS / SCAN ===== */
.dark-screen { background: #1a1a1a; color: white; }
.dark-screen.active { display: flex; flex-direction: column; }
.cam-stage { flex: 1; margin: 12px 22px; border-radius: 18px; background: #000; position: relative; overflow: hidden; min-height: 200px; display: flex; align-items: center; justify-content: center; }
.cam-stage video, .cam-stage canvas.preview { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-stage.placeholder { background: linear-gradient(180deg, #2a2a2a, #1a1a1a); border: 2px dashed rgba(255,255,255,0.25); }
.cam-overlay { position: absolute; inset: 0; pointer-events: none; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.cam-overlay .corner { position: absolute; width: 26px; height: 26px; border: 3px solid var(--brand); }
.cam-overlay .corner.tl { top: 10px; left: 10px; border-right: none; border-bottom: none; border-top-left-radius: 8px; }
.cam-overlay .corner.tr { top: 10px; right: 10px; border-left: none; border-bottom: none; border-top-right-radius: 8px; }
.cam-overlay .corner.bl { bottom: 10px; left: 10px; border-right: none; border-top: none; border-bottom-left-radius: 8px; }
.cam-overlay .corner.br { bottom: 10px; right: 10px; border-left: none; border-top: none; border-bottom-right-radius: 8px; }
.cam-hint { color: rgba(255,255,255,0.7); font-size: 13px; text-align: center; padding: 0 30px; }
.silhouette { opacity: 0.4; }
.photo-title { text-align: center; margin: 6px 0 4px; }
.photo-title .main { margin: 0; font-size: 17px; font-weight: 600; }
.photo-title .sub { margin: 2px 0 0; font-size: 12px; color: rgba(255,255,255,0.65); }
.photo-thumbs { display: flex; gap: 8px; margin: 8px 22px 18px; }
.pthumb { flex: 1; aspect-ratio: 1; border-radius: 12px; display: flex; align-items: center; justify-content: center; position: relative; }
.pthumb.done { background: var(--brand); }
.pthumb.done i { font-size: 22px; color: white; }
.pthumb.active { background: rgba(29,158,117,0.2); border: 2px solid var(--brand); }
.pthumb.active i { font-size: 22px; color: var(--brand); }
.pthumb.pending { background: rgba(255,255,255,0.08); }
.pthumb.pending i { font-size: 22px; color: rgba(255,255,255,0.4); }
.pthumb .lbl { position: absolute; bottom: -16px; left: 0; right: 0; font-size: 10px; text-align: center; color: rgba(255,255,255,0.55); }
.pthumb.active .lbl { color: rgba(255,255,255,0.9); font-weight: 500; }

.scan-modes { display: flex; gap: 8px; padding: 0 18px 12px; justify-content: center; }
.scan-mode { padding: 8px 16px; background: rgba(255,255,255,0.1); color: white; border: none; border-radius: var(--r-pill); font-size: 13px; cursor: pointer; font-family: inherit; }
.scan-mode.active { background: white; color: var(--ink); font-weight: 500; }

.shutter-row { display: flex; align-items: center; justify-content: space-between; padding: 0 22px 24px; }
.shutter { width: 70px; height: 70px; border-radius: 50%; background: white; border: 4px solid rgba(255,255,255,0.3); cursor: pointer; }
.shutter:active { transform: scale(0.92); }
.shutter-side { width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,0.15); color: white; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.shutter-side i { font-size: 20px; }
.privacy-line { margin: 12px 0 14px; font-size: 11px; text-align: center; color: rgba(255,255,255,0.5); line-height: 1.5; padding: 0 22px; }

.scanning-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.88); display: none; align-items: center; justify-content: center; flex-direction: column; gap: 14px; z-index: 30; color: white; }
.scanning-overlay.show { display: flex; }
.spinner { width: 54px; height: 54px; border: 3px solid rgba(255,255,255,0.2); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.8s linear infinite; }

/* ===== AI ANALYZING ===== */
#screen-analyzing { background: linear-gradient(180deg, #1a1a1a 0%, #2a2a2a 100%); color: white; }
.analyzing-wrap { flex: 1; display: flex; flex-direction: column; padding: 60px 26px 26px; }
.ai-spinner-wrap { text-align: center; margin-top: 40px; }
.ai-spinner { width: 92px; height: 92px; margin: 0 auto 22px; border-radius: 50%; background: rgba(29,158,117,0.15); display: flex; align-items: center; justify-content: center; position: relative; }
.ai-spinner::before { content: ''; position: absolute; inset: -10px; border: 3px solid var(--brand); border-top-color: transparent; border-radius: 50%; animation: spin 1.2s linear infinite; }
.ai-spinner i { font-size: 40px; color: var(--brand); }
.ai-title { margin: 0; font-size: 22px; font-weight: 600; text-align: center; }
.ai-subtitle { margin: 10px 0 0; font-size: 13px; color: rgba(255,255,255,0.6); text-align: center; line-height: 1.5; padding: 0 12px; }
.ai-checklist { margin-top: auto; background: rgba(255,255,255,0.06); border-radius: 14px; padding: 14px 16px; }
.ai-check-row { display: flex; gap: 10px; align-items: center; font-size: 13px; margin-bottom: 10px; }
.ai-check-row:last-child { margin-bottom: 0; }
.ai-check-row i { font-size: 16px; }
.ai-check-row.done i { color: var(--brand); }
.ai-check-row.doing { color: rgba(255,255,255,0.8); }
.ai-check-row.pending { color: rgba(255,255,255,0.4); }
.ai-check-row .doing-spinner { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.4); border-top-color: transparent; border-radius: 50%; animation: spin 1s linear infinite; }

/* ===== AVATAR REVEAL ===== */
#screen-reveal { background: linear-gradient(180deg, var(--brand-tint) 0%, var(--surface) 50%); }
.avatar-stage { margin: 4px 0 0; height: 300px; position: relative; background: radial-gradient(ellipse at center bottom, #C0DD97 0%, transparent 70%); }
.avatar-stage canvas { width: 100%; height: 100%; display: block; }
.customize-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 14px; }
.customize-btn { background: white; border: 1px solid var(--line-2); border-radius: 12px; padding: 12px; font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 8px; justify-content: center; cursor: pointer; font-family: inherit; }
.customize-btn i { font-size: 18px; }
.customize-btn:active { transform: scale(0.98); }

/* ===== STATS ===== */
.stat-row { background: var(--surface-3); border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.stat-row.goal { background: var(--good-bg); border: 1px solid #C0DD97; }
.stat-row .head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.stat-row .head .lbl { margin: 0; font-size: 11px; color: var(--ink-2); }
.stat-row.goal .head .lbl { color: var(--good-ink); font-weight: 500; }
.stat-row .head .val { margin: 0; font-size: 20px; font-weight: 600; }
.stat-row .head .val .u { font-size: 11px; color: var(--ink-2); font-weight: 400; margin-left: 2px; }
.stat-row.goal .head .val { color: var(--good-ink); }
.stat-row.goal .head .val .u { color: var(--good-ink); }
.stat-row input[type="range"] { width: 100%; accent-color: var(--brand); }
.stat-row .note { margin: 6px 0 0; font-size: 11px; color: var(--good-ink); }
.pair-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.pair-grid .stat-row { margin-bottom: 0; }
.seg-btn-row { display: flex; gap: 4px; }
.seg-btn { flex: 1; padding: 6px; border: none; border-radius: 6px; font-size: 12px; cursor: pointer; font-family: inherit; }
.seg-btn.on { background: var(--ink); color: white; font-weight: 500; }
.seg-btn.off { background: white; color: var(--ink-2); border: 1px solid var(--line); }
.activity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 18px; }
.activity-btn { padding: 10px; border-radius: 10px; text-align: left; font-family: inherit; cursor: pointer; }
.activity-btn.on { background: var(--ink); color: white; border: none; }
.activity-btn.off { background: white; color: var(--ink); border: 1px solid var(--line); }
.activity-btn .main { display: block; font-size: 12px; font-weight: 600; }
.activity-btn .sub { display: block; font-size: 11px; opacity: 0.7; margin-top: 1px; }

/* ===== PLAN ===== */
.cal-card { background: white; border: 1px solid var(--line); border-radius: 16px; padding: 18px; text-align: center; margin-bottom: 12px; }
.cal-card .lbl { margin: 0; font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; }
.cal-card .big { margin: 6px 0 0; font-size: 38px; font-weight: 700; color: var(--brand); letter-spacing: -1px; }
.cal-card .big .u { font-size: 14px; color: var(--ink-2); font-weight: 400; }
.cal-card .formula { margin: 4px 0 0; font-size: 11px; color: var(--ink-2); }
.macro-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.macro-grid .m { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; }
.macro-grid .m .lbl { margin: 0; font-size: 11px; color: var(--ink-2); }
.macro-grid .m .val { margin: 4px 0 2px; font-size: 18px; font-weight: 600; }
.macro-grid .m .pct { margin: 0; font-size: 10px; color: var(--ink-3); }
.macro-grid .m.p .val { color: var(--brand); }
.macro-grid .m.c .val { color: #BA7517; }
.macro-grid .m.f .val { color: var(--purple); }
.flag-card { border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; display: flex; gap: 8px; align-items: flex-start; font-size: 12px; line-height: 1.45; }
.flag-card i { font-size: 16px; margin-top: 1px; flex-shrink: 0; }
.flag-card.chol { background: var(--bad-bg); border: 1px solid #F7C1C1; color: var(--bad-ink); }
.flag-card.chol i { color: var(--bad-ink); }
.flag-card.diab { background: var(--blue-bg); border: 1px solid #B5D4F4; color: var(--blue-ink); }
.flag-card.diab i { color: var(--blue-ink); }
.milestone-card { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 12px 0 16px; }
.milestone-card .lbl { margin: 0 0 4px; font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.6px; }
.milestone-card .txt { margin: 0; font-size: 14px; font-weight: 500; }
.milestone-card .txt b { color: var(--brand); font-weight: 600; }

/* ===== HOME ===== */
.greeting { padding: 4px 0 10px; }
.greeting .day { margin: 0; font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.6px; }
.greeting h2 { margin: 2px 0 0; font-size: 22px; font-weight: 600; }
.tags-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tag { font-size: 11px; padding: 4px 10px; border-radius: var(--r-pill); font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.tag i { font-size: 12px; }
.tag.chol { background: var(--bad-bg); color: var(--bad-ink); }
.tag.diab { background: var(--blue-bg); color: var(--blue-ink); }
.tag.loss { background: var(--good-bg); color: var(--good-ink); }
.tag.hyp { background: var(--purple-bg); color: var(--purple-ink); }

.home-hero { background: linear-gradient(160deg, var(--brand-tint) 0%, white 100%); border-radius: 20px; padding: 12px 14px 8px; margin-bottom: 12px; display: grid; grid-template-columns: 120px 1fr; gap: 10px; align-items: center; }
.home-avatar { width: 120px; height: 160px; position: relative; }
.home-avatar canvas { width: 100%; height: 100%; display: block; }
.home-ring-area { text-align: center; }
.home-ring-area .ring-svg { display: block; margin: 0 auto; }
.home-ring-area .remain { margin: 2px 0 0; font-size: 11px; color: var(--ink-2); }

.macros { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.macro { background: var(--surface-2); border-radius: var(--r-md); padding: 10px 8px; text-align: center; }
.macro .lbl { margin: 0; font-size: 11px; color: var(--ink-2); }
.macro .val { margin: 2px 0 5px; font-size: 16px; font-weight: 600; }
.macro .bar { height: 4px; background: rgba(0,0,0,0.08); border-radius: 2px; overflow: hidden; }
.macro .bar > div { height: 100%; border-radius: 2px; }

.health-strip { cursor: pointer; background: white; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; display: grid; grid-template-columns: auto 1fr 1fr 1fr auto; gap: 10px; align-items: center; }
.health-strip .hs-logo { width: 32px; height: 32px; border-radius: 8px; background: #1428A0; display: flex; align-items: center; justify-content: center; }
.health-strip .hs-logo i { font-size: 18px; color: white; }
.health-strip .hs-cell { text-align: center; }
.health-strip .hs-cell p { margin: 0; }
.health-strip .hs-cell .l { font-size: 10px; color: var(--ink-2); }
.health-strip .hs-cell .v { margin: 1px 0 0; font-size: 13px; font-weight: 700; }
.health-strip .hs-chev { font-size: 16px; color: var(--ink-3); }

.quick-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.qt { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 12px; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 4px; font-family: inherit; }
.qt:active { transform: scale(0.98); }
.qt .qt-top { display: flex; align-items: center; gap: 8px; }
.qt .qt-ic { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qt .qt-ic i { font-size: 16px; }
.qt.water .qt-ic { background: var(--blue-bg); }
.qt.water .qt-ic i { color: var(--blue-ink); }
.qt.workout .qt-ic { background: var(--coral-bg); }
.qt.workout .qt-ic i { color: var(--coral-ink); }
.qt.coach .qt-ic { background: var(--good-bg); }
.qt.coach .qt-ic i { color: var(--good-ink); }
.qt.progress .qt-ic { background: var(--purple-bg); }
.qt.progress .qt-ic i { color: var(--purple-ink); }
.qt .qt-lbl { font-size: 11px; color: var(--ink-2); font-weight: 500; flex: 1; }
.qt .qt-val { margin: 0; font-size: 16px; font-weight: 700; color: var(--ink); }
.qt .qt-sub { margin: 0; font-size: 11px; color: var(--ink-3); }
.water-pips { display: flex; gap: 3px; margin-top: 4px; }
.water-pips .p { flex: 1; height: 4px; border-radius: 2px; background: rgba(0,0,0,0.08); }
.water-pips .p.full { background: var(--blue); }

.coach-tile { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%); color: white; border-radius: 14px; padding: 14px; margin-bottom: 14px; cursor: pointer; }
.coach-tile .row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.coach-tile .row .ic { width: 28px; height: 28px; border-radius: 8px; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; }
.coach-tile .row .ic i { font-size: 16px; }
.coach-tile .row .lbl { font-size: 10px; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; }
.coach-tile p { margin: 0; font-size: 13px; line-height: 1.5; }
.coach-tile .cta { margin-top: 10px; font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 4px; opacity: 0.95; }

.meal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 11px 14px; margin-bottom: 6px; display: flex; align-items: center; gap: 12px; }
.meal .stripe { width: 5px; align-self: stretch; border-radius: 3px; }
.meal .info { flex: 1; min-width: 0; }
.meal .name { margin: 0; font-size: 14px; font-weight: 500; }
.meal .sub { margin: 2px 0 0; font-size: 11px; color: var(--ink-2); }
.meal .verdict { font-size: 10px; padding: 3px 8px; border-radius: var(--r-pill); font-weight: 600; letter-spacing: 0.3px; }
.verdict.good { background: var(--good-bg); color: var(--good-ink); }
.verdict.warn { background: var(--warn-bg); color: var(--warn-ink); }
.verdict.bad { background: var(--bad-bg); color: var(--bad-ink); }
.no-meals { padding: 20px; text-align: center; color: var(--ink-3); font-size: 13px; background: var(--surface-2); border-radius: 12px; }

/* ===== SCAN RESULT ===== */
.verdict-card { border-radius: var(--r-lg); padding: 22px 18px; text-align: center; margin-bottom: 14px; border: 1px solid transparent; }
.verdict-card.bad { background: var(--bad-bg); border-color: #F7C1C1; }
.verdict-card.good { background: var(--good-bg); border-color: #C0DD97; }
.verdict-card.warn { background: var(--warn-bg); border-color: #FAC775; }
.verdict-card .icon-bubble { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; }
.verdict-card.bad .icon-bubble { background: var(--bad); }
.verdict-card.good .icon-bubble { background: var(--good); }
.verdict-card.warn .icon-bubble { background: var(--warn); }
.verdict-card .icon-bubble i { font-size: 28px; color: white; }
.verdict-card .title { margin: 0; font-size: 22px; font-weight: 600; }
.verdict-card.bad .title { color: var(--bad-ink); }
.verdict-card.good .title { color: var(--good-ink); }
.verdict-card.warn .title { color: var(--warn-ink); }
.verdict-card .subtitle { margin: 4px 0 0; font-size: 13px; opacity: 0.85; }
.reason-list { background: var(--surface-2); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.reason-list .lbl { margin: 0 0 10px; font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; }
.reason { display: flex; gap: 10px; margin-bottom: 8px; font-size: 13px; line-height: 1.45; }
.reason:last-child { margin-bottom: 0; }
.reason i { flex-shrink: 0; margin-top: 2px; font-size: 16px; }
.reason.bad i { color: var(--bad); }
.reason.warn i { color: var(--warn); }
.reason.good i { color: var(--good); }
.reason b { font-weight: 600; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.stat { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.stat .lbl { margin: 0; font-size: 11px; color: var(--ink-2); }
.stat .val { margin: 4px 0 0; font-size: 18px; font-weight: 600; }
.stat .flag { font-size: 11px; font-weight: 500; margin-left: 4px; }
.flag.high { color: var(--bad-ink); }
.swap-card { background: var(--good-bg); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.swap-card .lbl { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--good-ink); display: flex; align-items: center; gap: 4px; }
.swap-card p { margin: 0; font-size: 13px; color: var(--good-ink); line-height: 1.45; }

/* ===== PROGRESS ===== */
.progress-trio { background: linear-gradient(180deg, var(--brand-tint) 0%, #E5F5EC 100%); border-radius: 18px; padding: 12px; margin-bottom: 14px; }
.progress-trio-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; }
.ptile { text-align: center; }
.ptile .day { margin: 0 0 2px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.ptile.start .day, .ptile.goal .day { color: var(--ink-2); }
.ptile.now .day { color: var(--brand-dark); font-weight: 600; }
.ptile .canvas-holder { width: 80px; height: 130px; margin: 0 auto; }
.ptile .kg { margin: 4px 0 0; font-size: 13px; font-weight: 600; }
.ptile.now .kg { color: var(--brand-dark); }
.ptile .role { margin: 0; font-size: 10px; color: var(--ink-2); }
.ptile.now .role { color: var(--brand-dark); font-weight: 500; }
.ptile.goal { opacity: 0.7; }
.morph-slider { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.morph-slider .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.morph-slider .head .lbl { margin: 0; font-size: 12px; color: var(--ink-2); }
.morph-slider .head .v { margin: 0; font-size: 14px; font-weight: 600; }
.morph-slider input[type="range"] { width: 100%; accent-color: var(--brand); }
.morph-slider .scale { display: flex; justify-content: space-between; font-size: 10px; color: var(--ink-3); margin-top: 2px; }
.summary-card { background: var(--good-bg); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.summary-card .ic { width: 36px; height: 36px; border-radius: 50%; background: var(--brand); display: flex; align-items: center; justify-content: center; }
.summary-card .ic i { font-size: 18px; color: white; }
.summary-card .a { margin: 0; font-size: 13px; font-weight: 600; color: var(--good-ink); }
.summary-card .b { margin: 1px 0 0; font-size: 11px; color: var(--good-ink); opacity: 0.85; }
.chart-card { background: var(--surface-3); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.chart-card .head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.chart-card .head .lbl { margin: 0; font-size: 12px; color: var(--ink-2); }
.chart-card .head .delta { font-size: 11px; padding: 2px 8px; background: var(--good-bg); color: var(--good-ink); border-radius: var(--r-pill); font-weight: 500; }
.reward-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.reward { border-radius: 12px; padding: 12px; text-align: center; }
.reward i { font-size: 24px; }
.reward .v { margin: 4px 0 0; font-size: 17px; font-weight: 600; }
.reward .l { margin: 0; font-size: 11px; }
.reward.streak { background: var(--warn-bg); }
.reward.streak i, .reward.streak .v { color: var(--warn-ink); }
.reward.streak .l { color: #854F0B; }
.reward.club { background: var(--purple-bg); }
.reward.club i, .reward.club .v { color: var(--purple-ink); }
.reward.club .l { color: #3C3489; }

/* ===== RECIPES ===== */
.chip-row { display: flex; gap: 6px; margin-bottom: 14px; overflow-x: auto; padding-bottom: 4px; }
.chip-row::-webkit-scrollbar { display: none; }
.chip { font-size: 12px; padding: 6px 12px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink-2); white-space: nowrap; cursor: pointer; border: none; font-family: inherit; }
.chip.active { background: var(--ink); color: white; }
.ai-banner { background: var(--good-bg); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.ai-banner i { font-size: 20px; color: var(--good-ink); flex-shrink: 0; }
.ai-banner p { margin: 0; font-size: 12px; color: var(--good-ink); line-height: 1.4; }
.recipe-card { background: white; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 12px; cursor: pointer; }
.recipe-img { height: 110px; position: relative; display: flex; align-items: flex-end; padding: 12px; color: white; }
.recipe-img .match-badge { font-size: 10px; padding: 4px 10px; border-radius: var(--r-pill); background: rgba(255,255,255,0.95); color: var(--good-ink); font-weight: 600; letter-spacing: 0.4px; }
.recipe-img .time-badge { position: absolute; top: 12px; right: 12px; font-size: 11px; padding: 4px 10px; border-radius: var(--r-pill); background: rgba(0,0,0,0.55); color: white; display: flex; align-items: center; gap: 4px; }
.recipe-img .time-badge i { font-size: 12px; }
.recipe-body { padding: 12px 14px; }
.recipe-body .title { margin: 0; font-size: 15px; font-weight: 600; }
.recipe-body .meta { margin: 3px 0 8px; font-size: 12px; color: var(--ink-2); }
.recipe-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.rtag { font-size: 10px; padding: 2px 7px; border-radius: 4px; font-weight: 600; letter-spacing: 0.3px; }
.rtag.chol { background: var(--bad-bg); color: var(--bad-ink); }
.rtag.diab { background: var(--blue-bg); color: var(--blue-ink); }
.rtag.loss { background: var(--good-bg); color: var(--good-ink); }
.rtag.hyp { background: var(--purple-bg); color: var(--purple-ink); }

/* ===== RECIPE DETAIL ===== */
.rd-hero { height: 180px; position: relative; padding: 14px; flex-shrink: 0; }
.rd-hero .badge { position: absolute; bottom: 14px; left: 14px; font-size: 10px; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,0.95); color: #173404; font-weight: 600; letter-spacing: 0.4px; }
.rd-body { padding: 18px; }
.rd-meta { display: flex; gap: 14px; margin: 8px 0 14px; font-size: 12px; color: var(--ink-2); }
.rd-mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 16px; }
.rd-mini-stats .s { background: var(--surface-3); border-radius: 8px; padding: 8px; text-align: center; }
.rd-mini-stats .s .lbl { margin: 0; font-size: 10px; color: var(--ink-2); }
.rd-mini-stats .s .val { margin: 1px 0 0; font-size: 13px; font-weight: 600; }
.rd-mini-stats .s.p .val { color: var(--brand); }
.ing-row { display: flex; gap: 10px; align-items: center; padding: 7px 0; cursor: pointer; }
.ing-row .chk { width: 18px; height: 18px; border-radius: 4px; border: 1.5px solid var(--line-2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ing-row .chk i { font-size: 12px; color: white; display: none; }
.ing-row.done .chk { background: var(--brand); border-color: var(--brand); }
.ing-row.done .chk i { display: block; }
.ing-row.done p { text-decoration: line-through; color: var(--ink-2); }
.ing-row p { margin: 0; font-size: 13px; flex: 1; }

/* ===== COOK ALONG ===== */
#screen-cook { background: #1a1a1a; color: white; }
.cook-content { flex: 1; padding: 6px 22px 22px; display: flex; flex-direction: column; overflow-y: auto; }
.cook-progress { display: flex; gap: 3px; margin-bottom: 18px; }
.cook-progress .seg { flex: 1; height: 3px; background: rgba(255,255,255,0.15); border-radius: 2px; }
.cook-progress .seg.done { background: var(--brand); }
.cook-step-img { background: linear-gradient(135deg, #C0DD97, #1D9E75); border-radius: 18px; padding: 22px; text-align: center; margin-bottom: 16px; }
.cook-step-img i { font-size: 56px; color: white; opacity: 0.85; }
.cook-step-img p { margin: 8px 0 0; font-size: 11px; color: rgba(255,255,255,0.9); text-transform: uppercase; letter-spacing: 0.6px; }
.cook-title { margin: 0 0 10px; font-size: 20px; font-weight: 600; line-height: 1.35; }
.cook-detail { margin: 0; font-size: 13px; color: rgba(255,255,255,0.75); line-height: 1.6; }
.cook-timer { background: rgba(255,255,255,0.06); border-radius: 12px; padding: 14px; text-align: center; margin: 16px 0; }
.cook-timer .lbl { margin: 0 0 6px; font-size: 11px; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: 0.6px; }
.cook-timer .v { margin: 0; font-size: 38px; font-weight: 600; color: var(--brand); font-variant-numeric: tabular-nums; }
.cook-timer-btns { display: flex; gap: 8px; margin-top: 12px; justify-content: center; }
.cook-timer-btns button { border: none; cursor: pointer; font-family: inherit; }
.cook-timer-btns .pill { background: rgba(255,255,255,0.1); color: white; padding: 8px 14px; border-radius: 999px; font-size: 12px; }
.cook-timer-btns .pause { background: white; color: var(--ink); padding: 8px 22px; border-radius: 999px; font-size: 13px; font-weight: 600; }

/* ===== WORKOUT ===== */
.wk-hero { background: linear-gradient(135deg, #1D9E75 0%, #0F6E56 100%); border-radius: 18px; padding: 18px; color: white; margin-bottom: 14px; }
.wk-hero .l { margin: 0; font-size: 11px; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; }
.wk-hero .big { margin: 4px 0 10px; font-size: 22px; font-weight: 600; }
.wk-hero .meta { display: flex; gap: 14px; font-size: 12px; flex-wrap: wrap; }
.wk-hero .meta span { display: flex; align-items: center; gap: 4px; }
.wk-hero .meta i { font-size: 14px; }
.loc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 14px; }
.loc-btn { padding: 8px 4px; border-radius: 10px; font-size: 11px; font-weight: 500; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; font-family: inherit; }
.loc-btn i { font-size: 18px; }
.loc-btn.on { background: var(--ink); color: white; border: none; }
.loc-btn.off { background: white; border: 1px solid var(--line); color: var(--ink-2); }
.ex-card { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; display: flex; align-items: center; gap: 12px; }
.ex-card .num { width: 36px; height: 36px; border-radius: 9px; background: var(--blue-bg); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 14px; font-weight: 600; color: var(--blue-ink); }
.ex-card .info { flex: 1; min-width: 0; }
.ex-card .info .name { margin: 0; font-size: 14px; font-weight: 500; }
.ex-card .info .sub { margin: 2px 0 0; font-size: 11px; color: var(--ink-2); }
.ex-card .play { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.ex-card .play.go { background: var(--brand); color: white; }
.ex-card .play i { font-size: 14px; }
.finisher-card { background: var(--warn-bg); border: 1px solid #FAC775; border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.finisher-card i { font-size: 22px; color: var(--warn-ink); }
.finisher-card .a { margin: 0; font-size: 13px; font-weight: 500; color: var(--warn-ink); }
.finisher-card .b { margin: 1px 0 0; font-size: 11px; color: #854F0B; }

/* ===== WORKOUT ACTIVE TIMER OVERLAY ===== */
.timer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.92); z-index: 100; display: none; align-items: center; justify-content: center; flex-direction: column; color: white; padding: 20px; }
.timer-overlay.show { display: flex; }
.timer-overlay .ex-name { font-size: 22px; font-weight: 600; margin: 0 0 8px; text-align: center; }
.timer-overlay .ex-target { font-size: 13px; color: rgba(255,255,255,0.65); margin: 0 0 30px; }
.timer-overlay .ex-time { font-size: 78px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 0 0 8px; color: var(--brand); letter-spacing: -2px; }
.timer-overlay .ex-state { font-size: 12px; color: rgba(255,255,255,0.55); text-transform: uppercase; letter-spacing: 1px; margin: 0 0 30px; }
.timer-overlay .ex-controls { display: flex; gap: 12px; }
.timer-overlay .ex-controls button { font-family: inherit; cursor: pointer; border: none; }
.timer-overlay .ex-pill { background: rgba(255,255,255,0.12); color: white; padding: 12px 18px; border-radius: 999px; font-size: 13px; font-weight: 500; }
.timer-overlay .ex-pill.primary { background: var(--brand); color: white; padding: 14px 28px; font-weight: 600; }
.timer-overlay .ex-close { position: absolute; top: 20px; right: 20px; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.15); color: white; display: flex; align-items: center; justify-content: center; border: none; cursor: pointer; }
.timer-overlay .ex-close i { font-size: 20px; }

/* ===== COACH ===== */
#screen-coach { background: linear-gradient(180deg, var(--brand-tint) 0%, white 30%); }
.coach-checkin { background: white; border: 1px solid #C0DD97; border-radius: 18px; padding: 16px; margin-bottom: 14px; }
.coach-checkin .row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.coach-checkin .row .ic { width: 38px; height: 38px; border-radius: 50%; background: var(--brand); display: flex; align-items: center; justify-content: center; }
.coach-checkin .row .ic i { font-size: 20px; color: white; }
.coach-checkin .row .lbl { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; }
.coach-checkin .row .ttl { margin: 1px 0 0; font-size: 13px; font-weight: 600; }
.coach-checkin .msg { margin: 0 0 12px; font-size: 14px; line-height: 1.5; }
.coach-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.coach-stats .cs { background: var(--brand-tint); border-radius: 8px; padding: 8px; text-align: center; }
.coach-stats .cs .l { margin: 0; font-size: 10px; color: var(--ink-2); }
.coach-stats .cs .v { margin: 2px 0 0; font-size: 13px; font-weight: 600; }
.coach-stats .cs .e { margin: 2px 0 0; font-size: 18px; }
.tip-card, .insight-card, .plateau-card { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.tip-card .head, .insight-card .head, .plateau-card .head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.tip-card .head .ic { width: 32px; height: 32px; border-radius: 8px; background: var(--blue-bg); display: flex; align-items: center; justify-content: center; }
.tip-card .head .ic i { font-size: 16px; color: var(--blue-ink); }
.tip-card .head .lbl { margin: 0; font-size: 11px; color: var(--blue-ink); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; }
.tip-card .title { margin: 0 0 6px; font-size: 14px; font-weight: 600; }
.tip-card p { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.tip-card .link { margin-top: 10px; background: none; border: none; color: var(--blue-ink); font-size: 12px; font-weight: 600; padding: 0; cursor: pointer; display: flex; align-items: center; gap: 4px; font-family: inherit; }
.insight-card .head i { font-size: 18px; color: var(--brand); }
.insight-card .head .lbl { margin: 0; font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; }
.insight-card p { margin: 0 0 8px; font-size: 14px; line-height: 1.5; }
.insight-card .pills { display: flex; gap: 6px; flex-wrap: wrap; }
.insight-card .pill { font-size: 10px; padding: 3px 8px; border-radius: 999px; font-weight: 600; }
.insight-card .pill.ok { background: var(--good-bg); color: var(--good-ink); }
.insight-card .pill.warn { background: var(--warn-bg); color: var(--warn-ink); }
.plateau-card { background: linear-gradient(135deg, var(--bad-bg), #F7C1C1); border-color: var(--bad); }
.plateau-card .head i { font-size: 18px; color: var(--bad-ink); }
.plateau-card .head .lbl { margin: 0; font-size: 11px; color: var(--bad-ink); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; }
.plateau-card p { margin: 0; font-size: 13px; color: var(--bad-ink); line-height: 1.5; }
.todo-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 0.5px solid var(--line); cursor: pointer; }
.todo-row:last-child { border-bottom: none; }
.todo-row .chk { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--line-2); display: flex; align-items: center; justify-content: center; }
.todo-row .chk i { font-size: 14px; color: white; display: none; }
.todo-row.done .chk { background: var(--brand); border-color: var(--brand); }
.todo-row.done .chk i { display: block; }
.todo-row.done p { text-decoration: line-through; color: var(--ink-2); }
.todo-row p { margin: 0; font-size: 13px; flex: 1; }

/* ===== WATER ===== */
#screen-water { background: linear-gradient(180deg, var(--blue-bg) 0%, white 35%); }
.water-hero { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 24px; text-align: center; margin-bottom: 16px; }
.water-hero .lbl { margin: 0; font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; }
.water-hero .big { margin: 8px 0 4px; font-size: 48px; font-weight: 700; color: var(--blue); letter-spacing: -1.5px; }
.water-hero .big .u { font-size: 16px; color: var(--ink-2); font-weight: 400; }
.water-hero .target { font-size: 12px; color: var(--ink-2); margin: 0; }
.water-glasses { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0; }
.glass { aspect-ratio: 1; border-radius: 12px; border: 2px solid var(--blue); display: flex; align-items: center; justify-content: center; cursor: pointer; background: white; transition: all 0.15s; }
.glass i { font-size: 26px; color: var(--blue); opacity: 0.3; }
.glass.full { background: var(--blue); }
.glass.full i { color: white; opacity: 1; }
.water-quick { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.water-quick button { padding: 12px; border-radius: 12px; background: white; border: 1px solid var(--line); font-size: 13px; cursor: pointer; font-family: inherit; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.water-quick button i { font-size: 20px; color: var(--blue); }

/* ===== SHOPPING ===== */
.shop-banner { background: var(--good-bg); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.shop-banner i { font-size: 18px; color: var(--good-ink); flex-shrink: 0; }
.shop-banner .a { margin: 0; font-size: 13px; font-weight: 600; color: var(--good-ink); }
.shop-banner .b { margin: 0; font-size: 11px; color: var(--good-ink); opacity: 0.85; }
.aisle-label { margin: 12px 0 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; }
.aisle-label.produce { color: var(--good); }
.aisle-label.meat { color: var(--bad-ink); }
.aisle-label.cupboard { color: #BA7517; }
.aisle-label.dairy { color: #185FA5; }
.shop-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 0.5px solid var(--surface-2); cursor: pointer; }
.shop-row:last-of-type { border-bottom: none; }
.shop-row .chk { width: 20px; height: 20px; border-radius: 5px; border: 1.5px solid var(--line-2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.shop-row .chk i { font-size: 14px; color: white; display: none; }
.shop-row.done .chk { background: var(--brand); border-color: var(--brand); }
.shop-row.done .chk i { display: block; }
.shop-row.done .name { text-decoration: line-through; color: var(--ink-2); }
.shop-row .name { margin: 0; font-size: 13px; flex: 1; }
.shop-row .price { font-size: 11px; color: var(--ink-3); }

/* ===== MEAL PREP ===== */
.prep-hero { background: linear-gradient(135deg, #7F77DD, #534AB7); border-radius: 18px; padding: 16px; color: white; margin-bottom: 14px; }
.prep-hero .l { margin: 0; font-size: 11px; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; }
.prep-hero .big { margin: 4px 0 8px; font-size: 20px; font-weight: 600; }
.prep-hero .meta { display: flex; gap: 12px; font-size: 12px; }
.prep-hero .meta i { font-size: 14px; vertical-align: -2px; }
.menu-row { background: var(--surface-3); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.menu-row .ic { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: white; }
.menu-row .ic i { font-size: 22px; }
.menu-row .info { flex: 1; min-width: 0; }
.menu-row .name { margin: 0; font-size: 13px; font-weight: 600; }
.menu-row .when { margin: 1px 0 0; font-size: 11px; color: var(--ink-2); }
.menu-row .days { font-size: 11px; padding: 3px 8px; border-radius: 999px; font-weight: 600; }
.prep-step { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.prep-step .num { width: 24px; height: 24px; border-radius: 6px; background: var(--brand); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 12px; font-weight: 600; color: white; }
.prep-step .info { flex: 1; min-width: 0; }
.prep-step .name { margin: 0; font-size: 13px; font-weight: 500; }
.prep-step .hint { margin: 1px 0 0; font-size: 11px; color: var(--ink-2); }
.prep-step .time { font-size: 11px; color: var(--ink-3); }

/* ===== HEALTH CONNECT ===== */
.conn-card { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.conn-card.primary { border: 1.5px solid var(--brand); background: var(--brand-tint); }
.conn-head { display: flex; align-items: center; gap: 12px; }
.conn-logo { width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: white; }
.conn-logo i { font-size: 22px; }
.conn-logo.samsung { background: #1428A0; }
.conn-logo.apple   { background: #000; }
.conn-logo.google  { background: #4285F4; }
.conn-logo.fitbit  { background: #00B0B9; }
.conn-logo.garmin  { background: #006CC1; }
.conn-logo.strava  { background: #FC4C02; }
.conn-logo.whoop   { background: #2C2C2A; }
.conn-logo.oura    { background: #5B47AB; }
.conn-logo.scale   { background: #1D9E75; }
.conn-name { margin: 0; font-size: 14px; font-weight: 600; }
.conn-sub { margin: 1px 0 0; font-size: 11px; color: var(--ink-2); }
.conn-status { font-size: 10px; padding: 3px 8px; border-radius: 999px; font-weight: 700; letter-spacing: 0.4px; }
.conn-status.on { background: var(--brand); color: white; }
.conn-btn { padding: 7px 14px; background: var(--ink); color: white; border: none; border-radius: 999px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; }
.conn-btn:active { transform: scale(0.97); }
.conn-data { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 12px; }
.conn-data .cd { background: white; border-radius: 8px; padding: 8px 6px; text-align: center; }
.conn-data .cd .l { margin: 0; font-size: 10px; color: var(--ink-2); }
.conn-data .cd .v { margin: 2px 0 0; font-size: 13px; font-weight: 700; color: var(--brand-dark); }
.health-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.hg-card { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.hg-row { display: flex; align-items: center; gap: 6px; }
.hg-row i { font-size: 16px; }
.hg-lbl { font-size: 11px; color: var(--ink-2); }
.hg-v { margin: 6px 0 2px; font-size: 18px; font-weight: 700; }
.hg-delta { margin: 0; font-size: 11px; color: var(--good-ink); }

/* ===== PROFILE ===== */
.condition { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; margin-bottom: 8px; cursor: pointer; border: 1.5px solid transparent; background: var(--surface-2); }
.condition .icon-box { width: 38px; height: 38px; border-radius: 8px; background: white; display: flex; align-items: center; justify-content: center; }
.condition .icon-box i { font-size: 20px; color: var(--ink-2); }
.condition .info { flex: 1; }
.condition .name { margin: 0; font-size: 14px; font-weight: 600; }
.condition .desc { margin: 1px 0 0; font-size: 11px; color: var(--ink-2); }
.condition .check { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--line-2); display: flex; align-items: center; justify-content: center; }
.condition .check i { font-size: 16px; color: white; display: none; }
.condition.on { background: var(--surface); }
.condition.on .check i { display: block; }
.condition.on[data-color="blue"] { background: var(--blue-bg); border-color: var(--blue); }
.condition.on[data-color="blue"] .icon-box i, .condition.on[data-color="blue"] .name { color: var(--blue-ink); }
.condition.on[data-color="blue"] .check { background: var(--blue-ink); border-color: var(--blue-ink); }
.condition.on[data-color="red"] { background: var(--bad-bg); border-color: var(--bad); }
.condition.on[data-color="red"] .icon-box i, .condition.on[data-color="red"] .name { color: var(--bad-ink); }
.condition.on[data-color="red"] .check { background: var(--bad-ink); border-color: var(--bad-ink); }
.condition.on[data-color="purple"] { background: var(--purple-bg); border-color: var(--purple); }
.condition.on[data-color="purple"] .icon-box i, .condition.on[data-color="purple"] .name { color: var(--purple-ink); }
.condition.on[data-color="purple"] .check { background: var(--purple-ink); border-color: var(--purple-ink); }
.goals-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 18px; }
.goal { padding: 14px 10px; border-radius: 12px; background: var(--surface-2); text-align: center; cursor: pointer; border: 1.5px solid transparent; }
.goal i { font-size: 24px; color: var(--ink-2); }
.goal p { margin: 6px 0 0; font-size: 13px; font-weight: 500; }
.goal.on { background: var(--good-bg); border-color: var(--good); }
.goal.on i, .goal.on p { color: var(--good-ink); }

/* ===== FRIENDS ===== */
.friend-code-card { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%); color: white; border-radius: 18px; padding: 20px; margin-bottom: 16px; text-align: center; }
.friend-code-card .lbl { margin: 0; font-size: 11px; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; }
.friend-code-card .code { margin: 8px 0 6px; font-size: 38px; font-weight: 700; font-family: ui-monospace, monospace; letter-spacing: 6px; }
.friend-code-card .hint { margin: 0; font-size: 11px; opacity: 0.85; }
.friend-code-card .btn { background: rgba(255,255,255,0.18); color: white; border: none; }
.friend-card { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.friend-card .ava { width: 42px; height: 42px; border-radius: 50%; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-weight: 600; color: var(--ink-2); flex-shrink: 0; }
.friend-card .info { flex: 1; min-width: 0; }
.friend-card .info .n { margin: 0; font-size: 14px; font-weight: 500; }
.friend-card .info .s { margin: 1px 0 0; font-size: 11px; color: var(--ink-2); }
.friend-card .actions { display: flex; gap: 6px; }
.friend-card .actions button { padding: 6px 12px; font-size: 12px; border-radius: 999px; border: none; cursor: pointer; font-family: inherit; font-weight: 500; }
.friend-card .actions .accept { background: var(--brand); color: white; }
.friend-card .actions .reject { background: var(--surface-2); color: var(--ink-2); }

.share-card { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.share-card .head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.share-card .ava { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-weight: 600; color: var(--ink-2); font-size: 12px; }
.share-card .author { font-size: 13px; font-weight: 600; }
.share-card .when { font-size: 11px; color: var(--ink-3); margin-left: auto; }
.share-card .body { font-size: 14px; line-height: 1.5; margin: 0 0 8px; }
.share-card .reactions { display: flex; gap: 6px; flex-wrap: wrap; }
.share-card .react-btn { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: none; cursor: pointer; font-family: inherit; }
.share-card .react-btn.mine { background: var(--brand-tint); border: 1px solid var(--brand); }

.vis-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 10px 0 16px; }
.vis-toggle { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; cursor: pointer; font-size: 13px; }
.vis-toggle input { accent-color: var(--brand); }

.preview-card { background: var(--surface-3); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; align-items: center; gap: 12px; }
.preview-card .ava { width: 56px; height: 56px; border-radius: 50%; background: var(--brand-tint); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--brand-dark); font-size: 18px; }
.preview-card .info { flex: 1; }
.preview-card .info .n { margin: 0; font-size: 16px; font-weight: 600; }
.preview-card .info .c { margin: 2px 0 0; font-size: 12px; color: var(--ink-2); font-family: ui-monospace, monospace; }

/* ===== MODAL ===== */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop[hidden] { display: none; }
.modal { background: white; border-radius: 18px; width: 100%; max-width: 360px; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-actions { display: flex; gap: 8px; padding: 12px 18px 18px; border-top: 1px solid var(--line); }

/* ===== DECEPTIVE INGREDIENTS PANEL (on scan result) ===== */
.deceptive-card { background: linear-gradient(135deg, #FAEEDA 0%, #F5C4B3 100%); border: 1px solid var(--coral); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.deceptive-card .head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.deceptive-card .head i { font-size: 18px; color: var(--coral-ink); }
.deceptive-card .head .lbl { margin: 0; font-size: 11px; color: var(--coral-ink); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; }
.deceptive-card .row { margin-bottom: 8px; }
.deceptive-card .row:last-child { margin-bottom: 0; }
.deceptive-card .claim { font-size: 12px; color: var(--coral-ink); font-style: italic; margin: 0; }
.deceptive-card .claim::before { content: '"'; }
.deceptive-card .claim::after  { content: '"'; }
.deceptive-card .reality { font-size: 13px; color: var(--coral-ink); margin: 2px 0 0; font-weight: 500; }
.deceptive-card .reality::before { content: '↳ '; opacity: 0.7; }

/* ===== AUTH FORMS ===== */
.auth-content { display: flex; flex-direction: column; }
.field { display: block; margin-bottom: 14px; }
.field .label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.4px; }
.field input { width: 100%; padding: 14px 14px; font-size: 16px; font-family: inherit; background: var(--surface); border: 1.5px solid var(--line-2); border-radius: 12px; color: var(--ink); transition: border-color 0.15s; }
.field input:focus { outline: none; border-color: var(--brand); }
.field input:invalid:not(:placeholder-shown) { border-color: var(--bad); }
.auth-error { background: var(--bad-bg); color: var(--bad-ink); border-radius: 10px; padding: 10px 14px; font-size: 13px; margin: 0 0 14px; font-weight: 500; }
.auth-success { background: var(--good-bg); color: var(--good-ink); border-radius: 10px; padding: 10px 14px; font-size: 13px; margin: 0 0 14px; font-weight: 500; }
button:disabled, .btn:disabled { opacity: 0.6; cursor: not-allowed; }
.spin { display: inline-block; animation: spin 0.8s linear infinite; }

/* ===== ADMIN ===== */
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.admin-stat { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; align-items: center; gap: 10px; }
.admin-stat .ic { width: 36px; height: 36px; border-radius: 9px; background: var(--brand-tint); display: flex; align-items: center; justify-content: center; }
.admin-stat .ic i { font-size: 18px; color: var(--brand-dark); }
.admin-stat .v { margin: 0; font-size: 18px; font-weight: 700; }
.admin-stat .l { margin: 0; font-size: 11px; color: var(--ink-2); }
.lib-row { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 6px; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.lib-row:active { transform: scale(0.99); }
.lib-action { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); }
.lib-action i { font-size: 14px; }
.badge-master   { font-size: 9px; padding: 2px 6px; border-radius: 4px; background: var(--good); color: white; font-weight: 700; letter-spacing: 0.5px; margin-left: 6px; vertical-align: 2px; }
.badge-personal { font-size: 9px; padding: 2px 6px; border-radius: 4px; background: var(--surface-2); color: var(--ink-2); font-weight: 700; letter-spacing: 0.5px; margin-left: 6px; vertical-align: 2px; }
.badge-banned   { font-size: 9px; padding: 2px 6px; border-radius: 4px; background: var(--bad); color: white; font-weight: 700; letter-spacing: 0.5px; margin-left: 6px; vertical-align: 2px; }

/* ===== TOAST ===== */
.toast { position: absolute; bottom: 100px; left: 50%; transform: translateX(-50%); background: var(--ink); color: white; padding: 10px 18px; border-radius: var(--r-pill); font-size: 13px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity 0.25s; z-index: 40; max-width: 280px; text-align: center; }
.toast.show { opacity: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
