/* ----- splash (m1) ----- */
.screen-splash {
  min-height: 100dvh; background: #a1ce4f; /* exact mockup green */
  color: var(--brand-ink); display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative;
}
.screen-splash .splash-logo { width: 130px; height: auto; display: block; }
.screen-splash .brand {
  margin-top: 22px;
  font-size: 30px; font-weight: 700; letter-spacing: .2px; color: #1a1a1a;
}
.screen-splash .splash-loader {
  position: absolute; bottom: 56px; width: 56px; height: auto;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ----- onboarding intro pages (m3-style) ----- */
.intro-page {
  min-height: 100dvh;
  display: flex; flex-direction: column;
  background: #a1ce4f;
}
.intro-hero {
  flex: 1;
  display: grid; place-items: end center;
  padding: 28px 24px 0;
  position: relative;
  overflow: hidden;
}
.intro-hero::before {
  /* Subtle decorative blob behind the phone */
  content: ''; position: absolute; inset: -40px;
  background: radial-gradient(60% 50% at 50% 40%, rgba(255,255,255,.18) 0%, transparent 70%);
  pointer-events: none;
}

/* Phone illustration */
.phone-mock {
  width: min(78%, 280px); height: 100%;
  background: #1a1a1a;
  border-radius: 36px 36px 0 0;
  padding: 10px 10px 0;
  box-shadow: 0 18px 40px rgba(0,0,0,.18);
  position: relative;
}
.phone-notch {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  width: 90px; height: 26px; background: #000; border-radius: 14px;
  z-index: 2;
}
.phone-screen {
  width: 100%; height: 100%;
  background: #aede38;
  border-radius: 28px 28px 0 0;
  overflow: hidden;
  padding-top: 34px;
}

/* Bottom white card */
.intro-sheet {
  flex-shrink: 0;
  background: #fff;
  border-radius: 28px 28px 0 0;
  padding: 26px 24px calc(22px + var(--safe-bottom));
  box-shadow: 0 -10px 30px rgba(0,0,0,.05);
  margin-top: -22px;     /* tuck under hero */
  position: relative; z-index: 1;
}
.intro-title {
  text-align: center; font-size: 24px; line-height: 1.25; font-weight: 800;
  color: #111; margin: 0 0 12px; letter-spacing: -.2px;
}
.intro-body {
  text-align: center; color: var(--text-2); font-size: 14.5px;
  margin: 0 0 18px; line-height: 1.5;
}
.intro-dots {
  display: flex; gap: 6px; justify-content: center; margin: 6px 0 22px;
}
.intro-dots span {
  width: 8px; height: 8px; border-radius: 99px; background: #e1e5ea;
  transition: width .2s, background .2s;
}
.intro-dots span.active { width: 22px; background: var(--brand); }
.intro-actions { display: flex; gap: 12px; }
.intro-actions .btn { flex: 1; min-height: 52px; }
.intro-actions .btn.outline {
  background: #fff; color: #111; border: 1.5px solid #e3e6eb;
}
.intro-actions .btn.primary { background: var(--brand); color: #111; }

/* ----- mini home preview inside phone-mock ----- */
.mp {
  height: 100%; overflow: hidden;
  font-size: 9px; color: #111;
  display: flex; flex-direction: column;
}
.mp-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px 8px;
  background: #aede38;
  color: #1a2a05;
}
.mp-bar .mp-logo { width: 14px; height: 14px; }
.mp-bar .mp-title { flex: 1; text-align: center; font-weight: 700; font-size: 11px; }
.mp-bar .mp-bell {
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(255,255,255,.65); display: grid; place-items: center; font-size: 9px;
}
.mp-card {
  flex: 1; background: #fff;
  border-radius: 14px 14px 0 0;
  padding: 8px 10px 10px;
  overflow: hidden;
}
.mp-date {
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 600; font-size: 10px; padding: 2px 0 8px;
}
.mp-date .chev { color: var(--text-3); font-size: 14px; }
.mp-summary { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; }
.mp-stat { text-align: center; }
.mp-stat .mp-num { font-size: 14px; font-weight: 800; }
.mp-stat .mp-lbl { font-size: 8px; color: var(--text-2); }
.mp-ring { position: relative; width: 70px; height: 70px; display: grid; place-items: center; }
.mp-ring-svg { width: 70px; height: 70px; position: absolute; inset: 0; }
.mp-ring-val { font-size: 13px; font-weight: 800; }
.mp-ring-sub { font-size: 7px; color: var(--text-2); }
.mp-section { font-size: 9px; font-weight: 700; color: #111; margin: 6px 0 4px; }
.mp-macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.mp-macro { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.mp-macro-ring { position: relative; width: 40px; height: 40px; display: grid; place-items: center; }
.mp-macro-svg { width: 40px; height: 40px; position: absolute; inset: 0; }
.mp-macro-num { font-size: 10px; font-weight: 800; }
.mp-macro-sub { font-size: 6px; color: var(--text-2); }
.mp-macro-lbl { display: flex; align-items: center; gap: 3px; font-size: 8px; color: var(--text-2); }
.mp-macro-lbl .dot { width: 5px; height: 5px; border-radius: 50%; }
.mp-burned {
  display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; margin-top: 2px;
}
.mp-burned .b { display: flex; flex-direction: column; gap: 1px; }
.mp-burned .b-lbl { font-size: 7px; color: var(--text-2); }
.mp-burned .b-num { font-weight: 800; font-size: 11px; }
.mp-burned .b-plus {
  width: 20px; height: 20px; border-radius: 50%; background: var(--brand);
  color: #111; font-weight: 700; display: grid; place-items: center; align-self: end;
}

/* simpler previews for slides 1-2 */
.mp-bars { display: flex; align-items: end; gap: 6px; height: 140px; padding: 12px 4px; }
.mp-b { flex: 1; background: linear-gradient(180deg, #aede38 0%, #8bba2f 100%); border-radius: 4px; }
.mp-article { display: flex; gap: 6px; padding: 6px 4px; border-bottom: 1px solid #f0f1f4; font-size: 10px; }
.mp-article .t { color: var(--text-2); }

/* ----- onboarding question ----- */
.qpage { min-height: 100dvh; display: flex; flex-direction: column; padding: 16px 20px calc(20px + var(--safe-bottom)); }
.qpage .topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.qpage .topbar .back { width: 36px; height: 36px; }
.qpage .topbar .bar { flex: 1; background: var(--surface-2); height: 6px; border-radius: 99px; overflow: hidden; }
.qpage .topbar .bar > span { display: block; height: 100%; background: var(--brand); }
.qpage .topbar .step { font-size: 13px; color: var(--text-2); }
.qpage h2 { font-size: 22px; margin: 0 0 22px; }
.qpage .gender-row { display: flex; gap: 16px; }
.qpage .gender { flex: 1; aspect-ratio: 1; display: grid; place-items: center; background: var(--surface-2); border-radius: 50%; font-size: 60px; }
.qpage .gender.selected { background: var(--brand); }
.qpage .gender + .lbl { text-align: center; color: var(--text-2); margin-top: 6px; }
.qpage .unit-toggle { display: flex; gap: 8px; background: var(--surface-2); border-radius: 99px; padding: 4px; width: max-content; margin: 0 auto 14px; }
.qpage .unit-toggle button { padding: 8px 16px; border-radius: 99px; color: var(--text-2); }
.qpage .unit-toggle button.active { background: var(--brand); color: #1a2a05; }
.qpage .big-num { text-align: center; font-size: 44px; font-weight: 700; margin: 24px 0; }
.qpage .scrub {
  position: relative; height: 70px;
  background:
    repeating-linear-gradient(90deg, var(--text-3) 0 1px, transparent 1px 10px),
    repeating-linear-gradient(90deg, var(--text-2) 0 2px, transparent 2px 50px);
  background-position: center; background-repeat: no-repeat; background-size: 100% 30px;
  border-radius: 8px; margin-bottom: 22px; overflow: hidden;
}
.qpage .scrub::after { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; background: var(--brand); transform: translateX(-50%); }

/* ----- auth ----- */
.auth-page { padding: 18px 20px calc(20px + var(--safe-bottom)); min-height: 100dvh; display: flex; flex-direction: column; }
.auth-page h1 { font-size: 26px; margin: 6px 0 22px; }
.auth-page .sub { color: var(--text-2); margin-bottom: 18px; }
.auth-page .or-divider { display: flex; align-items: center; gap: 10px; color: var(--text-3); margin: 16px 0; font-size: 13px; }
.auth-page .or-divider::before, .auth-page .or-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-page .social-row { display: flex; justify-content: center; gap: 14px; margin-bottom: 14px; }
.auth-page .social-row button { width: 50px; height: 50px; border-radius: 50%; background: var(--surface-2); font-size: 20px; }
.auth-page .small { font-size: 13px; color: var(--text-2); }
.auth-page .small a { color: var(--brand-2); font-weight: 600; }
.auth-page .check-row { display: flex; align-items: flex-start; gap: 8px; margin: 6px 0 14px; font-size: 13px; }

/* ----- welcome / start (m2) ----- */
.auth-page.start { padding: 28px 22px calc(28px + var(--safe-bottom)); align-items: stretch; }
.auth-page.start .brand-mark-img {
  display: block; width: 76px; height: auto; margin: 28px auto 18px;
}
.auth-page.start .auth-title { text-align: center; font-size: 28px; font-weight: 800; margin: 0 0 6px; letter-spacing: -.2px; }
.auth-page.start .auth-sub { margin: 0 0 22px; font-size: 15px; }

.social-stack { display: flex; flex-direction: column; gap: 12px; margin-bottom: 22px; }
.social-btn {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-pill); padding: 14px 20px;
  font-size: 15px; font-weight: 600; color: var(--text);
  box-shadow: 0 1px 2px rgba(15,20,30,.04);
}
.social-btn:active { transform: scale(.99); }
.social-btn .ic { width: 22px; height: 22px; display: inline-grid; place-items: center; font-weight: 700; }
.social-btn .ic img { width: 22px; height: 22px; }
.social-btn .ic.facebook { background: #1877F2; color: #fff; border-radius: 50%; width: 22px; height: 22px; font-size: 14px; }
.social-btn .ic.xmark    { color: #111; font-size: 16px; }

.auth-page.start .btn.primary { background: var(--brand); color: var(--brand-ink); margin-top: 6px; }
.auth-page.start .btn.ghost   { background: var(--brand-soft); color: var(--brand-ink); margin-top: 10px; }
.auth-page.start .legal-foot {
  text-align: center; margin-top: 22px; font-size: 12.5px; color: var(--text-2);
}
.auth-page.start .legal-foot a { font-weight: 600; }

html[data-theme="dark"] .social-btn { background: var(--surface); border-color: var(--border); color: var(--text); }
html[data-theme="dark"] .auth-page.start .btn.ghost { background: var(--surface-2); color: var(--text); }
.auth-page .check { width: 18px; height: 18px; border-radius: 4px; background: var(--surface-2); border: 1.5px solid var(--text-3); display: grid; place-items: center; flex-shrink: 0; margin-top: 2px; }
.auth-page .check.on { background: var(--brand); border-color: var(--brand); color: #1a2a05; }

/* Auth signin/signup (m6, m4-style form) */
.auth-form-page { display: flex; flex-direction: column; min-height: 100dvh; }
.auth-form-body { padding: 8px 22px 24px; flex: 1; }
.auth-h1 { font-size: 26px; font-weight: 800; margin: 6px 0 8px; letter-spacing: -.2px; }
.auth-form-page .auth-sub { font-size: 14.5px; margin: 0 0 22px; }
.auth-form-page .field { margin-bottom: 18px; }
.auth-form-page .field label { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 8px; display: block; }
.auth-form-page .fieldbox {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border-radius: 14px;
  padding: 4px 14px; min-height: 54px;
}
.auth-form-page .fieldbox .lead { color: var(--text-3); font-size: 18px; }
.auth-form-page .fieldbox .fld { background: transparent; border: 0; outline: none; flex: 1; min-width: 0; font-size: 15px; }
.auth-form-page .fieldbox .eye { color: var(--text-3); padding: 6px; }
.auth-form-page .check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 14px; }
.auth-form-page .check { width: 20px; height: 20px; border-radius: 5px; background: var(--surface); border: 1.5px solid var(--brand-2); display: grid; place-items: center; flex-shrink: 0; cursor: pointer; }
.auth-form-page .check.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 800; }
.auth-form-page .auth-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.auth-form-page .small { font-size: 13px; color: var(--text-2); }
.auth-form-page .small a { color: var(--brand-2); font-weight: 700; }
.auth-form-page .or-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-3); font-size: 13px; margin: 14px 0;
}
.auth-form-page .or-divider::before, .auth-form-page .or-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.auth-form-page .social-row { display: flex; justify-content: center; gap: 14px; margin-bottom: 4px; }
.auth-form-page .social-row button {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 22px; font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.auth-page .otp-row { display: flex; gap: 12px; justify-content: center; margin: 20px 0; }
.auth-page .otp { width: 56px; height: 64px; border-radius: 14px; background: var(--surface-2); display: grid; place-items: center; font-size: 28px; font-weight: 700; }
.auth-page .otp.active { background: var(--surface); border: 2px solid var(--brand); }
.auth-page .keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.auth-page .keypad button { padding: 18px; font-size: 22px; border-radius: 14px; background: var(--surface-2); }

/* ----- home (m17) ----- */
.home { background: var(--section-bg); }
.home-hero {
  background: linear-gradient(180deg, var(--brand-bg) 0%, var(--brand-bg-2) 100%) !important;
  color: var(--brand-ink) !important;
  border-radius: 0 0 28px 28px;
  padding: 14px 16px 22px !important;
  position: sticky; top: 0; z-index: 5;
}
.home-hero .title { color: var(--brand-ink); }
.home-hero .home-logo { width: 28px; height: 28px; }
.home-hero .home-bell {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.55); color: var(--brand-ink);
  font-size: 16px;
}

.home-body { padding: 18px 16px 0; }

/* Date picker row */
.date-picker {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border-radius: 14px;
  padding: 8px 8px; margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.date-picker .chev {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--text-2); font-size: 20px;
}
.date-picker .date-label { flex: 1; text-align: center; font-weight: 600; font-size: 14px; }

/* Summary card */
.summary-card { padding: 18px 16px; margin-bottom: 14px; }
.summary-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; }
.summary-top .stat { text-align: center; }
.summary-top .stat .num { font-weight: 800; font-size: 24px; margin: 4px 0 2px; }
.summary-top .stat .lbl { font-size: 12px; color: var(--text-2); font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.summary-top .stat .lbl .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.summary-top .stat .lbl .dot.ok { background: var(--brand-2); }
.summary-top .stat .lbl .dot.burn { background: var(--weight); }
.ring-wrap { display: grid; place-items: center; }
.section-sm { font-size: 12px; font-weight: 600; color: var(--text-2); margin: 12px 0 8px; }

/* Macro rings */
.macro-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.m-col { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.m-ring { position: relative; width: 72px; height: 72px; display: grid; place-items: center; }
.m-svg { width: 72px; height: 72px; position: absolute; inset: 0; }
.m-num { font-size: 16px; font-weight: 800; color: var(--text); }
.m-sub { font-size: 9px; color: var(--text-2); margin-top: -2px; }
.m-lbl { font-size: 12.5px; color: var(--text); font-weight: 600; }

/* Burned row */
.burned-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: stretch; }
.burned-row .b-card {
  background: var(--surface-2); border-radius: 14px; padding: 10px 14px;
  display: flex; flex-direction: column; gap: 2px;
}
.burned-row .b-lbl { font-size: 11px; color: var(--text-2); font-weight: 500; }
.burned-row .b-val { font-size: 17px; font-weight: 800; }
.burned-row .b-unit { font-size: 10px; color: var(--text-3); }
.burned-row .b-plus {
  align-self: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--brand); color: var(--brand-ink);
  font-size: 22px; font-weight: 700;
  display: grid; place-items: center;
}

/* Meal cards */
.meals { padding: 6px 0 24px; }
.meal-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); padding: 14px;
  border-radius: 18px; margin-bottom: 12px;
  box-shadow: var(--shadow);
  color: var(--text);
}
.meal-card .ic {
  width: 44px; height: 44px; border-radius: 14px;
  background: var(--surface-2); display: grid; place-items: center; font-size: 24px;
  flex-shrink: 0;
}
.meal-card .body { flex: 1; min-width: 0; }
.meal-card .meal-top { display: flex; align-items: center; gap: 6px; }
.meal-card .meal-name { font-weight: 700; font-size: 15px; }
.meal-card .tick {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--brand); color: var(--brand-ink);
  font-size: 11px; font-weight: 800;
  display: grid; place-items: center;
}
.meal-card .bar { background: var(--surface-2); height: 6px; border-radius: 99px; overflow: hidden; margin: 6px 0; }
.meal-card .bar > span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.meal-card .meal-sub { font-size: 12px; color: var(--text-2); }
.meal-card .chev { color: var(--text-3); font-size: 22px; }

/* ----- food/activity log list ----- */
.foodlist { padding: 12px 16px 120px; }
.foodlist h3 { margin: 12px 0 10px; font-size: 16px; }

/* food picker (m8/m9/m12) */
.food-picker { background: var(--section-bg); }
.food-fixed { padding: 12px 16px 0; background: var(--bg); }
.food-list-wrap { padding: 4px 16px 120px; }
.food-list { padding: 4px 0; }
.food-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  color: var(--text);
  border-bottom: 1px solid var(--surface-2);
}
.food-row:last-child { border-bottom: 0; }
.food-row .plus {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid var(--brand);
  color: var(--brand-2); font-size: 18px; font-weight: 600;
  display: grid; place-items: center; flex-shrink: 0;
}
.food-row .body { flex: 1; min-width: 0; }
.food-row .nm { font-weight: 700; font-size: 14.5px; }
.food-row .sub { font-size: 12px; color: var(--text-2); margin-top: 1px; }
.food-row .trailing { color: var(--text-3); font-size: 18px; }
.food-row .trailing.del { color: var(--danger); }

.food-cart-total { display: flex; flex-direction: column; padding-right: 6px; }
.food-cart-total .lbl { font-size: 11px; color: var(--text-2); }
.food-cart-total .val { font-size: 20px; font-weight: 800; }

/* ----- food detail ----- */
.food-detail { padding: 16px; padding-bottom: 120px; }
.food-detail .hero { display: grid; place-items: center; margin: 8px 0 18px; font-size: 72px; }
.food-detail .name { text-align: center; font-size: 22px; font-weight: 600; margin-bottom: 14px; }
.food-detail .row-info { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--border); font-size: 14px; }
.food-detail .row-info .lbl { color: var(--text-2); }
.food-detail .footer-bar { display: flex; align-items: center; gap: 14px; padding: 12px 16px; }
.food-detail .footer-bar .qty { color: var(--text-2); font-size: 13px; }

/* ----- tracker / water / step / weight ----- */
.tracker-card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); padding: 16px;
  border-radius: 18px; margin-bottom: 12px;
  box-shadow: var(--shadow);
  text-decoration: none; color: var(--text);
}
.tracker-card .head { display: flex; align-items: center; gap: 10px; }
.tracker-card .head .ic {
  width: 36px; height: 36px; border-radius: 12px;
  background: var(--surface-2); display: grid; place-items: center; font-size: 18px;
}
.tracker-card .head .nm { flex: 1; font-weight: 700; font-size: 15px; }
.tracker-card .head .val { font-weight: 700; font-size: 14px; color: var(--text); }
.tracker-card .bar { background: var(--surface-2); height: 8px; border-radius: 99px; overflow: hidden; }
.tracker-card .bar > span { display: block; height: 100%; border-radius: 99px; }
.tracker-card .sub { font-size: 12.5px; color: var(--text-2); }
.tracker-card .head .up { color: var(--success); margin-left: 4px; }
.tracker-card .head .down { color: var(--danger); margin-left: 4px; }

/* Teardrop water reservoir (m20) — soft white card with internal drop shape. */
.glass {
  width: 100%; max-width: 280px; height: 240px; margin: 18px auto;
  position: relative;
  background: var(--surface);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.glass::before {
  content: ''; position: absolute; left: 50%; top: 28px; width: 130px; height: 170px;
  transform: translateX(-50%);
  background: var(--surface-2);
  border-radius: 50% 50% 50% 50% / 70% 70% 30% 30%;
  clip-path: path('M65,0 C100,40 130,80 130,115 a65 65 0 1 1 -130 0 C0,80 30,40 65,0 Z');
}
.glass .fill {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(180deg, #5fc0ff 0%, var(--water) 100%);
  transition: height .35s ease;
}

.bmi-bar { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr; gap: 2px; margin: 10px 0; }
.bmi-bar .seg { height: 14px; }
.bmi-bar .seg:nth-child(1) { background: #59c2ff; border-radius: 99px 0 0 99px; }
.bmi-bar .seg:nth-child(2) { background: #6cd394; }
.bmi-bar .seg:nth-child(3) { background: #ffd83c; }
.bmi-bar .seg:nth-child(4) { background: #ff8a47; }
.bmi-bar .seg:nth-child(5) { background: #ff5a5a; border-radius: 0 99px 99px 0; }
.bmi-bar.with-marker { position: relative; }
.bmi-bar .marker { position: absolute; bottom: -16px; width: 2px; height: 22px; background: var(--text); transform: translateX(-50%); }

/* insights charts (svg) */
.chart { width: 100%; height: 220px; }

/* articles */
.art-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px 30px; }
.art-card { background: var(--surface); border-radius: 18px; padding: 12px; box-shadow: var(--shadow); }
.art-card .ic { font-size: 32px; margin-bottom: 8px; }
.art-card .ttl { font-size: 13px; font-weight: 500; line-height: 1.3; }

/* Articles list redesign */
.articles-page .home-logo { width: 26px; height: 26px; }
.articles-page .art-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-bottom: 8px;
}
.articles-page .art-card {
  background: var(--surface); border-radius: 18px;
  padding: 14px 12px; display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--shadow); color: var(--text);
  min-height: 130px;
}
.articles-page .art-card .art-img {
  width: 64px; height: 64px; border-radius: 16px;
  background: var(--surface-2);
  display: grid; place-items: center; font-size: 32px;
}
.articles-page .art-card .art-ttl { font-size: 14px; font-weight: 700; line-height: 1.25; }

/* Article detail (m26) */
.article-detail .article-head { display: flex; gap: 14px; align-items: flex-start; }
.article-detail .article-text { flex: 1; min-width: 0; }
.article-detail .article-title { font-size: 22px; font-weight: 800; margin: 0 0 6px; line-height: 1.2; }
.article-detail .article-meta { color: var(--text-2); font-size: 12.5px; }
.article-detail .article-icon { font-size: 64px; line-height: 1; flex-shrink: 0; }
.article-detail .article-rule { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.article-detail .article-body h3 { margin: 18px 0 6px; font-size: 16px; }
.article-detail .article-body p { margin: 0 0 12px; color: var(--text); line-height: 1.55; }

/* ----- insights (m33-m34) ----- */
.insights-page .home-logo { width: 26px; height: 26px; }
.metric-card { padding: 16px; margin-bottom: 14px; }
.metric-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.metric-title { flex: 1; font-weight: 700; font-size: 16px; }
.metric-tools { display: flex; gap: 6px; }
.metric-tools .pill-btn {
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--surface-2); color: var(--text-2);
  font-size: 13px; display: grid; place-items: center;
}
.metric-tools .pill-btn.active { color: #fff; }
.metric-legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); margin-bottom: 10px; }
.metric-legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.metric-legend .dash { display: inline-block; width: 14px; height: 0; border-top: 1.5px dashed currentColor; vertical-align: middle; margin-right: 4px; }
.chart-wrap svg { width: 100%; height: auto; display: block; }

/* BMI gauge */
.bmi-gauge { position: relative; padding: 10px 0 6px; }
.bmi-gauge svg { display: block; }
.bmi-num { font-size: 28px; font-weight: 800; margin-top: -16px; }
.bmi-sub { font-size: 11px; color: var(--text-2); }
.bmi-legend { display: grid; gap: 6px; padding: 14px 0 0; font-size: 12px; color: var(--text-2); }
.bmi-legend .sw { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 8px; vertical-align: middle; }
.pill.bmi-norm { background: var(--brand-soft); color: var(--brand-2); padding: 4px 10px; border-radius: 99px; font-size: 11px; font-weight: 700; }

.nutri-legend { display: flex; gap: 12px; flex-wrap: wrap; padding: 6px 0 6px; font-size: 12px; }
.nutri-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.nutri-legend b { margin-left: 4px; color: var(--text); }

/* account list */
.account-page .account-header {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); padding: 16px;
  margin: 12px 16px 18px; border-radius: 22px;
  box-shadow: var(--shadow);
}
.account-page .account-header .avatar.lg { width: 64px; height: 64px; font-size: 32px; flex-shrink: 0; }
.account-page .account-header .avatar.lg img { width: 100%; height: 100%; object-fit: cover; }
.account-page .account-header .who { flex: 1; min-width: 0; }
.account-page .account-header .nm { font-weight: 700; font-size: 17px; }
.account-page .account-header .em { color: var(--text-2); font-size: 13px; }
.account-page .account-header .pro-pill {
  padding: 8px 14px; border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #ffd34d 0%, #ff9d34 100%);
  color: #2c1a05; font-size: 12px; font-weight: 700;
}

/* premium (m27/m28) */
.premium .tabs { max-width: 320px; margin: 8px auto 16px; }
.premium-card { padding: 22px 22px 18px; position: relative; }
.premium-card .save-pill {
  position: absolute; top: 14px; right: 14px;
  background: var(--brand); color: var(--brand-ink);
  padding: 4px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 700;
}
.premium-card .plan-title { text-align: center; font-weight: 700; font-size: 16px; margin-top: 6px; }
.premium-card .plan-price { text-align: center; font-size: 34px; font-weight: 800; margin: 8px 0 2px; }
.premium-card .plan-price .plan-period { color: var(--text-2); font-size: 14px; font-weight: 500; }
.premium-card .plan-rule { border: 0; border-top: 1px solid var(--border); margin: 12px 0; }
.premium-card .plan-features { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.premium-card .plan-features li { display: flex; align-items: center; gap: 12px; font-size: 14.5px; }
.premium-card .plan-features li::before { content: '✓'; color: var(--text); font-weight: 700; }
.premium-card .plan-features li .ck { display: none; }

/* premium success (m28) */
.success-page { background: var(--bg); position: relative; overflow: hidden; min-height: 100dvh; }
.success-page .confetti-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(8px 16px at 15% 6%, #ffb629 0%, transparent 60%),
    radial-gradient(10px 12px at 75% 8%, #ff5a3d 0%, transparent 60%),
    radial-gradient(6px 14px at 30% 4%, #4aa6ff 0%, transparent 60%),
    radial-gradient(8px 14px at 85% 16%, #a955e8 0%, transparent 60%),
    radial-gradient(6px 10px at 60% 12%, #aede38 0%, transparent 60%),
    radial-gradient(7px 13px at 45% 18%, #ff8a47 0%, transparent 60%);
  pointer-events: none; height: 200px;
}
.success-page .success-body { padding: 30px 24px 100px; text-align: center; position: relative; z-index: 1; }
.success-page .crown-badge {
  width: 78px; height: 78px; border-radius: 50%;
  background: linear-gradient(135deg, #ffb629 0%, #ff7a23 100%);
  color: #fff; font-size: 36px;
  display: grid; place-items: center;
  margin: 48px auto 18px;
  box-shadow: 0 12px 28px rgba(255,150,30,.4);
}
.success-page .success-title { font-size: 26px; font-weight: 800; margin: 0 0 8px; }
.success-page .success-sub { margin: 0 0 18px; font-size: 14px; }
.success-page .success-rule { border: 0; border-top: 1px solid var(--border); margin: 8px 0 16px; }
.success-page .success-features { text-align: left; display: grid; gap: 10px; }
.success-page .success-features-title { text-align: center; font-weight: 700; margin-bottom: 6px; }
.success-page .feature { display: flex; align-items: center; gap: 12px; font-size: 14.5px; }
.success-page .feature .ck { color: var(--text); font-weight: 700; }
.success-page .success-note { font-size: 12.5px; margin-top: 16px; text-align: center; line-height: 1.5; }
.premium .price .num { font-weight: 800; font-size: 36px; }
.premium .save { background: var(--brand); color: #1a2a05; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.premium .feature { display: flex; gap: 10px; padding: 8px 0; }
.premium .feature .ck { color: var(--brand-2); }

/* notif list */
.notif-day { color: var(--text-2); font-size: 13px; margin: 14px 0 8px; }

/* generic page padding for sub screens */
.page { padding: 0 0 calc(100px + var(--safe-bottom)); }

/* "Added to favorites" floating toast */
.float-toast { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); background: var(--surface); color: var(--text); padding: 10px 16px; border-radius: 99px; box-shadow: var(--shadow-lg); display: inline-flex; gap: 8px; align-items: center; z-index: 30; }

/* upgrade plan badge in profile */
.crown-badge { width: 96px; height: 96px; border-radius: 50%; background: linear-gradient(180deg, #ffb84a, #ff7a3a); display: grid; place-items: center; color: #fff; font-size: 40px; margin: 12px auto; }

/* selectable cup grid */
.cup-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0; }
.cup-grid .cup { padding: 12px 8px; border: 1.5px solid var(--border); border-radius: 14px; text-align: center; font-size: 12px; }
.cup-grid .cup.selected { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, var(--surface)); }
.cup-grid .cup .ic { font-size: 24px; display: block; margin-bottom: 4px; }

/* icon grid */
.icon-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.icon-grid .ic { aspect-ratio: 1; display: grid; place-items: center; background: var(--surface-2); border-radius: 14px; font-size: 24px; cursor: pointer; }
.icon-grid .ic.selected { background: var(--brand); }

/* keypad number entry (weight / BMI edit) */
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.numpad button { padding: 18px; font-size: 22px; background: var(--surface-2); border-radius: 14px; }
