/* Import centralized design tokens — bump ?v= with the SW CACHE version so dev
   browsers don't serve a stale token file (styles.css/script.js get ?v= in the
   <head>, but this @import is fetched fresh only when its own URL changes). */
@import '_tokens.css?v=236';

:root {
  /* Font stacks */
  --mono:
    "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Hide elements with hidden attribute */
[hidden] {
  display: none !important;
}

/* ============================================
   MATERIAL ICON UTILITY  (see .claude/skills/material-icons)
   Inline <svg> from app/public/assets/icons/*.svg. Inherits the parent's
   `color`; size with a modifier or by setting font-size on the icon.
   ============================================ */
.mi {
  width: 1em;
  height: 1em;
  fill: currentColor;
  flex-shrink: 0;
  vertical-align: -0.125em;
}
.mi--sm { font-size: 16px; }
.mi--md { font-size: 20px; }
.mi--lg { font-size: 24px; }
.mi--xl { font-size: 40px; }

:focus-visible {
  outline: 2px solid rgba(var(--primary-rgb), 0.7);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ============================================
   APP HEADER / NAVIGATION
   ============================================ */
/* One consistent header treatment on every tab (home / profile / check-in):
   solid surface + a subtle bg.png texture, no frosted blur, no divider — so the
   header blends seamlessly with the page (and with the goal zone on check-in). */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  /* extra top padding clears the status bar / notch so the avatar and back
     button sit in the safe area and stay reliably tappable on real devices */
  padding: calc(env(safe-area-inset-top) + var(--space-6)) var(--space-4) var(--space-6);
  overflow: hidden;
}

.app-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("assets/bg.png") center / cover no-repeat;
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
  /* Fade the photo out toward the bottom so it dissolves into the page
     instead of cutting off at a hard line. */
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 28%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 28%, transparent 100%);
}

.app-header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  position: relative; /* sit above the .app-header::before texture */
  z-index: 1;
}

/* Left side: Home button */
.app-header-left {
  display: flex;
  align-items: center;
}

/* Back chevron — only on the Profile / Family Centre page. It replaces the
   logo + check-in shortcuts there, and the profile avatar is hidden, so the
   header reads as a plain "‹ back" to the one home screen. */
.app-back-btn {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-primary, var(--text));
  cursor: pointer;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}
.app-back-btn:active { background: rgba(255, 255, 255, 0.08); }
/* the profile back carries .app-back now (display:grid) — keep it hidden on
   every other tab, where this button isn't used. */
.app-header:not(.app-header--profile) .app-back-btn { display: none; }
.app-header--profile .app-back-btn { display: inline-flex; }
.app-header--profile .app-home-btn,
.app-header--profile .app-checkin-btn,
.app-header--profile .app-profile-avatar-btn { display: none; }
/* Profile: the nav row is empty (back button is the fixed .app-back, floated
   out of flow) — collapse it so the profile content + its leaf hero start at
   y=0, the same seamless treatment the check-in home gets. */
.app-header--profile {
  position: static;
  min-height: 0;
  height: 0;
  padding: 0;
  background: transparent;
  border-bottom: 0;
  overflow: visible;   /* never clip the floated back button */
}
.app-header--profile::before { display: none; }
.app-header--profile .app-header-content { min-height: 0; }
/* The base .app-header-content is a z-index:1 stacking context — on profile that
   was trapping the fixed back button UNDER the leaf-hero content. Drop it here
   so the button's own z-index floats it above everything on the page. */
.app-header--profile .app-header-content {
  position: static;
  z-index: auto;
}
/* Solid, always-legible back chevron on the Profile page — it floats over the
   leaf hero, where a translucent disc (and backdrop-filter, unreliable on iOS)
   was invisible. Opaque card-bg circle + border + full-strength icon. */
.app-header--profile .app-back-btn.app-back {
  display: grid;
  z-index: 120;
  color: var(--text);
  background: var(--card-bg);
  border: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}
.app-header--profile .app-back-btn.app-back:active { background: var(--card-bg-alt, var(--card-bg)); }

.app-home-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  font-family: inherit;
  font-size: var(--type-body);
  font-weight: 600;
  padding: var(--space-2) var(--space-3);
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  min-height: 44px;
  min-width: 44px;
}

@media (hover: hover) {
  .app-home-btn:hover {
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--accent);
  }
}

.app-home-btn:active {
  background: rgba(var(--primary-rgb), 0.12);
}

.app-home-btn svg {
  flex-shrink: 0;
  stroke: currentColor;
}

.app-header-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.app-home-label {
  display: none;
}

@media (min-width: 540px) {
  .app-home-label {
    display: inline;
  }
}

.app-home-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  font-family: inherit;
  font-size: var(--type-body);
  font-weight: 600;
  padding: var(--space-2) var(--space-3);
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  min-height: 44px;
  min-width: 44px;
}

@media (hover: hover) {
  .app-home-btn:hover {
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--accent);
  }
}

.app-home-btn:active {
  background: rgba(var(--primary-rgb), 0.12);
}

.app-home-btn svg {
  flex-shrink: 0;
  stroke: currentColor;
}

.app-home-label {
  display: none;
}

/* Right side: Sign In / Profile */
.app-header-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* Language Selection Button */
.app-language-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  min-height: 32px;
  border: 1px solid rgba(var(--primary-rgb), 0.3);
  background: transparent;
  border-radius: 999px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: var(--type-xs);
  font-weight: 600;
  transition: border-color 0.2s, background 0.2s;
}

@media (hover: hover) {
  .app-language-btn:hover {
    border-color: rgba(var(--primary-rgb), 0.5);
    background: rgba(var(--primary-rgb), 0.04);
  }
}

/* Language Modal */
.language-modal {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border-radius: 24px 24px 0 0;
  max-height: calc(var(--vh-px, 100vh) * 0.7);
  width: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
  z-index: 1001;
  border: none;
  animation: slideUp 0.3s ease forwards;
  overflow: hidden;
  pointer-events: auto;
}

.language-modal-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: var(--space-3) auto;
  flex-shrink: 0;
}

.language-modal-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 var(--space-5) var(--space-5) var(--space-5);
  overflow-y: auto;
  gap: 0;
}

.language-modal-title {
  font-size: var(--type-lg);
  font-weight: 700;
  margin: var(--space-2) 0 var(--space-4) 0;
  color: var(--text);
}

/* Language Options List */
.language-options-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Language Option */
.language-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  color: var(--text-muted);
  font-family: inherit;
  font-size: var(--type-md);
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  width: 100%;
  justify-content: space-between;
  margin-bottom: var(--space-1);
  position: relative;
}

.language-option:last-child {
  margin-bottom: 0;
}

.language-option-flag {
  font-size: var(--type-lg);
  min-width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.language-option-name {
  font-size: var(--type-md);
  flex-shrink: 0;
}

.language-option-soon {
  font-size: var(--type-sm);
  color: var(--text-faint);
  font-weight: 400;
  white-space: nowrap;
  font-style: italic;
  text-align: right;
}

.language-option--active {
  color: var(--accent);
  font-weight: 600;
}

.language-option--active::after {
  content: "✓";
  font-size: var(--type-base);
  color: var(--accent);
  font-weight: 700;
}

@media (hover: hover) {
  .language-option:not(.language-option--active):hover {
    background: rgba(var(--primary-rgb), 0.06);
    color: var(--text);
  }
}

/* Check-In Button */
.app-checkin-btn {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  padding: var(--space-2) var(--space-3);
  min-height: 32px;
  border: 1px solid rgba(var(--primary-rgb), 0.3);
  background: transparent;
  border-radius: 999px;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  font-size: var(--type-md);
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
}

@media (hover: hover) {
  .app-checkin-btn:hover {
    background: rgba(var(--primary-rgb), 0.08);
    border-color: rgba(var(--primary-rgb), 0.5);
  }
}

/* Profile Avatar Button */
.app-profile-avatar-btn {
  background: none;
  border: none;
  padding: var(--space-1);
  border-radius: 50%;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

@media (hover: hover) {
  .app-profile-avatar-btn:hover {
    background: rgba(var(--primary-rgb), 0.08);
  }
}

.app-profile-avatar-btn:active {
  background: rgba(var(--primary-rgb), 0.12);
}

.app-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

/* Responsive: show label on larger screens */
@media (min-width: 540px) {
  .app-home-label {
    display: inline;
  }
}

/* ============================================
   PROFILE TAB CONTENT
   ============================================ */
.profile-tab-content {
  padding: var(--space-5) var(--space-4);
  /* clear the fixed .app-back button + the status bar */
  padding-top: calc(env(safe-area-inset-top) + 76px);
  position: relative;
}
/* Leaf hero behind the top of the profile — runs from y=0 (behind the status
   bar / floating back button) and fades out long and soft, so it dissolves
   into the page's dot-grid instead of cutting at the old header's edge. */
.profile-tab-content::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: calc(var(--app-header-h) + 150px);
  background: url("assets/bg.png") center top / cover no-repeat;
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 26%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 26%, transparent 100%);
}
.profile-tab-content > * { position: relative; z-index: 1; }

.profile-tab-content:not([hidden]) {
  animation: fadeIn 0.3s var(--ease-out);
}

.profile-page-container {
  max-width: 600px;
  margin: 0 auto;
}

/* CHECK-IN TAB — Lightweight daily recommendation todo list */
.checkin-tab-content {
  padding: 0;
  position: relative;
}

.checkin-tab-content:not([hidden]) {
  animation: fadeIn 0.3s var(--ease-out);
}

/* Leaf hero behind the top of the home check-in — same treatment as
   .profile-tab-content::before: the photo bleeds down from y=0 and fades
   out long and soft, so it dissolves into the page's dot-grid rather than
   cutting off where the header's own bg.png patch ends. Was previously
   carried by the (now-removed) .tracker-goal-zone::before, which went away
   with the goal card — restored here on its own since it's just a
   decorative wash, independent of the goal content. */
.checkin-tab-content::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: calc(var(--app-header-h) + 150px);
  background: url("assets/bg.png") center top / cover no-repeat;
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 26%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 26%, transparent 100%);
}
/* position only, no z-index — z-index:1 here used to trap any deeper
   descendant's z-index inside a stacking context capped at 1 (this element
   is the one that creates it), silently defeating any overlay elsewhere on
   the page that promotes a nested child above itself via a high z-index
   (e.g. the FRE spotlight's .fre-target-elevated, z-index 2401 — see
   [[odrifit_feedback_zindex_stacking_pattern]]). position:relative alone
   still paints these children above the z-index:0 ::before wash below,
   since same-or-auto z-index ties break by tree order. */
.checkin-tab-content > * { position: relative; }

/* Seamless header on Home — the sticky .app-header would otherwise cut the
   leaf wash into two independent, visibly-seamed pieces (its own ::before
   fading out by its own bottom edge, then .checkin-tab-content's own wash
   starting fresh right after). While Home is showing, make the header
   transparent and drop its own wash, then pull the content up underneath it
   so ONE continuous wash (this element's ::before, above) runs from true
   y=0 under the header instead. Scoped to Home only — other tabs keep the
   normal solid sticky header. */
body:has(.checkin-tab-content:not([hidden])) .app-header {
  /* Static, not sticky — combined with the negative-margin pull-up below,
     a sticky header here produced inconsistent/janky sticking (sometimes
     stuck, sometimes not) as the page scrolled. Only the bottom
     "Log with Odrifit" bar stays fixed on Home now. */
  position: static;
  background: transparent;
  border-bottom-color: transparent;
}
body:has(.checkin-tab-content:not([hidden])) .app-header::before {
  display: none;
}
body:has(.checkin-tab-content:not([hidden])) .checkin-tab-content {
  margin-top: calc(-1 * var(--app-header-h));
  padding-top: var(--app-header-h);
}
/* Home's toolbar carries only the avatar (matches the iOS reference, node
   49:510) — the wordmark stays for Profile's header. */
body:has(.checkin-tab-content:not([hidden])) .app-home-btn {
  display: none;
}

.home-header {
  margin-bottom: var(--space-5);
}

/* Odrifit's Recommendations Summary */

/* Inline builder inside goal context card */
.goal-ctx-sentence {
  justify-content: center;
  margin-bottom: var(--space-3) !important;
}

.goal-ctx-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-5);
  border: 1px solid rgba(var(--primary-rgb), 0.3);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: var(--type-sm);
  font-weight: 600;
  cursor: pointer;
  margin-top: var(--space-2);
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
  width: auto;
}

.goal-ctx-cta:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.06);
}

/* Ring component - positioned absolutely, not affecting flow */
.odrifit-progress-ring {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 100px;
  z-index: 0;
  /* Ring visual center: top = 10 + 50 = 60px */
}

.odrifit-progress-ring__bg {
  fill: none;
  stroke: rgba(var(--primary-rgb), 0.1);
  stroke-width: 3.5;
}

.odrifit-progress-ring__fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3.5;
  stroke-dasharray: 251; /* 2 * π * 40 */
  stroke-dashoffset: calc(251 - (251 * var(--progress)) / 100);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.4s ease;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

.odrifit-progress-ring__segment {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3.5;
  stroke-dasharray: var(--segment-size) var(--segment-gap);
  stroke-dashoffset: var(--segment-offset);
  stroke-linecap: round;
  transition: opacity 0.3s ease;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

.odrifit-rec-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px currentColor);
  transform-origin: center;
  overflow: visible;
  display: block;
  position: relative;
  z-index: 1;
}

.odrifit-rec-stat-col--with-meter .odrifit-rec-icon {
  width: 24px;
  height: 24px;
}

/* Animated icons */
/* Recommendation type colors - neon palette */
[data-rec-type="protein"] .odrifit-rec-icon--protein {
  color: var(--metric-protein);
  filter: drop-shadow(0 0 5px currentColor);
  animation: odrifit-curl 3s ease-in-out infinite;
}

[data-rec-type="protein"] .odrifit-progress-ring__fill {
  stroke: var(--metric-protein);
}

[data-rec-type="protein"] .odrifit-progress-ring__bg {
  stroke: rgba(var(--metric-protein-rgb), 0.15);
}

@keyframes odrifit-curl {
  0%    { transform: rotate(0deg)   scale(1);    filter: drop-shadow(0 0 5px currentColor); }
  20%   { transform: rotate(-6deg)  scale(0.96); filter: drop-shadow(0 0 4px currentColor); }
  45%   { transform: rotate(6deg)   scale(1.08); filter: drop-shadow(0 0 10px currentColor); }
  70%   { transform: rotate(-4deg)  scale(0.98); filter: drop-shadow(0 0 4px currentColor); }
  90%   { transform: rotate(0deg)   scale(1);    filter: drop-shadow(0 0 5px currentColor); }
  100%  { transform: rotate(0deg)   scale(1);    filter: drop-shadow(0 0 5px currentColor); }
}

[data-rec-type="steps"] .odrifit-rec-icon--movement {
  color: var(--metric-steps);
  filter: drop-shadow(0 0 5px currentColor);
}

[data-rec-type="steps"] .odrifit-progress-ring__fill {
  stroke: var(--metric-steps);
}

[data-rec-type="steps"] .odrifit-progress-ring__bg {
  stroke: rgba(var(--metric-steps-rgb), 0.15);
}

[data-rec-type="water"] .odrifit-rec-icon--water {
  color: var(--metric-water);
  filter: drop-shadow(0 0 5px currentColor);
  animation: odrifit-drip 3s ease-in-out infinite;
}

[data-rec-type="water"] .odrifit-progress-ring__fill {
  stroke: var(--metric-water);
}

[data-rec-type="water"] .odrifit-progress-ring__bg {
  stroke: rgba(var(--metric-water-rgb), 0.15);
}

@keyframes odrifit-drip {
  0%    { transform: scaleX(1)    scaleY(1);    filter: drop-shadow(0 0 5px currentColor); }
  22%   { transform: scaleX(0.82) scaleY(1.22); filter: drop-shadow(0 0 12px currentColor); }
  50%   { transform: scaleX(1.18) scaleY(0.82); filter: drop-shadow(0 0 8px currentColor); }
  78%   { transform: scaleX(0.96) scaleY(1.06); filter: drop-shadow(0 0 6px currentColor); }
  100%  { transform: scaleX(1)    scaleY(1);    filter: drop-shadow(0 0 5px currentColor); }
}

.odrifit-rec-icon--movement {
  color: #d4a04a;
}

.odrifit-rec-icon--water {
  color: var(--metric-water);
}

.odrifit-rec-icon--movement .foot {
  transform-origin: center;
}

.odrifit-rec-icon--movement .foot-left {
  animation: odrifit-march 2.4s ease-in-out infinite;
  animation-delay: 0s;
}

.odrifit-rec-icon--movement .foot-right {
  animation: odrifit-march 2.4s ease-in-out infinite;
  animation-delay: 0.4s;
}

@keyframes odrifit-march {
  0%    { transform: scale(1);    opacity: 0.55; }
  20%   { transform: scale(1.1);  opacity: 1;    filter: drop-shadow(0 0 7px currentColor); }
  40%   { transform: scale(1);    opacity: 0.55; }
  60%   { transform: scale(1.1);  opacity: 1;    filter: drop-shadow(0 0 7px currentColor); }
  80%   { transform: scale(1);    opacity: 0.55; }
  100%  { transform: scale(1);    opacity: 0.55; }
}

.checkin-section-more {
  font-size: var(--type-sm);
  color: var(--accent);
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.checkin-section-examples {
  font-size: var(--type-sm);
  font-weight: 600;
  color: var(--accent);
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 150ms ease;
}

.checkin-section-examples:hover {
  opacity: 0.8;
}

.checkin-bottom-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
  sticky: top;
  top: 0;
  background: var(--card-bg);
}

.checkin-bottom-sheet-header h3 {
  font-size: var(--type-base);
  font-weight: 600;
  margin: 0;
  color: var(--text);
  line-height: 1.4;
}

.checkin-bottom-sheet-subtitle {
  display: block;
  font-size: var(--type-sm);
  font-weight: 400;
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.checkin-food-examples-amount {
  color: var(--accent);
  font-weight: 600;
}

.checkin-bottom-sheet-close {
  border: none;
  background: transparent;
  font-size: var(--type-display);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkin-bottom-sheet .checkin-todo-item {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
}

.checkin-bottom-sheet .checkin-food-options-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  padding: var(--space-4);
}

@media (max-width: 540px) {
  .checkin-bottom-sheet .checkin-food-options-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.checkin-todo-item {
  display: flex;
  flex-direction: column;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.05);
  cursor: pointer;
  transition: background 0.15s;
}

.checkin-todo-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
}

.checkin-todo-item:last-child {
  border-bottom: none;
}

@media (hover: hover) {
  .checkin-todo-item:hover {
    background: rgba(var(--primary-rgb), 0.04);
  }
}

.checkin-todo-checkbox {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s;
}

.checkin-todo-checkbox--checked {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-size: var(--type-body);
  font-weight: 700;
}

.checkin-todo-label {
  flex: 1;
  font-size: var(--type-body);
  color: var(--text);
  transition: color 0.2s;
}

.checkin-todo-item--done .checkin-todo-label {
  color: var(--text-muted);
  text-decoration: line-through;
}

.checkin-food-options-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

/* Lower density on mobile: 2 across instead of 3/4 */
@media (max-width: 540px) {
  .checkin-food-options-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.checkin-food-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  border-radius: 8px;
  background: var(--background);
  border: 1px solid rgba(var(--primary-rgb), 0.1);
}

.checkin-food-emoji {
  font-size: var(--type-display);
  line-height: 1;
}

.checkin-food-name {
  font-size: var(--type-sm);
  color: var(--text);
  font-weight: 500;
  text-align: center;
}

.checkin-food-serving {
  font-size: var(--type-sm);
  color: var(--accent);
  font-weight: 500;
}

/* Profile Header */
/* Profile Center Header */
.family-centre-panel {
  margin-bottom: var(--space-8);
}

/* Health data — a single flat section, no outer card wrapper (was
   .profile-baseline-card, removed to kill the card-in-card nesting). */
.profile-section--health {
  border-bottom: none;
  padding-bottom: 0;
}

/* One entry point for every setting — a .recs-tile row (same as the home
   "Recommended for you" tiles), opening the full-screen #settingsPage. */
.profile-settings-tile { margin-top: var(--space-6); }

/* #settingsPage body — reuses the full-screen .health-data-all surface;
   the setting rows sit in a width-capped column like the recap table. */
.settings-page__body {
  width: 100%;
  max-width: 340px;
  margin: 0 auto calc(env(safe-area-inset-bottom) + 24px);
  display: flex;
  flex-direction: column;
}
.settings-page__body .profile-setting-row { padding: var(--space-4) 0; }
.settings-page__body .profile-setting-row + .profile-setting-row { border-top: 1px solid var(--border); }
/* On this page the label IS the row's main text (not a caption above a value
   like the Profile Health-data tiles), so it takes a normal body-row size
   instead of the 12px metric-label size. Hints line up with .recs-tile__sub. */
.settings-page__body .profile-item-label {
  font-size: var(--type-md);
  font-weight: 600;
  color: var(--text);
}
.settings-page__body .profile-setting-row--lab .profile-item-label { color: var(--text-muted); }
.settings-page__body .profile-setting-hint { font-size: 14px; max-width: 220px; }
.settings-page .health-data-all__sub { font-size: 14px; }
/* Coming-soon / disabled setting row */
.profile-setting-row--disabled { opacity: 0.55; }
.profile-setting-row--disabled .profile-toggle-btn { cursor: not-allowed; }
.profile-lab-tag.profile-lab-tag--soon {
  background: var(--icon-tile-bg);
  color: var(--text-muted);
}

.profile-center-header {
  margin-bottom: var(--space-5);
  text-align: center;
}

/* ── Family avatar row ───────────────────────────────────── */
.family-avatar-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-1) 0 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.family-avatar-row::-webkit-scrollbar { display: none; }

.family-avatar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.family-avatar-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition-fast);
  background: var(--input-bg);
}

.family-avatar-item--active .family-avatar-circle {
  border-color: var(--primary);
}

.family-avatar-initials {
  font-size: var(--type-lg);
  font-weight: var(--weight-bold);
  color: #fff;
  letter-spacing: 0.02em;
}

.family-avatar-name {
  font-size: var(--type-xs);
  color: var(--text-muted);
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.family-avatar-item--active .family-avatar-name {
  color: var(--primary);
  font-weight: var(--weight-semibold);
}

/* "+" add button */
.family-avatar-circle--add {
  border: 2px dashed rgba(var(--primary-rgb), 0.4);
  font-size: var(--type-2xl);
  font-weight: 300;
  color: var(--primary);
  background: transparent;
}

@media (hover: hover) {
  .family-avatar-add-item:not(.family-avatar-add-item--disabled):hover .family-avatar-circle--add {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.06);
  }
}

/* Disabled look once the family-profile limit is reached (still clickable to show info) */
.family-avatar-add-item--disabled .family-avatar-circle--add {
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-faint);
}

.family-avatar-add-item--disabled .family-avatar-name {
  color: var(--text-faint);
}

/* ── Family Circle: role selector (add-family sheet) ─────────────────── */

/* ── Family Circle: one-tap Self/member toggle (top of home) ─────────── */
.family-circle-toggle {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: var(--space-4) var(--space-4) 0;
  margin: 0 auto;
  max-width: 600px;
}
.family-circle-toggle::-webkit-scrollbar { display: none; }
.family-circle-toggle[hidden] { display: none; }
.family-circle-pill {
  flex-shrink: 0;
  padding: var(--space-2) var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--card-bg);
  color: var(--text-muted);
  font-family: inherit;
  font-size: var(--type-sm);
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.family-circle-pill--active {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
}

/* ── Family Circle: Care Log panel ────────────────────────────────────
   Default look matches the app's usual card styling (used for "partner"
   role members). .care-log-panel--calm (senior role) swaps in the spec's
   warmer, lower-anxiety palette — sage green / warm off-white / slate blue
   — instead of the app's neon teal, scoped entirely to this panel. */
.care-log-panel[hidden] { display: none; }
.care-log-panel {
  padding: var(--space-4) var(--space-4) var(--space-8);
  max-width: 600px;
  margin: 0 auto;
}
.care-log-header { text-align: left; margin: var(--space-2) 0 var(--space-6); }
.care-log-header__label {
  margin: 0 0 4px;
  font-size: var(--type-xs);
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.care-log-header__name { margin: 0; font-size: var(--type-xl); font-weight: 800; color: var(--text); }

.care-log-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}
.care-log-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.care-log-card__title { font-size: var(--type-md); font-weight: 700; color: var(--text); }

.care-log-toggle {
  padding: var(--space-2) var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: var(--type-sm);
  font-weight: 700;
  cursor: pointer;
}
.care-log-toggle--done {
  border-color: var(--success, #4caf7d);
  color: var(--success, #4caf7d);
  background: rgba(76, 175, 125, 0.1);
}

.care-log-add {
  background: none;
  border: 0;
  color: var(--primary);
  font-family: inherit;
  font-size: var(--type-sm);
  font-weight: 700;
  cursor: pointer;
  padding: var(--space-1) 0;
}

.care-log-list { margin-top: var(--space-3); display: flex; flex-direction: column; gap: var(--space-2); }
.care-log-empty { margin: var(--space-2) 0 0; font-size: var(--type-sm); color: var(--text-faint); }

.care-log-med {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
.care-log-med__check {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 14px;
  color: var(--success, #4caf7d);
}
.care-log-med--taken .care-log-med__check { border-color: var(--success, #4caf7d); background: rgba(76, 175, 125, 0.12); }
.care-log-med__text { display: flex; flex-direction: column; min-width: 0; }
.care-log-med__name { font-size: var(--type-sm); font-weight: 700; color: var(--text); }
.care-log-med__time { font-size: var(--type-xs); color: var(--text-faint); }

.care-log-steps-row { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-2); }
.care-log-steps-input {
  width: 90px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
  font-size: var(--type-md);
}
.care-log-steps-unit { flex: 1; font-size: var(--type-sm); color: var(--text-muted); }

.care-log-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--type-sm);
}
.care-log-row:last-child { border-bottom: 0; }
.care-log-row__date { flex-shrink: 0; font-weight: 700; color: var(--text); }
.care-log-row__note { color: var(--text-muted); }

/* Calming senior-care palette — scoped to this panel only, doesn't touch the
   app's global teal theme. Deliberately warmer/softer per the spec's UX
   guidance (avoid "aggressive fitness neon" for elder/dependent care). */
.care-log-panel--calm {
  --care-sage: #8fa88a;
  --care-sage-soft: rgba(143, 168, 138, 0.14);
  --care-offwhite: #f3ede2;
  --care-slate: #7c93a8;
  background: #171d18;
  border-radius: var(--radius-xl);
}
.care-log-panel--calm .care-log-header__name { color: var(--care-offwhite); }
.care-log-panel--calm .care-log-card {
  background: #1c231d;
  border-color: rgba(143, 168, 138, 0.25);
}
.care-log-panel--calm .care-log-card__title { color: var(--care-offwhite); }
.care-log-panel--calm .care-log-toggle {
  border-color: var(--care-slate);
  color: var(--care-slate);
}
.care-log-panel--calm .care-log-toggle--done {
  border-color: var(--care-sage);
  color: var(--care-sage);
  background: var(--care-sage-soft);
}
.care-log-panel--calm .care-log-add { color: var(--care-slate); }
.care-log-panel--calm .care-log-med { border-color: rgba(143, 168, 138, 0.25); }
.care-log-panel--calm .care-log-med__check { color: var(--care-sage); }
.care-log-panel--calm .care-log-med--taken .care-log-med__check { border-color: var(--care-sage); background: var(--care-sage-soft); }
.care-log-panel--calm .care-log-med__name,
.care-log-panel--calm .care-log-row__date { color: var(--care-offwhite); }
.care-log-panel--calm .care-log-row { border-color: rgba(143, 168, 138, 0.2); }

/* ── Family Dashboard — avatar row + story-style activity viewer ────────── */
.family-dash { padding: var(--space-5); }
.family-dash-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
}
.family-dash-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  width: 76px;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.family-dash-avatar__ring {
  width: 64px; height: 64px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 2px solid transparent;
}
/* New (unseen) activity — a highlight ring around the avatar, same idea as
   a chat app's "unread story" indicator. Clears once the viewer is opened
   for that person (markFamilyActivitySeen). */
.family-dash-avatar--new .family-dash-avatar__ring {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}
.family-dash-avatar__circle {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--icon-tile-bg);
  color: var(--primary);
  font-size: 20px;
  font-weight: 800;
}
/* The "+" avatar is the add control — solid, like a real avatar, not a ghost. */
.family-dash-avatar__ring--add { border: 2px solid transparent; }
.family-dash-avatar__circle--add {
  background: var(--icon-tile-bg);
  color: var(--primary);
  font-size: 30px;
  font-weight: 400;
}
.family-dash-avatar__name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  max-width: 76px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.family-dash-hint { margin: var(--space-6) 0 0; font-size: 13px; color: var(--text-faint); }

/* Family members metadata section — one card per member, below the avatars.
   Tap opens the edit / remove sheet (openFamilyMemberSheet). */
.family-dash-members { margin-top: var(--space-6); }
.family-dash-members__title {
  margin: 0 0 var(--space-3);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.fam-member-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  margin-top: var(--space-3);
  padding: 14px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: left;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.fam-member-card:first-of-type { margin-top: 0; }
.fam-member-card:hover { border-color: rgba(var(--primary-rgb), 0.35); }
.fam-member-card__head { display: flex; align-items: baseline; gap: var(--space-3); }
.fam-member-card__name { font-size: 15px; font-weight: 700; }
.fam-member-card__role { font-size: 11px; font-weight: 600; color: var(--text-faint); }
.fam-member-card__meta { font-size: 12px; color: var(--text-muted); }
.fam-member-card__edit {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}

/* Member detail / edit sheet */
.fam-sheet-grid { margin: var(--space-3) 0 var(--space-5); }
.fam-sheet-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.fam-sheet-row:last-child { border-bottom: 0; }
.fam-sheet-row span:first-child { color: var(--text-muted); }
.fam-sheet-row span:last-child { font-weight: 600; text-align: right; }
.fam-sheet-remove {
  width: 100%;
  margin-top: var(--space-3);
  padding: 12px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--error);
  cursor: pointer;
}
.fam-edit .field { margin-bottom: var(--space-4); text-align: left; }
.fam-edit .field-label { text-align: left; }
.fam-edit .input-row { justify-content: flex-start; }
.fam-edit .fam-food-row { gap: var(--space-2); }
.fam-edit .toggle-btn { min-width: 0; padding: 8px 14px; }

/* Story-style viewer: one activity category per screen, auto-advances
   (paused on reduced-motion), Prev/Next steps through manually too. */
.family-activity-viewer {
  position: fixed;
  inset: 0;
  z-index: 2300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--onboard-bg);
  opacity: 0;
  transition: opacity 0.25s ease;
  padding: var(--space-6);
  text-align: center;
}
.family-activity-viewer--open { opacity: 1; }
.family-activity-viewer__dots {
  position: absolute;
  top: calc(env(safe-area-inset-top) + var(--space-5));
  left: var(--space-6);
  right: var(--space-6);
  display: flex;
  gap: 6px;
}
.family-activity-viewer__dot {
  flex: 1;
  height: 3px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.15);
}
.family-activity-viewer__dot--active,
.family-activity-viewer__dot--done { background: var(--primary); }
.family-activity-viewer__close {
  position: absolute;
  top: calc(env(safe-area-inset-top) + var(--space-5) + 14px);
  right: var(--space-5);
  z-index: 2;
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  cursor: pointer;
}
.family-activity-viewer__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 360px;
}
.family-activity-viewer__icon { font-size: 40px; margin-bottom: var(--space-4); }
.family-activity-viewer__name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 4px;
}
.family-activity-viewer__title { font-size: 22px; font-weight: 800; color: var(--text); margin: 0 0 var(--space-5); }
.family-activity-viewer__content { display: flex; flex-direction: column; gap: var(--space-3); width: 100%; }
.family-activity-viewer__big { font-size: 17px; color: var(--text); margin: 0; }
.family-activity-viewer__row { font-size: 14px; color: var(--text-muted); margin: 0; text-align: left; }
.family-activity-viewer__row strong { color: var(--text); }
.family-activity-viewer__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  cursor: pointer;
}
.family-activity-viewer__nav--prev { left: var(--space-4); }
.family-activity-viewer__nav--next { right: var(--space-4); }
.family-activity-viewer__nav[hidden] { visibility: hidden; }
@media (prefers-reduced-motion: reduce) {
  .family-activity-viewer { transition: none; }
}

/* ── Viewing banner ──────────────────────────────────────── */
.viewing-banner {
  position: sticky;
  top: var(--app-header-h); /* stack below the sticky header, not on top of it */
  z-index: 99; /* below the header so they never visually merge */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: rgba(var(--primary-rgb), 0.12);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.2);
  font-size: var(--type-md);
  width: 100%;
  box-sizing: border-box;
}

.viewing-banner-text {
  color: var(--text-muted);
}

.viewing-banner-text strong {
  color: var(--primary);
  font-weight: var(--weight-semibold);
}

.viewing-banner-switch {
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-full);
  border: 1px solid var(--primary);
  background: transparent;
  color: var(--primary);
  font-size: var(--type-sm);
  font-weight: var(--weight-semibold);
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.viewing-banner-switch:hover {
  background: rgba(var(--primary-rgb), 0.1);
}

/* Pills inside the family sheet: no global min-width, fill available space */
.add-family-sheet .input-pill {
  min-width: 0;
  flex: 1;
}

/* Input fills the pill so the whole area is tappable */
.add-family-sheet .input-pill input {
  flex: 1;
  width: auto;
  min-width: 0;
}

/* Left-align everything inside the family sheet */
.add-family-sheet .cond-comprehensive-title,
.add-family-sheet .goal-sheet-subtitle,
.add-family-sheet .field-label {
  text-align: left;
}

.add-family-sheet .input-row {
  justify-content: flex-start;
}

.add-family-sheet .gender-row {
  width: 100%;
  margin: 0;
  justify-content: flex-start;
}

.add-family-cta-footer .edit-health-cta {
  flex: 1;
}

.profile-email {
  font-size: var(--type-sm);
  color: var(--text-faint);
  text-align: center;
  margin-top: var(--space-4);
  padding: 0;
}

/* Profile Sections */
.profile-section {
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.1);
}

.profile-section:last-of-type {
  border-bottom: none;
}

.profile-section-title {
  font-size: var(--type-body);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  opacity: 0.8;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.profile-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-4);
  min-height: 92px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
/* .profile-item's own display:flex would otherwise beat the UA [hidden]
   rule — some tiles are conditionally hidden by populateProfileTab(). */
.profile-item[hidden] { display: none; }

/* Matches #trackerCards .tracker-card-label on the home screen — sentence
   case, muted, 12px — so labels read the same everywhere. */
.profile-item-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: normal;
}

.profile-item-value {
  font-size: var(--type-lg);
  color: var(--text);
  font-weight: 700;
  line-height: 1.15;
}

/* Action Buttons */
.profile-action-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-family: inherit;
  font-size: var(--type-sm);
  font-weight: 600;
  cursor: pointer;
  padding: var(--space-1) var(--space-2);
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
  min-height: auto;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.profile-action-btn svg {
  flex-shrink: 0;
  stroke: currentColor;
}

@media (hover: hover) {
  .profile-action-btn:hover {
    background: rgba(var(--primary-rgb), 0.1);
  }
}

.profile-action-btn:active {
  background: rgba(var(--primary-rgb), 0.15);
}

/* Food Preferences Toggle */
.profile-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: var(--type-sm);
  font-weight: 600;
  cursor: pointer;
  padding: var(--space-2) var(--space-3);
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

@media (hover: hover) {
  .profile-toggle-btn:hover {
    color: var(--text-primary);
  }
}

.profile-toggle-btn--active {
  background: var(--accent);
  color: var(--btn-text);
}

.profile-toggle-btn--active:hover {
  background: var(--accent);
}

/* Settings rows (theme toggle + language) */
.profile-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) 0;
}

.profile-setting-row--link {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

/* Experimental ("Labs") setting — kept understated. */
.profile-setting-row--lab .profile-item-label {
  color: var(--text-muted);
}
.profile-setting-hint {
  display: block;
  margin-top: 2px;
  font-size: var(--type-xs);
  font-weight: var(--weight-regular, 400);
  color: var(--text-faint);
  max-width: 210px;
  line-height: 1.35;
}
.profile-lab-tag {
  display: inline-block;
  margin-left: var(--space-2);
  padding: 1px var(--space-2);
  border-radius: 999px;
  background: rgba(var(--primary-rgb), 0.14);
  color: var(--primary);
  font-size: var(--type-2xs, 10px);
  font-weight: var(--weight-bold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

@media (hover: hover) {
  .profile-setting-row--link:hover {
    opacity: 0.75;
  }
}

.profile-setting-row--link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.profile-toggle-group {
  display: flex;
  gap: 0;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid rgba(var(--primary-rgb), 0.3);
  border-radius: 999px;
  padding: var(--space-1);
}

.profile-setting-value-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
  color: var(--text-muted);
}

.profile-setting-value {
  font-size: var(--type-md);
  font-weight: 600;
  color: var(--text-muted);
}

/* Sign Out Button */
.profile-signout-btn {
  width: 100%;
  margin-top: var(--space-8);
  padding: var(--space-3) var(--space-4);
  min-height: 44px;
  background: transparent;
  border: 1px solid rgba(220, 60, 60, 0.5);
  border-radius: 999px;
  color: rgba(220, 60, 60, 0.8);
  font-family: inherit;
  font-size: var(--type-md);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

@media (hover: hover) {
  .profile-signout-btn:hover {
    background: rgba(220, 60, 60, 0.08);
    border-color: rgba(220, 60, 60, 0.8);
    color: rgba(220, 60, 60, 1);
  }
}

.profile-signout-btn:active {
  background: rgba(220, 60, 60, 0.12);
}

.profile-delete-btn {
  width: 100%;
  margin-top: var(--space-8);
  padding: var(--space-3) var(--space-4);
  min-height: 44px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: var(--type-md);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

@media (hover: hover) {
  .profile-delete-btn:hover {
    background: rgba(220, 60, 60, 0.08);
    border-color: rgba(220, 60, 60, 0.6);
    color: rgba(220, 60, 60, 1);
  }
}

.profile-delete-btn:active {
  background: rgba(220, 60, 60, 0.12);
  border-color: rgba(220, 60, 60, 0.6);
  color: rgba(220, 60, 60, 1);
}

/* Responsive adjustments */
@media (min-width: 540px) {

  .profile-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

/* ============================================
   CUSTOM SCROLLBAR (Design System)
   Deliberately near-invisible — a faint neutral track, never tinted.
   ============================================ */
/* Webkit browsers (Chrome, Safari, Edge). Scoped to :not(.is-android-app) —
   defining ANY ::-webkit-scrollbar rule switches Chromium/WebView from its
   native fading overlay scrollbar to "classic" (always-visible, own layout
   space) rendering. That reads as web-y inside the Android app, so Android
   gets no rule here at all and keeps the native overlay behavior. */
html:not(.is-android-app) ::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

html:not(.is-android-app) ::-webkit-scrollbar-track {
  background: transparent;
}

html:not(.is-android-app) ::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 999px;
  transition: background 0.2s;
}

html:not(.is-android-app) ::-webkit-scrollbar-thumb:hover,
html:not(.is-android-app) ::-webkit-scrollbar-thumb:active {
  background: var(--scrollbar-thumb-hover);
}

/* Firefox */
* {
  scrollbar-color: var(--scrollbar-thumb) transparent;
  scrollbar-width: thin;
}

*:hover {
  scrollbar-color: var(--scrollbar-thumb-hover) transparent;
}

/* ============================================
   UNIFIED TOGGLE BUTTON
   ============================================ */
.toggle-btn {
  padding: var(--space-3) var(--space-6);
  min-height: 44px;
  border: 1px solid var(--border-control);
  background: transparent;
  border-radius: 999px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: var(--type-md);
  font-weight: 600;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

@media (hover: hover) {
  .toggle-btn:hover:not(.active) {
    border-color: #555555;
  }

  .toggle-btn.active:hover {
    border-color: var(--accent);
    color: var(--accent);
  }
}

.toggle-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(var(--primary-rgb), 0.08);
}

/* ============================================
   GENDER SELECTOR (Separate Component)
   ============================================ */
.gender-btn {
  padding: var(--space-3) var(--space-6);
  min-height: 44px;
  border: 1px solid var(--border-control);
  background: transparent;
  border-radius: 999px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: var(--type-md);
  font-weight: 600;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

@media (hover: hover) {
  .gender-btn:hover:not(.active) {
    border-color: #555555;
  }

  .gender-btn.active:hover {
    border-color: var(--accent);
    color: var(--accent);
  }
}

.gender-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(var(--primary-rgb), 0.08);
}

/* ============================================
   ICON-ONLY BUTTON (Subtle, No Stroke)
   ============================================ */
.icon-btn {
  min-width: 48px;
  min-height: 48px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background-color 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text);
  }
}

.icon-btn:active {
  background-color: rgba(255, 255, 255, 0.12);
}

.icon-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -4px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html,
body {
  background: var(--bg);
  color: var(--text);
  font-family:
    "Manrope",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  letter-spacing: -0.005em;
  min-height: 100vh;
  min-height: 100dvh;
  /* Column layout so a short tab (e.g. the locked check-in) can push the
     disclaimer to the bottom via margin-top:auto instead of floating mid-page. */
  display: flex;
  flex-direction: column;
}

/* subtle dot grid + radial accent — tech feel without noise */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(
      circle at 50% -10%,
      rgba(var(--primary-rgb), 0.1),
      transparent 55%
    ),
    radial-gradient(rgba(94, 234, 212, 0.05) 1px, transparent 1px);
  background-size:
    auto,
    22px 22px;
  background-position:
    0 0,
    0 0;
}

.container {
  position: relative;
  z-index: 1;
}

/* ---- Home 3-step accordion (1 BMI · 2 Weight goal · 3 Health) ---- */
/* One seamless shell; exactly one step expanded (data-active), the rest are flat
   footprints. Steps beyond data-reached stay hidden. */
.home-wizard {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
/* Merge the inner cards into the shell — no nested rounding / borders / shadows. */
.home-wizard .card,
.home-wizard .rec-card,
.home-wizard .rec-card--cond {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

/* Consistent step width: every step (and the footprint) uses Step 1's (BMI card)
   horizontal padding so all content lines up at the same width. */
.home-wizard .card,
.home-wizard .rec-card,
.home-wizard .rec-card--cond,
.home-wizard .step-footprint {
  padding-left: var(--space-9);
  padding-right: var(--space-9);
}

/* Reveal up to the furthest-reached step. */
.home-wizard[data-reached="1"] .is-2,
.home-wizard[data-reached="1"] .is-3,
.home-wizard[data-reached="2"] .is-3 { display: none; }

/* Hairline divider between visible sections; none under the last visible step. */
.wizard-step { border-bottom: 1px solid var(--border); }
.home-wizard[data-reached="1"] .is-1,
.home-wizard[data-reached="2"] .is-2,
.home-wizard[data-reached="3"] .is-3 { border-bottom: none; }

/* Footprint (collapsed) vs body (expanded): body shows only for the active step. */
.step-body { display: none; }
.step-footprint { display: none; }
.wizard-step .step-footprint { display: flex; }
.home-wizard[data-active="1"] .is-1 .step-body,
.home-wizard[data-active="2"] .is-2 .step-body,
.home-wizard[data-active="3"] .is-3 .step-body { display: block; }
.home-wizard[data-active="1"] .is-1 .step-footprint,
.home-wizard[data-active="2"] .is-2 .step-footprint,
.home-wizard[data-active="3"] .is-3 .step-footprint { display: none; }

/* Below-wizard learn-more appears only once Step 2 (goal) is done (reached 3). */
.home-wizard:not([data-reached="3"]) ~ .macros-section,
.home-wizard:not([data-reached="3"]) ~ .rec-supporting-label,
.home-wizard:not([data-reached="3"]) ~ .protein-details-card,
.home-wizard:not([data-reached="3"]) ~ .newsletter-card { display: none !important; }

/* Footprint (collapsed step) — centered, minimal stack inside the seamless shell:
   number badge → subtle title → entered data → Edit pill. (display is set by the
   visibility rules above; only layout direction/alignment here.) */
.step-footprint {
  width: 100%;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-align: center;
  background: transparent;
  border: none;
  padding: var(--space-6) var(--space-9);
  cursor: pointer;
}
/* Numbered badge — same treatment as the expanded step eyebrow. */
.step-fp__num {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--primary-fill); color: var(--btn-text);
  font-size: 12px; font-weight: 800; line-height: 1;
}
.step-fp__title { font-size: var(--type-body); font-weight: 600; color: var(--text-muted); }
.step-fp__metrics { font-size: var(--type-sm); color: var(--text-faint); }
.step-fp__metrics:empty { display: none; }
/* Edit as a pill button, centered below the text */
.step-fp__edit {
  margin-top: var(--space-1);
  color: var(--primary); font-weight: 700; font-size: var(--type-sm); white-space: nowrap;
  border: 1px solid rgba(var(--primary-rgb), 0.4);
  border-radius: var(--radius-full);
  padding: var(--space-2) var(--space-5);
  transition: background 0.2s, color 0.2s;
}

/* Step "Next" primary CTAs (full-width filled) */
.home-wizard .wiz-primary {
  width: 100%;
  margin-top: var(--space-6);
  border: none;
  border-radius: 999px;
  background: var(--primary-fill);
  color: var(--btn-text);
  font: inherit;
  font-weight: 700;
  font-size: var(--type-md);
  padding: var(--space-3) var(--space-5);
  cursor: pointer;
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
}
/* One CTA per step. The accordion hides the whole step body when collapsed, so these
   only need their own gating: Step 1 once BMI is calculated (not zero state); Step 2
   once a goal is set. */
#step1Cta { display: none; }
.container:not(.home-zero) #step1Cta { display: flex; }
/* Step 2 CTA always shows on the card; it's disabled (inert) until a goal is set. */
#step2Cta { display: flex; }
#step2Cta:disabled { opacity: 0.4; cursor: not-allowed; }
/* Helper line below the disabled CTA — hidden once a goal is set. */
.wiz-cta-hint { margin: var(--space-3) 0 0; text-align: center; font-size: var(--type-sm); color: var(--text-faint); }
.home-wizard.goal-set .wiz-cta-hint { display: none; }

/* Replaced by the single CTA + icon buttons; also hide the BMI "Start over". */
#saveWeightPlanBtn,
#saveProteinPlanBtn,
#saveCondPlanBtn,
#openShareModal,
#openProteinShareModal,
#condShareBtn,
#bmiResetBtn { display: none !important; }

/* Step 2's "Save your progress or share with others" block is redundant (the wizard
   has one Save CTA on Step 3). */
.home-wizard .is-2 .plan-share { display: none; }

/* The BMI "…Odrifit has made you a health plan / See my plan" CTA is redundant in the
   wizard (the weight card sits right below + Next handles progression). */
.bmi-cta { display: none !important; }

/* STEP eyebrow (Step 1 = BMI, Step 2 = Health concerns). Marks the two real
   actions; supporting cards (weight tips, protein) don't get one. */
.step-eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: var(--type-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 var(--space-3);
}
.step-eyebrow__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-fill);
  color: var(--btn-text);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}
/* The expanded step always shows its solid number badge; the ✓ lives in the
   collapsed footprint, not the eyebrow. (No --done swap here.) */
/* Supporting (non-step) content: weight tips + protein. Visually secondary to
   the Step 1/Step 2 cards — flatter, lighter, smaller heading. */
.rec-supporting-label {
  font-size: var(--type-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  text-align: center;
  margin: var(--space-6) 0 var(--space-3);
}
.rec-card--supporting {
  background: rgba(15, 24, 25, 0.55); /* fallback ≈ var(--card-bg) at 55% */
  background: color-mix(in srgb, var(--card-bg) 55%, transparent);
  box-shadow: none;
  padding: var(--space-7) var(--space-8);
}
.rec-card--supporting .protein-card-title,
.rec-card--supporting .rec-meta-context {
  font-size: var(--type-md);
}

/* Check-in lock nudge (shown until Step 2 / health plan is saved) */
.checkin-lock-nudge {
  margin: var(--space-8) var(--space-4);
}

/* ============================================
   LANGUAGE TOGGLE — fixed top-right
   ============================================ */
/* Single-pill language picker */
.lang-picker {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
}

.lang-dropdown.is-open {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
  pointer-events: auto;
}

.lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: var(--space-3) var(--space-4);
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: var(--type-md);
  font-weight: 500;
  text-align: left;
  width: 100%;
  transition: color 0.15s, background 0.15s;
}

.lang-option:disabled {
  cursor: default;
  opacity: 0.6;
}

.lang-option--active {
  color: var(--text);
  background: var(--accent-dim);
  font-weight: 700;
}

@media (hover: hover) {
  .lang-option:not(:disabled):hover {
    color: var(--text);
    background: rgba(94, 234, 212, 0.08);
  }
}

/* ============================================
   TOP INSTAGRAM FOLLOW BUTTON
   ============================================ */
.top-ig {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(15, 24, 25, 0.72);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: var(--space-2) var(--space-4);
  color: var(--text-muted);
  text-decoration: none;
  font-family: inherit;
  font-size: var(--type-sm);
  font-weight: 500;
  letter-spacing: 0.01em;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.6);
  transition:
    color 0.3s var(--ease-out),
    background 0.3s var(--ease-out),
    border-color 0.3s var(--ease-out),
    transform 0.3s var(--ease-out);
}

.top-ig .ig-icon {
  transition: transform 0.4s var(--ease-spring);
}

@media (hover: hover) {
  .top-ig:hover {
    color: var(--accent-soft);
    background: rgba(var(--primary-rgb), 0.1);
    border-color: var(--border-strong);
    transform: translateY(-1px);
  }
  .top-ig:hover .ig-icon {
    transform: rotate(-8deg) scale(1.1);
  }
}

@media (max-width: 540px) {
  /* Icon-only on mobile so the centered lang toggle has room */
.top-ig {
    padding: var(--space-2);
    gap: 0;
  }
  .top-ig span {
    display: none;
  }
  .top-ig .ig-icon {
    width: 16px;
    height: 16px;
  }
}

.container {
  width: 100%;            /* fill the flex-column body; auto margins would otherwise
                             shrink-wrap it to content (and grow with wide chips) */
  max-width: 660px;
  margin: 0 auto;
  padding: 132px var(--space-6) var(--space-10);
  display: flex;
  flex-direction: column;
  gap: var(--space-14);
}

/* ============================================
   MOTION: reveal-on-scroll
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.8s var(--ease-out),
    transform 0.8s var(--ease-out);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .logo-circle,
.logo-circle img,
.macros-chart img {
    animation: none !important;
  }
  .logo-sparkles i {
    animation: none !important;
    opacity: 0.5;
  }
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ============================================
   HERO
   ============================================ */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-1);
  padding-top: var(--space-3);
}

.logo-circle {
  position: relative;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  /* extra room below so the title clears the sparkle field (dots extend ~28% past the ring) */
  margin-bottom: var(--space-12);
}

/* soft teal halo sitting behind the logo */
.logo-circle::before {
  content: "";
  position: absolute;
  inset: -22%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(var(--primary-rgb), 0.45) 0%,
    rgba(var(--primary-rgb), 0.18) 40%,
    transparent 70%
  );
  filter: blur(10px);
  z-index: -1;
  animation: glow-enhanced 2.5s ease-in-out infinite;
  pointer-events: none;
}

.logo-circle img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 50%;
  /* slow continuous spin of the SVG ring mark (stays crisp; rotation never upscales) */
  animation: spin 16s linear infinite;
}

/* Subtle star-like glow dots scattered around the logo. Themed via --primary /
   --primary-rgb. */
.logo-sparkles {
  position: absolute;
  inset: -28%;
  pointer-events: none;
  z-index: 1;
}
.logo-sparkles i {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 6px 1px rgba(var(--primary-rgb), 0.85);
  opacity: 0;
  animation: sparkle-twinkle 3s ease-in-out infinite;
}
.logo-sparkles i:nth-child(1) { top: 6%;  left: 50%; width: 2px; height: 2px; animation-duration: 2.6s; animation-delay: 0s;   }
.logo-sparkles i:nth-child(2) { top: 20%; left: 88%;                           animation-duration: 3.2s; animation-delay: .6s;  }
.logo-sparkles i:nth-child(3) { top: 58%; left: 95%; width: 2px; height: 2px; animation-duration: 2.9s; animation-delay: 1.1s; }
.logo-sparkles i:nth-child(4) { top: 90%; left: 70%; width: 4px; height: 4px; animation-duration: 3.4s; animation-delay: .3s;  }
.logo-sparkles i:nth-child(5) { top: 92%; left: 28%; width: 2px; height: 2px; animation-duration: 2.7s; animation-delay: 1.4s; }
.logo-sparkles i:nth-child(6) { top: 62%; left: 4%;                            animation-duration: 3.1s; animation-delay: .9s;  }
.logo-sparkles i:nth-child(7) { top: 24%; left: 10%; width: 2px; height: 2px; animation-duration: 3.5s; animation-delay: .2s;  }
.logo-sparkles i:nth-child(8) { top: 2%;  left: 78%; width: 4px; height: 4px; animation-duration: 2.8s; animation-delay: 1.7s; }

@keyframes sparkle-twinkle {
  0%, 100% { opacity: 0;    transform: scale(0.5); }
  50%      { opacity: 0.85; transform: scale(1);   }
}

@keyframes glow-pulse {
  0%,
  100% {
    opacity: 0.7;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

/* Hero logo: slow continuous rotation of the SVG ring mark. Rotation never bitmap-
   upscales an <img> SVG, so the logo stays crisp at any size. */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes glow-enhanced {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 0.65;
  }
}

.brand-title {
  color: var(--primary);
  font-size: var(--type-display-3);
  font-weight: 800;
  letter-spacing: -1.4px;
  line-height: 1.1;
  margin-bottom: var(--space-1);
}

.brand-subtitle {
  color: var(--text-muted);
  font-size: var(--type-body);
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.01em;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  position: relative;
  background: var(--card-bg);
  border-radius: 20px;
  padding: var(--space-10) var(--space-9);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transition: transform 0.4s var(--ease-out);
}

.card-title {
  font-size: var(--type-2xl);
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-2);
  letter-spacing: -0.4px;
}

.card-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: var(--type-md);
  font-weight: 400;
  margin-bottom: var(--space-5);
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

/* ============================================
   UNIT TOGGLE (Metric / Imperial)
   ============================================ */
.unit-toggle {
  display: flex;
  width: fit-content;
  background: var(--input-bg);
  border-radius: 999px;
  padding: var(--space-1);
  margin: 0 auto var(--space-8);
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.field-label-row .field-label {
  margin-bottom: 0;
}

.field-label-row .unit-toggle {
  margin: 0;
}

.unit-switch-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: var(--type-sm);
  font-weight: 600;
  text-decoration: underline;
  padding: var(--space-1) 0;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s var(--ease-out);
}

@media (hover: hover) {
  .unit-switch-link:hover {
    color: var(--text-muted);
  }
}

/* ============================================
   REC CARD SHIMMER — rotating conic-gradient border
   ============================================ */
@property --shimmer-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

@keyframes shimmer-spin {
  to { --shimmer-angle: 360deg; }
}

@keyframes shimmer-fade {
  0%, 80% { opacity: 1; }
  100%     { opacity: 0; }
}

/* ============================================
   PROGRESSIVE DISCLOSURE
   ============================================ */
@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-in {
  animation: slide-in 0.5s var(--ease-out) both;
}

/* ============================================
   BMI CARD: INPUTS
   ============================================ */
.field {
  text-align: center;
  margin-bottom: var(--space-7);
}

.field:last-of-type {
  margin-bottom: var(--space-2);
}

.field-label {
  display: block;
  font-size: var(--type-md);
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
  letter-spacing: 0.005em;
}

.unit-toggle--inline {
  margin: 0 auto var(--space-4);
}

.input-row {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.input-pill {
  background: var(--input-bg);
  border-radius: 999px;
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 140px;
  /* Spring easing (slight overshoot) on the focus lift; smooth settle for
     everything else. Shared by every .input-pill surface — BMI checker,
     edit-health form, add-family sheet, onboarding chat. */
  transition:
    background 0.2s var(--ease-out),
    box-shadow 0.3s ease,
    transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Subtly lifts toward the user on focus — the "sprint into focus". */
.input-pill:focus-within {
  background: var(--input-bg-focus);
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.25);
  transform: scale(1.015);
}
/* Re-triggerable one-shot so the sprint replays on EVERY tap, not just the
   first focus (JS toggles this on pointerdown/focus — a plain :focus-within
   transition fires only on entry). Ends where :focus-within holds. */
@keyframes input-pill-sprint {
  0%   { transform: scale(1); }
  55%  { transform: scale(1.03); }
  100% { transform: scale(1.015); }
}
.input-pill--sprint { animation: input-pill-sprint 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both; }

@media (prefers-reduced-motion: reduce) {
  .input-pill { transition: background 0.2s ease, box-shadow 0.2s ease; }
  .input-pill:focus-within { transform: none; }
  .input-pill--sprint { animation: none; }
}

/* ---- Button tap ------------------------------------------------------------
   A quick spring press that plays on EVERY tap of any <button> / [role=button]
   (delegated in JS — see wireButtonTap — so it covers buttons rendered later).
   Uses the standalone `scale` property, NOT `transform: scale()`, so it never
   clobbers a button that uses `transform` for layout (FAB centring etc.).
   Additive to each button's own :hover / :active styling. */
@keyframes btn-tap {
  0%   { scale: 1; }
  42%  { scale: 0.94; }
  100% { scale: 1; }
}
.btn-tapped { animation: btn-tap 260ms cubic-bezier(0.34, 1.56, 0.64, 1); }
@media (prefers-reduced-motion: reduce) {
  .btn-tapped { animation: none; }
}

/* Material-style ripple, spawned by spawnBtnRipple() — Android app only
   (see wireButtonTap's isAndroidApp check); the element is never created
   on web/iOS, so this rule has no effect there. Layers on top of the
   scale-press above, same as a real Material button (dim + ripple). */
.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  pointer-events: none;
  transform: scale(0);
  opacity: 0.6;
  animation: btn-ripple-expand 450ms ease-out forwards;
}
@keyframes btn-ripple-expand {
  to { transform: scale(1); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .btn-ripple { display: none; }
}

.input-pill input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: var(--type-base);
  font-weight: 500;
  width: 42px;
  -moz-appearance: textfield;
}

.input-pill input::-webkit-outer-spin-button,
.input-pill input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.input-pill input::placeholder {
  color: var(--text-faint);
  font-weight: 400;
}

.input-pill .unit {
  background: var(--card-bg-alt);
  color: var(--text-muted);
  padding: var(--space-2) var(--space-4);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: var(--type-sm);
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-left: auto;
}

/* gender buttons */
.gender-row {
  gap: var(--space-3);
  width: fit-content;
  margin: 0 auto;
}

/* ============================================
   BMI RESULT
   ============================================ */
.bmi-result {
  text-align: center;
  margin-top: var(--space-7);
  margin-bottom: var(--space-7);
}

.bmi-result-label {
  font-size: var(--type-body);
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
  letter-spacing: 0.01em;
}

.bmi-result-value {
  font-family: var(--font-numeric);
  font-variant-numeric: tabular-nums;
  font-size: var(--type-num-2xl);
  font-weight: 700;
  line-height: 1.0;
  letter-spacing: normal;
  transition: transform 0.4s var(--ease-spring);
  display: inline-block;
}

.bmi-result-value.pulse {
  transform: scale(1.08);
}

/* ============================================
   BMI SCALE
   ============================================ */
.bmi-scale {
  position: relative;
  margin-top: var(--space-3);
}

.bmi-pointer {
  position: absolute;
  left: 30%;
  top: 0;
  width: 2px;
  height: 20px;
  background: var(--pointer);
  transform: translateX(-50%);
  transition: left 0.7s var(--ease-spring);
  margin-bottom: var(--space-2);
}

.bmi-scale-bar {
  display: flex;
  gap: var(--space-1);
  height: 10px;
  width: 100%;
}

.bmi-segment {
  flex: 1;
  border-radius: 3px;
  transition:
    filter 0.3s var(--ease-out),
    transform 0.3s var(--ease-out);
}

/* Zone color coding (themeable via tokens) */
.seg-1 {
  background: var(--bmi-zone-1);
}
.seg-2 {
  background: var(--primary);
  color: var(--btn-text);
}
.seg-3 {
  background: var(--bmi-zone-3);
}
.seg-4 {
  background: var(--bmi-zone-4);
}

.bmi-scale-labels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-1);
  margin-top: var(--space-3);
}

.scale-label {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--type-sm);
}

.scale-name {
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.005em;
}

.scale-range {
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: var(--type-xs);
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* Floating category label above the scale pointer — removed; the friendly
   "your BMI is …" note states the band instead. */
.bmi-pointer-label { display: none; }

.bmi-reset-btn[hidden] { display: none; }

/* BMI plan loader — shown once after first valid weight */
.bmi-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-6) 0 var(--space-2);
}

.bmi-loader[hidden] { display: none; }

.bmi-loader-text {
  font-size: var(--type-body);
  font-weight: 600;
  color: var(--text-muted);
  animation: cond-fade-up 0.35s var(--ease-out) both;
}

.bmi-loader-dots {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.bmi-loader-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.5;
  animation: cond-dot-bounce 1.1s ease-in-out infinite;
}

.bmi-loader-dots span:nth-child(2) { animation-delay: 0.18s; }
.bmi-loader-dots span:nth-child(3) { animation-delay: 0.36s; }

.bmi-reset-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: var(--space-4) auto 0;
  background: transparent;
  border: none;
  padding: var(--space-3) var(--space-5);
  min-height: 44px;
  cursor: pointer;
  color: var(--text-muted);
  font-family: inherit;
  font-size: var(--type-md);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

@media (hover: hover) {
  .bmi-reset-btn:hover {
    color: var(--text-muted);
  }
}

.bmi-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-7);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
}

.bmi-cta[hidden] {
  display: none;
}

.bmi-cta-text {
  font-size: var(--type-base);
  font-weight: 700;
  color: var(--text);
  text-align: center;
  line-height: 1.5;
}

/* Friendly "your plan is ready" line below the BMI scale, above Proceed. */
.bmi-ready-note {
  margin: var(--space-9) 0 var(--space-8);
  text-align: center;
  font-size: var(--type-body);
  line-height: 1.5;
  color: var(--text-muted);
}
.bmi-ready-note strong {
  color: var(--primary);
  font-weight: 700;
}

.bmi-cta-category {
  color: var(--primary);
  font-weight: 800;
}

.bmi-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  min-height: 44px;
  border-radius: 999px;
  border: 1.5px solid var(--border-strong);
  background: transparent;
  color: var(--accent);
  font-family: inherit;
  font-size: var(--type-sm);
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease-out);
}

.bmi-cta-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  transition: transform 0.3s var(--ease-out);
}

@media (hover: hover) {
  .bmi-cta-btn:hover {
    background: rgba(var(--primary-rgb), 0.08);
    border-color: var(--accent);
    transform: translateY(1px);
  }
  .bmi-cta-btn:hover svg {
    transform: translateY(3px);
  }
}

.stat-block {
  text-align: center;
}

.stat-label {
  font-family: var(--mono);
  font-size: var(--type-md);
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat-value {
  font-size: var(--type-num-md);
  font-weight: 700;
  letter-spacing: -0.8px;
  transition: transform 0.4s var(--ease-spring);
  display: inline-block;
}

.stat-value.pulse {
  transform: scale(1.08);
}

.stat-sublabel {
  font-size: var(--type-sm);
  color: var(--text-faint);
  margin-top: var(--space-1);
  font-weight: 500;
}

.protein-cta {
  margin-top: var(--space-2);
  padding: 0;
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: var(--type-sm);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.2s var(--ease-out);
}

.protein-cta:hover {
  color: var(--accent-light);
}

/* ============================================
   RECOMMENDATIONS SECTION (stacked cards)
   ============================================ */
.recommendations {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: var(--space-2) 0;
}

.recommendations .section-title {
  text-align: center;
  margin-bottom: var(--space-2);
}

/* Gradient-text section title with flanking sparkles */
.section-title--shine {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

/* Headers read in the neutral text color now — teal is reserved for
   tappable text (see design-system note near .goal-context-hero--action).
   The sparkle icons flanking the title keep their accent color. */
.section-title--shine > span {
  color: var(--text);
}

.sparkle {
  width: 18px;
  height: 18px;
  color: var(--accent);
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px currentColor);
  transform-origin: center;
  animation: sparkle-twinkle 2.8s ease-in-out infinite;
}

.sparkle--left {
  animation-delay: 0s;
}
.sparkle--right {
  animation-delay: 1.4s;
}

@keyframes sparkle-twinkle {
  0%,
  100% {
    transform: rotate(0deg) scale(0.85);
    opacity: 0.55;
  }
  50% {
    transform: rotate(180deg) scale(1.15);
    opacity: 1;
  }
}

@keyframes pulse-beat {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

.rec-card {
  padding: var(--space-7) var(--space-8);
  isolation: isolate;
}

/* Smooth unlock transition */
.recommendations .rec-card {
  transition: opacity 0.6s var(--ease-out), box-shadow 0.4s var(--ease-out), border-color 0.4s var(--ease-out);
}

/* Live state: glow-in animation + persistent subtle border */
/* Locked state — before BMI is calculated */
.recommendations--locked .rec-card {
  opacity: 0.3;
  pointer-events: none;
  user-select: none;
  height: auto;
  padding: 0 var(--space-8) var(--space-7) var(--space-8);
}

.rec-unlock-hint {
  display: none;
  text-align: center;
  font-size: var(--type-md);
  color: var(--text-faint);
  margin-top: -8.0px;
  margin-bottom: var(--space-4);
  letter-spacing: 0.01em;
}

.recommendations--locked .rec-unlock-hint {
  display: block;
}

.cond-unlock-hint {
  display: none;
  text-align: center;
  font-size: var(--type-md);
  color: var(--text-faint);
  margin-top: -8.0px;
  margin-bottom: var(--space-4);
  letter-spacing: 0.01em;
}

.recommendations--locked .cond-unlock-hint {
  display: block;
}

.unlock-scroll-btn {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  padding: 0;
  font-size: inherit;
  font-weight: 600;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.unlock-scroll-btn:hover {
  color: var(--primary-hover);
}

.unlock-scroll-btn:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
  border-radius: 2px;
}

.rec-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.rec-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px currentColor);
  transform-origin: center;
}

/* All three rec icons animate simultaneously, each with a full-cycle keyframe */
/* PROTEIN — continuous dumbbell curl */
.rec-icon--protein {
  color: var(--metric-protein);
  filter: drop-shadow(0 0 5px currentColor);
  animation: rec-curl 3s ease-in-out infinite;
}
@keyframes rec-curl {
  0%    { transform: rotate(0deg)   scale(1);    filter: drop-shadow(0 0 5px currentColor); }
  20%   { transform: rotate(-14deg) scale(0.92); filter: drop-shadow(0 0 4px currentColor); }
  45%   { transform: rotate(14deg)  scale(1.18); filter: drop-shadow(0 0 13px currentColor); }
  70%   { transform: rotate(-12deg) scale(0.94); filter: drop-shadow(0 0 4px currentColor); }
  90%   { transform: rotate(0deg)   scale(1);    filter: drop-shadow(0 0 5px currentColor); }
  100%  { transform: rotate(0deg)   scale(1);    filter: drop-shadow(0 0 5px currentColor); }
}

/* WATER — continuous drip morph */
.rec-icon--water {
  color: var(--metric-water);
  filter: drop-shadow(0 0 5px currentColor);
  animation: rec-drip 3s ease-in-out infinite;
}
@keyframes rec-drip {
  0%    { transform: scaleX(1)    scaleY(1)    translateY(0);    filter: drop-shadow(0 0 5px currentColor); }
  22%   { transform: scaleX(0.82) scaleY(1.22) translateY(-4px); filter: drop-shadow(0 0 12px currentColor); }
  50%   { transform: scaleX(1.18) scaleY(0.82) translateY(4px);  filter: drop-shadow(0 0 8px currentColor); }
  78%   { transform: scaleX(0.96) scaleY(1.06) translateY(-2px); filter: drop-shadow(0 0 6px currentColor); }
  100%  { transform: scaleX(1)    scaleY(1)    translateY(0);    filter: drop-shadow(0 0 5px currentColor); }
}

/* MOVEMENT — continuous marching feet */
.rec-icon--movement {
  color: var(--metric-steps);
}
.rec-icon--movement .foot {
  transform-origin: center;
}
.rec-icon--movement .foot-left {
  animation: rec-march 2.4s ease-in-out infinite;
  animation-delay: 0s;
}
.rec-icon--movement .foot-right {
  animation: rec-march 2.4s ease-in-out infinite;
  animation-delay: 0.4s;
}
@keyframes rec-march {
  0%    { transform: translateY(0)    scale(1);    opacity: 0.35; }
  20%   { transform: translateY(-6px) scale(1.14); opacity: 1;    filter: drop-shadow(0 0 7px currentColor); }
  40%   { transform: translateY(0)    scale(1);    opacity: 0.35; }
  60%   { transform: translateY(-6px) scale(1.14); opacity: 1;    filter: drop-shadow(0 0 7px currentColor); }
  80%   { transform: translateY(0)    scale(1);    opacity: 0.35; }
  100%  { transform: translateY(0)    scale(1);    opacity: 0.35; }
}

.rec-tag {
  font-family: var(--mono);
  font-size: var(--type-sm);
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* Slim variant of stat values inside rec cards */
.rec-card .stat-value {
  font-size: var(--type-hero);
}

.rec-bmi .stat-label {
  margin-bottom: var(--space-2);
}

/* Weight card metadata: centered 3-column grid (protein / steps / water) */
.rec-combined-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-1);
}

.rec-stat-col {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-4) var(--space-2);
}

.rec-stat-col .rec-header {
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.rec-stat-col .stat-label {
  margin-bottom: var(--space-1);
}

/* ============================================
   WEIGHT GOAL BUILDER (sentence-style)
   ============================================ */
.weight-goal-builder {
  margin-top: var(--space-6);
  margin-bottom: var(--space-6); /* 24px breathing room before the metric icons */
}

/* "SET A GOAL" label removed — redundant with the card title. */
.weight-goal-label { display: none; }

.weight-goal-sentence {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: var(--type-base);
  color: var(--text-muted);
  font-weight: var(--weight-semibold);
  line-height: 1.6;
  text-align: center;
}

.weight-goal-loss-part {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.goal-chip {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-full);
  border: 1.5px dashed rgba(var(--primary-rgb), 0.4);
  background: transparent;
  color: var(--text-muted);
  font-size: var(--type-body);
  font-weight: var(--weight-semibold);
  font-family: var(--font-sans);
  min-height: 36px;
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}

.goal-chip:hover {
  border-color: var(--primary);
  color: var(--text);
}

/* Upfront option pills (empty state): solid outline so they read as real choices. */
.goal-type-pills { display: inline-flex; flex-wrap: wrap; gap: var(--space-2); }
.goal-type-pills[hidden] { display: none; }
.goal-chip--option { border-style: solid; border-color: rgba(var(--primary-rgb), 0.5); color: var(--text); }

/* Protein "Find out how" only makes sense once a goal fills the numbers. */
.home-wizard:not(.goal-set) #proteinFindOutBtn { display: none; }

.goal-chip--set {
  border-style: solid;
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), 0.08);
  color: var(--primary);
}

.weight-goal-assessment {
  margin-top: var(--space-2);
  font-size: var(--type-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.02em;
  text-align: center;
}

.weight-goal-summary {
  margin-top: var(--space-2);
  font-size: var(--type-sm);
  color: var(--text-muted);
  font-weight: var(--weight-semibold);
  text-align: center;
}

/* Goal type options list */
.goal-type-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  padding: var(--space-4) var(--space-4);
  margin-bottom: var(--space-2);
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.goal-type-option:hover {
  border-color: rgba(var(--primary-rgb), 0.4);
  background: rgba(var(--primary-rgb), 0.04);
}

.goal-type-option--active {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), 0.08);
}

.goal-type-label {
  font-size: var(--type-base);
  font-weight: var(--weight-semibold);
  color: var(--text);
}

.goal-type-desc {
  font-size: var(--type-sm);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

/* Goal amount / timeline options grid */
.goal-sheet-subtitle {
  font-size: var(--type-sm);
  color: var(--text-faint);
  margin: var(--space-1) 0 var(--space-4);
}

.goal-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

.goal-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: var(--space-3) var(--space-4);
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  min-height: 80px;
}

.goal-option:hover {
  border-color: rgba(var(--primary-rgb), 0.35);
}

.goal-option--selected {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), 0.08);
}

.goal-option-main {
  font-size: var(--type-lg);
  font-weight: var(--weight-bold);
  color: var(--text);
}

.goal-option-rate {
  font-size: var(--type-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.goal-option-badge {
  margin-top: var(--space-2);
  font-size: var(--type-xxs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
}

.goal-option-badge--recommended { color: var(--success); background: rgba(74, 222, 128, 0.12); }
.goal-option-badge--achievable { color: var(--warning); background: rgba(245, 158, 11, 0.12); }
.goal-option-badge--aggressive { color: var(--error);   background: rgba(214, 86, 86, 0.12); }

.goal-option:disabled,
.goal-option[disabled] {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================
   FOOD PREFERENCE TOGGLE (Fresh Component)
   Two equal-width pill buttons with sliding teal background
   ============================================ */
.food-pref-toggle {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: var(--space-1);
  width: 100%;
  max-width: 320px;
  margin: 0 auto var(--space-5);
  isolation: isolate;
}

.food-pref-btn {
  position: relative;
  z-index: 2;
  flex: 1;
  padding: var(--space-3) var(--space-4);
  min-height: 44px;
  border: none;
  background: transparent;
  border-radius: 995px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: var(--type-md);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-md) var(--easing-spring), transform var(--transition-md) var(--easing-spring);
  text-align: center;
}

@media (hover: hover) {
  .food-pref-btn:hover {
    color: var(--text-muted);
  }
}

.food-pref-btn.active {
  color: var(--text);
  background: rgba(var(--primary-rgb), 0.15);
  border-radius: 995px;
  transform: scale(1.02);
}

/* Animated teal background that slides behind active button */
.food-pref-thumb {
  position: absolute;
  z-index: 1;
  top: 4px;
  bottom: 4px;
  background: rgba(var(--primary-rgb), 0.15);
  border-radius: 995px;
  transition:
    left var(--transition-md) var(--easing-spring),
    width var(--transition-md) var(--easing-spring);
  pointer-events: none;
}

/* ============================================
   PROTEIN SOURCES GRID (How to get 25g)
   ============================================ */
.protein-sources {
  text-align: center;
  padding: var(--space-2) 0;
}

.sources-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  text-align: left;
}

.source-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  background: var(--card-bg);
  border-radius: 12px;
  padding: var(--space-3);
  border: 1px solid rgba(255, 255, 255, 0.03);
  transition:
    transform 0.35s var(--ease-out),
    box-shadow 0.35s var(--ease-out);
}

@media (hover: hover) {
  .source-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(var(--primary-rgb), 0.18);
  }
  .source-card:hover .source-image img {
    transform: scale(1.06);
  }
}

.source-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--card-bg-alt);
}

.source-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s var(--ease-out);
}

.source-card figcaption {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: 0 var(--space-1) var(--space-1);
}

.source-amount {
  font-size: var(--type-sm);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.source-name {
  font-size: var(--type-sm);
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  line-height: 1.3;
}

/* ============================================
   SECTION TITLES (used by food macros)
   ============================================ */
.section-title {
  font-size: var(--type-xl);
  font-weight: 700;
  margin-bottom: var(--space-8);
  letter-spacing: -0.4px;
}

.section-title.big {
  font-size: var(--type-display-2);
  font-weight: 800;
  letter-spacing: -0.8px;
  margin-bottom: var(--space-2);
}

/* ============================================
   FOOD MACROS
   ============================================ */
.macros-section {
  text-align: center;
  padding: var(--space-2) 0;
  display: flex;
  flex-direction: column;
}

.macros-collapsible:not([hidden]) ~ .macros-see-all {
  order: 10;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: var(--type-body);
  font-weight: 400;
  margin-bottom: 0;
}

.macros-chart {
  width: 180px;
  margin: 0 auto var(--space-7);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  transition: transform 0.6s var(--ease-spring);
}

.macros-chart-caption {
  font-size: var(--type-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-style: italic;
}

.macros-pie {
  width: 180px;
  height: 180px;
  filter: drop-shadow(0 8px 20px rgba(var(--primary-rgb), 0.22));
}

.pie-slice {
  cursor: pointer;
  transition: opacity 0.18s ease, transform 0.18s ease;
  transform-origin: 100px 100px;
}

/* Macro pie colors via tokens (CSS fill overrides the inline fallback) so the
   pie re-hues with the theme. */
.pie-slice[data-macro="protein"] { fill: var(--primary); }
.pie-slice[data-macro="carbs"] { fill: var(--macro-carbs); }
.pie-slice[data-macro="fats"] { fill: var(--macro-fats); }

@media (hover: hover) {
  .pie-slice:hover {
    opacity: 0.82;
    transform: scale(1.06);
  }
}

.macros-intro {
  text-align: center;
  color: var(--text);
  font-size: var(--type-base);
  font-weight: 400;
  line-height: 1.65;
  margin-bottom: var(--space-4);
  padding: 0 var(--space-3);
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

.macros-collapsible {
  margin-top: var(--space-7);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.macros-collapsible[hidden] { display: none; }

.macros-why {
  text-align: center;
  color: var(--text-muted);
  font-size: var(--type-md);
  font-weight: 400;
  line-height: 1.7;
  margin-bottom: var(--space-6);
  padding: var(--space-4) var(--space-5);
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
  border-left: 3px solid rgba(var(--primary-rgb), 0.4);
  background: rgba(var(--primary-rgb), 0.04);
  border-radius: 0 10px 10px 0;
  text-align: left;
}

.macros-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  text-align: left;
}

.macro-card {
  position: relative;
  background:
    linear-gradient(180deg, rgba(94, 234, 212, 0.025), transparent 35%),
    var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: var(--space-7) var(--space-7);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  box-shadow: 0 18px 40px -28px rgba(0, 0, 0, 0.6);
}

.macro-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.macro-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 12px currentColor;
}

.macro-dot--protein {
  background: var(--primary);
  color: var(--btn-text);
}
.macro-dot--carbs {
  background: var(--macro-carbs);
  color: rgba(var(--primary-rgb), 0.5);
}
.macro-dot--fats {
  background: var(--macro-fats);
  color: rgba(var(--primary-rgb), 0.35);
}
.macro-dot--micro {
  background: #f59e0b;
  color: rgba(245, 158, 11, 0.5);
}

.macro-micro-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.macro-micro-pills .toggle-btn {
  padding: var(--space-2) var(--space-4);
  min-height: 32px;
  font-size: var(--type-sm);
}

.macro-micro-pills .toggle-btn.active {
  background: var(--accent-dim);
  border-color: rgba(var(--primary-rgb),0.35);
}

/* Detail panels */
.micro-details {
  overflow: hidden;
}

.micro-detail-panel {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.35s var(--ease-out), opacity 0.25s ease;
}

.micro-detail-panel.open {
  max-height: 700px;
  opacity: 1;
}

/* Nutrient table */
.micro-table-wrap {
  overflow-x: auto;
  margin-top: var(--space-4);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.micro-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--type-sm);
  line-height: 1.5;
  table-layout: fixed;
}

.micro-table th {
  font-size: var(--type-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
  background: var(--card-bg-alt);
  padding: var(--space-2) var(--space-3);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.micro-table td {
  padding: var(--space-2) var(--space-3);
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: top;
}

.micro-table tbody tr:last-child td {
  border-bottom: none;
}

.micro-table td:first-child {
  font-weight: 700;
  color: var(--text);
  width: 28%;
}

.micro-table td:nth-child(2) {
  width: 38%;
}

.micro-table td:nth-child(3) {
  width: 34%;
}

/* Water panel */
.micro-water {
  margin-top: var(--space-4);
}

.micro-water-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-10);
  align-items: stretch;
}

.micro-water-left {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: 100%;
}

.micro-water-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  justify-content: flex-start;
  height: 100%;
}

.micro-body-svg {
  height: 168px;
  width: auto;
  display: block;
}

.micro-water-pct-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}

.micro-water-pct {
  font-size: var(--type-display);
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -1px;
  line-height: 1;
}

.micro-water-pct-text {
  font-size: var(--type-md);
  color: var(--text-muted);
}

.micro-water-intake {
  padding-top: var(--space-3);
  border-top: 1px dashed var(--border);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
}

.micro-water-intake-num {
  font-size: var(--type-xl);
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.micro-water-intake-text {
  font-size: var(--type-sm);
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

.micro-water-intake-blurb {
  font-size: var(--type-sm);
  color: var(--text-muted);
  line-height: 1.6;
  margin: var(--space-2) 0 0 0;
  opacity: 0.85;
}

/* Wave animation */
@keyframes water-wave-anim {
  0%, 100% { transform: translateX(0); }
  50%       { transform: translateX(-180px); }
}

.water-wave {
  animation: water-wave-anim 4s ease-in-out infinite;
}

.macro-titles {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.macro-name {
  font-size: var(--type-xl);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
  margin: 0;
}

.macro-tagline {
  font-family: var(--mono);
  font-size: var(--type-sm);
  font-weight: 500;
  color: var(--text-faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.macro-text {
  font-size: var(--type-body);
  font-weight: 400;
  color: var(--text);
  line-height: 1.6;
  opacity: 0.88;
  margin: 0;
}

/* ============================================
   FOOD THUMBNAIL — Unified Component
   Used by: story of nutrition + protein card
   ============================================ */
.food-thumb-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  padding-top: var(--space-2);
}

.food-thumb {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  text-align: left;
  margin: 0;
  background: var(--card-bg);
  border-radius: 10px;
  padding: var(--space-2);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.food-thumb__image {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
  background: var(--card-bg-alt);
}

.food-thumb__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.food-thumb__label {
  font-size: var(--type-sm);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.25;
  padding: 0 var(--space-1) var(--space-1);
  margin: 0;
}

.food-thumb__amount {
  font-size: var(--type-xxs);
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.3;
  padding: 0 var(--space-1);
  margin: 0;
}

/* ============================================
   NEWSLETTER
   ============================================ */
.newsletter-card {
  text-align: center;
}

.newsletter-card .card-title {
  margin-bottom: var(--space-3);
}

.newsletter-subtitle {
  font-size: var(--type-md);
  color: var(--text-faint);
  line-height: 1.5;
  margin-bottom: var(--space-6);
  font-weight: 400;
}

.newsletter-icon {
  display: block;
  width: 26px;
  height: 26px;
  margin: 0 auto var(--space-3);
  color: var(--accent);
  filter: drop-shadow(0 0 8px rgba(var(--primary-rgb), 0.35));
  animation: nl-hover 3.5s ease-in-out infinite;
}

@keyframes nl-hover {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 380px;
  margin: 0 auto;
}

.newsletter-contact {
  background: var(--input-bg);
  border: none;
  border-radius: 8px;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: var(--type-body);
  font-weight: 400;
  padding: var(--space-3);
  transition: box-shadow 0.2s var(--ease-out);
}

.newsletter-contact::placeholder {
  color: var(--text-faint);
}

.newsletter-contact:focus {
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.25);
}

.feedback-wrapper {
  background: var(--input-bg);
  border-radius: 12px;
  padding: var(--space-3);
  transition: box-shadow 0.2s var(--ease-out);
}

.feedback-wrapper:focus-within {
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.25);
}

.feedback-wrapper textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: var(--type-body);
  font-weight: 400;
  padding: 0;
  resize: none;
  min-height: auto;
  line-height: 1.5;
}

.feedback-wrapper textarea::placeholder {
  color: var(--text-faint);
}

.feedback-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--space-1);
  gap: var(--space-3);
}

.feedback-counter {
  font-size: var(--type-xs);
  color: var(--text-faint);
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

.feedback-counter-sep {
  margin: 0 var(--space-1);
}

.feedback-controls button {
  background: var(--accent-dim);
  color: var(--text);
  border: none;
  padding: var(--space-3) var(--space-6);
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: var(--type-body);
  font-weight: 600;
  white-space: nowrap;
  transition:
    background 0.3s var(--ease-out),
    transform 0.15s var(--ease-out);
}

@media (hover: hover) {
  .feedback-controls button:hover {
    background: var(--accent);
    color: var(--btn-text);
  }
}

.feedback-controls button:active {
  transform: scale(0.96);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  text-align: center;
  padding: var(--space-5) 0 var(--space-8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
}

.ig-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-muted);
  font-size: var(--type-md);
  font-weight: 500;
  text-decoration: none;
  padding: var(--space-2) var(--space-4);
  border-radius: 999px;
  transition:
    color 0.3s var(--ease-out),
    background 0.3s var(--ease-out),
    transform 0.3s var(--ease-out);
}

.ig-icon {
  transition: transform 0.4s var(--ease-spring);
}

@media (hover: hover) {
  .ig-link:hover {
    color: var(--accent-soft);
    background: rgba(var(--primary-rgb), 0.08);
    transform: translateY(-1px);
  }

  .ig-link:hover .ig-icon {
    transform: rotate(-8deg) scale(1.1);
  }
}

/* ============================================
   SHARE PLAN SECTION
   ============================================ */
/* ============================================
   UNIFIED SHARE COMPONENT (Design System)
   Consolidates weight/protein/health share UIs
   ============================================ */
/* ============================================
   UNIFIED SHARE COMPONENT (Design System)
   Minimal, subtle design for all three cards
   ============================================ */
.plan-share {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.plan-share--subtle {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
}

.plan-share-subtitle {
  font-size: var(--type-xs);
  color: var(--text-faint);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Unified button styling */
.plan-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  min-height: auto;
  border: 1px solid rgba(var(--primary-rgb), 0.3);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: var(--type-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s var(--ease-out);
}

@media (hover: hover) {
  .plan-share-btn:not([disabled]):hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(var(--primary-rgb), 0.06);
  }
}

.plan-share-btn:active {
  transform: scale(0.95);
}

.plan-share-btn[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: var(--border-disabled);
  background: transparent;
  color: var(--text-muted);
  pointer-events: none;
}

.plan-share-btn--saved {
  border-color: var(--accent);
  background: rgba(var(--primary-rgb), 0.1);
  color: var(--accent);
  pointer-events: none;
}

/* ============================================
   SHARE MODAL (native <dialog>)
   ============================================ */
#shareNameModal,
#proteinShareNameModal,
#deleteProfileModal,
#profileLimitModal {
  border: none;
  border-radius: 20px;
  padding: 0;
  background: var(--card-bg);
  color: var(--text);
  max-width: 380px;
  width: calc(100vw - 40px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
  outline: none;
  /* Explicit centering — native dialog auto-center is inconsistent */
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
}

#shareNameModal::backdrop,
#proteinShareNameModal::backdrop,
#deleteProfileModal::backdrop,
#profileLimitModal::backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Remove-profile confirmation */
.delete-confirm-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.delete-confirm-cancel,
.delete-confirm-remove {
  flex: 1 1 0;
  min-height: 48px;
  border-radius: 999px;
  font-family: inherit;
  font-size: var(--type-md);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s var(--ease-out);
}

.delete-confirm-cancel {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
}

.delete-confirm-remove {
  background: rgba(220, 60, 60, 0.95);
  border: 1px solid transparent;
  color: #fff;
}

/* Neutral confirm (info popups) — teal instead of danger red */
.delete-confirm-ok {
  background: var(--accent);
  color: var(--btn-text);
}

@media (hover: hover) {
  .delete-confirm-cancel:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--text);
  }
  .delete-confirm-remove:not(.delete-confirm-ok):hover {
    background: rgba(220, 60, 60, 1);
    transform: translateY(-1px);
  }
  .delete-confirm-ok:hover {
    background: var(--accent-soft, var(--primary));
    transform: translateY(-1px);
  }
}

.delete-confirm-cancel:active,
.delete-confirm-remove:active {
  transform: translateY(0);
}

.share-modal-box {
  padding: var(--space-11) var(--space-7) var(--space-9);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.share-modal-title {
  font-size: var(--type-xl);
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.3px;
  margin-bottom: var(--space-2);
  line-height: 1.3;
}

.share-modal-sub {
  font-size: var(--type-md);
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
  margin-bottom: var(--space-6);
}

/* Input row — clean field, no inline button */
.share-input-row {
  display: flex;
  align-items: center;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: var(--space-1) var(--space-4);
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: var(--space-4);
}

.share-input-row:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

.share-name-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: var(--type-base);
  font-weight: 500;
  color: var(--text);
  padding: var(--space-3) 0;
  min-width: 0;
}

.share-name-input::placeholder {
  color: var(--text-faint);
  font-weight: 400;
}

/* Standalone Next CTA */
.share-next-btn {
  width: 100%;
  min-height: 50px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: var(--btn-text);
  font-family: inherit;
  font-size: var(--type-base);
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, opacity 0.2s, transform 0.15s var(--ease-out);
}

.share-next-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

@media (hover: hover) {
  .share-next-btn:not(:disabled):hover {
    background: var(--accent-soft, var(--primary));
    transform: translateY(-1px);
  }
}

.share-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: var(--space-2);
  min-height: var(--touch-min);
  min-width: var(--touch-min);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.15s, background 0.15s;
}

.share-close-btn:hover {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
}

#shareStateReady,
#proteinShareStateReady {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

#shareStateReady[hidden],
#proteinShareStateReady[hidden] { display: none; }

#shareStateReady .share-modal-sub,
#proteinShareStateReady .share-modal-sub {
  margin-bottom: var(--space-7);
}

#shareStateReady .plan-share-btn,
#proteinShareStateReady .plan-share-btn {
  width: 100%;
  justify-content: center;
  min-height: 50px;
  font-size: var(--type-base);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 540px) {
  .container {
    padding: 100.0px var(--space-5) var(--space-7);
    gap: var(--space-10);
  }

  .brand-title {
    font-size: var(--type-hero);
  }

  .card {
    padding: var(--space-8) var(--space-6);
    border-radius: 18px;
  }

  .card-title {
    font-size: var(--type-xl);
  }

  .macros-grid {
    gap: var(--space-4);
  }
  .macro-card {
    padding: var(--space-6) var(--space-5);
    gap: var(--space-4);
  }
  .macro-name {
    font-size: var(--type-lg);
  }
  .macro-text {
    font-size: var(--type-md);
  }
  .food-thumb-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }

  .rec-card {
    padding: var(--space-6) var(--space-5);
  }
  .rec-card .stat-value {
    font-size: var(--type-num-sm);
  }
  .rec-stat-col {
    padding: var(--space-3) var(--space-1);
  }
  .rec-combined-stats {
    gap: var(--space-1);
  }

  .sparkle {
    width: 14px;
    height: 14px;
  }
  .section-title--shine {
    gap: var(--space-3);
  }

  .macros-chart {
    width: 160px;
    height: 160px;
  }

  .sources-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }
  .source-amount {
    font-size: var(--type-md);
  }
  .source-name {
    font-size: var(--type-sm);
  }

  .scale-label {
    font-size: var(--type-xs);
  }
  .scale-range {
    font-size: var(--type-xxs);
  }

  .bmi-result-value {
    font-size: var(--type-num-xl);
  }
  .section-title.big {
    font-size: var(--type-display);
  }
  .stat-value {
    font-size: var(--type-hero);
  }

  /* Prevent iOS Safari from zooming on input focus */
.input-pill input,
.newsletter-contact,
.feedback-wrapper textarea {
    font-size: var(--type-base);
  }

  /* Slightly larger tap targets */
.toggle-btn {
    padding: var(--space-3) var(--space-8);
  }
  .feedback-controls button {
    padding: var(--space-3) var(--space-7);
  }
}

/* =========================================================
   CONDITIONS SECTION
   ========================================================= */
/* ════════════════════════════════════════════════════════════════════════════
   HEALTH CARD — Health Conditions & Personalized Recommendations
   ════════════════════════════════════════════════════════════════════════════
   Reference: "Health Card" in future PRs/comments
   Main Classes: .rec-card--cond, .cond-question-wrapper, .cond-matrix
   Status: Active development — logic/state changes ongoing
   ════════════════════════════════════════════════════════════════════════════ */
/* Subtle tint + border to differentiate from the generic rec-card above */
.rec-card--cond {
  border-color: rgba(var(--primary-rgb), 0.2);
  background:
    linear-gradient(180deg, rgba(var(--primary-rgb), 0.04) 0%, transparent 30%),
    var(--card-bg);
  position: relative;
  overflow: visible;
  transition: opacity 0.6s var(--ease-out), box-shadow 0.4s var(--ease-out), border-color 0.4s var(--ease-out);
}

.conditions-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  justify-content: center;
}

.meta-chip {
  font-size: var(--type-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--card-bg-alt);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: var(--space-2) var(--space-4);
  color: var(--text-muted);
  cursor: default;
  user-select: none;
}

.meta-chip--empty {
  color: var(--text-faint);
  opacity: 0.5;
}

/* Answer pills accumulate here as user answers each question */
.cond-answer-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
  align-items: center;
  min-height: 36px;
  margin-bottom: var(--space-3);
}

.cond-answer-cloud--active {
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

/* Locked state: remove min-height for compact appearance */
.recommendations--locked .cond-answer-cloud {
  min-height: 0;
}

/* Interactive answer pill — tap to go back and change */
.cond-answer-pill {
  cursor: pointer;
  border-color: rgba(var(--primary-rgb), 0.3);
  color: var(--accent-soft);
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  position: relative;
}

@media (hover: hover) {
  .cond-answer-pill:hover {
    border-color: var(--accent);
    background: rgba(var(--primary-rgb), 0.08);
    transform: translateY(-1px);
  }
}

.cond-answer-pill:active {
  transform: scale(0.96);
}

/* "Add more" action pill — always last, accent styling */
.cond-add-more-pill {
  order: 999;
  border-color: var(--accent);
  background: transparent;
  color: var(--accent);
  font-weight: 700;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

@media (hover: hover) {
  .cond-add-more-pill:hover {
    border-color: var(--accent);
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--accent);
  }
}

/* Bottom sheet modal */
.cond-bottom-sheet-modal {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  /* Closing only removes this class, not the element — without pointer-events:none
     here, a sheet that was ever opened stays as an invisible full-page click-blocker. */
  pointer-events: none;
}

.cond-bottom-sheet-modal--open {
  pointer-events: auto;
}

.cond-bottom-sheet-backdrop {
  flex: 1;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

.cond-bottom-sheet-modal--open .cond-bottom-sheet-backdrop {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.cond-bottom-sheet {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border-radius: 20px 20px 0 0;
  max-height: calc(var(--vh-px, 100vh) * 0.8);
  overflow: hidden;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.cond-bottom-sheet-modal--open .cond-bottom-sheet {
  transform: translateY(0);
}

.cond-bottom-sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: var(--space-3) auto;
  flex-shrink: 0;
}

/* Protein bottom sheet — scrollable body + sticky "Done" footer. */
.protein-sheet { max-height: calc(var(--vh-px, 100vh) * 0.88); }
.protein-sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 var(--space-5) var(--space-4);
}
/* Card chrome off — it's inside the sheet surface now. */
.protein-sheet-body .card {
  border: none; box-shadow: none; background: transparent;
  border-radius: 0; padding-left: 0; padding-right: 0;
}
.protein-sheet-footer {
  flex-shrink: 0;
  padding: var(--space-4) var(--space-5) calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  background: var(--card-bg);
}
.protein-sheet-footer button {
  width: 100%;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: var(--radius-full);
  background: var(--primary-fill); color: var(--btn-text);
  font: inherit; font-weight: 700; font-size: var(--type-md);
  padding: var(--space-3) var(--space-5);
  cursor: pointer;
}

/* Comprehensive conditions view */
.cond-comprehensive-view {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 0 var(--space-5) 0;
  height: 100%;
  overflow: hidden;
}

.cond-comprehensive-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-5) var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.cond-comprehensive-title {
  font-size: var(--type-body);
  font-weight: 700;
  color: var(--text);
  text-align: left;
  margin: 0;
  letter-spacing: -0.3px;
  flex: 1;
  line-height: 1.5;
}

.cond-comprehensive-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
  flex-shrink: 0;
}

.cond-comprehensive-close svg {
  width: 20px;
  height: 20px;
}

@media (hover: hover) {
  .cond-comprehensive-close:hover {
    color: var(--text);
  }
}

.cond-comprehensive-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  overflow-y: auto;
  flex: 1;
  padding: var(--space-4) var(--space-5) var(--space-4) var(--space-5);
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  transition: scrollbar-color 0.3s;
}

.cond-comprehensive-options:hover {
  scrollbar-color: var(--border) transparent;
}

.cond-comprehensive-options::-webkit-scrollbar {
  width: 8px;
}

.cond-comprehensive-options::-webkit-scrollbar-track {
  background: transparent;
}

.cond-comprehensive-options::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 4px;
  transition: background 0.3s;
}

.cond-comprehensive-options:hover::-webkit-scrollbar-thumb {
  background: var(--border);
}

.cond-comprehensive-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-2) 0;
}

.cond-comprehensive-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}

.cond-comprehensive-label {
  font-size: var(--type-sm);
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
  line-height: 1.5;
}

.cond-comprehensive-btns {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.cond-comprehensive-btn {
  padding: var(--space-2) var(--space-4);
  min-height: var(--touch-min);
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: var(--type-sm);
  font-weight: 600;
  font-family: inherit;
  line-height: 1.5;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.cond-comprehensive-btn.selected {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(var(--primary-rgb), 0.08);
}

@media (hover: hover) {
  .cond-comprehensive-btn:hover {
    border-color: var(--accent);
  }

  .cond-comprehensive-btn.selected:hover {
    background: rgba(var(--primary-rgb), 0.12);
  }
}

.cond-comprehensive-apply {
  width: calc(100% - 24px);
  min-height: 44px;
  margin: var(--space-3) var(--space-3) 0;
  padding: var(--space-3) var(--space-4);
  background: var(--primary-fill);
  border: none;
  border-radius: 12px;
  color: var(--btn-text);
  font-family: inherit;
  font-size: var(--type-md);
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s ease-out;
  flex-shrink: 0;
}

@media (hover: hover) {
  .cond-comprehensive-apply:hover {
    opacity: 0.9;
  }
}

.cond-comprehensive-apply:active {
  transform: scale(0.98);
}

.cond-comprehensive-row--coming-soon {
  opacity: 0.6;
  position: relative;
  padding: var(--space-2) 0;
}

.cond-coming-soon-badge {
  font-size: var(--type-xxs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Fixed-height area — one question shown at a time, no layout jump */
/* Disabled state callout — centre-aligned, flat (no nested card styling) */
.cond-question-wrapper {
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: min-height 0.3s ease, opacity 0.3s ease;
  opacity: 1;
}

/* Disabled state: show ghost preview, block interaction */
.cond-question-wrapper--disabled {
  pointer-events: none;
  cursor: not-allowed;
  min-height: 160px;
}

/* Ghost preview — only visible in the disabled/locked state */
.cond-preview-ghost {
  width: 100%;
  text-align: center;
  user-select: none;
  -webkit-user-select: none;
}

.cond-preview-ghost .cond-q-text {
  opacity: 0.5;
  font-size: var(--type-lg);
}

.cond-preview-ghost .cond-btns {
  opacity: 0.4;
}

.cond-preview-ghost .toggle-btn {
  pointer-events: none;
}

.cond-preview-hint {
  margin-top: var(--space-4);
  font-size: var(--type-sm);
  color: var(--text-muted);
  opacity: 0.7;
  font-style: italic;
}

/* Hide ghost once questions are live (wrapper no longer --disabled) */
.cond-question-wrapper:not(.cond-question-wrapper--disabled) .cond-preview-ghost {
  display: none;
}

.cond-question-wrapper--disabled .toggle-btn,
.cond-question-wrapper--disabled .cond-btn {
  cursor: not-allowed;
  opacity: 0.4;
  pointer-events: none;
}

.cond-question-wrapper--done {
  min-height: 0;
}

/* Locked state: let the wrapper breathe so the ghost preview shows */
.recommendations--locked .cond-question-wrapper {
  min-height: auto;
}

.cond-question {
  width: 100%;
  text-align: center;
  transition: opacity 0.28s ease, transform 0.28s ease;
  background: var(--card-bg-alt);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-5);
}

.cond-question--fading {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}

.cond-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: var(--type-body);
  font-weight: 400;
  cursor: pointer;
  transition: color 0.2s;
}

.cond-back-btn[hidden] {
  display: none !important;
  visibility: hidden;
}

.cond-back-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

@media (hover: hover) {
  .cond-back-btn:hover {
    color: var(--text);
  }
}

.cond-back-btn:active {
  transform: scale(0.92);
}

.cond-q-text {
  font-size: var(--type-base);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-5);
  line-height: 1.35;
  letter-spacing: -0.1px;
}

.cond-btns {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  justify-content: center;
}

/* Condition buttons use .toggle-btn with .selected alias for active state */
.cond-btns .toggle-btn.selected {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(var(--primary-rgb), 0.08);
}

/* cond-answers tombstone removed — answers now surface as live pills in .cond-answer-cloud */
/* Loading state */
.cond-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-7) 0 var(--space-5);
}

.cond-loader[hidden] { display: none; }

.cond-loader-text {
  font-size: var(--type-body);
  font-weight: 600;
  color: var(--text-muted);
  animation: cond-fade-up 0.35s var(--ease-out) both;
}

@keyframes cond-fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cond-loader-dots {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.cond-loader-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: cond-dot-bounce 1.1s ease-in-out infinite;
  opacity: 0.5;
}

.cond-loader-dots span:nth-child(2) { animation-delay: 0.18s; }
.cond-loader-dots span:nth-child(3) { animation-delay: 0.36s; }

@keyframes cond-dot-bounce {
  0%, 80%, 100% { transform: translateY(0);    opacity: 0.4; }
  40%           { transform: translateY(-9px); opacity: 1;   }
}

/* Horizontal matrix */
.cond-matrix {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-1);
}

.cond-matrix[hidden] { display: none; }

/* ============================================
   GUARDRAIL ALERT CARD
   ============================================ */
.guardrail-alert {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--warning-dim);
  border: 1px solid rgba(245, 158, 11, 0.22);
  margin-top: var(--space-3);
}

.guardrail-alert-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--warning);
  margin-top: var(--space-1);
}

.guardrail-alert-icon svg {
  width: 100%;
  height: 100%;
}

.guardrail-alert-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.guardrail-alert-title {
  font-size: var(--type-md);
  font-weight: var(--weight-bold);
  color: var(--warning);
  margin: 0;
  line-height: var(--line-title);
}

.guardrail-alert-text {
  font-size: var(--type-sm);
  font-weight: var(--weight-regular);
  color: var(--text-muted);
  margin: 0;
  line-height: var(--line-body);
}

/* ============================================
   TIMELINE — daily / weekly / monthly / periodic
   ============================================ */
/* Frequency badge pill */
.tl-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: 20px;
  font-size: var(--type-xxs);
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.tl-badge svg { width: 12px; height: 12px; }
.tl-badge--daily { background: rgba(var(--primary-rgb),0.12);  color: var(--accent);       border: 1px solid rgba(var(--primary-rgb),0.25); }
.tl-badge--weekly { background: rgba(100,180,255,0.1);  color: #64b4ff;             border: 1px solid rgba(100,180,255,0.2); }
.tl-badge--monthly { background: rgba(255,180,60,0.1);   color: #e6a535;             border: 1px solid rgba(255,180,60,0.2);  }
.tl-badge--periodic { background: rgba(180,140,255,0.1);  color: #b48cff;             border: 1px solid rgba(180,140,255,0.2); }

/* Hero daily card */
.cond-filter-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-5) 0 var(--space-6);
  opacity: 0.6;
}
.cond-filter-divider[hidden] { display: none; }

.tl-hero {
  padding: var(--space-1) 0 0;
  margin-bottom: 0;
}

.tl-hero-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
  text-align: left;
}

.tl-hero-title,
.tl-card-title {
  font-size: var(--type-xl);
  font-weight: 800;
  color: var(--text);
  margin: 0;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.tl-hero-sub,
.tl-card-sub {
  font-size: var(--type-xs);
  color: var(--text-faint);
  margin: 0;
}

.tl-item-examples,
.cond-item-examples {
  display: block;
  font-size: var(--type-xs);
  font-style: italic;
  color: var(--accent);
  margin-top: var(--space-1);
  line-height: 1.5;
  opacity: 0.85;
}

/* Visual stats row (protein / steps / water) — horizontal 3-column left-aligned */
.tl-stats-row {
  display: flex;
  flex-direction: row;
  gap: var(--space-6);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px dashed var(--border);
  align-items: flex-start;
}

.tl-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  text-align: left;
  flex: 1;
}

.tl-stat-icon {
  width: 20px;
  height: 20px;
  opacity: 0.75;
}
.tl-stat-icon--protein { color: var(--primary); }
.tl-stat-icon--steps { color: var(--primary); }
.tl-stat-icon--water { color: var(--primary); }

.tl-stat-value {
  font-family: var(--font-numeric);
  font-size: var(--type-lg);
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.tl-stat-label {
  font-size: var(--type-xxs);
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
}

/* Daily hero preview with top 3 items + more link */
.tl-hero-preview {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.tl-hero-more-btn {
  align-self: flex-start;
  padding: var(--space-2) var(--space-3);
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: var(--type-sm);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  transition: opacity 0.2s;
}

.tl-hero-more-btn:hover {
  opacity: 0.8;
}

/* "See full plan" button at bottom of recommendations */
.cond-see-full-plan-btn {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  margin-top: var(--space-5);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--accent);
  font-size: var(--type-md);
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

@media (hover: hover) {
  .cond-see-full-plan-btn:hover {
    background: var(--accent);
    color: var(--btn-text);
    border-color: var(--accent);
  }
}

.cond-see-full-plan-btn:active {
  transform: scale(0.98);
}

/* Habit list shared by hero and freq cards */
.tl-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.tl-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) 0 var(--space-2) var(--space-3);
  border-left: 2px solid var(--border);
  background: none;
  border-radius: 0;
  transition: opacity 0.3s ease;
}

.tl-item--locked {
  opacity: 0.45;
}

.tl-item--locked:hover {
  opacity: 0.55;
}

.tl-item-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1;
  min-width: 0;
}

.tl-item-title {
  font-size: var(--type-body);
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
}

.tl-item-detail {
  font-size: var(--type-sm);
  color: var(--text-muted);
  line-height: 1.5;
}

.tl-item-unlock {
  display: block;
  font-size: var(--type-xs);
  color: var(--text-faint);
  font-style: italic;
  margin-top: var(--space-1);
  opacity: 0.8;
}

/* Source condition tag */
.tl-src-tag {
  flex-shrink: 0;
  font-size: var(--type-xxs);
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: var(--space-1) var(--space-2);
  border-radius: 20px;
  background: rgba(var(--primary-rgb),0.07);
  color: var(--accent-soft);
  border: 1px solid rgba(var(--primary-rgb),0.16);
  align-self: flex-start;
  margin-top: var(--space-1);
  white-space: nowrap;
}

.tl-src-tag--postpartum {
  background: rgba(236,72,153,0.07);
  color: #EC4899;
  border: 1px solid rgba(236,72,153,0.16);
}

/* Frequency sections — plain divider style, no card nesting */
.tl-card {
  background: none;
  border: none;
  border-radius: 0;
  margin-bottom: 0;
  overflow: visible;
}

.tl-card-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  min-height: 44px;
}

.tl-card-toggle-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
  text-align: left;
}

.tl-card-count {
  font-size: var(--type-xs);
  font-weight: 600;
  color: var(--text-faint);
  white-space: nowrap;
  flex-shrink: 0;
}

.tl-card-chevron {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--text-faint);
  transition: transform 0.2s ease;
}

/* Special concerns collapsible section */
.tl-concerns {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px dashed var(--border);
}

.tl-concerns-toggle {
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  padding: 0;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.tl-concerns-toggle-inner {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.tl-concerns-icon {
  width: 20px;
  height: 20px;
  color: var(--accent-soft);
  flex-shrink: 0;
}

.tl-concerns-toggle-inner > span {
  flex: 1;
  font-size: var(--type-body);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.1px;
}

.tl-concerns-chevron {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--text-faint);
  transition: transform 0.2s ease;
}

.tl-concerns-sub {
  font-size: var(--type-xs);
  color: var(--text-faint);
  margin: var(--space-1) 0 0;
  line-height: 1.5;
  padding-left: var(--space-7);
}

.tl-concerns-deep {
  margin-top: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.tl-concerns-deep[hidden] { display: none; }

/* ── Condition Tabs ───────────────────────────────────────────────────────── */
.cond-tabs { margin-top: var(--space-3); }

.cond-tabs-bar {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: var(--space-3);
}
.cond-tabs-bar::-webkit-scrollbar { display: none; }

.cond-tab-btn {
  flex-shrink: 0;
  padding: var(--space-2) var(--space-4);
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: var(--type-sm);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  min-height: 32px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.cond-tab-btn--active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(var(--primary-rgb),0.35);
}

.cond-tab-panel[hidden] { display: none; }

.cond-pillar-section-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* Flat recommendation row — left border accent, no card background */
.cond-tab-item {
  padding: var(--space-2) 0 var(--space-2) var(--space-3);
  border-left: 2px solid rgba(var(--primary-rgb),0.35);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.cond-tab-item-title {
  font-size: var(--type-sm);
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.cond-tab-item-detail {
  font-size: var(--type-xs);
  color: var(--text-muted);
  line-height: 1.4;
}

/* Subtle condition source label — e.g. "PCOS" or "Preconception" */
.cond-item-source {
  font-size: var(--type-xxs);
  color: var(--text-faint);
  font-style: italic;
  margin-top: var(--space-1);
  opacity: 0.8;
}

/* Pink postpartum tag */
.cond-item-source--postpartum {
  color: #EC4899;
  opacity: 1;
  font-style: normal;
  font-weight: 600;
}

/* "What not to do" section */
.cond-avoid-section {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
}

.cond-avoid-label {
  font-size: var(--type-xxs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(214,86,86,0.65);
  margin-bottom: var(--space-2);
}

.cond-tab-item--avoid {
  border-left-color: rgba(214,86,86,0.45);
}

/* "See full plan" — left-aligned stroke button */
.cond-tabs-see-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: var(--space-3);
  margin-left: 0;
  padding: var(--space-2) var(--space-4);
  background: transparent;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-pill);
  color: var(--accent);
  font-size: var(--type-xs);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s, border-color 0.2s;
}
.cond-tabs-see-more:hover {
  background: rgba(var(--primary-rgb), 0.08);
  border-color: var(--accent);
}
.cond-tabs-see-more:active {
  background: rgba(var(--primary-rgb), 0.15);
}

/* ── Collapsible Extras Card ────────────────────────────────────────────── */
.cond-extras-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  margin: var(--space-5) 0;
  overflow: hidden;
  transition: all 0.25s ease;
}

.cond-extras-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-4);
  background: transparent;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  min-height: 44px;
  font-family: inherit;
  transition: background 0.2s;
}

.cond-extras-card-header:hover {
  background: rgba(var(--primary-rgb), 0.04);
}

.cond-extras-card-header-title {
  font-size: var(--type-body);
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.cond-extras-card-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-faint);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.cond-extras-card--closed .cond-extras-card-chevron {
  transform: rotate(180deg);
}

.cond-extras-card-content {
  max-height: 1200px;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 var(--space-4) var(--space-4) var(--space-4);
}

.cond-extras-card--closed .cond-extras-card-content {
  max-height: 0;
  padding: 0 var(--space-4);
}

.cond-extras-card-footer {
  display: none;
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
  background: rgba(var(--primary-rgb), 0.04);
}

.cond-extras-card.has-changes .cond-extras-card-footer {
  display: block;
  animation: slideDown 0.3s ease;
}

.cond-extras-view-rec-btn {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--accent);
  font-size: var(--type-md);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  font-family: inherit;
}

.cond-extras-view-rec-btn:hover {
  background: rgba(var(--primary-rgb), 0.08);
  box-shadow: 0 0 12px rgba(var(--primary-rgb), 0.2);
}

.cond-extras-view-rec-btn:active {
  background: rgba(var(--primary-rgb), 0.15);
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 60px;
  }
}

@keyframes rowHighlight {
  0% {
    background: rgba(var(--primary-rgb), 0.15);
  }
  100% {
    background: transparent;
  }
}

/* ── Recommendations Loader ──────────────────────────────────────────────── */
.cond-rec-loader {
  display: none;
}

.cond-rec-loader:not([hidden]) {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-8) var(--space-5);
  text-align: center;
}

.cond-rec-loader-text {
  font-size: var(--type-body);
  color: var(--text-muted);
  margin: 0;
  font-weight: 500;
}

.cond-rec-loader-dots {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
}

.cond-rec-loader-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: loader-bounce 1.4s ease-in-out infinite;
}

.cond-rec-loader-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.cond-rec-loader-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes loader-bounce {
  0%, 100% { opacity: 0.4; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-6px); }
}

/* Weekly/monthly/periodic freq items — same flat style as daily */
.tl-freq-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) 0 var(--space-2);
}

.tl-freq-items--hidden {
  display: none !important;
}

/* ── Condition Popup (bottom-sheet) ──────────────────────────────────────── */
.cond-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  transition: background 0.25s ease;
  pointer-events: none;
}
.cond-popup-overlay--open {
  background: rgba(0,0,0,0.65);
  pointer-events: all;
}

.cond-popup-panel {
  width: 100%;
  max-height: calc(var(--vh-px, 100vh) * 0.82);
  background: var(--card-bg-alt);
  border-radius: 22px 22px 0 0;
  border-top: 1px solid rgba(var(--primary-rgb),0.18);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
}
.cond-popup-overlay--open .cond-popup-panel { transform: translateY(0); }

.cond-popup-drag {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: var(--space-3) auto 0;
  flex-shrink: 0;
}

.cond-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5) var(--space-3);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.cond-popup-header-left { display: flex; flex-direction: column; gap: var(--space-1); }

.cond-popup-headline {
  font-size: var(--type-base);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.cond-popup-sub {
  font-size: var(--type-xs);
  color: var(--text-faint);
}

.cond-popup-close {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: var(--input-bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cond-popup-close svg { width: 14px; height: 14px; color: var(--text-muted); }

.cond-popup-list {
  list-style: none;
  padding: var(--space-4) var(--space-5) var(--space-8);
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.cond-popup-item {
  padding: var(--space-2) 0 var(--space-2) var(--space-3);
  border-left: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  background: none;
  border-radius: 0;
}

.cond-popup-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

.cond-popup-item-title {
  font-size: var(--type-body);
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
  flex: 1;
}

.cond-popup-item-detail {
  font-size: var(--type-sm);
  color: var(--text-muted);
  line-height: 1.5;
}

.cond-popup-item .tl-item-examples {
  font-size: var(--type-xs);
  margin-top: var(--space-1);
  line-height: 1.5;
}

/* ── Grouped Popup Layout (by frequency) ──────────────────────────────────── */
.cond-popup-grouped {
  overflow-y: auto;
  max-height: calc(var(--vh-px, 100vh) * 0.6);
  padding: 0 var(--space-5) var(--space-5);
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  transition: scrollbar-color 0.3s;
}

.cond-popup-grouped:hover {
  scrollbar-color: var(--border) transparent;
}

.cond-popup-grouped::-webkit-scrollbar {
  width: 8px;
}

.cond-popup-grouped::-webkit-scrollbar-track {
  background: transparent;
}

.cond-popup-grouped::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 4px;
  transition: background 0.3s;
}

.cond-popup-grouped:hover::-webkit-scrollbar-thumb {
  background: var(--border);
}

.cond-popup-freq-header {
  font-size: var(--type-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin: var(--space-4) 0 var(--space-2) 0;
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
}

.cond-popup-freq-header:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.cond-popup-list--freq {
  padding: 0;
  margin: 0;
  gap: var(--space-2);
}

.cond-popup-list--freq .cond-popup-item {
  padding: var(--space-2) 0;
  border-left: 2px solid var(--accent);
  padding-left: var(--space-3);
}

/* Locked recommendations (higher level, not yet unlocked) */
.cond-popup-item--locked {
  opacity: 0.45;
  transition: opacity 0.3s ease;
}

.cond-popup-item--locked:hover {
  opacity: 0.55;
}

.cond-popup-item-unlock {
  display: block;
  font-size: var(--type-xs);
  color: var(--text-faint);
  font-style: italic;
  margin-top: var(--space-1);
  opacity: 0.8;
  line-height: 1.5;
}

/* Bigger icons inside the special concern pillar cards */
.tl-concerns-deep .cond-pillar-icon {
  width: 28px;
  height: 28px;
}

.cond-pillar {
  background: var(--card-bg-alt);
  border-radius: 10px;
  padding: var(--space-4) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.cond-pillar-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--type-sm);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.cond-pillar-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: var(--accent);
}

/* Micro-animations per pillar icon type */
.cond-pillar-icon--nutrition {
  animation: icon-bounce 2.8s ease-in-out infinite;
}
.cond-pillar-icon--movement {
  animation: icon-step 2.2s ease-in-out infinite;
}
.cond-pillar-icon--rest {
  animation: icon-sway 4s ease-in-out infinite;
}
.cond-pillar-icon--monitor {
  animation: icon-beat 1.9s ease-in-out infinite;
}

@keyframes icon-bounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  35%       { transform: translateY(-3px) rotate(-5deg); }
  65%       { transform: translateY(-2px) rotate(3deg); }
}
@keyframes icon-step {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  30%      { transform: translateX(2px) rotate(6deg); }
  60%      { transform: translateX(-2px) rotate(-6deg); }
}
@keyframes icon-sway {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50%      { transform: rotate(-15deg) scale(1.06); }
}
@keyframes icon-beat {
  0%, 100% { transform: scaleX(1); opacity: 0.9; }
  30%      { transform: scaleX(1.1); opacity: 1; }
  50%      { transform: scaleX(0.95); opacity: 0.8; }
  70%      { transform: scaleX(1.06); opacity: 1; }
}

.cond-pillar-items {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.cond-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.cond-item-title {
  font-size: var(--type-md);
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.cond-item-detail {
  font-size: var(--type-md);
  color: var(--text-muted);
  line-height: 1.55;
}

@media (max-width: 540px) {
  .cond-pillar-items {
    grid-template-columns: 1fr;
  }
}

/* Age-based recommendation section (TTC / perimenopause / post-menopause) */
.cond-age-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.cond-age-section[hidden] { display: none; }

.cond-age-heading {
  font-size: var(--type-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  text-align: center;
  padding-top: var(--space-4);
  padding-bottom: var(--space-1);
  border-top: 1px dashed var(--border);
  margin-top: var(--space-1);
}

/* "Add more" chip button — sits with the filter pills above questions */
.cond-add-more {
  font-size: var(--type-sm);
  font-weight: 700;
  letter-spacing: 0.03em;
  background: transparent;
  border: 1px dashed var(--border-strong);
  border-radius: 20px;
  padding: var(--space-3) var(--space-4);
  min-height: 36px;
  display: flex;
  align-items: center;
  width: fit-content;
  margin: 0 auto;
  color: var(--accent);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, border-color 0.2s;
}

@media (hover: hover) {
  .cond-add-more:hover {
    background: rgba(var(--primary-rgb), 0.08);
    border-color: var(--accent);
  }
}

.cond-add-more[hidden] { display: none; }

.cond-extras-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.cond-extra-row-btn.selected {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(var(--primary-rgb), 0.08);
}

/* Extra recommendations section */
.cond-extras-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.cond-extras-section[hidden] { display: none; }

/* ========================================================= */

@media (max-width: 360px) {
  .scale-label {
    font-size: var(--type-xxs);
  }
  .scale-range {
    display: none;
  }
}

/* ============================================
   PROTEIN DETAILS CARD
   ============================================ */
.protein-details-card {
  margin-top: var(--space-7);
}

.protein-card-title {
  font-size: var(--type-2xl);
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-2);
  letter-spacing: -0.4px;
}

.protein-card-subtitle {
  font-size: var(--type-md);
  color: var(--text-muted);
  text-align: center;
  margin-bottom: var(--space-5);
  line-height: 1.5;
}

.protein-amount {
  color: inherit;
}

.protein-amount-value {
  color: var(--primary);
  font-weight: 600;
}

.protein-see-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin: var(--space-6) auto 0;
  padding: var(--space-3) var(--space-6);
  min-height: 44px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: none;
  font-family: inherit;
  font-size: var(--type-md);
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: border-color 0.2s, color 0.2s;
}

.protein-see-all svg {
  width: 14px;
  height: 14px;
  transition: transform 0.25s ease;
}

.protein-see-all.expanded {
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
}

.protein-see-all.expanded svg {
  transform: rotate(180deg);
}

@media (hover: hover) {
  .protein-see-all:hover {
    border-color: var(--accent);
    color: var(--accent);
  }
}

.protein-collapsible {
  margin-top: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.protein-collapsible[hidden] {
  display: none;
}

.protein-meal-breakdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.protein-meal-col {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-4) var(--space-2);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.protein-meal-name {
  font-size: var(--type-md);
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin: 0 0 var(--space-3);
}

.protein-meal-amount {
  font-size: var(--type-display);
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1;
}

.meal-icon {
  width: 24px;
  height: 24px;
  margin-bottom: var(--space-2);
  transition: transform 0.3s ease;
}

/* Teal-only app-wide — was a per-meal orange/purple/blue accent, out of step
   with the rest of the app's single-highlight-color convention. */
.protein-meal-col:nth-child(1) .meal-icon {
  color: var(--primary);
  filter: drop-shadow(0 0 5px currentColor);
  animation: glow-breakfast 2.5s ease-in-out infinite;
}

.protein-meal-col:nth-child(2) .meal-icon {
  color: var(--primary);
  filter: drop-shadow(0 0 5px currentColor);
  animation: glow-lunch 2.5s ease-in-out infinite;
}

.protein-meal-col:nth-child(3) .meal-icon {
  color: var(--primary);
  filter: drop-shadow(0 0 5px currentColor);
  animation: glow-dinner 2.5s ease-in-out infinite;
}

@keyframes glow-breakfast {
  0%,   100% { transform: translateY(0);  filter: drop-shadow(0 0 5px currentColor); }
  25%  { transform: translateY(-2px); filter: drop-shadow(0 0 8px currentColor); }
  50%  { transform: translateY(0);  filter: drop-shadow(0 0 12px currentColor); }
  75%  { transform: translateY(-1px); filter: drop-shadow(0 0 7px currentColor); }
}

@keyframes glow-lunch {
  0%,   100% { transform: scale(1);     filter: drop-shadow(0 0 5px currentColor); }
  25%  { transform: scale(1.05);  filter: drop-shadow(0 0 7px currentColor); }
  50%  { transform: scale(1.1);   filter: drop-shadow(0 0 12px currentColor); }
  75%  { transform: scale(1.04);  filter: drop-shadow(0 0 8px currentColor); }
}

@keyframes glow-dinner {
  0%,   100% { transform: rotate(0deg);  filter: drop-shadow(0 0 5px currentColor); }
  25%  { transform: rotate(6deg);  filter: drop-shadow(0 0 8px currentColor); }
  50%  { transform: rotate(0deg);  filter: drop-shadow(0 0 12px currentColor); }
  75%  { transform: rotate(-5deg); filter: drop-shadow(0 0 7px currentColor); }
}

.protein-breakdown-subtext {
  font-size: var(--type-body);
  font-weight: 600;
  color: var(--text);
  margin: 0 0 var(--space-4);
  text-align: center;
}

@media (max-width: 540px) {
  .food-thumb-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
  }

  .food-thumb__image {
    aspect-ratio: 16 / 9;
  }
}

/* =========================================================
   DISCLAIMER SECTION
   ========================================================= */
.disclaimer-section {
  text-align: center;
  padding: var(--space-8) var(--space-5);
  margin-top: var(--space-12);
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

/* Tracker / check-in tab: disclaimer hugs the bottom of the card (no buffer gap,
   no divider). margin-top:auto pushes it to the bottom of the viewport when the
   tab is short (e.g. the locked state); with long content there's no slack so it
   simply hugs the content as before. */
.disclaimer-section--flush {
  margin-top: auto;
  border-top: none;
}

/* On the tracker tab the texture must stay seamless with the goal zone above —
   no top fade (that would show a seam). Keep the soft bottom fade only. */
.disclaimer-section--flush::before {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 60px), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 60px), transparent 100%);
}

/* Subtle bg.png overlay behind the disclaimer. Fade it in at the top (and out at
   the bottom) with a mask so the texture emerges smoothly from the page instead
   of cutting in with a hard edge. */
.disclaimer-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("assets/bg.png") center / cover no-repeat;
  opacity: 0.16;
  pointer-events: none;
  z-index: 0;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 120px, #000 calc(100% - 60px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 120px, #000 calc(100% - 60px), transparent 100%);
}

/* keep the disclaimer content above the overlay */
.disclaimer-section > * {
  position: relative;
  z-index: 1;
}

.disclaimer-text {
  font-size: var(--type-sm);
  color: var(--text-faint);
  line-height: 1.6;
  margin: 0;
  max-width: 600px;
  margin: 0 auto;
}

/* Every inline text button / link in the disclaimer + consent copy reads the
   same: teal, semibold, no underline. */
.disclaimer-link,
.consent-modal-body a {
  background: none;
  border: none;
  padding: 0;
  color: var(--primary);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.disclaimer-link:hover,
.consent-modal-body a:hover {
  opacity: 0.8;
}

/* ---- Shared bottom-sheet chrome (About, Give feedback) ---- */
.odri-sheet[hidden] { display: none; }
.odri-sheet {
  position: fixed;
  inset: 0;
  z-index: 2100;
}
.odri-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.odri-sheet__panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 520px;
  max-height: calc(var(--vh-px, 100vh) * 0.88);
  margin: 0 auto;
  overflow-y: auto;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: var(--space-5) var(--space-7) max(var(--space-8), env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5);
  animation: odriSheetSlideUp 0.3s var(--ease-out);
}
@keyframes odriSheetSlideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.odri-sheet__handle {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: var(--border);
  margin: 0 auto var(--space-4);
}
.odri-sheet__close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 1;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  cursor: pointer;
}

/* ---- About Odrifit sheet (header logo) ---- */
.about-modal-mark {
  width: 52px;
  height: 52px;
  margin: 0 auto var(--space-4);
}
.about-modal-mark img { width: 100%; height: 100%; }
#aboutModal .share-modal-title { text-align: center; margin-bottom: var(--space-5); }
.about-modal-body {
  font-size: var(--type-md);
  line-height: 1.6;
  color: var(--text-muted);
  text-align: left;
}
.about-modal-body p { margin: 0 0 var(--space-4); }
.about-modal-body strong { color: var(--text); font-weight: 700; }
.about-modal-cta {
  display: block;
  width: 100%;
  margin-top: var(--space-5);
  padding: 14px 20px;
  border: 0;
  border-radius: var(--radius-full);
  background: var(--primary-fill);
  color: var(--primary-ink);
  font-family: inherit;
  font-size: var(--type-md);
  font-weight: 800;
  text-align: center;
  cursor: pointer;
}
.about-modal-cta:active { transform: translateY(1px); }
.about-modal-email {
  margin: var(--space-3) 0 0;
  font-size: var(--type-sm);
  color: var(--text-faint);
  text-align: center;
}
.about-modal-email a { color: var(--primary); text-decoration: none; }

/* ---- Give feedback sheet ---- */
#feedbackSheet .share-modal-title { text-align: center; margin-bottom: var(--space-2); }
.feedback-sheet-sub {
  margin: 0 0 var(--space-5);
  font-size: var(--type-sm);
  color: var(--text-faint);
  text-align: center;
  line-height: 1.5;
}
.feedback-sheet-textarea {
  width: 100%;
  min-height: 100px;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
  font-size: var(--type-md);
  line-height: 1.5;
  resize: vertical;
}
.feedback-sheet-textarea:focus {
  outline: none;
  border-color: var(--primary);
}
.feedback-sheet-attach-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  background: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: var(--type-sm);
  font-weight: 600;
  cursor: pointer;
}
.feedback-sheet-preview[hidden] { display: none; }
.feedback-sheet-preview {
  position: relative;
  margin-top: var(--space-3);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}
.feedback-sheet-preview img {
  display: block;
  width: 100%;
  max-height: 160px;
  object-fit: cover;
}
.feedback-sheet-preview-remove {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
}
.feedback-sheet-send {
  width: 100%;
  margin-top: var(--space-5);
  padding: 14px 20px;
  border: 0;
  border-radius: var(--radius-full);
  background: var(--primary-fill);
  color: var(--primary-ink);
  font-family: inherit;
  font-size: var(--type-md);
  font-weight: 800;
  cursor: pointer;
  min-height: 48px;
}
.feedback-sheet-send:disabled {
  opacity: 0.5;
  cursor: default;
}
.feedback-sheet-send:not(:disabled):active { transform: translateY(1px); }

/* =========================================================
   CONSENT — full-screen page (Onboarding), not a modal.
   A native <dialog> + ::backdrop{backdrop-filter} here failed to paint on iOS
   Safari (backdrop blurred, the box never rendered — the mobile blocking-screen
   bug). Rebuilt as a plain fixed full-screen section: solid background, no
   blur, no dialog semantics — same pattern already proven bug-free by
   .log-chat / .onboard-chat / .onboarding-done.
   ========================================================= */
.consent-full {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.consent-full[hidden] { display: none; }

.consent-full__title {
  font-size: var(--type-xl);
  font-weight: 800;
  letter-spacing: -0.3px;
  text-align: left;
  padding: var(--space-8) var(--space-7) var(--space-1);
  margin: 0;
}
/* #disclaimerPage carries the fixed .app-back chevron (top-left, ~60px tall
   incl. its offset) — push the title clear of it so they don't overlap. The
   consent modal has no back button and keeps the tighter top padding. */
#disclaimerPage .consent-full__title {
  padding-top: calc(44px + 2 * var(--space-4));
}

.consent-full__sub {
  font-size: var(--type-md);
  color: var(--text-muted);
  text-align: left;
  padding: 0 var(--space-7) var(--space-5);
  margin: 0;
  border-bottom: 1px solid var(--border); /* the divider; no gap before the scroll body */
}

.consent-modal-body {
  flex: 1;
  overflow-y: auto;
  /* No vertical padding: the scroll viewport edges line up exactly with the
     separators (sub's border-bottom above, this border-bottom below) so text is
     hard-cut by the lines as it scrolls — full text right up to the line, then
     sliced. Resting breathing room comes from the first/last child margins
     below, which scroll away under the lines. (No mask fade: a fade leaves a
     transparent band that reads as a gap below the line.) */
  padding: 0 var(--space-7);
  font-size: var(--type-md);
  color: var(--text);
  line-height: 1.6;
  text-align: left;
  border-bottom: 1px solid var(--border);
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

.consent-modal-body > :first-child { margin-top: var(--space-4); }

.consent-modal-body:hover {
  scrollbar-color: var(--border) transparent;
}

.consent-modal-body::-webkit-scrollbar {
  width: 6px;
}

.consent-modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.consent-modal-body::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 3px;
}

.consent-modal-body:hover::-webkit-scrollbar-thumb {
  background: var(--border);
}

.consent-modal-body p {
  margin: 0 0 var(--space-3);
}

.consent-modal-body p:last-child {
  margin-bottom: var(--space-4); /* symmetric resting gap; scrolls under the line */
}

.consent-modal-body strong {
  font-weight: 600;
}

.consent-ack {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  padding: var(--space-2) 0;
  margin: 0 0 var(--space-2);
  cursor: pointer;
  user-select: none;
}

.consent-ack__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.consent-ack__box {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  /* --border-control (not the near-invisible --border) — this is a real
     tappable control, not a decorative divider; it should read as one. */
  border: 2px solid var(--border-control);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.consent-ack__input:checked + .consent-ack__box {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--btn-text);
}

.consent-ack__input:focus-visible + .consent-ack__box {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.consent-ack__label {
  font-size: var(--type-md);
  font-weight: 600;
  color: var(--text);
}

.consent-cta-btn {
  width: calc(100% - 56px);
  min-height: 50px;
  flex-shrink: 0;
  margin: var(--space-5) var(--space-7) var(--space-6);
  border-radius: 999px;
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-family: inherit;
  font-size: var(--type-base);
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, opacity 0.2s, transform 0.15s var(--ease-out);
}

/* aria-disabled, not the native disabled attribute — a genuinely disabled
   button fires no click at all, which is exactly why tapping it before
   ticking the checkbox used to do nothing. This keeps the same dimmed look
   while still letting the click handler run and show a toast. */
.consent-cta-btn[aria-disabled="true"] {
  opacity: 0.3;
}

@media (hover: hover) {
  .consent-cta-btn:not([aria-disabled="true"]):hover {
    background: var(--accent);
    color: var(--btn-text);
    transform: translateY(-1px);
  }
}

/* =========================================================
   PWA INSTALL — "Download the app" banner + instructions page.
   ========================================================= */
.pwa-banner {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-4) var(--space-5) 0;
  padding: var(--space-3);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.pwa-banner[hidden] { display: none; }
.pwa-banner__body {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.pwa-banner__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(var(--primary-rgb), 0.12);
  color: var(--primary);
}
.pwa-banner__icon img { width: 20px; height: 20px; }
.pwa-banner__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pwa-banner__text strong { font-size: var(--type-md); font-weight: 700; }
.pwa-banner__text small { font-size: var(--type-sm); color: var(--text-muted); }
.pwa-banner__chev { flex-shrink: 0; color: var(--text-faint); display: flex; }
.pwa-banner__close {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
}

/* Full-screen instructions page — same proven pattern as .consent-full /
   .log-chat: solid background, no <dialog>, no backdrop-filter. */
.install-full {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: var(--onboard-bg);
  color: var(--text);
}
.install-full[hidden] { display: none; }
.install-full__close {
  position: absolute;
  top: calc(env(safe-area-inset-top) + var(--space-5));
  right: var(--space-5);
  z-index: 2;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  cursor: pointer;
}
.install-full__inner {
  width: 100%;
  max-width: 400px;
  max-height: 100%;
  overflow-y: auto;
  padding: 6px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.install-full__mark {
  width: 68px; height: 68px;
  margin-bottom: var(--space-5);
}
.install-full__mark img { width: 100%; height: 100%; }
.install-full__title {
  margin: 0 0 var(--space-2);
  font-size: var(--type-xl);
  font-weight: 800;
  letter-spacing: -0.01em;
}
.install-full__sub {
  margin: 0 0 var(--space-7);
  font-size: var(--type-md);
  color: var(--text-muted);
  line-height: 1.5;
}
.install-full__body { width: 100%; }
.install-full__cta {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: var(--radius-full);
  background: var(--primary-fill);
  color: var(--primary-ink);
  font-family: inherit;
  font-size: var(--type-base);
  font-weight: 800;
  cursor: pointer;
}
.install-full__cta:disabled { opacity: 0.5; cursor: not-allowed; }
.install-full__hint {
  margin: var(--space-4) 0 0;
  font-size: var(--type-sm);
  color: var(--text-faint);
  line-height: 1.5;
}
.install-full__steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  text-align: left;
}
.install-full__steps li {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--type-md);
  line-height: 1.4;
}
.install-full__step-num {
  flex-shrink: 0;
  width: 36px; height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(var(--primary-rgb), 0.12);
  color: var(--primary);
  font-weight: 800;
  font-size: var(--type-sm);
}
/* Small icon embedded inline next to the word it illustrates (e.g. "Share"),
   not a separate badge — every step keeps its numbered badge instead. */
.install-full__inline-icon {
  width: 18px; height: 18px;
  vertical-align: -4px;
  margin: 0 1px;
}
.install-full__fallback {
  margin: 0;
  font-size: var(--type-md);
  color: var(--text-muted);
  line-height: 1.6;
}

/* ---- Mandatory sign-in gate (full screen, shown before anything else) ---- */
.signin-gate-full {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: var(--bg);
  color: var(--text);
}
.signin-gate-full[hidden] { display: none; }
.signin-gate-full__inner {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.signin-gate-full__mark {
  width: 68px;
  height: 68px;
  margin-bottom: var(--space-5);
}
.signin-gate-full__mark img { width: 100%; height: 100%; }
.signin-gate-full__title {
  margin: 0 0 var(--space-2);
  font-size: var(--type-xl);
  font-weight: 800;
  letter-spacing: -0.01em;
}
.signin-gate-full__sub {
  margin: 0 0 var(--space-7);
  font-size: var(--type-md);
  color: var(--text-muted);
  line-height: 1.5;
}
.signin-gate-full__signin {
  min-height: 52px;
  padding: 0 var(--space-8);
  border: 0;
  border-radius: var(--radius-full);
  background: var(--primary-fill);
  color: var(--primary-ink);
  font-family: inherit;
  /* Was --type-base (20px)/800 — oversized next to every other button in the
     app; large buttons elsewhere run 15-17px bold (e.g. .tracker-ai-fab-title,
     the Button component spec). */
  font-size: var(--type-title-2);
  font-weight: 700;
  cursor: pointer;
}
.signin-gate-full__signin:active { transform: translateY(1px); }

/* ============================================
   EDIT HEALTH DATA BOTTOM SHEET MODAL
   ============================================ */
.bottom-sheet {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.bottom-sheet.active {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 1;
  pointer-events: all;
}

.bottom-sheet-content {
  position: relative;
  z-index: 1001;
  width: 100%;
  max-width: 480px;
  max-height: calc(var(--vh-px, 100vh) * 0.7);
  background: var(--card-bg);
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bottom-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-5) var(--space-4);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.bottom-sheet-title {
  font-size: var(--type-base);
  font-weight: var(--weight-bold);
  color: var(--text);
  margin: 0;
}

.bottom-sheet-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: var(--type-xl);
  cursor: pointer;
  padding: 0 var(--space-1);
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.bottom-sheet-body {
  overflow-y: auto;
  padding: var(--space-4) var(--space-5) var(--space-6);
  flex: 1;
}

.rec-item {
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border);
}
.rec-item:last-child { border-bottom: none; }

.rec-item-title {
  font-size: var(--type-md);
  font-weight: var(--weight-bold);
  color: var(--text);
  margin: 0 0 var(--space-1);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.rec-item-value {
  font-size: var(--type-md);
  color: var(--primary);
  margin: 0;
}

.rec-empty {
  font-size: var(--type-md);
  color: var(--text-faint);
  margin: 0;
  line-height: 1.5;
}

.bottom-sheet-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  pointer-events: auto;
}

.edit-health-modal-box {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border-radius: 24px 24px 0 0;
  max-height: calc(var(--vh-px, 100vh) * 0.9);
  width: 100%;
  padding: 0;
  padding-bottom: var(--space-3);
  display: flex;
  flex-direction: column;
  z-index: 1001;
  border: none;
  animation: slideUp 0.3s ease forwards;
  overflow: hidden;
  pointer-events: auto;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes confetti-rise {
  0% {
    transform: translateY(0) rotateZ(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(-100px) rotateZ(180deg);
    opacity: 0;
  }
}

/* Recommendations bottom sheet */
.rec-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.05);
}

.rec-item:last-child {
  border-bottom: none;
}

.rec-item-title {
  font-size: var(--type-md);
  font-weight: 600;
  color: var(--text);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rec-item-value {
  font-size: var(--type-body);
  color: var(--accent);
  margin: 0;
  font-weight: 500;
}

.rec-empty {
  padding: var(--space-5) var(--space-4);
  text-align: center;
  font-size: var(--type-body);
  color: var(--text-muted);
  margin: 0;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(-100px) rotateZ(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotateZ(360deg);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  @keyframes confetti-rise {
    0%, 100% {
      opacity: 0;
    }
  }
  @keyframes confetti-fall {
    0%, 100% {
      opacity: 0;
    }
  }
}

.edit-health-modal-box .share-modal-title,
.edit-health-modal-box .share-modal-sub {
  text-align: left;
}

.edit-health-modal-box .share-modal-title {
  color: var(--text);
  padding: var(--space-4) var(--space-3) var(--space-1);
  font-size: var(--type-xl);
}

.edit-health-modal-box .share-modal-sub {
  padding: 0 var(--space-3) var(--space-3);
  border-bottom: 1px solid var(--border);
  font-size: var(--type-sm);
}

.edit-health-modal-box .share-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
}

.edit-health-form {
  /* basis:auto so the dialog's fit-content height includes the form (WebKit
     does NOT count a flex:1 / basis:0 child in intrinsic height — the sheet
     then collapsed to just title+sub+CTA and the form couldn't scroll).
     shrink:1 + min-height:0 lets it absorb all the overflow and scroll once
     the dialog hits max-height. */
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: var(--space-3) var(--space-3) var(--space-3);
  padding-right: calc(var(--space-3) - var(--space-2));
  margin-bottom: 0;
}

.edit-health-form::-webkit-scrollbar {
  width: 6px;
}

.edit-health-form::-webkit-scrollbar-track {
  background: transparent;
}

.edit-health-form::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 3px;
}

.edit-health-form:hover::-webkit-scrollbar-thumb {
  background: var(--border);
}

/* Edit health form field styling */
.edit-health-form .field {
  text-align: left;
  margin-bottom: var(--space-3);
}

.edit-health-form .field:last-of-type {
  margin-bottom: 0;
}

.edit-health-form .field-label {
  display: block;
  font-size: var(--type-sm);
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
  letter-spacing: 0.005em;
  text-align: left;
}

.edit-health-form .input-row {
  display: flex;
  justify-content: flex-start;
  gap: var(--space-1);
  flex-wrap: nowrap;
  align-items: center;
  padding: 0 -12px;
}

.edit-health-form .input-row.gender-row {
  flex-wrap: nowrap;
  margin: 0;
  width: auto;
  justify-content: flex-start;
}

.edit-health-form .input-pill {
  background: var(--input-bg);
  border-radius: 999px;
  padding: var(--space-1) var(--space-1) var(--space-1) var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  flex: 1 1 auto;
  transition: background 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
  min-height: 32px;
}

.edit-health-form .field:nth-child(1) .input-pill {
  flex: 0 0 auto;
  min-width: 96px;
}

.edit-health-form .field:nth-child(3) .input-pill {
  flex: 0 0 auto;
  width: 150px;
  min-width: 150px;
}

/* Height: identical typing area in both Feet and Inches pills */
.edit-health-form .field:nth-child(3) .input-pill input {
  width: 48px;
  max-width: none;
  flex: 0 0 48px;
}

.edit-health-form .field:nth-child(4) .input-pill {
  flex: 0 0 auto;
  min-width: 96px;
}

.edit-health-form .field:nth-child(5) .input-pill {
  flex: 0 0 auto;
  min-width: 96px;
}

.edit-health-form .field:nth-child(6) .input-pill {
  flex: 0 0 auto;
  min-width: 96px;
}

.edit-health-form .input-pill:focus-within {
  background: var(--input-bg-focus);
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.25);
}

.edit-health-form .input-pill--readonly {
  opacity: 0.6;
  cursor: not-allowed;
}

.edit-health-form .input-pill input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: var(--type-md);
  font-weight: 500;
  width: 100%;
  max-width: 40px;
  -moz-appearance: textfield;
}

.edit-health-form .input-pill input::-webkit-outer-spin-button,
.edit-health-form .input-pill input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.edit-health-form .unit {
  font-size: var(--type-xs);
  color: var(--text-faint);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.edit-health-form .toggle-btn {
  padding: var(--space-2) var(--space-5);
  min-height: 40px;
  background: transparent;
  border: 1px solid var(--border-control);
  border-radius: 999px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: var(--type-md);
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  text-align: center;
  white-space: nowrap;
  flex: 0 0 auto;
  min-width: 0;
}

@media (hover: hover) {
  .edit-health-form .toggle-btn:hover:not(.active) {
    border-color: #555555;
  }

  .edit-health-form .toggle-btn.active:hover {
    border-color: var(--accent);
    color: var(--accent);
  }
}

.edit-health-form .toggle-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(var(--primary-rgb), 0.08);
}

.edit-health-cta {
  width: calc(100% - 24px);
  min-height: 44px;
  margin: var(--space-3) var(--space-3) 0;
  padding: var(--space-3) var(--space-4);
  background: var(--primary-fill);
  border: none;
  border-radius: 12px;
  color: var(--btn-text);
  font-family: inherit;
  font-size: var(--type-md);
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s ease-out;
  flex-shrink: 0;
}

@media (hover: hover) {
  .edit-health-cta:hover {
    opacity: 0.9;
  }
}

.edit-health-cta:active {
  transform: scale(0.98);
}

.form-toggle-btn.active {
  background: var(--primary-fill);
  border-color: var(--primary);
  color: var(--btn-text);
}

/* ── Food Log Camera Button (protein ring) ─────────────────────────────────── */
.food-log-camera-btn {
  background: none;
  border: none;
  padding: var(--space-1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: var(--primary);
  border-radius: 50%;
  transition: background 0.2s;
}
.food-log-camera-btn:hover { background: rgba(var(--primary-rgb), 0.1); }

/* ── Food Log Sheet ─────────────────────────────────────────────────────────── */
.food-log-sheet {
  display: flex;
  flex-direction: column;
  max-height: calc(var(--vh-px, 100vh) * 0.88);
  overflow: hidden;
  padding: 0;
}
.food-log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5) var(--space-3);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.food-log-title {
  font-size: var(--type-base);
  font-weight: var(--weight-bold);
  color: var(--text);
  margin: 0;
}
.food-log-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: var(--type-base);
  cursor: pointer;
  padding: var(--space-1) var(--space-2);
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.food-log-camera-viewport {
  position: relative;
  width: 100%;
  height: 200px;
  background: #000;
  overflow: hidden;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.food-log-video,
.food-log-snapshot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.food-log-canvas { display: none; }
.food-log-camera-overlay {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.food-log-capture-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: background 0.15s, transform 0.1s;
}
.food-log-capture-btn:active { transform: scale(0.92); }
.food-log-capture-ring {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  display: block;
}
.food-log-camera-hint {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: var(--type-xs);
  color: rgba(255,255,255,0.75);
  background: rgba(0,0,0,0.4);
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
  white-space: nowrap;
  backdrop-filter: blur(4px);
}
/* Shown in place of the video feed when the user cancels/denies the camera
   permission prompt — an actual empty state with a way back in, instead of
   a dead viewport and a hint line explaining why nothing's happening. */
.food-log-camera-denied {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4);
  text-align: center;
  background: #000;
}
.food-log-camera-denied-icon { width: 28px; height: 28px; color: var(--text-faint); }
.food-log-camera-denied-text { margin: 0; font-size: var(--type-sm); color: var(--text-muted); }
.food-log-camera-denied-btn {
  margin-top: var(--space-1);
  padding: var(--space-2) var(--space-5);
  border: 0;
  border-radius: var(--radius-full);
  background: var(--primary-fill);
  color: var(--primary-ink);
  font-family: inherit;
  font-size: var(--type-sm);
  font-weight: 700;
  cursor: pointer;
}
/* Sits beside the shutter button rather than centered with it, so tapping
   either one is unambiguous. */
.food-log-gallery-btn {
  position: absolute;
  bottom: 18px;
  right: 16px;
  z-index: 1;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.6);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.food-log-gallery-btn svg { width: 18px; height: 18px; }
.food-log-section-label {
  font-size: var(--type-xxs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 var(--space-3);
}
.food-log-suggestions {
  padding: var(--space-4) var(--space-5) var(--space-3);
  flex-shrink: 0;
}
.food-log-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.food-log-chip {
  padding: var(--space-2) var(--space-4);
  border-radius: 999px;
  border: 1.5px solid rgba(var(--primary-rgb), 0.3);
  background: transparent;
  color: var(--text-muted);
  font-size: var(--type-md);
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.food-log-chip--active,
.food-log-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.08);
}
.food-log-search-row {
  padding: var(--space-2) var(--space-5) var(--space-3);
  flex-shrink: 0;
}

@keyframes foodQAnswerIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.food-log-search-wrap { position: relative; }
.food-log-search {
  width: 100%;
  padding: var(--space-3) calc(var(--space-4) + 104px) var(--space-3) var(--space-4);
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-size: var(--type-base);
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
}
.food-log-search:focus { border-color: var(--primary); }
.food-log-search::-webkit-search-cancel-button,
.food-log-search::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

/* Themed clear button (replaces the browser's off-theme search "x") */
.food-log-clear {
  position: absolute;
  right: 84px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
}
.food-log-clear[hidden] { display: none; }
@media (hover: hover) {
  .food-log-clear:hover { color: var(--text); background: rgba(255,255,255,0.06); }
}

/* Voice input — disabled for now (speech-to-text coming soon). */
.food-log-mic {
  position: absolute;
  right: 52px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-faint);
  cursor: not-allowed;
}
.food-log-mic svg { width: 18px; height: 18px; }

/* "Add" — submit the typed item, rightmost in the field */
.food-log-add {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  border-radius: var(--radius-full);
  background: var(--primary-fill);
  color: var(--primary-ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  padding: 7px 15px;
  min-height: 32px;
  cursor: pointer;
}
.food-log-add:disabled { opacity: 0.4; cursor: default; }
.food-log-add:not(:disabled):active { transform: translateY(calc(-50% + 1px)); }
.food-log-mic:disabled { display: none; }
/* Enabled (experimental) state */
.food-log-mic:not(:disabled) {
  color: var(--text-muted);
  cursor: pointer;
}
@media (hover: hover) {
  .food-log-mic:not(:disabled):hover { color: var(--primary); background: rgba(var(--primary-rgb), 0.1); }
}
.food-log-mic--listening {
  color: #e74c3c !important;
  animation: foodMicPulse 1.1s ease-in-out infinite;
}
@keyframes foodMicPulse {
  0%, 100% { transform: translateY(-50%) scale(1); }
  50% { transform: translateY(-50%) scale(1.18); }
}
.food-log-results {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding: 0 var(--space-5) var(--space-1);
}
.food-log-result-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  text-align: left;
  cursor: pointer;
}
.food-log-result-name {
  color: var(--text);
  font-size: var(--type-body);
  font-weight: var(--weight-semibold);
}
.food-log-result-local {
  color: var(--text-faint);
  font-size: var(--type-sm);
}
.food-log-result-row--custom .food-log-result-name { color: var(--primary); }
.food-log-result-row--custom .food-log-result-local { font-style: italic; }
.food-log-no-result {
  color: var(--text-faint);
  font-size: var(--type-md);
  padding: var(--space-3) 0;
  margin: 0;
}
.food-log-contribute-link {
  background: none;
  border: none;
  color: var(--primary);
  font-size: var(--type-md);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  font-family: inherit;
}
.food-log-portion-picker {
  border-top: 1px solid var(--border);
  padding: var(--space-4) var(--space-5);
  flex-shrink: 0;
  background: var(--bg-card);
}
.food-log-portions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: var(--space-3) 0 var(--space-4);
}
.food-log-portion-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-family: inherit;
}
.food-log-portion-btn--active {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), 0.07);
}
.food-log-portion-label {
  flex: 1;
  color: var(--text);
  font-size: var(--type-body);
  font-weight: var(--weight-semibold);
}
.food-log-portion-protein {
  color: var(--primary);
  font-size: var(--type-md);
  font-weight: var(--weight-bold);
}
.food-log-portion-cal {
  color: var(--text-faint);
  font-size: var(--type-sm);
}
.food-log-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: var(--space-3);
  border-radius: var(--radius-full);
  background: var(--primary-fill);
  color: var(--btn-text);
  /* Was --type-base(20px)/800 — same oversized-pill-CTA bug fixed elsewhere
     this session (large buttons run 15-17px bold, not 20px). */
  font-size: var(--type-title-2);
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
}
.food-log-cta:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ── Tracker Page (new daily mirror layout) ─────────────────────────────────── */
.tracker-page {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  /* Match the home page: centered single column, capped on desktop.
     Below 660px this is a no-op, so the mobile layout is unchanged. */
  max-width: 660px;
  margin: 0 auto;
}

/* LOWER: rounded tracking panel — an elevated surface that fills the rest */
/* Layout wrapper only — no surface. The metrics tiles, recs card, and section
   headers sit as separate blocks directly on the page background. */
.tracker-baseline {
  padding-bottom: var(--space-6);
}

.tracker-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-4) var(--space-6);
}

/* Separate section below the metrics (header + health card + recommendations) */
.tracker-section {
  padding: var(--section-gap) var(--space-4) 0;
}

.tracker-section-title {
  font-size: var(--type-lg);
  font-weight: 700;
  letter-spacing: -0.2px;
  text-transform: none;
  color: var(--text);
  text-align: left;
  margin: 0 0 var(--section-header-gap);
}

/* Section titles are left-aligned now — no flanking sparkles, no centring. */
.tracker-panel-title.section-title--shine,
.tracker-section-title.section-title--shine {
  justify-content: flex-start;
  gap: var(--space-3);
}
.tracker-panel-title.section-title--shine { margin: 0; }
.tracker-section-title.section-title--shine { margin: 0 0 var(--section-header-gap); }

/* Section head row with a trailing text link (e.g. Family centre → Manage) */
.tracker-section-headrow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}
.tracker-section-headrow .tracker-section-title { flex: 1 1 auto; }
.tracker-section-headrow__link {
  flex: none;
  background: none;
  border: 0;
  padding: 4px 2px;
  font: inherit;
  font-size: var(--type-sm);
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
}
.tracker-section-headrow__link[hidden] { display: none; }

/* ---- Family centre: home avatar strip ---- */
.family-centre-strip {
  display: flex;
  /* Avatars pack from the left with a fixed gap — the "Add" button always sits
     immediately to the right of the last member, never flung to the far edge.
     Scrolls if the 4-member cap + Add ever overflow. */
  justify-content: flex-start;
  gap: var(--space-4);
  overflow-x: auto;
  scrollbar-width: none;
  padding: var(--space-1) var(--space-3) var(--space-2);
}
.family-centre-strip::-webkit-scrollbar { display: none; }
.family-centre-strip[hidden] { display: none; }
.family-centre-av {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: 66px;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.family-centre-av__circle {
  width: 60px; height: 60px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--icon-tile-bg);
  color: var(--primary);
  font-size: 22px;
  font-weight: 700;
  border: 1px solid var(--border);
}
.family-centre-av__circle--new { box-shadow: 0 0 0 2px var(--primary); }
.family-centre-av__circle--add {
  color: var(--text-muted);
  font-size: 30px;
  font-weight: 400;
  border-style: dashed;
}
.family-centre-av__name {
  font-size: var(--type-xs);
  color: var(--text-muted);
  max-width: 66px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- Family centre: Manage page (member tabs + data + calendar) ---- */
.fam-manage { padding: var(--space-4) var(--space-4) var(--space-10); }
.fam-manage__tabs {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: var(--space-5);
}
.fam-manage__tabs::-webkit-scrollbar { display: none; }
/* Matches .recs-pillar-tab's exact shape/treatment (Health recommendations
   page) — rounded-rect, near-transparent at rest, subtle teal tint when
   active, not a solid-filled pill. */
.fam-manage__tab {
  flex: none;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-faint);
  font: inherit;
  font-size: var(--type-xs);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.fam-manage__tab.is-active {
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
  border-color: rgba(var(--primary-rgb), 0.3);
}
.fam-manage__headrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}
.fam-manage__role {
  font-size: var(--type-xs);
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.fam-manage__edit {
  background: none; border: 0; padding: 0;
  font: inherit; font-size: var(--type-sm); font-weight: 600;
  color: var(--primary); cursor: pointer;
}
.fam-manage__data {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  padding: 4px 14px;
  margin-bottom: var(--space-6);
}
.fam-manage__data-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  font-size: var(--type-md);
}
.fam-manage__data-row + .fam-manage__data-row { border-top: 1px solid var(--border); }
.fam-manage__data-row span:first-child { color: var(--text-muted); }
.fam-manage__data-row span:last-child { color: var(--text); font-weight: 600; }

/* "All health concerns" review page (openAllConcernsPage) — reuses
   .fam-manage__data/__data-row for the list (same label/value card shape)
   and .onboarding-done__cta/__change for the two CTAs, just stretched full
   width here instead of their usual shrink-to-content, left-aligned look. */
.allconcerns-page { padding: var(--space-5); display: flex; flex-direction: column; }
.allconcerns-page .onboarding-done__cta { width: 100%; text-align: center; }
.allconcerns-page .onboarding-done__cta--secondary { margin-bottom: var(--space-3); }
.fam-manage__cal-title {
  font-size: var(--type-lg);
  font-weight: 700;
  color: var(--text);
  margin: 0 0 var(--space-2);
}
.fam-manage__cal-legend {
  font-size: var(--type-xs);
  color: var(--text-faint);
  margin: 0 0 var(--space-3);
  display: flex;
  align-items: center;
  gap: 6px;
}
.fam-cal-swatch {
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 4px;
  vertical-align: middle;
}
.fam-cal-swatch--hit { background: var(--primary-fill); }
.fam-cal-swatch--partial { background: rgba(var(--primary-rgb), 0.14); box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), 0.4); }
.fam-manage__cal { position: relative; }
.fam-cal-tip { transform: translate(-50%, calc(-100% - 8px)); }
.tracker-section-title .sparkle { display: none; }

/* ── Family Circle — medication reminders ────────────────────────────────── */
.fam-meds-list {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  margin-bottom: var(--space-3);
  overflow: hidden;
}
.fam-meds-empty {
  margin: 0;
  padding: var(--space-4);
  font-size: var(--type-sm);
  color: var(--text-faint);
  text-align: center;
}
/* Whole row is one tappable button now — opens openFamilyMedDetailSheet
   (name/time/meal-timing + Log for today + Remove), replacing the old
   inline Log/X buttons. "Add" moved to the section header (.fam-manage__edit,
   reused — see renderFamilyManage). */
.fam-med-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.fam-med-row + .fam-med-row { border-top: 1px solid var(--border); }
.fam-med-row__icon {
  flex: none;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: var(--radius-md, 10px);
  background: var(--icon-tile-bg, rgba(255, 255, 255, 0.06));
  color: var(--primary);
}
.fam-med-row__icon svg { width: 18px; height: 18px; }
.fam-med-row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fam-med-row__name { font-size: var(--type-md); font-weight: 600; color: var(--text); }
.fam-med-row__meta { font-size: var(--type-xs); color: var(--text-faint); }
.fam-med-row__chev { flex: none; width: 18px; height: 18px; color: var(--text-faint); stroke: currentColor; }
.fam-med-row--done .fam-med-row__name { color: var(--text-muted); }

/* Medicine detail sheet (openFamilyMedDetailSheet). */
.fam-med-detail__time { text-align: center; color: var(--text-muted); font-size: var(--type-base); margin: 0 0 var(--space-5); }

/* Add-medication sheet form (former openAddMedicationSheet) — retired for
   the chat flow; the sheet's own styles below stay orphaned harmlessly. */
.add-med-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-2) 0 var(--space-5);
}
.add-med-field { display: flex; flex-direction: column; gap: 6px; }
.add-med-field span:first-child { font-size: var(--type-sm); color: var(--text-muted); font-weight: 600; }
.add-med-field input {
  height: 46px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-md, 10px);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  font-size: var(--type-md);
}
.add-med-field input:focus { outline: none; border-color: var(--primary); }
.add-med-field__label { font-size: var(--type-sm); color: var(--text-muted); font-weight: 600; margin-bottom: -6px; }
.add-med-mealtiming { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.add-med-mt-opt {
  flex: 1;
  min-width: 96px;
  padding: 10px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-control);
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: var(--type-sm);
  font-weight: 600;
  cursor: pointer;
}
.add-med-mt-opt.is-selected {
  border-color: transparent;
  background: var(--primary-fill);
  color: var(--primary-ink);
}

/* "Have they had their meal?" prerequisite confirm (openMedMealPrereqConfirm). */
.med-confirm-q {
  margin: 0 0 var(--space-4);
  font-size: var(--type-md);
  color: var(--text-muted);
}
.med-confirm-opts { display: flex; gap: var(--space-3); padding-bottom: var(--space-5); }
.med-confirm-opt {
  flex: 1;
  height: 48px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--primary-fill);
  color: var(--primary-ink);
  font: inherit;
  font-weight: 700;
  font-size: var(--type-md);
  cursor: pointer;
}
.med-confirm-opt--secondary {
  background: none;
  border: 1.5px solid var(--border-control);
  color: var(--text);
}

/* ── Condition-based recommendations (tabbed) ─────────────────────────────── */
/* No surface — tabs + food cards sit directly on the page bg (no card-in-card) */
.recs-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Recommendation-type tabs = icon tab bar (content-width, centered, wraps) */
.recs-pillar-tabs {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: var(--space-2);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 0 calc(-1 * var(--space-4));
  padding: 0 var(--space-4) var(--space-1);
}
.recs-pillar-tabs::-webkit-scrollbar { display: none; }

/* Health recommendations full page (openRecsFullPage) — reuses the shared
   collapsing hero (see the comment above .period-page). The pillar tabs pin
   directly under the slim bar as a second sticky zone once it's collapsed,
   same idea as the period calendar's weekday row under .pcal-stickyhead. */
.recs-page {
  --collapsing-hero-slim-h: calc(env(safe-area-inset-top) + 68px);
}
.recs-page .recs-pillar-tabs {
  position: sticky;
  top: var(--collapsing-hero-slim-h);
  z-index: 2;
  background: var(--bg);
  padding-top: var(--space-2);
}

/* Avoid items on the icon tabs (Movement/Rest/Monitor): red icon + tint */
.recs-food-card--avoid .recs-food-thumb--icon svg {
  color: var(--error);
}
.recs-food-card--avoid .recs-food-thumb--icon {
  background: rgba(214, 86, 86, 0.12);
}

.recs-pillar-tab {
  display: inline-flex;
  flex-direction: row;
  flex-shrink: 0;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-faint);
  font-family: inherit;
  font-size: var(--type-xs);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.recs-pillar-tab svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.recs-pillar-tab span {
  white-space: nowrap;
}

@media (hover: hover) {
  .recs-pillar-tab:hover { color: var(--text-muted); }
}

.recs-pillar-tab--active {
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
  border-color: rgba(var(--primary-rgb), 0.3);
}

.recs-list {
  display: flex;
  flex-direction: column;
}

/* Nutrition pillar — food image cards (2-col grid) */
.recs-food-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  grid-auto-rows: 1fr; /* all rows equal height → all cards the same height */
  align-items: stretch; /* cards fill their row; banner stays locked at 16:9 */
}

/* Full-screen "See all" page: one card per row instead of the home panel's
   2-up grid. The icon-card variant (movement/rest/monitor — not nutrition's
   photo banner) switches from stacked (icon-top, text-below) to a horizontal
   row so the icon sits next to its text. align-items:flex-start (not
   center) lines the icon's top edge up with the title's top edge — with a
   2-3 line title+detail+tag block, centering against the whole block reads
   as the icon floating disconnected below the title instead of "aligned". */
.recs-food-grid--single {
  grid-template-columns: 1fr;
}
.recs-food-grid--single .recs-food-card:not(.recs-food-card--photo) {
  flex-direction: row;
  align-items: flex-start;
}

/* Text-forward card: small visual top-left, then title, then subtitle */
.recs-food-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  text-align: left;
  padding: var(--space-4);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.recs-food-thumb {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Nutrition variant: full-width 16:9 photo banner at the top, text padded below */
.recs-food-card--photo {
  padding: 0;
  gap: 0;
  overflow: hidden;
}

.recs-food-banner {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  flex-shrink: 0; /* never stretch/shrink — hold the 16:9 ratio */
  background: var(--card-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* "Avoid" recommendations get a light red tint over the photo */
.recs-food-banner--avoid::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(214, 86, 86, 0.32);
  pointer-events: none;
}

/* "Avoid" badge inside the image (above the tint) */
.recs-avoid-badge {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 1;
  font-size: var(--type-xxs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--error-strong);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}

.recs-food-banner .recs-food-photo--fallback {
  position: static;
  width: 44px;
  height: 44px;
  opacity: 0.5;
}

/* Nicer placeholder banner when a photo is missing (gradient instead of flat) */
.recs-food-banner:has(.recs-food-photo--fallback) {
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.12), var(--card-bg-alt));
}

/* Photo fills the 16:9 box absolutely so it can never push the banner taller */
.recs-food-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.recs-food-photo--fallback {
  width: 22px;
  height: 22px;
  object-fit: contain;
  opacity: 0.4;
}

/* Wraps every card's text (title/detail/tags) — the icon-card variant's own
   .recs-food-card already carries padding, so only the photo variant (whose
   card has padding:0, the banner above being full-bleed) adds its own here. */
.recs-food-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}
.recs-food-card--photo .recs-food-body {
  padding: var(--space-3) var(--space-4) var(--space-4);
  flex: 1; /* fill the card so the tags can pin to the bottom */
}

/* Condition tags — subtle, pinned to the bottom of every card (consistent position) */
.recs-food-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: auto;
  padding-top: var(--space-2);
}
.recs-food-tag {
  /* 7px (half the app's --type-xxs floor) turned out illegible — 11px is
     the founder-confirmed floor for this tag's text. Padding stays halved
     from the original --space-1/2 (that part wasn't the complaint). */
  font-size: 11px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 5px;
  border-radius: var(--radius-full);
}

/* ── Health concerns editor ───────────────────────────────────────────────── */
.hc-sheet {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 var(--space-5) var(--space-5);
}
.hc-edit {
  padding: 0 var(--space-5) var(--space-8);
}

/* Scrollable list; sticky save button stays at the bottom */
.hc-sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  /* Mobile-style: no visible scrollbar */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.hc-sheet-body::-webkit-scrollbar { display: none; }

.hc-save-all {
  flex-shrink: 0;
  width: 100%;
  margin-top: var(--space-4);
  padding: var(--space-4);
  border: none;
  border-radius: var(--radius-full);
  background: var(--primary-fill);
  color: var(--btn-text);
  font-family: inherit;
  font-size: var(--type-base);
  font-weight: var(--weight-bold);
  cursor: pointer;
  transition: opacity 0.2s, background 0.2s;
}
.hc-save-all:disabled {
  background: var(--btn-bg-disabled);
  color: var(--text-disabled);
  cursor: not-allowed;
}

.hc-sheet-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0 var(--space-4);
}

.hc-sheet-title {
  flex: 1;
  font-size: var(--type-lg);
  font-weight: var(--weight-bold);
  color: var(--text);
  text-align: left;
  margin: 0;
}

.hc-sheet-close,
.hc-edit-back {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: var(--type-2xl);
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.hc-group-label {
  font-size: var(--type-xxs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: var(--space-4) 0 var(--space-2);
}

.hc-empty {
  font-size: var(--type-sm);
  color: var(--text-faint);
  margin: var(--space-2) 0;
}

.hc-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* Collapsible concern item — the card; options reveal inline on tap */
.hc-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.15s;
}
.hc-item--open {
  border-color: rgba(var(--primary-rgb), 0.35);
}
@media (hover: hover) {
  .hc-item:hover { border-color: rgba(var(--primary-rgb), 0.3); }
}

.hc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-4);
  background: transparent;
  border: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.hc-item-options {
  display: none;
  padding: 0 var(--space-4) var(--space-3);
}
.hc-item--open .hc-item-options {
  display: block;
}
/* Inline options sit directly in the tile — no extra bottom gap */
.hc-item-options .hc-edit-options {
  margin-bottom: 0;
}
/* Once expanded, the selected chip shows the state — drop the redundant header value */
.hc-item--open .hc-row-value {
  display: none;
}

.hc-row-label {
  font-size: var(--type-body);
  font-weight: var(--weight-semibold);
  color: var(--text);
}

.hc-row-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.hc-row-value {
  font-size: var(--type-sm);
  font-weight: var(--weight-semibold);
  color: var(--primary);
}

.hc-row-chevron svg {
  width: 18px;
  height: 18px;
  color: var(--text-faint);
  display: block;
  transition: transform 0.2s;
}
.hc-item--open .hc-row-chevron svg {
  transform: rotate(90deg);
}

/* Sheet 2 — focused per-concern editor */
.hc-edit-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.hc-opt {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: var(--type-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.hc-opt--selected {
  background: rgba(var(--primary-rgb), 0.12);
  border-color: var(--primary);
  color: var(--primary);
}

.hc-edit-save {
  width: 100%;
  padding: var(--space-4);
  border-radius: var(--radius-full);
  border: none;
  background: var(--primary-fill);
  color: var(--btn-text);
  font-family: inherit;
  font-size: var(--type-base);
  font-weight: var(--weight-bold);
  cursor: pointer;
}

/* Movement / Rest / Monitor — icon thumbnail */
.recs-food-thumb--icon svg {
  width: 24px;
  height: 24px;
  color: var(--primary);
}

.recs-food-title {
  font-size: var(--type-body);
  font-weight: var(--weight-bold);
  color: var(--text);
  line-height: 1.3;
  margin: 0;
}

.recs-food-detail {
  font-size: var(--type-sm);
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.recs-empty {
  font-size: var(--type-sm);
  color: var(--text-faint);
  line-height: 1.5;
  margin: 0;
}

/* The "See all" full-screen page — .recs-panel has no padding of its own
   normally (it relies on .tracker-section's padding on the home page). */
.recs-panel--full { padding: var(--space-5); }
.recs-panel--full .recs-tile--inline { margin-bottom: var(--space-5); }

/* Empty-state nudge for "Recommended for you" (signed-out + zero state) */
.recs-nudge {
  text-align: center;
  padding: var(--space-7) var(--space-5);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.recs-nudge__icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto var(--space-3);
  background: rgba(var(--primary-rgb), 0.12);
  color: var(--primary);
}
.recs-nudge__title {
  font-size: var(--type-md);
  font-weight: 700;
  color: var(--text);
  margin: 0 0 var(--space-2);
}
.recs-nudge__text {
  font-size: var(--type-sm);
  color: var(--text-faint);
  line-height: 1.5;
  margin: 0 0 var(--space-4);
}
.recs-nudge__cta {
  background: var(--primary-fill);
  color: var(--btn-text);
  border: none;
  border-radius: 999px;
  padding: var(--space-2) var(--space-5);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  min-height: 40px;
}

.tracker-panel-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
}

.tracker-panel-title {
  font-size: var(--type-lg);
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--text);
  text-align: left;
  margin: 0;
}
/* Left-aligned title — drop the flanking sparkles and the centring. */
.tracker-panel-title.section-title--shine { justify-content: flex-start; }
.tracker-panel-title .sparkle { display: none; }
.tracker-panel-title > span { text-align: left; }

/* Home header — date / big headline / energy note / goal line, matching the
   iOS Home header (Figma t8GMAHeEqPgZjH8TdSM9zl, node 49:510). */
.home-header__date {
  margin: 0;
  font-size: var(--type-body-2);
  color: var(--text-muted);
}
.home-header__headline {
  font-size: var(--type-header-2);
  font-weight: 800;
  line-height: 1.1;
}
.home-header__goal {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: var(--space-1) 0 0;
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: var(--type-body-2);
  cursor: pointer;
}
.home-header__goal[hidden] { display: none; }
.home-header__goal-label { color: var(--text-muted); }
.home-header__goal-text { color: var(--primary); font-weight: 600; }
.home-header__goal svg { color: var(--primary); flex-shrink: 0; }

/* Vertical stack of full-width metric tile cards */
.tracker-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* ── Edge-to-edge frosted bar that the pill sits on ── */
.tracker-ai-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 800;
  display: flex;
  justify-content: center;
  padding: var(--space-7) var(--space-5) calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
  animation: trackerFabIn 0.35s var(--ease-out) both;
  /* This wrapper is full-viewport-width and taller than the FAB it centers
     (generous padding above it) — without this, its empty padding/gutter
     area silently swallows taps meant for whatever scrolls underneath its
     fixed footprint (e.g. the disclaimer section's "Learn more" link).
     Only the actual button should be clickable. */
  pointer-events: none;
}
.tracker-ai-bar > * { pointer-events: auto; }

/* Frosted backdrop layer — fades to transparent at the top so it blends
   into the content above instead of cutting a hard line. */
.tracker-ai-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(7, 13, 14, 0) 0%, rgba(7, 13, 14, 0.55) 70%);
  -webkit-backdrop-filter: blur(16px) saturate(135%);
  backdrop-filter: blur(16px) saturate(135%);
  /* Fade the whole frosted layer (blur + fill) in from the top */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 60%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 60%);
}

/* ── "Ask or talk to Odrifit" pill — sits on top of the bar ── */
.tracker-ai-fab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  max-width: calc(100vw - 2 * var(--space-5));
  padding: var(--space-2) var(--space-5) var(--space-2) var(--space-2);
  border: 1px solid rgba(var(--primary-rgb), 0.4);
  border-radius: var(--radius-full);
  background: rgba(15, 24, 25, 0.45);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
  color: var(--text);
  font-family: inherit;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}

.tracker-ai-fab-icon-wrap {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--primary-rgb), 0.14);
}
.tracker-ai-fab-icon {
  width: 18px;
  height: 18px;
  color: var(--primary);
}

.tracker-ai-fab-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
  min-width: 0;
}
.tracker-ai-fab-title {
  font-size: var(--type-sm);
  font-weight: var(--weight-bold);
  color: var(--text);
  white-space: nowrap;
}
.tracker-ai-fab-soon {
  font-size: var(--type-xxs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
  white-space: nowrap;
}

@keyframes trackerFabIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .tracker-ai-bar { animation: none; }
}

/* Give the disclaimer clearance so the fixed "Log with Odrifit" bar never
   crowds it: the bar's own top pad + button height + bottom pad + the safe
   area it reserves, plus extra breathing room on top of that. */
.disclaimer-section--flush {
  padding-bottom: calc(env(safe-area-inset-bottom) + var(--space-7) + 54px + var(--space-4) + var(--space-6));
}

/* Card = container (main log row + journey footer, divider between) */
.tracker-metric-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* ── Goal-sync: cards acknowledge a new goal, then reload recommendations ── */
.tracker-metric-card--syncing {
  border-color: rgba(var(--primary-rgb), 0.35);
}
.tracker-metric-card--syncing .tracker-card-main,
.tracker-metric-card--syncing .tracker-card-journey {
  opacity: 0.28;
  transition: opacity 0.2s ease;
}

.tracker-card-sync {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  pointer-events: none;
  overflow: hidden;
}
/* subtle shimmer sweep across the tile */
.tracker-card-sync::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 35%, rgba(var(--primary-rgb), 0.10) 50%, transparent 65%);
  transform: translateX(-100%);
  animation: trackerSyncSweep 1.2s ease-in-out infinite;
}
.tracker-card-sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  animation: trackerSyncPulse 1s ease-in-out infinite;
}
.tracker-card-sync-text {
  font-size: var(--type-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  letter-spacing: 0.01em;
}
@keyframes trackerSyncSweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@keyframes trackerSyncPulse {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50%      { opacity: 1;   transform: scale(1.1); }
}
@media (prefers-reduced-motion: reduce) {
  .tracker-card-sync::before,
.tracker-card-sync-dot { animation: none; }
}

/* Main row = the log action (text + ring) */
.tracker-card-main {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-5);
  width: 100%;
  text-align: left;
  padding: var(--space-4) var(--space-5);
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, transform 0.15s;
}

.tracker-card-main:active { transform: scale(0.98); }

@media (hover: hover) {
  .tracker-card-main:hover { background: rgba(var(--primary-rgb), 0.04); }
}

/* Journey footer = subtle entry point to the history view */
.tracker-card-journey {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-3) var(--space-5);
  background: transparent;
  border: none;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}

@media (hover: hover) {
  .tracker-card-journey:hover { background: rgba(var(--primary-rgb), 0.04); color: var(--text-muted); }
}

.tracker-card-journey-text {
  font-size: var(--type-sm);
  font-weight: var(--weight-semibold);
}

.tracker-card-journey-chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Label + value, stacked to the right of the ring */
.tracker-card-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
}

.tracker-card-ring {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

.tracker-card-ring .odrifit-progress-ring {
  width: 80px;
  height: 80px;
  top: 0; /* reset base ring's top:10px so ring center (40px) matches the icon wrap's center (40px) */
}

.tracker-ring-icon-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
/* Shown only in the goal-hit state (see #trackerCards .is-onstreak). */
.tracker-ring-check {
  display: none;
  width: 26px;
  height: 26px;
  flex: none;
}

.tracker-card-ring .odrifit-rec-header {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.tracker-card-value {
  font-family: var(--font-numeric);
  font-variant-numeric: tabular-nums;
  font-size: var(--type-2xl);
  font-weight: var(--weight-bold);
  color: var(--text);
  margin: 0;
  line-height: 1.1;
}

/* Muted "/ goal" suffix next to the current value */
.tracker-card-goal {
  font-size: var(--type-lg);
  font-weight: var(--weight-semibold);
  color: var(--text-faint);
  margin-left: var(--space-1);
}

.tracker-card-label {
  font-size: var(--type-xxs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* Feature layout — text on the left, ring on the right (water-card prototype).
   The ring keeps the animated water-drop icon and stays concentric. */
.tracker-metric-card--feature .tracker-card-main {
  justify-content: space-between;
}

.tracker-metric-card--feature .tracker-card-text {
  gap: var(--space-1);
}

.tracker-metric-card--feature .tracker-card-label {
  font-size: var(--type-md);
  font-weight: var(--weight-semibold);
  letter-spacing: normal;
  text-transform: none;
  color: var(--text-muted);
}
.tracker-card-label strong { font-weight: var(--weight-bold); color: var(--text); }

.tracker-metric-card--feature .tracker-card-value {
  font-size: var(--type-hero);
}

/* ── Tracker full-page overlay ──────────────────────────────────────────────── */
.tracker-full-page {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
}

.tracker-full-page--open {
  transform: translateY(0);
}

/* Shared header for every full-screen tracker page (.tracker-full-page).
   Grid keeps the title truly centred whichever side carries the nav button —
   the unused side gets a same-width .tracker-page-nav-spacer instead of
   collapsing, so the title never drifts off-centre. flex-shrink:0 already
   keeps it out of .tracker-page-body's scroll, but it's pinned with
   position:sticky too so it can never scroll away even if a page nests it
   inside a scrolling ancestor by mistake (the exact bug the old rogue
   "Learn about nutrition" header had — see trackerPageHeader() in script.js). */
.tracker-full-page-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  /* left nav column aligned to the app-wide .app-back slot (40px, --space-4) */
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: var(--space-3);
  padding: calc(env(safe-area-inset-top) + var(--space-4)) var(--space-4) var(--space-4);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.tracker-page-nav {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  transition: background 0.15s;
}
.tracker-page-nav svg { width: 24px; height: 24px; }
.tracker-page-nav:hover { background: rgba(255,255,255,0.06); }
.tracker-page-nav:active { transform: translateY(1px); }
.tracker-page-nav-spacer { width: 40px; height: 40px; }

.tracker-page-title {
  grid-column: 2;
  font-size: var(--type-lg);
  font-weight: var(--weight-bold);
  color: var(--text);
  text-align: center;
  margin: 0;
}

.tracker-page-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ── Food camera step (full-screen) ────────────────────────────────────────── */
.food-camera-step {
  position: absolute;
  inset: 0;
  background: #000;
  z-index: 1;
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.food-camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* Before getUserMedia() resolves, an empty <video> paints the browser's
     own placeholder graphic stretched to fill the element — visible as a
     jarring flash on open. An explicit black background hides it. */
  background: #000;
}

.food-camera-canvas { display: none; }

/* Capture flash — brief white wash on shutter press. */
.food-camera-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 3;
}
.food-camera-flash--on { animation: foodCamFlash 0.5s ease-out both; }
@keyframes foodCamFlash {
  0% { opacity: 0.85; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .food-camera-flash--on { animation: none; }
}

.food-camera-hint {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: var(--type-md);
  color: rgba(255,255,255,0.9);
  background: rgba(0,0,0,0.5);
  padding: var(--space-2) var(--space-4);
  border-radius: 999px;
  white-space: nowrap;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
}
.food-camera-hint:empty { display: none; }

.food-camera-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 150px;
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.8));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-8) calc(env(safe-area-inset-bottom, 0px) + var(--space-6));
}

.food-camera-close {
  position: absolute;
  right: var(--space-6);
  bottom: calc(env(safe-area-inset-bottom, 0px) + var(--space-8));
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.18);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: var(--type-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background 0.15s, transform 0.1s;
}
.food-camera-close:active { transform: scale(0.9); }

.food-camera-gallery {
  position: absolute;
  left: var(--space-6);
  bottom: calc(env(safe-area-inset-bottom, 0px) + var(--space-8));
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.18);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background 0.15s, transform 0.1s;
}
.food-camera-gallery:active { transform: scale(0.9); }

.food-camera-shutter {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: none;
  border: 4px solid rgba(255,255,255,0.92);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s;
  flex-shrink: 0;
}
.food-camera-shutter:active { transform: scale(0.9); }

.food-camera-shutter-inner {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  display: block;
}

/* ── Food questions step (slides in from right) ─────────────────────────────── */
.food-questions-step {
  position: absolute;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
  z-index: 2;
}

.food-questions-step--visible {
  transform: translateX(0);
}

/* ── Food verify screen: full-bleed photo + floating sheet ─────────────────── */
.food-verify {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #000;
}
.food-verify--nophoto { background: var(--bg); }

.food-verify__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Bottom-up dark gradient so the sheet's top edge reads against any photo. */
.food-verify__scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.34) 40%, rgba(0,0,0,0) 66%);
}
.food-verify--nophoto .food-verify__scrim { display: none; }

/* "Photo taken — hold" beat: the photo shows instantly, the builder eases in
   ~800ms later when .food-verify--holding is removed. */
.food-verify__header,
.food-log-flow {
  transition: opacity 0.35s ease, transform 0.35s var(--ease-out, ease);
}
.food-verify--holding .food-verify__header { opacity: 0; transform: translateY(-8px); }
.food-verify--holding .food-log-flow { opacity: 0; transform: translateY(24px); pointer-events: none; }
.food-verify--holding .food-verify__canvas { pointer-events: none; }

/* Running header — "Your breakfast for today · 24g protein" */
.food-verify__header {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + var(--space-4));
  left: 0;
  right: 0;
  z-index: 3;
  text-align: center;
  pointer-events: none;
}
.food-verify__header-title {
  margin: 0;
  font-size: var(--type-md);
  font-weight: var(--weight-semibold);
  color: #fff;
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}
.food-verify--nophoto .food-verify__header-title { color: var(--text); text-shadow: none; }
.food-verify__header-meal {
  border: none;
  background: none;
  padding: 0 1px;
  font: inherit;
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  pointer-events: auto;
}
.food-verify__header-p {
  margin: 2px 0 0;
  font-size: var(--type-xs);
  color: rgba(255,255,255,0.7);
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.food-verify--nophoto .food-verify__header-p { color: var(--text-muted); text-shadow: none; }

.food-verify__close {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + var(--space-3));
  left: var(--space-4);
  z-index: 4;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.42);
  color: #fff;
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: transform 0.1s, background 0.15s;
}
.food-verify--nophoto .food-verify__close {
  background: var(--card-bg-alt);
  color: var(--text-muted);
}
.food-verify__close:active { transform: scale(0.9); }

/* The floating sheet — sits over the lower part of the photo, scrolls its own
   content if it gets tall. */
.food-verify__sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 82%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5) calc(env(safe-area-inset-bottom, 0px) + var(--space-4));
  background: rgba(17, 24, 23, 0.95);
  background: color-mix(in srgb, var(--card-bg) 90%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  border-top: 1px solid rgba(255,255,255,0.05);
  animation: saveSheetSlideUp 0.32s var(--ease-out, ease) both;
}
.food-verify--nophoto .food-verify__sheet {
  top: 0;
  max-height: none;
  background: var(--bg);
  border-radius: 0;
  border-top: none;
  padding-top: calc(env(safe-area-inset-top, 0px) + 64px);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  animation: none;
}
.food-verify--nophoto .food-verify__grab { display: none; }

.food-verify__grab {
  width: 32px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  align-self: center;
}

.food-verify__sheet-title {
  margin: 2px 0 0;
  text-align: center;
  font-size: var(--type-md);
  font-weight: var(--weight-bold);
  color: var(--text);
}
.food-verify__sheet-sub {
  margin: 0 0 var(--space-1);
  text-align: center;
  font-size: var(--type-sm);
  color: var(--text-muted);
  line-height: 1.4;
}

.food-verify__addphoto {
  border: none;
  background: none;
  padding: var(--space-2);
  color: var(--primary);
  font-family: inherit;
  font-size: var(--type-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
}

/* The reused search row loses its page padding — the sheet already provides it. */
.food-verify__sheet .food-log-search-row { padding: 0; }
.food-verify__sheet .food-log-results:empty { display: none; }

.food-verify__chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
}
.food-verify__chips:empty,
.food-verify__chips[hidden] { display: none; }
.food-verify__chips .food-log-chip {
  min-height: 34px;
  padding: 6px 16px;
  display: inline-flex;
  align-items: center;
  border: none;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font-size: var(--type-sm);
  font-weight: var(--weight-semibold);
}
.food-verify__chips .food-log-chip:active { background: rgba(255,255,255,0.16); }

/* Added items — shown BIG, right on the photo. Each pops in when added so it's
   obvious we caught it. This is the "here's what we've got" surface. */
.food-verify__stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-height: calc(var(--vh-px, 100vh) * 0.34);
  overflow-y: auto;
  padding-right: 2px;
}
.food-verify__stack[hidden] { display: none; }

.food-verify__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.food-verify__item-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
}
.food-verify__item-name {
  flex: 1;
  min-width: 0;
  font-size: var(--type-xl);
  font-weight: 800;
  line-height: 1.15;
  color: #fff;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.food-verify--nophoto .food-verify__item-name { color: var(--text); }

.food-verify__item-remove {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  align-self: center;
}
.food-verify__item-remove:active { background: rgba(255,255,255,0.16); color: #fff; }

.food-verify__item-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--type-sm);
}
.food-verify__item-portion {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: none;
  background: none;
  padding: 2px 0;
  color: var(--primary);
  font-family: inherit;
  font-size: var(--type-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
}
.food-verify__row-caret { color: currentColor; opacity: 0.7; font-size: 0.8em; }
.food-verify__item-val { color: rgba(255,255,255,0.7); }
.food-verify--nophoto .food-verify__item-val { color: var(--text-muted); }
.food-verify__item-added {
  color: var(--primary);
  font-weight: var(--weight-semibold);
}

/* pop-in: the just-added item scales up + glows briefly */
.food-verify__item--new { animation: foodItemPop 0.42s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes foodItemPop {
  0%   { opacity: 0; transform: translateY(10px) scale(0.94); }
  55%  { opacity: 1; transform: translateY(0) scale(1.03); }
  100% { opacity: 1; transform: scale(1); }
}
.food-verify__item--new .food-verify__item-name { animation: foodItemGlow 0.7s ease-out both; }
@keyframes foodItemGlow {
  0%   { text-shadow: 0 0 0 rgba(var(--primary-rgb), 0); }
  30%  { text-shadow: 0 0 16px rgba(var(--primary-rgb), 0.6); }
  100% { text-shadow: 0 0 0 rgba(var(--primary-rgb), 0); }
}
@media (prefers-reduced-motion: reduce) {
  .food-verify__item--new,
.food-verify__item--new .food-verify__item-name { animation: none; }
}

/* Live matches from the food library — appear just above the input as you type,
   so a typed dish logs real protein instead of a blank custom entry. */
.food-verify__results {
  display: flex;
  flex-direction: column;
  max-height: calc(var(--vh-px, 100vh) * 0.3);
  overflow-y: auto;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
}
.food-verify__results[hidden] { display: none; }

.food-verify__result {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 46px;
  padding: var(--space-2) var(--space-4);
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: none;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.food-verify__result:last-child { border-bottom: none; }
.food-verify__result:active { background: rgba(255, 255, 255, 0.06); }

.food-verify__result-name {
  flex: 1;
  min-width: 0;
  font-size: var(--type-md);
  font-weight: var(--weight-semibold);
}
.food-verify__result-local { color: var(--text-faint); font-weight: 400; }
.food-verify__result-p {
  flex-shrink: 0;
  font-size: var(--type-sm);
  font-weight: var(--weight-semibold);
  color: var(--primary);
}
.food-verify__result-p--muted { color: var(--text-faint); font-weight: 400; }
.food-verify__result--custom .food-verify__result-name { font-weight: 400; color: var(--text-muted); }

.food-verify__cta {
  width: 100%;
  min-height: 52px;
  border-radius: var(--radius-full);
  margin-top: var(--space-1);
}
.food-verify__cta:disabled { opacity: 0.4; }

/* ── Circle-to-label ─────────────────────────────────────────────────────────
   A gesture surface over the photo: draw a loop around a dish, we zoom a touch
   and ask its name, then pin the label where it was circled. Sits above the
   photo/scrim but below the bottom sheet (DOM order), so the sheet stays live. */
.food-verify__canvas {
  position: absolute;
  inset: 0;
  touch-action: none;
  cursor: crosshair;
}
.food-verify__lasso {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.food-verify__lasso path {
  fill: rgba(var(--primary-rgb), 0.12);
  stroke: var(--primary);
  stroke-width: 2.5;
  stroke-dasharray: 7 6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.food-verify__lasso--active path { fill: rgba(var(--primary-rgb), 0.06); }

.food-verify__photo {
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
  will-change: transform;
}
.food-verify--zoomed .food-verify__photo { transform: scale(1.22); }
.food-verify--zoomed .food-verify__scrim {
  background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.55) 50%, rgba(0,0,0,0.4) 100%);
}

.food-verify__pins {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.food-verify__label {
  position: absolute;
  transform: translate(-50%, -50%); /* overridden inline per-pin for edge anchoring */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  pointer-events: none;
  /* animate `scale` (separate property) so the inline translate survives */
  animation: foodPinPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes foodPinPop {
  0%   { opacity: 0; scale: 0.7; }
  60%  { opacity: 1; scale: 1.08; }
  100% { opacity: 1; scale: 1; }
}
.food-verify__label-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.25), 0 1px 6px rgba(0,0,0,0.55);
}
.food-verify__label-name {
  margin-top: 3px;
  border: none;
  background: none;
  padding: 0;
  max-width: 46vw;
  color: #fff;
  font-family: inherit;
  font-size: var(--type-sm);
  font-weight: 800;
  line-height: 1.15;
  text-shadow: 0 1px 6px rgba(0,0,0,0.75);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: auto;
  cursor: pointer;
}
.food-verify--nophoto .food-verify__label-name { color: var(--text); text-shadow: none; }
.food-verify__label-p {
  color: var(--primary);
  font-size: var(--type-xs);
  font-weight: 700;
  text-shadow: 0 1px 5px rgba(0,0,0,0.75);
}
/* ✕ appears only once a pin is tapped (selected) */
.food-verify__label-x {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 18px;
  height: 18px;
  display: none;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  cursor: pointer;
  pointer-events: auto;
}
.food-verify__label--sel .food-verify__label-x { display: grid; }
.food-verify__label--sel .food-verify__label-name { text-decoration: underline; text-underline-offset: 2px; }
.food-verify__label-x:active { background: rgba(0,0,0,0.85); }

/* Name-this-dish — floats beside the circled area, above the keyboard.
   left / top / width are set inline when it opens. */
.food-verify__namer {
  position: absolute;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  animation: foodPinPop 0.24s ease both;
}
.food-verify__namer[hidden] { display: none; }
.food-verify__namer-inputrow {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: var(--radius-full);
  background: var(--card-bg);
  box-shadow: 0 6px 26px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.1);
}
.food-verify__namer-inputrow input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: var(--type-base);
  outline: none;
}
.food-verify__namer-inputrow button {
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: var(--primary-fill);
  color: var(--primary-ink);
  cursor: pointer;
}
.food-verify__namer-results {
  display: flex;
  flex-direction: column;
  max-height: calc(var(--vh-px, 100vh) * 0.3);
  overflow-y: auto;
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  box-shadow: 0 6px 26px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.08);
}
.food-verify__namer-results:empty { display: none; }
.food-verify__namer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 44px;
  padding: 8px 14px;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: none;
  color: var(--text);
  font-family: inherit;
  font-size: var(--type-md);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.food-verify__namer-row:last-child { border-bottom: none; }
.food-verify__namer-row:active { background: rgba(255,255,255,0.05); }
.food-verify__namer-p { flex: none; color: var(--primary); font-size: var(--type-sm); font-weight: 700; }
.food-verify__namer-row--custom { color: var(--text-muted); font-weight: 400; }

/* ── First-run coach for the circle gesture ─────────────────────────────────
   Pointer-transparent so the first real draw both dismisses it and starts the
   loop; only the "Got it" button takes taps. */
.food-verify__fre {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: rgba(0, 0, 0, 0.46);
  -webkit-backdrop-filter: blur(1.5px);
  backdrop-filter: blur(1.5px);
  pointer-events: none;
  animation: foodQAnswerIn 0.3s ease both;
}
.food-verify__fre[hidden] { display: none; }
.food-verify__fre-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  text-align: center;
}
.food-verify__fre-svg {
  width: 176px;
  height: 176px;
  filter: drop-shadow(0 2px 14px rgba(0, 0, 0, 0.6));
}
.food-verify__fre-loop {
  stroke: var(--primary);
  stroke-width: 4;
  fill: none;
  stroke-dasharray: 360;
  animation: freDraw 2.6s ease-in-out infinite;
}
@keyframes freDraw {
  0%   { stroke-dashoffset: 360; opacity: 1; }
  50%  { stroke-dashoffset: 0;   opacity: 1; }
  80%  { stroke-dashoffset: 0;   opacity: 1; }
  92%  { opacity: 0; }
  100% { stroke-dashoffset: 360; opacity: 0; }
}
.food-verify__fre-dot { fill: #fff; }
.food-verify__fre-ripple {
  fill: rgba(255, 255, 255, 0.3);
  transform-box: fill-box;
  transform-origin: center;
  animation: frePulse 2.6s ease-in-out infinite;
}
@keyframes frePulse {
  0%, 100% { transform: scale(0.5); opacity: 0.55; }
  50%      { transform: scale(1);   opacity: 0; }
}
.food-verify__fre-caption {
  margin: 0;
  color: #fff;
  font-size: var(--type-lg);
  font-weight: 800;
  line-height: 1.3;
}
.food-verify__fre-caption span {
  display: block;
  margin-top: 3px;
  font-size: var(--type-sm);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
}
.food-verify__fre-got {
  pointer-events: auto;
  border: none;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-family: inherit;
  font-size: var(--type-md);
  font-weight: 700;
  padding: 11px 28px;
  cursor: pointer;
}
.food-verify__fre-got:active { background: rgba(255, 255, 255, 0.28); }

@media (prefers-reduced-motion: reduce) {
  .food-verify__photo,
.food-verify__label,
.food-verify__namer,
.food-verify__header,
.food-log-flow { transition: none; animation: none; }
  .food-verify__fre,
.food-verify__fre-loop,
.food-verify__fre-ripple { animation: none; }
  .food-verify__fre-loop { stroke-dashoffset: 0; }
}

/* Meal picker bottom-sheet rows need their own card chrome (.hc-row is bare) */
.meal-picker-opt {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.meal-picker-opt--selected {
  border-color: rgba(var(--primary-rgb), 0.4);
}
.meal-picker-opt--selected .hc-row-label {
  color: var(--primary);
}

/* Period log sheet — done state (icon + message, stacked & centred) */
.period-sheet-done { gap: var(--space-3); padding-bottom: var(--space-4); }
.period-sheet-done .food-log-done-check {
  margin: 0 auto;
  animation: done-pop 0.4s var(--ease-out, ease) both;
}
.period-sheet-done .csheet__cta { margin-top: var(--space-3); }
@media (prefers-reduced-motion: reduce) {
  .period-sheet-done .food-log-done-check { animation: none; }
}

/* End-of-flow confirmation — one line, then Done. Opaque, covers the photo. */
.food-log-done {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-5);
  padding: var(--space-9) var(--space-6) calc(env(safe-area-inset-bottom, 0px) + var(--space-7));
  background: var(--bg);
  text-align: center;
  animation: foodQAnswerIn 0.3s var(--ease-out, ease) both;
}
.food-log-done[hidden] { display: none; }
.food-log-done-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary-fill);
  color: var(--primary-ink);
  animation: done-pop 0.4s var(--ease-out, ease) both;
}
.food-log-done-check svg { width: 32px; height: 32px; }
.food-log-done-title {
  font-size: var(--type-xl);
  font-weight: var(--weight-bold);
  color: var(--text);
  margin: 0;
  line-height: 1.35;
  max-width: 24ch;
}
.food-log-done #foodLogDoneBtn {
  width: 100%;
  max-width: 320px;
  min-height: 52px;
  border-radius: var(--radius-full);
}
.food-log-done #foodLogDoneBtn[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .food-verify__sheet,
.food-log-done,
.food-log-done-check { animation: none; }
}

/* ── Steps page ────────────────────────────────────────────────────────────── */
.steps-page { padding-bottom: var(--space-10); }

.steps-hero {
  padding: var(--space-8) var(--space-6) var(--space-6);
  text-align: center;
}

/* Single progress ring (shared .odrifit-progress-ring component, same one
   the home tracker cards use) sized up as this page's hero — replaces the
   old separate "steps today" text line + a second time-based timer ring,
   which showed the same information twice. */
.steps-ring-wrap {
  position: relative;
  width: 278px;
  height: 278px;
  margin: 0 auto var(--space-4);
}
.steps-ring-svg { width: 100%; height: 100%; display: block; }

/* Shared by both hero rings (steps + water, Figma 387:534/535) — icon and
   count used to each be independently absolute-positioned by percentage
   (icon at top:25%, count at top:50%), which only avoided overlapping at
   the exact sizes someone eyeballed once; any real content (a 5-digit step
   count, a taller glass fill) collided with the icon above it. A flex
   column centered as one group scales correctly regardless of exact icon/
   number size — the fix is structural, not a re-tuned magic number. */
.steps-ring-wrap .ring-content,
.water-ring-wrap .ring-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}
.steps-ring-wrap .ring-content .tracker-ring-icon-wrap,
.water-ring-wrap .ring-content .tracker-ring-icon-wrap {
  position: static;
}

.steps-count {
  font-family: var(--font-numeric);
  font-size: var(--type-num-lg);
  font-weight: 800;
  color: var(--metric-steps);
  margin: 0;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.steps-goal-label {
  font-size: var(--type-md);
  color: var(--text-faint);
  margin: 0;
}
.steps-goal-label strong { color: var(--text); font-weight: var(--weight-bold); }

/* Android-only Health Connect hero (renderAndroidStepsPage, Figma 387:534) —
   the icon/check inside the shared ring sized up for this bigger hero
   context (default .odrifit-rec-icon/.tracker-ring-check are card-sized). */
.steps-ring-wrap .odrifit-rec-icon,
.steps-ring-wrap .tracker-ring-check {
  width: 44px;
  height: 44px;
}
.steps-hero-title {
  margin: var(--space-5) 0 0;
  font-size: var(--type-lg);
  font-weight: 800;
  color: var(--text);
}
.steps-hero-sub {
  margin: var(--space-1) 0 0;
  font-size: var(--type-sm);
  color: var(--text-muted);
}
.steps-hero-sub:empty { display: none; }
.steps-sync-btn {
  margin-top: var(--space-5);
  min-height: 48px;
  padding: 0 var(--space-6);
  border: 0;
  border-radius: var(--radius-full);
  background: var(--primary-fill);
  color: var(--primary-ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}
/* No data yet — mute the ring icon (no glow/march animation) instead of its
   normal live green, and hide the goal-hit check (never shown together). */
.steps-hero--nodata .steps-ring-wrap .odrifit-rec-icon--movement {
  color: var(--text-faint);
  filter: none;
  animation: none;
}
.steps-hero--nodata .steps-ring-wrap .odrifit-rec-icon--movement .foot {
  animation: none;
}
/* The count matches whatever color the icon is currently showing: muted at
   zero (nodata), full metric color while in progress (base .steps-count). */
.steps-hero--nodata .steps-count { color: var(--text-faint); }
/* Goal hit — same treatment as the home tracker card's on-streak state
   (swap the feet icon for a check, ring turns teal) but at full brightness:
   this is a dedicated celebratory screen, not a small ambient card. The
   count also switches from the icon's own color to the highlight color. */
.steps-hero--complete .steps-ring-wrap .odrifit-progress-ring__fill {
  stroke: var(--primary);
}
.steps-hero--complete .steps-ring-wrap .odrifit-rec-icon { display: none; }
.steps-hero--complete .steps-ring-wrap .tracker-ring-check {
  display: block;
  color: var(--primary);
}
.steps-hero--complete .steps-count { color: var(--primary); }

.steps-progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.steps-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* Walk section */
.steps-walk-section {
  padding: var(--space-6) var(--space-6) var(--space-5);
  text-align: center;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}

.steps-walk-title {
  font-size: var(--type-body);
  color: var(--text-muted);
  margin: 0 0 var(--space-4);
}

/* Start / Pause button */
.steps-start-btn {
  padding: var(--space-3) var(--space-9);
  border-radius: 999px;
  background: var(--primary-fill);
  color: var(--btn-text);
  font-size: var(--type-base);
  font-weight: var(--weight-bold);
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s, transform 0.1s;
  margin-top: var(--space-1);
}
.steps-start-btn:active { transform: scale(0.96); }

/* Stop / dismiss button — subtle ghost text */
.steps-stop-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: var(--type-md);
  font-family: inherit;
  cursor: pointer;
  padding: var(--space-2) var(--space-4);
  margin-top: var(--space-1);
  border-radius: 999px;
  transition: color 0.15s;
}
.steps-stop-btn:hover { color: var(--text-muted); }

/* Circadian morning-movement tip (male profiles only) — quiet, non-blocking. */
.walk-timer-tip {
  position: relative;
  margin: var(--space-2) var(--space-6) 0;
  padding: var(--space-3) var(--space-8) var(--space-3) var(--space-3);
  background: var(--card-bg-alt, var(--card-bg));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: var(--type-sm);
  line-height: 1.45;
  color: var(--text-muted);
}
.walk-timer-tip__x {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  font-size: 20px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}

/* Manual add — hidden until tapped */
.steps-manual-section {
  padding: var(--space-1) var(--space-6) var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.steps-manual-toggle {
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: var(--type-sm);
  font-family: inherit;
  cursor: pointer;
  padding: var(--space-2) var(--space-3);
  border-radius: 999px;
  transition: color 0.15s;
  opacity: 0.65;
}
.steps-manual-toggle:hover { color: var(--text-muted); opacity: 1; }

.steps-manual-form { width: 100%; }

.steps-manual-row {
  display: flex;
  gap: var(--space-3);
}

.steps-manual-input {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-size: var(--type-base);
  font-family: inherit;
  outline: none;
}
.steps-manual-input:focus { border-color: var(--primary); }

.steps-manual-add {
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  background: rgba(var(--primary-rgb, 26,188,156), 0.15);
  color: var(--primary);
  font-weight: 600;
  font-size: var(--type-md);
  border: 1px solid var(--primary);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.steps-manual-add:hover { background: rgba(var(--primary-rgb, 26,188,156), 0.25); }

/* Integrations — tiny and dim */
.steps-integrations {
  padding: var(--space-3) var(--space-6) var(--space-8);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: center;
}

.steps-integration-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-disabled);
  background: transparent;
  color: var(--text-muted);
  font-size: var(--type-sm);
  font-family: inherit;
  cursor: not-allowed;
  opacity: 0.4;
}

.steps-integration-note {
  font-size: var(--type-xxs);
  color: var(--text-faint);
  text-align: center;
  margin: 0;
  opacity: 0.5;
}

/* ── Water page — Figma 387:535 ───────────────────────────────────────────── */
.water-page { padding-bottom: var(--space-10); }

.water-hero {
  padding: var(--space-8) var(--space-6) var(--space-6);
  text-align: center;
}

/* Same recipe as .steps-ring-wrap (steps hero, Figma 387:534) — one shared
   ring/icon/count/goal-label composition, kept as parallel per-feature
   classes rather than a cross-feature abstraction (matches how this
   codebase already handles repeated visual recipes, e.g. the CTA-pill
   pattern duplicated across .edit-health-cta/.onboarding-done__cta/etc). */
.water-ring-wrap {
  position: relative;
  width: 278px;
  height: 278px;
  margin: 0 auto var(--space-4);
}
.water-ring-wrap .odrifit-progress-ring { width: 100%; height: 100%; display: block; }
.water-ring-wrap .tracker-ring-check { width: 44px; height: 44px; }
.water-ring-wrap .odrifit-rec-icon {
  width: 44px;
  height: 44px;
}

.water-count {
  font-family: var(--font-numeric);
  font-size: var(--type-num-lg);
  font-weight: 800;
  color: var(--metric-water);
  margin: 0;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.water-goal-label {
  font-size: var(--type-md);
  color: var(--text-faint);
  margin: 0;
}
.water-goal-label strong { color: var(--text); font-weight: var(--weight-bold); }

.water-hero-title {
  margin: var(--space-5) 0 0;
  font-size: var(--type-lg);
  font-weight: 800;
  color: var(--text);
}
.water-hero-sub {
  margin: var(--space-1) auto 0;
  max-width: 328px;
  font-size: var(--type-sm);
  color: var(--text-muted);
}
.water-hero-sub:empty { display: none; }

.water-log-btn {
  margin-top: var(--space-5);
  min-height: 48px;
  padding: 0 var(--space-6);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--primary);
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}
.water-undo-btn {
  display: block;
  margin: var(--space-3) auto 0;
  background: none;
  border: 0;
  color: var(--primary);
  font-size: var(--type-sm);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  padding: var(--space-1) var(--space-2);
}
.water-undo-btn[hidden] { display: none; }

/* In-progress ring stays --info (blue, per Figma) even though the icon/count
   now read in --metric-water — the ring arc is a distinct accent, not tied
   to the icon. Complete reuses the steps hero's teal-ring/check-swap
   treatment, and the count switches from the icon's color to the highlight
   color, same as steps. */
.water-hero--progress .water-ring-wrap .odrifit-progress-ring__fill { stroke: var(--info); }
.water-hero--complete .water-ring-wrap .odrifit-progress-ring__fill { stroke: var(--primary); }
.water-hero--complete .water-ring-wrap .odrifit-rec-icon { display: none; }
.water-hero--complete .water-ring-wrap .tracker-ring-check {
  display: block;
  color: var(--primary);
}
.water-hero--complete .water-count { color: var(--primary); }

/* ── "Your journey" — cumulative calendar + fun fact ─────────────────────── */
.journey-page { padding: var(--space-5) var(--space-5) var(--space-10); }

.journey-fact-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
}
.journey-fact-icon { font-size: 20px; line-height: 1; flex-shrink: 0; }
.journey-fact-text {
  margin: 0;
  font-size: var(--type-md);
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.journey-streak {
  text-align: center;
  font-size: var(--type-sm);
  font-weight: 700;
  color: var(--text-muted);
  margin: 0 0 var(--space-5);
}

/* Steps journey only: a gentle, dismissible cycle-tracking heads-up for female
   users who haven't opted in. Turning tracking on lets the adaptive walking
   engine move the daily step target with cycle energy. Kept muted to hold the
   uncluttered look — the terracotta period accent stays reserved for the
   calendar itself. */
.journey-cycle-nudge {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  padding-right: var(--space-8);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
}
.journey-cycle-nudge__icon { font-size: 20px; line-height: 1; flex-shrink: 0; }
.journey-cycle-nudge__body { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.journey-cycle-nudge__title {
  margin: 0;
  font-size: var(--type-md);
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}
.journey-cycle-nudge__text {
  margin: 0;
  font-size: var(--type-sm);
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.45;
}
.journey-cycle-nudge__cta {
  align-self: flex-start;
  margin-top: var(--space-1);
  padding: 0;
  background: none;
  border: none;
  font-size: var(--type-sm);
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
}
.journey-cycle-nudge__cta:hover { text-decoration: underline; }
.journey-cycle-nudge__dismiss {
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}

/* Continuous vertical scroll of months — current month first, past months
   below, instead of paging back and forth with prev/next controls. */
.journey-cal-scroll {
  display: flex;
  flex-direction: column;
  gap: var(--space-7);
}
.journey-month-block { display: flex; flex-direction: column; }
.journey-cal-month {
  font-size: var(--type-md);
  font-weight: 800;
  color: var(--text);
  margin: 0 0 var(--space-3);
}

.journey-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: var(--space-2);
}
.journey-cal-weekdays span {
  text-align: center;
  font-size: var(--type-xs);
  font-weight: 700;
  color: var(--text-faint);
}

.journey-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

/* Continuous period calendar (Apple Calendar pattern) — one grid, weeks
   flow uninterrupted, weekday header sticks, month name sits inline in the
   lead cells of the row it starts on. */
.pcal { position: relative; }
.pcal .journey-cal-weekdays {
  position: sticky; top: 0; z-index: 1;
  background: var(--bg);
  padding-bottom: var(--space-1);
  margin-bottom: 0;
}
.pcal-grid { row-gap: 4px; align-items: start; }
/* Tap-or-scroll-up affordance that reveals the previous month on request —
   see revealPreviousPcalMonth() in script.js. Removed from the DOM once used. */
.pcal-prevmonth {
  grid-column: 1 / -1;
  padding: var(--space-2) 2px var(--space-3);
  border: 0;
  background: none;
  font: inherit;
  font-size: var(--type-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-faint);
  text-align: center;
  cursor: pointer;
}
.pcal-prevmonth:active { color: var(--text-muted); }
/* Month name on its own full-width row — normal text colour, not teal. */
.pcal-monthlabel {
  grid-column: 1 / -1;
  padding: var(--space-3) 2px var(--space-1);
  font-size: var(--type-md);
  font-weight: 700;
  color: var(--text);
}
/* Cycle-phase key under the calendar. */
.pcal-phase-note {
  margin: 0 0 var(--space-4);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}
.pcal-phase-note b { color: var(--text); font-weight: 700; }
.journey-cal-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}
.journey-cal-cell--empty { background: none; }
.journey-cal-cell.is-today { box-shadow: inset 0 0 0 1.5px var(--primary); }
.journey-cal-daynum { font-family: var(--font-numeric); font-variant-numeric: tabular-nums; font-size: var(--type-xs); color: var(--text-faint); }
.journey-cal-cell.is-hit .journey-cal-daynum,
.journey-cal-cell.is-partial .journey-cal-daynum { color: var(--text-muted); }
.journey-cal-check {
  width: 14px; height: 14px;
  color: var(--primary-ink);
}
.journey-cal-cell.is-hit {
  background: var(--primary-fill);
}
.journey-cal-cell.is-hit .journey-cal-daynum { color: var(--primary-ink); opacity: 0.7; }
.journey-cal-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
}
.journey-cal-cell.is-partial .journey-cal-dot { background: var(--primary); }

/* ── Cycle colour system ─────────────────────────────────────────────────
   Every date is painted its phase colour — Period (solid block, warmed with a
   touch of rose), Follicular & Luteal (faint teal washes), Ovulation (a hair
   brighter + a slight rose), Predicted period (the "pencilled in" dashed block
   — the only border on the calendar). The header legend names only the three
   key states; Follicular & Luteal read from the tap tooltip. Alt themes fall
   back to a pure alpha ramp. */
.pcal, .collapsing-hero__legend {
  --cyc-menstrual:      #43c8c0;   /* fallback for no color-mix */
  --cyc-menstrual:      color-mix(in srgb, var(--primary-fill) 80%, #ff6fae 20%);
  --cyc-menstrual-ink:  var(--primary-ink);
  --cyc-follicular:     rgba(40, 224, 190, 0.15);   /* green-leaning teal */
  /* Ovulation reads pink — a soft rose wash so it stands out from the teal
     period / follicular / luteal washes. */
  --cyc-ovulatory:      rgba(255, 111, 174, 0.18);   /* fallback for no color-mix */
  --cyc-ovulatory:      color-mix(in srgb, rgba(255, 111, 174, 0.26) 82%, rgba(46, 255, 232, 0.18) 18%);
  --cyc-ovulatory-ink:  #f0a9cf;
  --cyc-luteal:         rgba(96, 172, 180, 0.12);   /* cooler, greyed teal */
  --cyc-predicted:      rgba(var(--primary-rgb), 0.10);
  --cyc-predicted-line: rgba(var(--primary-rgb), 0.55);
}
:root.theme-light .pcal, :root.theme-light .collapsing-hero__legend {
  --cyc-menstrual:     var(--primary-fill);
  --cyc-follicular:    rgba(var(--primary-rgb), 0.18);
  --cyc-ovulatory:     rgba(255, 111, 174, 0.22);
  --cyc-ovulatory-ink: #c85a92;
  --cyc-luteal:        rgba(var(--primary-rgb), 0.12);
}

/* Bleed days are the one solid block; the phases are ambient washes. Only
   predicted bleed has a border (dashed). */
.journey-cal-cell.period-cal-cell--actual {
  background: var(--cyc-menstrual);
}
.journey-cal-cell.period-cal-cell--actual .journey-cal-daynum {
  color: var(--cyc-menstrual-ink); opacity: 0.9;
}
.journey-cal-cell.period-cal-cell--predicted {
  background: var(--cyc-predicted);
  outline: 1.5px dashed var(--cyc-predicted-line);
  outline-offset: -2px;
}
.journey-cal-cell.period-cal-cell--predicted .journey-cal-daynum {
  color: var(--primary);
}
.journey-cal-cell.period-cal-cell--follicular { background: var(--cyc-follicular); }
.journey-cal-cell.period-cal-cell--follicular .journey-cal-daynum { color: var(--text-muted); }
.journey-cal-cell.period-cal-cell--luteal { background: var(--cyc-luteal); }
.journey-cal-cell.period-cal-cell--luteal .journey-cal-daynum { color: var(--text-faint); }
/* Today, in the period calendar only: a solid 2px light inset stroke around the
   cell — high-contrast on every fill (period, ovulation, predicted, empty), and
   visually distinct from predicted's dashed outline. The number keeps its
   normal per-fill colour. */
.period-page .journey-cal-cell.is-today {
  box-shadow: inset 0 0 0 2px var(--text);
}
.period-page .journey-cal-cell.is-today .journey-cal-daynum {
  font-weight: 700;
}
.period-page .journey-cal-cell { position: relative; }
.journey-cal-cell.period-cal-cell--ovulatory { background: var(--cyc-ovulatory); }
.journey-cal-cell.period-cal-cell--ovulatory .journey-cal-daynum { color: var(--cyc-ovulatory-ink, var(--text-muted)); }

/* Legend swatches — one per phase, matching the cell fills. */
.period-cal-swatch {
  width: 12px; height: 12px;
  border-radius: 4px;
  flex: none;
  background: var(--cyc-menstrual);
}
.period-cal-swatch--ovulatory  { background: var(--cyc-ovulatory); }
.period-cal-swatch--predicted  {
  background: var(--cyc-predicted);
  outline: 1.5px dashed var(--cyc-predicted-line);
  outline-offset: -2px;
}

/* ── Period calendar "edit mode" — the custom "Pick a date" picker ─────────
   Entered via openPcalEditMode() (script.js). Strips every phase colour back
   to the plain cell fill, hides the header controls that don't apply mid-pick,
   and gives each selectable day an empty radio dot. The Back/Save bar is a
   flex sibling of .tracker-page-body inside #periodCalendarPage (itself a
   flex column) — no position:fixed needed, it just takes its natural height
   at the bottom while the body scrolls in the space above it. */
#periodCalendarPage.pcal-edit-active .collapsing-hero__legend,
#periodCalendarPage.pcal-edit-active .collapsing-hero__nav,
#periodCalendarPage.pcal-edit-active .collapsing-hero__action,
#periodCalendarPage.pcal-edit-active #periodTrackTile { display: none; }
#periodCalendarPage.pcal-edit-active .collapsing-hero__hero { pointer-events: none; }

.pcal-edit-active .journey-cal-cell.period-cal-cell--actual,
.pcal-edit-active .journey-cal-cell.period-cal-cell--predicted,
.pcal-edit-active .journey-cal-cell.period-cal-cell--follicular,
.pcal-edit-active .journey-cal-cell.period-cal-cell--luteal,
.pcal-edit-active .journey-cal-cell.period-cal-cell--ovulatory {
  background: rgba(255, 255, 255, 0.03);
  outline: none;
}
.pcal-edit-active .journey-cal-cell.period-cal-cell--actual .journey-cal-daynum,
.pcal-edit-active .journey-cal-cell.period-cal-cell--predicted .journey-cal-daynum,
.pcal-edit-active .journey-cal-cell.period-cal-cell--follicular .journey-cal-daynum,
.pcal-edit-active .journey-cal-cell.period-cal-cell--luteal .journey-cal-daynum,
.pcal-edit-active .journey-cal-cell.period-cal-cell--ovulatory .journey-cal-daynum {
  color: var(--text-faint);
}
.pcal-edit-active .journey-cal-cell.is-today { box-shadow: none; }

.pcal-edit-cell--disabled { opacity: 0.3; pointer-events: none; }
.pcal-edit-cell--selectable { cursor: pointer; }
.pcal-edit-radio {
  display: block;
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 1.5px solid var(--border-control);
  background: transparent;
  transition: background 0.15s, border-color 0.15s;
}
.journey-cal-cell--picked .pcal-edit-radio {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: inset 0 0 0 3px var(--bg);
}
.journey-cal-cell--picked .journey-cal-daynum { color: var(--primary) !important; font-weight: 700; }

.pcal-editbar {
  display: flex;
  gap: var(--space-3);
  flex-shrink: 0;
  padding: var(--space-4) var(--space-5) calc(var(--space-4) + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--border);
}
.pcal-editbar__btn {
  flex: 1;
  height: 48px;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
}
.pcal-editbar__btn--back {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border-control);
}
.pcal-editbar__btn--save {
  background: var(--primary-fill);
  color: var(--primary-ink);
}
.pcal-editbar__btn--save:disabled { opacity: 0.35; pointer-events: none; }

/* Tap-a-date phase tooltip (wirePcalTooltip). Absolutely placed inside .pcal,
   pointing down at the tapped cell; on today it carries a "Log period" CTA. */
.pcal { position: relative; }
.pcal-tip {
  position: absolute;
  z-index: 4;
  transform: translate(-50%, calc(-100% - 8px));
  min-width: 132px;
  max-width: 200px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
  text-align: left;
  pointer-events: auto;
}
.pcal-tip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 12px; height: 12px;
  transform: translateX(-50%) rotate(45deg);
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.pcal-tip__phase {
  display: block;
  font-size: var(--type-sm);
  font-weight: 700;
  color: var(--text);
}
.pcal-tip__desc {
  display: block;
  margin-top: 2px;
  font-size: var(--type-xs);
  color: var(--text-muted);
}
.pcal-tip__cta {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px 10px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--primary-fill);
  color: var(--primary-ink);
  font: inherit;
  font-size: var(--type-xs);
  font-weight: 700;
  cursor: pointer;
}
.pcal-tip[hidden] { display: none; }

.journey-legend {
  display: flex;
  justify-content: center;
  gap: var(--space-5);
  margin: 0 0 var(--space-6);
}
.journey-legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--type-xs);
  color: var(--text-faint);
}
.journey-legend-item .journey-cal-check { color: var(--primary); }
.journey-legend-item .journey-cal-dot { background: var(--primary); }

/* ---- Period tracker: collapsing header + sticky calendar head -------
   Two decoupled sticky zones inside .period-page (the .tracker-page-body
   scroll container). See HEADER-COLLAPSING-SPEC.md.
     1. .collapsing-hero__slim — always sticky at top:0, transparent until the
        hero scrolls past, then --collapsed fades in bg/border + the title.
        SHARED — collapsingHeroHtml()/wireCollapsingHero() (script.js) also
        drive the Health recommendations page's header with these same
        classes; nothing here is period-specific.
     2. .pcal-stickyhead — the running month name + the S·M·T·W row, pinned
        just under the slim bar; the month updates as you scroll
        (updateStickyMonth in wirePeriodHeader). Period-only.
   Collapse is toggled by one IntersectionObserver on .collapsing-hero__sentinel
   (wireCollapsingHero), no scroll math. */
/* --collapsing-hero-slim-h is declared per page-root (.period-page here,
   .recs-page below) since custom properties don't cross a shared class alone
   — same value both places, it's just the rendered height of
   .collapsing-hero__slim (safe-area + space-4 top pad + 40px button +
   space-2 bottom pad), needed by anything that pins its own sticky zone
   directly under the slim bar. */
.period-page {
  --collapsing-hero-slim-h: calc(env(safe-area-inset-top) + 68px);
}
.period-page .pcal-stickyhead {
  position: sticky;
  top: var(--collapsing-hero-slim-h);
  z-index: 2;
  background: var(--bg);
}
/* the shared weekday header is sticky at top:0 by default — inside the
   stickyhead wrapper it goes back to normal flow. */
.period-page .pcal .journey-cal-weekdays {
  position: static;
  top: auto;
}
.pcal-stickyhead__month {
  display: block;
  padding: 6px 2px 4px;
  font-size: var(--type-md);
  font-weight: 700;
  color: var(--text);
}
/* at rest (before any month has scrolled under the head) it's empty — collapse
   it so the inline month label isn't duplicated right above the weekday row. */
.pcal-stickyhead__month:empty { display: none; }
.period-page__content {
  /* top pad = the gap above the tile; it matches the tile's bottom margin
     below, so the tile has equal breathing room on both sides. */
  padding: var(--space-5) var(--space-5) var(--space-10);
}
/* The "Log your period" / "Edit period" tile above the calendar — one compact
   line, no chevron; icon matches the header's edit-calendar action button.
   Launches the chat flow (openPeriodChat). */
.period-track-tile {
  margin: 0 0 var(--space-5);
  align-items: center;
  min-height: 0;
  padding: var(--space-4) var(--space-5);
}
.period-track-tile .recs-tile__body { gap: 0; }
.period-track-tile .recs-tile__icon svg { width: 22px; height: 22px; }

.collapsing-hero__slim {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--collapsing-hero-slim-h);
  padding: calc(env(safe-area-inset-top) + var(--space-4)) var(--space-4) var(--space-2);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 220ms var(--ease-out, ease),
              border-color 220ms var(--ease-out, ease),
              box-shadow 220ms var(--ease-out, ease);
}
.collapsing-hero--collapsed .collapsing-hero__slim {
  background: var(--bg);
  border-bottom-color: var(--border);
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.18);
}
.collapsing-hero__nav,
.collapsing-hero__action {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  padding: 0;
}
.collapsing-hero__nav { color: var(--text-muted); }
.collapsing-hero__action {
  background: var(--icon-tile-bg);
  color: var(--primary);
}
.collapsing-hero__action svg { width: 20px; height: 20px; }
.collapsing-hero__slimtitle {
  grid-column: 2;
  text-align: center;
  font-size: var(--type-body);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 220ms var(--ease-out, ease),
              transform 220ms var(--ease-out, ease);
}
.collapsing-hero--collapsed .collapsing-hero__slimtitle {
  opacity: 1;
  transform: translateY(0);
}
.collapsing-hero__hero {
  /* bottom padding is 0 — the gap down to the tile is owned by
     .period-page__content's top padding, kept equal to the tile's bottom gap. */
  padding: var(--space-3) var(--space-5) 0;
}
.collapsing-hero__title {
  margin: 0;
  font-size: var(--type-xl);
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}
.collapsing-hero__subtitle {
  margin: var(--space-1) 0 0;
  font-size: var(--type-sm);
  color: var(--text-muted);
}
/* Single "Edit" entry point next to the logged-period subtitle — replaces
   the old toolbar icon + full-width "Edit period" tile (two ways to do the
   same thing). */
.pcal-edit-inline-btn {
  margin-left: var(--space-2);
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
}
.collapsing-hero__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  margin-top: var(--space-3);
}
.collapsing-hero__legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--type-xs);
  color: var(--text-faint);
}
.collapsing-hero__sentinel {
  display: block;
  height: 1px;
}

@media (prefers-reduced-motion: reduce) {
  .collapsing-hero__slim,
  .collapsing-hero__slimtitle { transition: opacity 120ms linear; }
  .collapsing-hero__slimtitle { transform: none; }
}

/* ---- Log-period sheet ------------------------------------------------- */
/* (the old in-body .period-log-btn pill was removed in v223 — the period
   header's edit-calendar action button is the single log/update entry point) */

/* Centred bottom-sheet body — same look & feel as the goal sheet
   (openGoalActiveSheet / .goal-active-sheet). Used by the log-period sheet. */
.csheet {
  padding: var(--space-2) var(--space-5) calc(env(safe-area-inset-bottom) + var(--space-6));
  text-align: center;
}
.csheet__label {
  margin: 0 0 var(--space-2);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.csheet__title {
  margin: 0 0 var(--space-3);
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
}
.csheet__note {
  margin: 0 0 var(--space-5);
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
}
.csheet__subhead {
  margin: var(--space-5) 0 var(--space-3);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.csheet__cta {
  width: 100%;
  min-height: 48px;
  margin-top: var(--space-5);
  border: 0;
  border-radius: var(--radius-full);
  background: var(--primary-fill);
  color: var(--primary-ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}
.csheet__cta:active { transform: translateY(1px); }

.period-pick__pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
}
.period-pick .period-pill { min-height: 44px; font-size: 15px; }
/* "Pick a date" IS a pill — the <input type=date> is visually hidden and only
   there so the pill's click handler can call showPicker(). */
.period-date-input {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  border: 0; opacity: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* "It's still going on" — centred checkbox row */
.period-still {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin: var(--space-4) 0 0;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.period-still__input,
.period-still input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.period-still__box {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 1.5px solid var(--border-control, var(--border));
  display: grid;
  place-items: center;
  color: var(--primary-ink);
  background: transparent;
  transition: background .12s ease, border-color .12s ease;
}
.period-still__box svg { width: 14px; height: 14px; opacity: 0; }
.period-still input:checked + .period-still__box {
  background: var(--primary-fill);
  border-color: var(--primary-fill);
}
.period-still input:checked + .period-still__box svg { opacity: 1; }
.period-still input:focus-visible + .period-still__box {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.period-end-q { margin-top: var(--space-2); }
.period-link {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-size: inherit;
  color: var(--primary);
  text-decoration: underline;
  cursor: pointer;
}

/* ---- Cycle phase energy line (under the goal on home) --------------- */

/* Home section divider — between the Family centre card and Learn about
   nutrition. */
.home-sep {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--space-5) 0;
}

/* Recs section — "Your health" heading, then the tiles. */
.tracker-section--recs {
  padding-top: var(--section-gap);
  /* one consistent gap between the recs tiles regardless of which are shown
     (protein / health / period) — the per-tile margin-top rules gave an
     uneven rhythm and left a big gap before a conditionally-shown tile. */
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.tracker-section--recs .recs-tile { margin-top: 0; }
/* the heading's own bottom margin would double up with the flex gap */
.tracker-section--recs > .tracker-section-title { margin-bottom: 0; }

/* ---- Profile: Subscription section -------------------------------- */
/* The status badge sits inline next to the "Subscription" heading (not on its
   own row under it); the note is a plain left-aligned line below. */
.profile-section-title--inline {
  justify-content: flex-start;
  gap: var(--space-3);
  /* "First 3 months free" is close to this row's width budget on the
     narrowest supported screens (~320px) — wrap to its own line there
     rather than overflow, instead of assuming the badge text stays short. */
  flex-wrap: wrap;
  row-gap: 4px;
}
.subs-status__badge {
  flex: none;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.subs-status__badge--active {
  border-color: var(--primary);
  color: var(--primary);
}
/* The explicit <hr> is the divider between Subscription and Settings — drop
   the section's own faint bottom border so they don't double up. */
.profile-section--subs { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.profile-subs-sep { margin: var(--space-6) 0; }

/* ---- Ephemeral toast (odriToast) --------------------------------- */
.odri-toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 88px);
  transform: translateX(-50%) translateY(8px);
  max-width: calc(100vw - 48px);
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--card-bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  z-index: 5000;
  transition: opacity .2s ease, transform .2s ease;
}
.odri-toast--show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .odri-toast { transition: opacity .2s ease; transform: translateX(-50%); }
  .odri-toast--show { transform: translateX(-50%); }
}

/* ============================================================
   APP SHELL — onboarding flow, "plan ready" panel, bottom nav,
   My Plan mount. Added with the logging-is-hero restructure.
   ============================================================ */
/* No bottom nav. The check-in home IS the app; the header logo goes home and the
   header avatar goes to Profile. Plan-setup + "Learn about nutrition" are
   launched as full views. */
#appCheckinBtn { display: none; }   /* header stays minimal: logo + avatar only */
#appBottomNav { display: none; }                /* removed; guard any stragglers */
/* ---- Full-screen overlays hide the app shell ---- */
body.lang-gate-active,
body.onboard-welcome-active,
body.onboard-chat-active,
body.log-chat-active,
body.health-chat-active,
body.period-chat-active,
body.consent-active,
body.disclaimer-page-active,
body.install-page-active,
body.signin-gate-active { overflow: hidden; }
body.lang-gate-active .app-header,
body.lang-gate-active .container,
body.lang-gate-active .viewing-banner,
body.lang-gate-active #checkinTabContent,
body.lang-gate-active #profileTabContent,
body.onboard-welcome-active .app-header,
body.onboard-welcome-active .container,
body.onboard-welcome-active .viewing-banner,
body.onboard-welcome-active #checkinTabContent,
body.onboard-welcome-active #profileTabContent,
body.onboard-chat-active .app-header,
body.onboard-chat-active .container,
body.onboard-chat-active .viewing-banner,
body.onboard-chat-active #checkinTabContent,
body.onboard-chat-active #profileTabContent,
body.log-chat-active .app-header,
body.log-chat-active .container,
body.log-chat-active .viewing-banner,
body.log-chat-active #checkinTabContent,
body.log-chat-active #profileTabContent,
body.health-chat-active .app-header,
body.health-chat-active .container,
body.health-chat-active .viewing-banner,
body.health-chat-active #checkinTabContent,
body.health-chat-active #profileTabContent,
body.period-chat-active .app-header,
body.period-chat-active .container,
body.period-chat-active .viewing-banner,
body.period-chat-active #checkinTabContent,
body.period-chat-active #profileTabContent,
body.consent-active .app-header,
body.consent-active .container,
body.consent-active .viewing-banner,
body.consent-active #checkinTabContent,
body.consent-active #profileTabContent,
body.disclaimer-page-active .app-header,
body.disclaimer-page-active .container,
body.disclaimer-page-active .viewing-banner,
body.disclaimer-page-active #checkinTabContent,
body.disclaimer-page-active #profileTabContent,
body.install-page-active .app-header,
body.install-page-active .container,
body.install-page-active .viewing-banner,
body.install-page-active #checkinTabContent,
body.install-page-active #profileTabContent,
body.signin-gate-active .app-header,
body.signin-gate-active .container,
body.signin-gate-active .viewing-banner,
body.signin-gate-active #checkinTabContent,
body.signin-gate-active #profileTabContent { display: none !important; }

.lang-gate {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: var(--bg);
}
.lang-gate[hidden] { display: none; }
.lang-gate__inner {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  text-align: center;
}
.lang-gate__mark {
  width: 40px;
  height: 40px;
  margin: 0 auto var(--space-6);
  opacity: 0.9;
}
/* Same view-transition-name as the welcome screen's mark (below) — the
   browser morphs size/position between the two automatically, so the logo
   reads as one continuous object growing into place, not two separate
   images cutting from one screen to the next (see dismissLangGate()). */
@media (prefers-reduced-motion: no-preference) {
  .lang-gate__mark,
.onboard-welcome__mark img {
    view-transition-name: odrifit-brand-mark;
  }
}
.lang-gate__title {
  margin: 0 0 var(--space-2);
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}
.lang-gate__sub {
  margin: 0 0 var(--space-7);
  font-size: 13px;
  color: var(--text-muted);
}
.lang-gate__pills {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-7);
}
.lang-gate__pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.lang-gate__pill.is-active {
  border-color: var(--primary);
  background: var(--surface-teal);
}
.lang-gate__pill:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  font-weight: 600;
}
.lang-gate__soon {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-faint);
}
/* =========================================================
   ONBOARDING STEP 2 — welcome (#onboardWelcome)
   ========================================================= */
/* Shared vertical rhythm with #planSetupDone (.onboarding-done) below: the
   whole content block is vertically centered in the viewport (not anchored
   near the top), same illustration-to-title gap on both screens, and the CTA
   sits directly after the body text (not separately pinned to the bottom) —
   centering the block is what keeps the button's position consistent between
   screens of similar shape, whatever their exact content height. */
.onboard-welcome {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(env(safe-area-inset-top) + var(--space-6)) var(--space-6)
           calc(env(safe-area-inset-bottom) + var(--space-6));
  background: var(--bg);
}
.onboard-welcome[hidden] { display: none; }
.onboard-welcome__inner {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.onboard-welcome__mark {
  position: relative;
  width: 140px;
  height: 140px;
  margin-bottom: var(--space-10);
  display: grid;
  place-items: center;
  animation: onboard-mark-in 620ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.onboard-welcome__mark img {
  position: relative;
  z-index: 1;
  width: 108px;
  height: 108px;
  /* motion: .ani-pulse class in the markup (see icon-animator block) */
}
/* Toned down deliberately — this is a backdrop, not the focal point; the
   rotating logo itself (.ani-spin) should read as the main motion here. */
.onboard-welcome__mark::before {
  content: "";
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    rgba(var(--primary-rgb), 0.55), transparent 40%, transparent 60%, rgba(var(--primary-rgb), 0.55));
  filter: blur(26px);
  opacity: 0.25;
  animation: onboard-mark-glow 6s linear infinite;
}
.onboard-welcome__title {
  margin: 0 0 var(--space-3);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.onboard-welcome__sub {
  margin: 0 0 var(--space-8);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-muted);
}
.onboard-welcome__cta {
  min-height: 52px;
  padding: 0 var(--space-8);
  border: 0;
  border-radius: var(--radius-full);
  background: var(--primary-fill);
  color: var(--primary-ink);
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}
.onboard-welcome__cta:active { transform: translateY(1px); }
.onboard-welcome__notnow {
  margin-top: var(--space-4);
  background: none;
  border: 0;
  padding: var(--space-2);
  color: var(--text-faint);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

@keyframes onboard-mark-in {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes onboard-mark-glow {
  to { transform: rotate(360deg); }
}

/* =========================================================
   icon-animator — micro-animations for large icons
   (see .claude/skills/icon-animator). Style in use: pulse.
   Looping icons are paused while off-screen by initIconAnim() in script.js
   (toggles .ani-paused), and capped at a calm amplitude.
   ========================================================= */
@media (prefers-reduced-motion: no-preference) {
  .ani-pulse { animation: ani-pulse 2.6s ease-in-out infinite; will-change: transform; }
  /* Slow, continuous rotation — used on the language-gate and welcome-screen
     brand marks so the same mark keeps turning across the screen transition. */
.ani-spin { animation: ani-spin 14s linear infinite; will-change: transform; }
}
@keyframes ani-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}
@keyframes ani-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
/* off-screen pause (toggled by refreshIconAnim). Also covers the home metric
   ring icons, which run their own bespoke curl/drip/walk loops. */
.ani-paused,
.ani-paused * { animation-play-state: paused !important; }

/* =========================================================
   ONBOARDING STEP 3 — conversational Q&A (#onboardChat, Figma 240:2600)
   ========================================================= */
.onboard-chat {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.onboard-chat[hidden] { display: none; }

/* One shared column: progress bar, message log and footer are all the same width
   and share the same 24px horizontal inset, so every element lines up. The log
   spans the full width (scrollbar hugs the edge) — its 24px padding keeps the
   text aligned with the bar and the pills. */
.onboard-chat__progress,
.onboard-chat__log,
.onboard-chat__footer {
  width: 100%;
  max-width: calc(412px + 2 * var(--space-6));
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

.onboard-chat__progress {
  flex-shrink: 0;
  margin-top: calc(env(safe-area-inset-top) + var(--space-7));
}
/* Row 1 of every chat-based flow's header (onboarding / health check-in /
   add-family-member): back-or-spacer, centered title, close-or-spacer — same
   44px/1fr/44px column math as .tracker-full-page-header so the title lands
   dead center whichever side carries a button. This row is already pinned in
   place by its parent's flex layout (a flex-shrink:0 sibling of the scrolling
   log, never inside it), so no position:sticky is needed here. */
.chat-page-header {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: var(--space-3);
}
.chat-page-header__title {
  grid-column: 2;
  margin: 0;
  font-size: var(--type-md);
  font-weight: var(--weight-bold);
  color: var(--text);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-page-header__spacer { width: 44px; height: 44px; }
/* Row 2 — the progress bar, now full width on its own line under the title
   instead of squeezed beside the nav button. */
.chat-page-header__progress { margin-top: var(--space-4); }
.onboard-chat__progress-track {
  display: flex;
  width: 100%;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--surface-teal);
  overflow: hidden;
}
.onboard-chat__progress-fill {
  width: 0%;
  background: var(--primary);
  border-radius: var(--radius-full);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.onboard-chat__log {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  /* Pins messages to the bottom, right above the input, when there aren't
     enough of them yet to fill the log — so the very first question lands
     next to the pills/input like a real chat thread instead of floating at
     the top of an empty panel. Once messages overflow, normal top-to-bottom
     scroll order takes over automatically. */
  justify-content: flex-end;
  gap: var(--space-6);
  padding-top: var(--space-8);
  padding-bottom: var(--space-6);
}

.onboard-chat__msg {
  max-width: 88%;
  font-size: 16px;
  line-height: 1.5;
  animation: onboard-msg-in 260ms ease both;
}
.onboard-chat__msg--bot {
  align-self: flex-start;
  color: var(--text);
  white-space: pre-line;
}
.onboard-chat__msg--bot strong { color: var(--primary); font-weight: 700; }
/* The question currently awaiting an answer — bold sets it apart from the
   rest of the transcript. Cleared the moment the user actually answers. */
.onboard-chat__msg--active { font-weight: 700; }
/* Weight-loss guardrail nudge (evaluateGoalSafety's "aggressive" tier) — same
   caution red already used for "Not recommended" goal-safety badges elsewhere. */
.onboard-chat__msg--caution {
  color: var(--error);
  font-weight: 600;
}
.onboard-chat__msg--user {
  align-self: flex-end;
  background: var(--onboard-user-bubble);
  color: var(--text);
  padding: var(--space-4) var(--space-6);
  border-radius: 24px;
}
/* A "reveal" moment (the BMI step) — centered and tiled, not a left-aligned
   bubble, so it stands out as its own small card rather than another line
   of chat. */
.onboard-chat__msg--info {
  align-self: stretch;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  text-align: left;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}
.onboard-chat__msg-info-icon {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  /* Rounded-square treatment, same as .recs-tile__icon (Health &
     recommendations etc.) — was a full circle, which read as a different
     icon language from the rest of the app's tile icons. */
  border-radius: 12px;
  background: var(--icon-tile-bg);
  color: var(--primary);
}
.onboard-chat__msg-info-icon .mi { font-size: 24px; }
.onboard-chat__msg-info-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
}
/* Answered exchanges recede — smaller and more muted — once a new question
   is on the table, so the active one is what visually pops. */
.onboard-chat__msg--past {
  font-size: 14px;
  color: var(--text-muted);
}
.onboard-chat__msg--past.onboard-chat__msg--bot strong { color: var(--text-faint); }
@keyframes onboard-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.onboard-chat__typing {
  align-self: flex-start;
  display: inline-flex;
  gap: 5px;
  padding: 14px var(--space-5);
  background: var(--onboard-user-bubble);
  border-radius: 24px;
}
.onboard-chat__typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: onboard-typing 1.2s ease-in-out infinite;
}
.onboard-chat__typing span:nth-child(2) { animation-delay: 0.15s; }
.onboard-chat__typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes onboard-typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30%           { opacity: 1; transform: translateY(-3px); }
}

/* Quiet recap of the concerns just logged — subtle chips, not another loud
   bot bubble, so the health-chat completion doesn't feel like a shout. */
.hc-chat-summary {
  align-self: flex-start;
  max-width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.hc-chat-summary__chip {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--onboard-user-bubble);
  color: var(--text-muted);
  font-size: var(--type-xs);
  font-weight: 600;
}
.hc-chat-summary__chip--empty { font-style: italic; }

.onboard-chat__footer {
  flex-shrink: 0;
  padding-top: var(--space-3);
  padding-bottom: calc(env(safe-area-inset-bottom) + var(--space-3));
  background: var(--bg);
}
.onboard-chat__quick {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.onboard-chat__quick[hidden] { display: none; }
.onboard-chat__pill {
  min-height: 48px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-full);
  border: 1px solid var(--primary);
  background: var(--bg);
  color: var(--primary);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
}
/* Secondary quick-reply pills ("Not now", "Skip", "Someone else"...) used to
   render muted/grey — read as disabled. Founder wants one single treatment
   for every quick-reply pill, matching whatever "Yes" uses, so --secondary
   no longer overrides the base teal border/text. */
.onboard-chat__pill:active { transform: translateY(1px); }

/* Rich quick-reply pill — a tile's worth of info (main label + a sub line +
   a safety badge) rendered as a chat pill. Used by the change-goal chat's
   month / kg steps so the tier metadata from the old bottom sheets survives. */
.onboard-chat__pill--rich {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-height: 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  text-align: left;
}
.onboard-chat__pill-main { font-size: 15px; font-weight: 700; color: var(--primary); }
.onboard-chat__pill-sub { font-size: 12px; font-weight: 600; color: var(--text-muted); letter-spacing: 0; }
.onboard-chat__pill-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}
.onboard-chat__pill-badge--recommended { background: rgba(var(--primary-rgb), 0.14); color: var(--primary); }
.onboard-chat__pill-badge--achievable  { background: rgba(255, 255, 255, 0.08); color: var(--text-muted); }
.onboard-chat__pill-badge--aggressive  { background: rgba(255, 90, 77, 0.14); color: var(--error); }

/* "Your active goal" bottom sheet — one line of context + one action. */
.goal-active-sheet {
  padding: var(--space-2) var(--space-5) calc(env(safe-area-inset-bottom) + var(--space-6));
  text-align: center;
}
.goal-active-sheet__label {
  margin: 0 0 var(--space-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: normal;
  color: var(--text-muted);
}
.goal-active-sheet__goal {
  margin: 0 0 var(--space-3);
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
}
.goal-active-sheet__hint {
  margin: 0 0 var(--space-6);
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
}
/* Full-screen "active goal" page (was a bottom sheet) — primary/secondary
   CTAs reuse .onboarding-done__cta, just stretched full width like the
   all-concerns page does for the same pattern. */
.goal-active-page .onboarding-done__cta {
  width: 100%;
  margin: var(--space-3) 0 0;
}
/* Manage-family page's "Invite {name} to auto sync data" — same reused
   .onboarding-done__cta pattern, stretched full width. */
.fam-manage__panel .onboarding-done__cta { width: 100%; text-align: center; }
/* Weight history bar chart tile — same visual language as the onboarding
   BMI reveal (.onboard-chat__msg--info): full-width card, real icon tile
   above the content. Sits on the active-goal page (was previously above
   the goal chat's "Log a new weight" question — moved here so it's
   visible without starting that flow). See weightChartTileHtml(), styled
   after the Odrifit Design System's weight bar-chart reference
   (Figma node 402:138). */
.weight-chart-tile {
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin: var(--space-4) 0;
  text-align: left;
}
.weight-chart-tile__icon {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--icon-tile-bg);
  color: var(--primary);
}
.weight-chart-tile__icon svg { width: 24px; height: 24px; }
.weight-chart-tile__body { width: 100%; }
.weight-chart-tile__label { margin: 0; font-size: 13px; color: var(--text-muted); }
.weight-chart-tile__headline {
  margin: 2px 0 var(--space-5);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}
.weight-chart__track {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  width: 100%;
  overflow-x: auto;
}
.weight-chart__col {
  flex: 1 0 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}
.weight-chart__col-bars {
  /* 72px max bar height + headroom above it for the current-value chip
     (was the same 72px as the tallest bar, with the chip positioned
     relative to the whole column — clipped the chip's top whenever the
     current bar was near max height, since there was no room reserved
     above it). */
  position: relative;
  height: 108px;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.weight-chart__bar {
  width: 8px;
  min-height: 4px;
  border-radius: 4px;
  background: var(--primary);
  opacity: 0.55;
}
.weight-chart__bar--current { background: var(--error); opacity: 1; }
.weight-chart__dot {
  width: 6px;
  height: 6px;
  margin-bottom: 3px;
  border-radius: 50%;
  background: var(--text-faint);
}
.weight-chart__col-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}
.weight-chart__chip {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--surface-teal, #0a3d37);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

/* ── Goal-completion popup — a small centered celebration (distinct from
   the full-screen water/steps hero's own "top notch"/"Great going" copy,
   which only shows inside that tracker page). z-index above
   .tracker-full-page (2000) since it can appear the instant a water/steps
   page starts closing, while that page is still mid slide-out in the DOM.
   See maybeShowGoalCompletePopup(). ── */
.goal-complete-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.goal-complete-modal--open { opacity: 1; pointer-events: auto; }
.goal-complete-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}
.goal-complete-card {
  position: relative;
  width: 100%;
  max-width: 320px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-7) var(--space-6) var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transform: scale(0.92);
  transition: transform 0.2s ease;
}
.goal-complete-modal--open .goal-complete-card { transform: scale(1); }
.goal-complete-card__check {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  background: var(--icon-tile-bg);
  margin-bottom: var(--space-5);
  animation: done-pop 480ms ease-out both;
}
.goal-complete-card__title {
  margin: 0 0 var(--space-6);
  font-size: var(--type-lg);
  font-weight: 800;
  color: var(--text);
  line-height: 1.35;
}
.goal-complete-card__cta {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: var(--radius-full);
  background: var(--primary-fill);
  color: var(--primary-ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}
.goal-complete-card__cta:active { transform: translateY(1px); }
@media (prefers-reduced-motion: reduce) {
  .goal-complete-card__check { animation: none; }
}

.onboard-chat__inputbar {
  display: flex;
  align-items: center;
  /* Chips hug the right edge, next to the send button, instead of a wide
     pill spanning the row. */
  justify-content: flex-end;
  gap: var(--space-3);
  /* Explicit (not min-height) so the row has a truly definite height —
     .onboard-chat__send's align-self:stretch + aspect-ratio:1 only resolves
     into a real circle when the flex line's cross size is definite; a
     content-derived or min-height-only row leaves the button's width at its
     content size (the arrow glyph), squishing it into an oval. */
  height: 52px;
}
.onboard-chat__inputbar[hidden] { display: none; }
/* Collapsed but NOT display:none / [hidden] — the field inside stays focused
   (see hideOnboardInputChrome) so the on-screen keyboard doesn't close for a
   pill-only question and reopen for the next typed one. */
.onboard-chat__inputbar--invisible {
  height: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* unit switch (same link style as the BMI checker's "Use cm / Use lbs") now
   sits inline in the input row itself instead of a row above it. Compact
   "/cm" / "/lbs" copy in highlight color here — no underline, reads as a
   quick tappable shortcut rather than a text link. */
.onboard-chat__unitlink {
  flex-shrink: 0;
  font-size: var(--type-xs);
  color: var(--primary);
  text-decoration: none;
}
.onboard-chat__unitlink[hidden] { display: none; }

/* AM/PM toggle chips, shown beside the hour field for a "time12" chat step —
   merges what used to be two separate questions (hour, then AM/PM) into one:
   an empty number field with the AM/PM filter right beside it. */
.onboard-chat__ampm { display: flex; gap: 6px; flex-shrink: 0; }
.onboard-chat__ampm[hidden] { display: none; }
.onboard-chat__ampm-btn {
  flex: none;
  padding: 0 14px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  background: none;
  color: var(--text-muted);
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.onboard-chat__ampm-btn--active {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
}
@media (hover: hover) {
  .onboard-chat__unitlink:hover { color: var(--primary); opacity: 0.85; }
}

/* number/text entry reuses the BMI checker's .input-pill component */
.onboard-chat__field {
  flex: 1;
  min-width: 0;
  /* Grow toward the row, not off the right edge (the chip is right-aligned). */
  transform-origin: right center;
}
.onboard-chat__field[hidden] { display: none; }
.onboard-chat__field .onboard-chat__input {
  flex: 1;
  min-width: 0;
  width: auto;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: var(--type-base);
  font-weight: 500;
  -moz-appearance: textfield;
}
.onboard-chat__field .onboard-chat__input::-webkit-outer-spin-button,
.onboard-chat__field .onboard-chat__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.onboard-chat__field .onboard-chat__input::placeholder { color: var(--text-faint); font-weight: 400; }

/* Number steps: the chip shrink-wraps to a stable few-digit width (JS sets a
   fixed ch width per step) instead of a wide pill filling the row. Text is
   left-aligned — digits stay put and the caret moves left-to-right as you
   type, the standard behaviour. Text steps + the ft/in dual layout keep the
   full-width field. */
.onboard-chat__inputbar--tight .onboard-chat__field { flex: 0 0 auto; }
.onboard-chat__inputbar--tight .onboard-chat__field .onboard-chat__input {
  flex: 0 0 auto;
  width: auto;
  text-align: left;
}

/* Ft/in height step: two number pills + the /cm switch + the send button all
   need to fit one row on a narrow phone — the ghost "0" placeholder was
   getting clipped because the pills' full base .input-pill padding/gap left
   too little room. Scoped to this mode only (toggled in setOnboardInput())
   so the roomier single-field layout everywhere else is untouched. */
.onboard-chat__inputbar--dual { gap: var(--space-2); }
.onboard-chat__inputbar--dual .onboard-chat__field {
  padding-left: var(--space-4);
  gap: var(--space-2);
}
.onboard-chat__inputbar--dual .onboard-chat__field .unit {
  padding-left: var(--space-3);
  padding-right: var(--space-3);
}
.onboard-chat__inputbar--dual .onboard-chat__unitlink { margin-inline: -2px; }

.onboard-chat__inputbar--shake { animation: onboard-input-shake 360ms ease-in-out; }
@keyframes onboard-input-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
@media (prefers-reduced-motion: reduce) {
  .onboard-chat__inputbar--shake { animation: none; }
}
.onboard-chat__send {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  /* Stretch to the row's height (set by the taller input pill), then let
     aspect-ratio grow the width to match — always a true circle, whatever
     the pill's actual rendered height ends up being. */
  align-self: stretch;
  width: auto;
  height: auto;
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: var(--primary-fill);
  color: var(--primary-ink);
  cursor: pointer;
}
.onboard-chat__send:disabled { opacity: 0.4; cursor: default; }

@media (prefers-reduced-motion: reduce) {
  .onboard-welcome__mark,
.onboard-welcome__mark img,
.onboard-welcome__mark::before { animation: none; }
  .onboard-welcome__mark { opacity: 1; }
  .onboard-welcome__mark::before { opacity: 0.25; }
  .onboard-chat__msg,
.onboard-chat__typing span { animation: none; }
  .onboard-chat__progress-fill { transition: none; }
}

/* =========================================================
   FIRST-RUN EXPERIENCE — one combined elevated card (live-style preview +
   teaching copy, joined as one surface) per tile, floating above a dimmed,
   blurred backdrop. Replaces an earlier spotlight-cutout version that tried
   to cut a literal hole over the real tile — fragile to get pixel-perfect
   (had to measure the target's rect after its scroll-into-view settled,
   which broke across steps) and, per founder feedback, not actually the
   right idea: this reads better as one elevated teaching surface than a
   hole punched in the dimming layer.
   ========================================================= */
/* Pure blur/dim backdrop — no children. The spotlight effect itself needs
   no rect math: the real target tile is simply promoted above this layer
   via z-index (.fre-target-elevated), so it paints on top and never gets
   blurred, while everything else sits below the backdrop-filter. */
/* The teaching drawer sits in normal document flow (it moves to wherever
   the current tile scrolls to), so it can land right at the bottom of the
   viewport on some steps — hide the fixed "Log with Odrifit" bar for the
   tour's duration so its glow can't bleed through the blur behind it. */
body.fre-active .tracker-ai-bar { display: none; }
/* Light frosted haze, not a dark scrim — a dark wash over an already-dark
   theme was crushing the blurred content behind it to near-black, so there
   was no way to tell where on the page the elevated tile actually sat
   relative to everything else. A light translucent layer keeps the blurred
   shapes/positions of the rest of the UI legible while still reading as
   clearly de-emphasized next to the crisp elevated tile. */
.fre-overlay {
  position: fixed;
  inset: 0;
  z-index: 2400; /* above everything else, including the family activity viewer (2300) */
  background: rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.fre-overlay[hidden] { display: none; }
/* Applied to the real, live tile for the current step (see freTargetEl()) —
   lifts it above the blurred backdrop in place, in its natural scroll
   position, instead of showing a separate mocked-up copy of it. Locked from
   taps so the tour can't be exited by accidentally triggering the tile's
   real action. A teal frame (continuing onto .fre-teach below) is what now
   marks it as "the elevated one", since the lighter overlay alone gives
   less contrast than the old dark scrim did. */
.fre-target-elevated {
  position: relative;
  z-index: 2401;
  pointer-events: none;
  /* One flat surface fused with .fre-teach below: same explicit bg (the
     tile's own could be a streak/sync variant), a 2px teal frame on the
     top + sides only, and NO box-shadow. The old shadow stack cast a
     0 20px 50px drop shadow straight down onto .fre-teach and a 0 0 0 1px
     ring along the touching edge — that was the "line + shadow in the
     middle". The teal frame + the blur on everything else is enough to
     mark this as the elevated tile. */
  background: var(--card-bg) !important;
  /* Full frame incl. the bottom edge, so the elevated tile is always a
     COMPLETE card on its own. The bottom edge is only dropped (below) while
     a visible .fre-teach is fused directly underneath — this is what stops
     the "card cut in half" frame during a step swap, when the drawer has
     been detached and the tile would otherwise show a borderless, square
     bottom for the length of the scroll. */
  border: 2px solid var(--primary) !important;
  box-shadow: none !important;
  /* No transform: scale() — it grew the tile from its centre while
     .fre-teach (fused underneath, unscaled) stayed put, splitting their
     shared edge. fre-lift-in moves both by the same translateY instead.
     Fades in on the same 260ms curve as the drawer so the two halves
     always appear together, never one before the other. */
  animation: fre-lift-in 260ms ease-out both, fre-teach-fade 260ms ease-out both;
}
/* Fuse with the drawer only when one is actually attached and visible. */
.fre-target-elevated:has(+ .fre-teach:not([hidden])) {
  border-bottom-color: transparent !important;
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}
/* Whole fused card leaves as one unit on a step swap (drawer + tile). */
.fre-target-elevated--leaving {
  animation: none !important;
  opacity: 0;
  transition: opacity 140ms ease-in;
}
@keyframes fre-lift-in {
  from { transform: translateY(6px); }
  to   { transform: translateY(0); }
}
/* During the tour there's nothing to log yet and no journey to look back
   on, so the card's own hint line + "View your journey" row are dead
   weight under the teaching copy — hide them for exactly as long as this
   tile is the elevated one (reverts automatically when the class comes
   off, no JS needed). */
.fre-target-elevated .tracker-card-journey {
  display: none !important;
}
/* The teaching copy — physically moved via insertAdjacentElement to sit
   right after whichever tile is the current step's target, so it's a true
   extension of that tile's surface rather than a floating card elsewhere
   on screen. Shares the tile's z-index so it also clears the blur. Its
   border continues the elevated tile's frame into one unbroken outline
   around the whole fused card, with the SAME background and no internal
   divider — reads as one continuous card, not two stacked pieces. */
.fre-teach {
  position: relative;
  z-index: 2401;
  padding: var(--space-4) var(--space-5) var(--space-5);
  /* Continues the elevated tile's surface — identical bg, the teal frame
     carried onto the bottom + sides, no top border and no box-shadow, so
     the two halves read as one seamless card with nothing in the middle. */
  background: var(--card-bg);
  border: 2px solid var(--primary);
  border-top: none;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  box-shadow: none;
  /* Same translateY keyframe as .fre-target-elevated (fre-lift-in), plus its
     own opacity fade layered on top — sharing the exact transform keeps the
     two pieces' touching border in lockstep through the whole animation. */
  animation: fre-lift-in 260ms ease-out both, fre-teach-fade 260ms ease-out both;
}
/* .fre-teach sits right after the elevated tile in the DOM, but its parent
   layout adds space there two different ways depending on the tile type:
   #trackerCards is a flex column with a `gap`, which a plain negative
   margin has to fully cancel or the tour shows a visible gap between the
   tile and the drawer; .recs-tile rows use per-element margin-top instead
   (no parent gap), so the drawer only needs to close its own border seam.
   Both actually use the same --space-4 (20px) — #trackerCards' own `gap`
   and .recs-tile's own margin-top match exactly, so one value cancels
   both. (Previously read --space-3/12px, 8px short of the real 20px gap —
   left a visible seam that the blur bug above was masking.) */
.fre-teach { margin-top: calc(-1 * var(--space-4)); }
.fre-teach--tile { margin-top: -2px; }
/* The health-concerns tile uses the smaller --radius-lg tile radius, not
   the bigger metric-card one — match whichever tile is current. */
.fre-teach--tile { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.fre-teach[hidden] { display: none; }
@keyframes fre-teach-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
/* Brief fade-out applied to the drawer just before each step swap (see
   showFREStep) so the outgoing card and the incoming one easing to the
   fixed anchor line don't overlap into one abrupt hop. Needs `animation:
   none` to get out from under fre-teach-fade's `both` fill. */
.fre-teach--leaving {
  animation: none !important;
  opacity: 0;
  transition: opacity 140ms ease-in;
}
/* Scroll runway while the tour runs: every target tile — the first one
   near the top of the list, the last one near the bottom — needs enough
   page below it to rise to the fixed anchor line (FRE_ANCHOR_RATIO, ~20vh).
   Reverts the instant body.fre-active clears (before endFRE's scrollTo). */
body.fre-active #checkinTabContent { padding-bottom: 85vh; }
/* One concise line — replaces the old bold title + muted subtitle pair
   (the tile above already names the metric, so a separate heading just
   repeated it). */
.fre-teach__line {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  margin: 0 0 var(--space-4);
}
.fre-teach__footer { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.fre-teach__dots { display: flex; gap: 6px; }
.fre-teach__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border); }
.fre-teach__dot--active { background: var(--primary); width: 16px; border-radius: var(--radius-full); }
.fre-teach__actions { display: flex; align-items: center; gap: var(--space-4); }
.fre-teach__skip {
  background: none; border: 0;
  color: var(--text-faint);
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.fre-teach__next {
  background: var(--primary-fill); color: var(--primary-ink);
  border: 0; border-radius: var(--radius-full);
  padding: var(--space-2) var(--space-5);
  font-family: inherit; font-size: 13px; font-weight: 800;
  cursor: pointer;
}
@media (prefers-reduced-motion: reduce) {
  .fre-teach { animation: none; }
  .fre-target-elevated { animation: none; }
}

/* =========================================================
   LOG WITH ODRIFIT — mini chat canvas (pick food / walk / water)
   ========================================================= */
.log-chat {
  position: fixed;
  inset: 0;
  z-index: 2000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: var(--onboard-bg);
}
.log-chat[hidden] { display: none; }
.log-chat::before {                       /* ambient teal glow, same idea as the done screen */
  content: "";
  position: absolute;
  inset: -40%;
  z-index: 0;
  background: conic-gradient(from 0deg,
    rgba(var(--primary-rgb), 0.20), transparent 30%,
    rgba(var(--primary-rgb), 0.12) 55%, transparent 78%,
    rgba(var(--primary-rgb), 0.20));
  filter: blur(90px);
  opacity: 0.45;
  animation: done-aurora 24s linear infinite;
  pointer-events: none;
}
.log-chat__close {
  position: absolute;
  top: calc(env(safe-area-inset-top) + var(--space-5));
  right: var(--space-5);
  z-index: 2;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  cursor: pointer;
}
.log-chat__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  max-height: 100%;
  overflow-y: auto;
  /* Top padding has to clear the mark's own glow halo (::after, inset:-10px
     + blur(14px)) since this container clips overflow — 6px wasn't enough
     and cropped the gradient at the very top of the screen. */
  padding: 36px 14px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: done-rise 420ms ease-out both;
}
.log-chat__mark {
  position: relative;
  width: 68px; height: 68px;
  margin-bottom: var(--space-5);
  animation: done-pop 460ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.log-chat__mark img {
  width: 100%; height: 100%;
  /* motion: .ani-spin class in the markup — same slow continuous rotation
     as the onboarding welcome-screen mark (see .onboard-welcome__mark) */
}
.log-chat__mark::after {                 /* rotating gradient halo, same treatment
                                             as .onboard-welcome__mark::before */
  content: "";
  position: absolute;
  inset: -10px;
  z-index: -1;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    rgba(var(--primary-rgb), 0.55), transparent 40%, transparent 60%, rgba(var(--primary-rgb), 0.55));
  filter: blur(14px);
  opacity: 0.25;
  animation: onboard-mark-glow 6s linear infinite;
}

.log-chat__msg {
  margin: 0 0 var(--space-6);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
}
.log-chat__opts {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
}
.log-chat__opt {
  display: flex;
  align-items: center;   /* single-line subtitle now — no need to top-align */
  gap: var(--space-3);
  width: 100%;
  min-height: 64px;
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid transparent;
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  box-shadow: inset 0 0 0 1px var(--border);
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
  /* sequential "pick one" stroke prompt — each tile lights up in turn, softly */
  animation: opt-hint 5s ease-in-out infinite;
}
.log-chat__opt:nth-child(1) { animation-delay: 0s; }
.log-chat__opt:nth-child(2) { animation-delay: 1s; }
.log-chat__opt:nth-child(3) { animation-delay: 2s; }
.log-chat__opt:nth-child(4) { animation-delay: 3s; }
.log-chat__opt:nth-child(5) { animation-delay: 4s; }
@keyframes opt-hint {
  0%, 100% { border-color: transparent; box-shadow: inset 0 0 0 1px var(--border); }
  4%       { border-color: rgba(var(--primary-rgb), 0.45); box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), 0.4), 0 0 10px rgba(var(--primary-rgb), 0.12); }
  20%      { border-color: rgba(var(--primary-rgb), 0.45); box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), 0.4), 0 0 10px rgba(var(--primary-rgb), 0.12); }
  26%      { border-color: transparent; box-shadow: inset 0 0 0 1px var(--border); }
}
.log-chat__opt:hover,
.log-chat__opt:focus-visible {
  animation: none;
  border-color: rgba(var(--primary-rgb), 0.5);
  box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), 0.45), 0 0 10px rgba(var(--primary-rgb), 0.10);
}
.log-chat__opt:active { transform: scale(0.99); }
.log-chat__opt-icon {
  flex: none;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--icon-tile-bg);
  color: var(--primary);
}
.log-chat__opt-icon .mi { font-size: 22px; }
.log-chat__opt-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.log-chat__opt-text strong { font-size: 16px; font-weight: 800; }
.log-chat__opt-text small {
  font-size: 12.5px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

@media (prefers-reduced-motion: reduce) {
  .log-chat::before,
.log-chat__inner,
.log-chat__mark,
.log-chat__mark img,
.log-chat__mark::after,
.log-chat__opt { animation: none; }
  .log-chat::before { opacity: 0.25; }
  .log-chat__mark::after { opacity: 0.25; }
}

/* Health/family/onboarding chat headers reuse .onboard-chat styling — the
   nav button itself (back or close). */
.health-chat__back {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  cursor: pointer;
}

/* ---- Plan-setup flow (the .container: hero + 2-step wizard) ---- */
body.plan-setup-active .container .newsletter-card,
body.plan-setup-active .container .footer,
body.plan-setup-active #scrollToPlanBtn,
body.plan-setup-active #saveWeightPlanBtn,
body.plan-setup-active #saveProteinPlanBtn,
body.plan-setup-active #openShareModal { display: none; }

/* the confirmation panel leads once setup completes */
body.plan-setup-done .hero,
body.plan-setup-done .home-wizard { display: none; }

/* Same fixed top-left slot as .app-back — kept as its own class so the
   plan-setup-active / -done visibility toggles still drive it. */
.plan-setup-back {
  display: none;
  position: fixed;
  top: calc(env(safe-area-inset-top) + var(--space-4));
  left: var(--space-4);
  z-index: 6;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
}
body.plan-setup-active .plan-setup-back { display: grid; }
body.plan-setup-done .plan-setup-back { display: none; }
.plan-setup-back:active { transform: translateY(1px); }
.plan-setup-back svg { width: 24px; height: 24px; stroke: currentColor; }
.plan-setup-back > span { display: none; }

/* ---- "Your plan is ready" confirmation panel (#planSetupDone) ---- */
/* "Your plan is ready" — a clean full-screen moment: no app header, no footer
   disclaimer, just the centred content over a slow ambient teal aurora. */
/* Shares its vertical rhythm with #onboardWelcome (.onboard-welcome) above:
   the block is vertically centered, same illustration-to-title gap, and the
   CTA sits directly after the body text, same as the welcome screen. */
.onboarding-done {
  position: fixed;
  inset: 0;
  z-index: 2000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: calc(env(safe-area-inset-top) + 14px) var(--space-6)
           calc(env(safe-area-inset-bottom) + 14px);
  background: var(--bg);
  text-align: left;
}
/* No ambient glow here (unlike .log-chat, which keeps its own) — every
   onboarding screen (lang gate, welcome, chat, sign-in gate, this one)
   deliberately shares the same flat --onboard-bg so the sequence reads as
   one consistent surface, not a shifting background from screen to screen. */
.onboarding-done > * { position: relative; z-index: 1; }

/* Static, no pop/breathe/sonar-ring animation — same neutral-tile-plus-
   teal-line-icon treatment used everywhere else in the app now (recs
   tiles, plan-summary metrics, the header avatar, etc). */
.onboarding-done__check {
  position: relative;
  width: 48px; height: 48px;
  flex-shrink: 0;
  margin: 0 0 var(--space-8);
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--primary);
  background: var(--icon-tile-bg);
}
/* Was a shared view-transition badge morphing #planSetupDone's checkmark
   into #planSummaryPage's flag; those are one screen now (v175) so nothing
   to morph, but the name is harmless and the badge still uses it. */
.plan-flow-check { view-transition-name: odrifit-plan-check; }

.onboarding-done__tick,
.onboarding-done__badge-icon { width: 24px; height: 24px; }
.onboarding-done__tick polyline {                 /* fully drawn, static */
  stroke-dasharray: 24;
  stroke-dashoffset: 0;
}

.onboarding-done__title { font-size: var(--type-lg); font-weight: 800; margin: 0 0 8px; color: var(--text); }
.onboarding-done__text { font-size: 13px; line-height: 1.4; color: var(--text-muted); margin: 0 0 24px; max-width: 320px; }

/* ---- "View all" full input recap (#healthDataAllPage) — reached from the
   plan-summary "View all" pill. A quiet label/value table on the same
   full-screen onboarding surface. ---- */
/* Can run long (up to ~12 rows) — scroll instead of clipping (the base
   .onboarding-done is overflow:hidden + vertically centred), and start
   from the top so the back button never overlaps the title. */
.health-data-all {
  justify-content: flex-start;
  overflow-y: auto;
  padding-top: calc(env(safe-area-inset-top) + 68px);
}
.health-data-all__back {
  position: fixed; top: calc(env(safe-area-inset-top) + 14px); left: var(--space-6);
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: none; border: 0; padding: 0;
  color: var(--text-muted); cursor: pointer;
}
.health-data-all__back:active { transform: translateY(1px); }
/* "Save" CTA — only shown when the page is reached from the Edit-health chat. */
.health-data-all__save {
  align-self: center;
  width: 100%;
  max-width: 320px;
  margin: var(--space-6) 0 calc(env(safe-area-inset-bottom) + var(--space-6));
}

/* ---- "Know your period" (openKnowYourPeriodPage) — deliberately plain:
   no card/tile per phase, just a heading + energy line + body text, one
   after another, separated by a hairline. ---- */
.know-period { padding: var(--space-2) var(--space-6) var(--space-8); }
.know-period__phase { padding: var(--space-6) 0; }
.know-period__phase + .know-period__phase { border-top: 1px solid var(--border); }
.know-period__phase:first-child { padding-top: var(--space-3); }
.know-period__name {
  margin: 0 0 var(--space-1);
  font-size: var(--type-xl);
  font-weight: 800;
  color: var(--text);
}
.know-period__energy {
  margin: 0 0 var(--space-3);
  font-size: var(--type-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
}
.know-period__body {
  margin: 0;
  font-size: var(--type-base);
  line-height: 1.55;
  color: var(--text-muted);
}
.health-data-all__save[hidden] { display: none; }

/* ── Canonical back button ───────────────────────────────────────────────
   The same fixed top-left position + size on every full-screen page and
   overlay. Co-applied with a page's own back/close class; defined last so it
   wins (resets `right`, background, radius from the older per-page classes).
   Bottom sheets and modal <dialog>s keep their own X — this is not for them. */
.app-back {
  position: fixed;
  top: calc(env(safe-area-inset-top) + var(--space-4));
  left: var(--space-4);
  right: auto;
  z-index: 6;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.app-back:active { transform: translateY(1px); }
@media (hover: hover) { .app-back:hover { background: rgba(255, 255, 255, 0.06); } }
.app-back svg { width: 24px; height: 24px; }
.app-back > span { display: none; }   /* drop any "Back" text label — icon only */
.app-back[hidden] { display: none; }
.health-data-all__title {
  font-size: 20px; font-weight: 800; color: var(--text);
  margin: 0 0 6px; text-align: center;
}
.health-data-all__sub {
  font-size: 12px; line-height: 1.4; color: var(--text-muted);
  margin: 0 0 var(--space-7); text-align: center; max-width: 300px;
}
.plan-setup-recap {
  width: 100%; max-width: 320px;
  /* Neutral card, matching the app's other flat recap/tile surfaces
     (.recs-tile etc.) — a thin border is accent enough. */
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 2px 14px;
  margin: 0 0 calc(env(safe-area-inset-bottom) + 24px);
}
.plan-setup-recap__row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.plan-setup-recap__row:last-child { border-bottom: none; }
.plan-setup-recap__label { color: var(--text-muted); }
.plan-setup-recap__value { color: var(--text); font-weight: 700; text-align: right; }
/* Same CTA spec used on the other full-screen onboarding moments
   (.onboard-welcome__cta / .signin-gate-full__signin). */
.onboarding-done__cta {
  min-height: 52px;
  padding: 0 var(--space-8);
  border: 0; border-radius: var(--radius-full);
  background: var(--primary-fill); color: var(--primary-ink);
  font-family: inherit;
  /* Was --type-base (20px)/800 — same oversized-pill-CTA bug as the sign-in
     gate button; matched to the same fix (large buttons run 15-17px bold). */
  font-size: var(--type-title-2); font-weight: 700;
  cursor: pointer;
}
.onboarding-done__cta:active { transform: translateY(1px); }
/* Understated second option that's still a real button (not the plain
   underlined .onboarding-done__change text link) — same pill shape/size as
   the primary CTA, just outlined instead of filled. */
.onboarding-done__cta--secondary {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}

/* Deliberately understated way back into the flow to redo answers — plain
   text, no border/fill. On #planSummaryPage it sits between the metric
   tiles and the CTA (see the delay override lower down). */
.onboarding-done__change {
  margin: 0 0 14px;
  background: none; border: 0;
  color: var(--text-faint);
  font-family: inherit; font-size: 11px; font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.onboarding-done__title,
.onboarding-done__text,
.onboarding-done__cta,
.onboarding-done__change { animation: done-rise 440ms ease-out both; }
.onboarding-done__title { animation-delay: 180ms; }
.onboarding-done__change { animation-delay: 310ms; }
.onboarding-done__text { animation-delay: 340ms; }
.onboarding-done__cta { animation-delay: 370ms; }

/* ---- Plan Summary — one heading line + three icon-tile metrics, replacing
   the table-row recap this screen used to share with #planSetupDone. ---- */
/* .onboarding-done (shared base) is align-items:flex-start — correct for
   #healthChatDonePanel/#healthDataAllPage, which are genuinely left-aligned
   text/lists. This page's own children (heading, caption) were separately
   given text-align:center, but the flex-start container never centered the
   icon badge or the CTA button, or the intro/metrics boxes as a whole —
   scoped here, not on the shared base, so those other pages are untouched. */
.plan-summary { align-items: center; }

/* #healthChatDonePanel — same override, for the same reason: the shared
   .onboarding-done base is align-items:flex-start (correct for the still-
   left-aligned #healthDataAllPage), but this screen reads better centered
   like the plan-ready/plan-summary moments it's modelled on. */
#healthChatDonePanel { align-items: center; text-align: center; }

/* #familyInviteOfferPanel/#familyChatDonePanel — same override, same reason:
   these confirmation-style moments read better centered like the plan-ready
   screen they're modelled on. */
#familyInviteOfferPanel { align-items: center; text-align: center; }
#familyChatDonePanel { align-items: center; text-align: center; }

/* #healthDataAllPage ("Your health data so far") — same root cause as
   above, plus a subtler one: .health-data-all__title/__sub already had
   their OWN text-align:center, but align-items:flex-start shrinks a block
   element to fit its content width, leaving no room for that centering to
   do anything — the box itself just sits at the left edge. Centering the
   container fixes both the block's position and gives multi-line text
   somewhere to actually center within. */
#healthDataAllPage { align-items: center; }
/* Heading + caption + facts are one text group now (#planSummaryIntro),
   revealed first, then it eases up as the metric tiles appear below it. */
.plan-summary__intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 340px;
  margin: 0 0 var(--space-6);
}
.plan-summary__heading {
  margin: 0 0 var(--space-2);
  font-size: var(--type-lg);
  font-weight: 800;
  color: var(--text);
  text-align: center;
}
/* One line: "…what you've shared with us.  Age 35 yrs · Weight 57 kg · View all" */
.plan-summary__caption {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-muted);
  text-align: center;
}
/* Plain text, inline with the caption — no pills. */
.plan-summary__facts {
  color: var(--text-muted);
}
.plan-summary__facts[hidden] { display: none; }
.plan-summary__facts b { color: var(--text); font-weight: 700; }
/* Plain teal text button for the rest of the recap — no chip. */
.plan-summary__viewall {
  font-family: inherit;
  font-size: inherit;
  font-weight: 700;
  color: var(--primary);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  white-space: nowrap;
}
.plan-summary__viewall:active { opacity: 0.7; }
.plan-summary__metrics {
  display: flex;
  justify-content: center;
  gap: var(--space-6);
  width: 100%;
  max-width: 320px;
  margin: 0 0 24px;
}
.plan-summary__metric {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  opacity: 0;
  animation: done-rise 420ms ease-out both;
}
/* One tile at a time instead of all three together, and each icon's own
   loop (curl / march / drip) is timed to kick in right as its tile
   appears — the row reads as a little relay, not everything at once. */
#planSummaryMetrics .plan-summary__metric:nth-child(1) { animation-delay: 560ms; }
#planSummaryMetrics .plan-summary__metric:nth-child(2) { animation-delay: 720ms; }
#planSummaryMetrics .plan-summary__metric:nth-child(3) { animation-delay: 880ms; }
#planSummaryMetrics .plan-summary__metric:nth-child(1) .odrifit-rec-icon { animation-delay: 560ms; }
#planSummaryMetrics .plan-summary__metric:nth-child(2) .foot-left { animation-delay: 720ms; }
#planSummaryMetrics .plan-summary__metric:nth-child(2) .foot-right { animation-delay: calc(720ms + 0.4s); }
#planSummaryMetrics .plan-summary__metric:nth-child(3) .odrifit-rec-icon { animation-delay: 880ms; }
/* Icon itself (RING_ICONS + data-rec-type) picks up the same neon color +
   animation the home tracker cards use — see [data-rec-type] rules above. */
.plan-summary__metric-icon {
  width: 56px;
  height: 56px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--icon-tile-bg);
  opacity: 0;
  transform: scale(0.4);
  animation: plan-icon-fill 380ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
/* The circle "fills in" on its own pop timed to the same relay as the tile
   row above, rather than just inheriting the parent's plain fade/rise —
   this is the visible first beat of the tile's progressive-disclosure
   sequence (circle fills → number counts up, see animatePlanSummaryCounters()). */
#planSummaryMetrics .plan-summary__metric:nth-child(1) .plan-summary__metric-icon { animation-delay: 560ms; }
#planSummaryMetrics .plan-summary__metric:nth-child(2) .plan-summary__metric-icon { animation-delay: 720ms; }
#planSummaryMetrics .plan-summary__metric:nth-child(3) .plan-summary__metric-icon { animation-delay: 880ms; }
.plan-summary__metric-value {
  margin: 0;
  font-family: var(--font-numeric);
  font-variant-numeric: tabular-nums;
  font-size: var(--type-lg);
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}
.plan-summary__metric-unit {
  font-size: var(--type-sm);
  font-weight: 700;
  color: var(--text-muted);
  margin-left: 1px;
}
/* Sits above the value — sentence case, matching the home tracker cards. */
.plan-summary__metric-label {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: normal;
  color: var(--text-muted);
}
/* "~2 eggs or 1 cup of paneer" etc — the same real-world equivalent line
   the home tracker cards show, surfaced here too (shared *EquivText()). */
.plan-summary__metric-equiv {
  margin: 2px 0 0;
  font-size: 10px;
  line-height: 1.35;
  color: var(--text-faint);
  text-wrap: balance;
}
/* Beat 1: the whole heading+caption+facts group rises in as one, then eases
   up ~6px as the metric tiles (beat 2) fill the space below it. Beat 3: the
   CTA, after the last tile settles (~880ms delay + 420ms). */
.plan-summary__intro {
  animation: plan-intro-in 1000ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 120ms;
}
@keyframes plan-intro-in {
  0%   { opacity: 0; transform: translateY(16px); }
  30%  { opacity: 1; transform: translateY(0); }
  100% { opacity: 1; transform: translateY(-6px); }
}
#planSummaryPage .onboarding-done__change { animation-delay: 1340ms; }
#planSummaryPage .onboarding-done__cta { animation-delay: 1380ms; }

@keyframes done-pop { 0% { transform: scale(0); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes done-aurora {
  0%   { transform: rotate(0deg)   scale(1);    }
  50%  { transform: rotate(180deg) scale(1.12); }
  100% { transform: rotate(360deg) scale(1);    }
}
@keyframes done-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes plan-icon-fill { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .onboarding-done__title,
.onboarding-done__text,
.onboarding-done__cta,
.onboarding-done__change,
.plan-summary__intro { animation: none; }
}

/* ---- Unified recs-section tile: Sign-in · Health concerns · Learn about nutrition ---- */
.recs-tile {
  display: flex;
  /* Icon + text top-aligned (design-system rule): the icon's top edge lines
     up with the title, so when the sub-line wraps to 2-3 lines the icon
     stays anchored to the title instead of floating mid-block. */
  align-items: flex-start;
  gap: var(--space-3);
  width: 100%;
  min-height: 68px;
  margin-top: var(--space-4);
  padding: 16px 18px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);   /* 18px — standard card radius */
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.15s ease;
}
.recs-tile:hover { border-color: rgba(var(--primary-rgb), 0.35); }
/* The 92px override this used to need is gone — every subtitle is forced to
   one line now (see .recs-tile__sub), so the base 68px min-height already
   fits every tile uniformly; the old override just left dead space at the
   bottom of every card. */
/* Sits directly under the "Recommended" title (which already carries its own
   bottom margin) — skip the tile's usual top margin so it doesn't stack. */
.recs-tile--inline { margin-top: 0; }
/* Purely informational tile — not a control (no hover, no pointer, no chevron). */
.recs-tile--static { cursor: default; }
.recs-tile--static:hover { border-color: var(--border); }
.recs-tile__icon {
  flex: none;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--icon-tile-bg);
  color: var(--primary);
}
.recs-tile__icon svg { width: 22px; height: 22px; }
.recs-tile__icon .mi { font-size: 22px; }
.recs-tile__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.recs-tile__title { display: block; font-size: 16px; font-weight: 700; color: var(--text); line-height: 1.3; }
.recs-tile__sub {
  display: block;
  font-size: 14px;
  color: var(--text-faint);
  line-height: 1.35;
  /* Always one line — keeps every tile the same height regardless of copy
     length, instead of a longer subtitle silently wrapping and growing
     just that one tile. */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
/* The recs-page concerns tile only — the concern list truncates to one line
   instead of wrapping (the full list lives on #allConcernsPage now, a tap
   away). Not applied to the home tile, which still wraps. */
.recs-tile__sub--clamp1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Chevron top-aligns with the icon + title (not vertically centred in the
   row) — the small margin optically centres it on the title's first line. */
.recs-tile__chev { flex: none; align-self: flex-start; margin-top: 2px; width: 18px; height: 18px; color: var(--text-faint); stroke: currentColor; }

/* "Your concerns · PCOS · Edit" now lives directly in the collapsing hero's
   subtitle (see recsHeaderHtml) — plain text, no pill treatment, reusing
   .pcal-edit-inline-btn for the Edit link. Nothing extra needed here. */

/* ---- Self medications — Home section tiles + confirm sheet ---- */
.self-med-list { display: flex; flex-direction: column; }
.self-med-tile__status { flex: none; align-self: flex-start; margin-top: 2px; width: 22px; height: 22px; color: var(--text-faint); }
.self-med-tile__status svg { width: 22px; height: 22px; }
.self-med-tile--done .self-med-tile__status { color: var(--primary-fill); }
.self-med-confirm {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  min-height: 100%;
  padding: var(--space-8) var(--space-6);
  text-align: center;
}
.self-med-confirm__name {
  font-size: var(--type-xl);
  font-weight: var(--weight-bold);
  color: var(--text);
  margin: 0;
  line-height: 1.35;
  max-width: 24ch;
}
.self-med-confirm__time { font-size: var(--type-base); color: var(--text-faint); margin: 0; }
.self-med-confirm__water {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--type-base);
  color: var(--text);
  cursor: pointer;
}
.self-med-confirm__water input[type="checkbox"] {
  width: 20px; height: 20px; accent-color: var(--primary-fill); flex: none;
}
.self-med-confirm__cta { max-width: 320px; min-height: 52px; }

/* ---- "The story of nutrition" full-screen page ---- */
.nutrition-page {
  padding: var(--space-7) var(--space-5) calc(var(--space-8) + env(safe-area-inset-bottom));
  max-width: 640px;
  margin: 0 auto;
}
/* Everything left-aligned, like the rest of the app's pages. */
.nutrition-page-content,
.nutrition-page-content .macros-section,
.nutrition-page-content .section-title,
.nutrition-page-content .section-subtitle,
.nutrition-page-content .macros-intro,
.nutrition-page-content .macros-why,
.nutrition-page-content .macros-chart-caption {
  text-align: left;
}
.nutrition-page-content .macros-section { margin: 0; }
/* The page header already says "The story of nutrition". */
.nutrition-page-content .macros-section > .section-title { display: none; }
.nutrition-page-content .macros-section > .section-subtitle { margin-top: 0; }
.nutrition-page-content .macros-intro,
.nutrition-page-content .macros-why {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
}
.nutrition-page-content .macros-why {
  padding: var(--space-4) var(--space-5);
  border-left: 3px solid rgba(var(--primary-rgb), 0.4);
}
/* The pie chart is a figure, not text — keep it centred. */
.nutrition-page-content .macros-chart { margin-left: 0; align-items: flex-start; }
.nutrition-page-content .macros-chart-caption { align-self: flex-start; }
/* No card-under-card: the macro sections sit straight on the page. Only the
   food-picture tiles inside them keep a card look. */
.nutrition-page-content .macros-grid { gap: var(--space-8); }
.nutrition-page-content .macro-card {
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
  gap: var(--space-4);
}
.nutrition-page-content .macro-card:first-child { border-top: 0; padding-top: 0; }
@keyframes holoPulse { 0%,100% { opacity: 0.75; } 50% { opacity: 1; } }

/* ---- "How to hit your Xg protein" full-screen page ---- */
/* The collapsing-hero slim bar needs to sit flush at the top of this scroll
   container (.tracker-page-body) to stick correctly — .protein-page itself
   carries no padding/width constraint now (matches .recs-page/.period-page);
   the reading-width cap + side/bottom padding live on .protein-page-content
   instead, below the hero. */
.protein-page-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  max-width: 640px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-5) calc(var(--space-8) + env(safe-area-inset-bottom));
}
/* No card treatment on the text body — the page itself is the frame, and every
   line is left-aligned like the rest of the app. Only the food tiles keep a
   card look, and the grid spans the full page width. */
.protein-page-content .protein-details-card {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
.protein-page-content .protein-card-subtitle,
.protein-page-content .protein-breakdown-subtext {
  text-align: left;
}
/* .protein-page-content is display:flex with its own gap: var(--space-6)
   (28px) between every child — .protein-breakdown-subtext's own
   margin-bottom: var(--space-4) (20px) stacked on top of that, plus a
   padding-top the grid used to add on this page specifically, added up to
   68px of space before "Here's what Ng looks like:". Zeroing the redundant
   own-margin here (the flex gap alone already separates these two) gets
   this down to 28px — about half. */
.protein-page-content .protein-breakdown-subtext { margin-bottom: 0; }
.protein-page-content .protein-collapsible { margin-top: var(--space-5); }

/* Sources / citations block — foot of the protein + nutrition pages. */
.protein-location-note {
  margin-top: var(--space-5);
  padding: var(--space-4);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.protein-location-note__text {
  margin: 0 0 var(--space-3);
  font-size: var(--type-sm);
  color: var(--text-muted);
  line-height: 1.45;
}
.protein-location-note__btn {
  min-height: 40px;
  padding: 0 var(--space-5);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--primary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.protein-location-note__btn[hidden] { display: none; }

.nutrition-sources {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
}
.nutrition-sources__title {
  font-size: var(--type-sm);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 var(--space-2);
}
.nutrition-sources__lead {
  font-size: var(--type-sm);
  color: var(--text-faint);
  margin: 0 0 var(--space-3);
}
.nutrition-sources__list {
  margin: 0;
  padding-left: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.nutrition-sources__list li {
  font-size: var(--type-sm);
  color: var(--text-faint);
  line-height: 1.45;
}

/* ============================================================
   HOME RESTYLE to Figma 240:3469 — daily cards, big-rocks,
   add-tracker, bottom "Talk to Odrifit" pill.
   ============================================================ */
/* ---- Daily little rocks: card layout ---- */
#trackerCards .tracker-metric-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  padding: 18px 18px 6px;
}
/* Goal-hit state — calm, not loud. No teal card outline/glow; the ring
   dims to a subtle teal, the metric icon becomes a subtle teal tick, and
   the value goes teal. */
#trackerCards .tracker-metric-card.is-onstreak {
  border-color: var(--border);
  box-shadow: none;
}
#trackerCards .tracker-metric-card.is-onstreak .odrifit-progress-ring__fill {
  stroke: rgba(var(--primary-rgb), 0.35);
}
#trackerCards .tracker-metric-card.is-onstreak .odrifit-rec-icon { display: none; }
#trackerCards .tracker-metric-card.is-onstreak .tracker-ring-check {
  display: block;
  color: var(--primary);
  opacity: 0.85;
}
#trackerCards .tracker-metric-card.is-onstreak .tracker-card-value,
#trackerCards .tracker-metric-card.is-onstreak .tracker-card-value .tracker-card-goal,
#trackerCards .tracker-metric-card.is-onstreak .tracker-card-value .tracker-card-goal * {
  color: var(--primary);
}
#trackerCards .tracker-card-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
}
#trackerCards .tracker-card-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
/* Journey footer: bleed the row (and its divider) out to the card edges so the
   click target is flush to the card shape, while the label lines up with the
   metric text above it (both at the card's 16px inset). */
#trackerCards .tracker-card-journey {
  width: auto;
  margin: 6px -18px 0;
  padding: 12px 18px;
}
#trackerCards .tracker-card-value {
  margin: 2px 0 0;
  font-size: 34px;
  font-weight: 800;
  line-height: 1.05;
  color: var(--text);
}
#trackerCards .tracker-card-value .tracker-card-goal,
#trackerCards .tracker-card-value .tracker-card-goal * {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-faint);
  margin-left: 6px;
}
/* Loading skeleton — shown briefly while goal/health data is still being
   fetched (see showTrackerCardsLoading/hideTrackerCardsLoading in
   script.js, wired around the sign-in cloud-data fetch). Only the
   data-dependent text (label/value/hint/streak) gets a shimmer skeleton —
   the icon, its ring, and their existing micro-animations are left exactly
   as-is underneath, so the tile's visual identity never changes between
   loading → empty → populated, just the text. */
@keyframes tracker-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
/* #trackerCards-prefixed to outrank #trackerCards .tracker-card-label/-value
   above (an ID selector beats plain classes regardless of how many). The
   shimmer overlay is semi-transparent by design (it's a moving highlight,
   not an opaque block), so it only visually hides text that's ALSO been
   made transparent — the label's own text inherits color:transparent fine,
   but the bold <strong> number and the .tracker-card-goal "glasses" suffix
   both set their own opaque color and need forcing separately. */
#trackerCards .tracker-card--loading .tracker-card-label,
#trackerCards .tracker-card--loading .tracker-card-value,
#trackerCards .tracker-card--loading .tracker-card-label strong,
#trackerCards .tracker-card--loading .tracker-card-value .tracker-card-goal {
  color: transparent;
}
#trackerCards .tracker-card--loading .tracker-card-label,
#trackerCards .tracker-card--loading .tracker-card-value {
  display: block;
  position: relative;
  border-radius: 6px;
  overflow: hidden;
}
#trackerCards .tracker-card--loading .tracker-card-label { width: 60%; max-width: 130px; height: 15px; }
#trackerCards .tracker-card--loading .tracker-card-value { width: 40%; max-width: 70px; height: 32px; margin-top: 2px; }
#trackerCards .tracker-card--loading .tracker-card-label::after,
#trackerCards .tracker-card--loading .tracker-card-value::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.06) 25%,
    rgba(255, 255, 255, 0.14) 50%,
    rgba(255, 255, 255, 0.06) 75%);
  background-size: 200% 100%;
  animation: tracker-shimmer 1.5s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  #trackerCards .tracker-card--loading .tracker-card-label::after,
#trackerCards .tracker-card--loading .tracker-card-value::after { animation: none; opacity: 0.5; }
}

/* Track (the "remaining" background ring) — subtly-dimmer teal once the
   user has logged something today, neutral in the empty state. (Was a
   coral/--error track — founder feedback: "looks bad, use a subtle teal
   instead".) This ID-scoped rule is more specific than the per-metric
   [data-rec-type] rules above, which is correct for the track — but an
   accompanying `__fill` override here was ALSO more specific than those
   same per-metric rules and had been silently winning for the fill/progress
   arc too, flattening protein/steps/water back to one generic colour.
   Removed — the fill stays per-metric (var(--metric-protein/steps/water)),
   only the track is the deliberately-generic teal. */
#trackerCards .odrifit-progress-ring__bg { stroke: rgba(var(--primary-rgb), 0.22); }
#trackerCards .odrifit-progress-ring--empty .odrifit-progress-ring__bg { stroke: rgba(255, 255, 255, 0.07); }

/* ---- Long term big rocks ---- */
.bigrocks-panel { margin-top: 8px; }
.bigrocks-cards { display: flex; flex-direction: column; gap: 12px; }
.bigrock-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card-bg);
  padding: 16px;
}
.bigrock-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.bigrock-title { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.bigrock-headline { font-family: var(--font-numeric); font-variant-numeric: tabular-nums; font-size: 17px; font-weight: 700; color: var(--text); }
.bigrock-sub { margin: 6px 0 0; font-size: 11px; color: var(--text-faint); }
.bigrock-bar {
  margin-top: 12px;
  height: 8px;
  border-radius: 999px;
  background: rgba(var(--error-rgb), 0.35);
  overflow: hidden;
}
.bigrock-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
}
.bigrock-hint { margin: 8px 0 0; font-size: 11px; font-weight: 600; color: var(--text-muted); }

.add-track-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
  padding: 13px 16px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.add-track-btn svg { stroke: currentColor; }

/* ---- Bottom "Log with Odrifit" pill — Figma 411:182: pale-mint→bright-teal
   gradient, light aqua border, dark text/icon (fixed colors, not
   theme-driven — a specific brand-accent treatment). Founder updated this
   Figma component's colors 2026-09-24 (was teal→lavender) — re-check this
   node before assuming these values are still current if it's been a while. ---- */
.tracker-ai-bar {
  padding-left: 16px;
  padding-right: 16px;
}
.tracker-ai-fab {
  position: relative;
  overflow: hidden;
  width: auto;
  max-width: calc(100vw - 32px);
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border: 3px solid #bbfff7;
  border-radius: 999px;
  background: linear-gradient(140deg, #b4eae4 6.483%, #26ffe6 117.3%);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: 0 10px 30px rgba(38, 255, 230, 0.25);
  color: #111817;
  cursor: pointer;
}
.tracker-ai-fab:active { transform: translateY(1px); }

/* Idle shimmer — a light sweep that plays while the check-in screen is open
   and the user hasn't interacted with it yet (see armFabIdleShimmer in
   script.js); the first tap/scroll/keypress anywhere removes --idle. */
.tracker-ai-fab--idle::after {
  content: "";
  position: absolute;
  inset: 0;
  left: -150%;
  width: 60%;
  background: linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.55) 50%, transparent 100%);
  transform: skewX(-20deg);
  pointer-events: none;
  animation: fabShimmerSweep 3.4s ease-in-out infinite;
}
@keyframes fabShimmerSweep {
  0%   { left: -150%; }
  18%  { left: 150%; }
  100% { left: 150%; }
}
@media (prefers-reduced-motion: reduce) {
  .tracker-ai-fab--idle::after { animation: none; display: none; }
}
.tracker-ai-fab-icon-wrap { width: 15px; height: 14px; background: none; flex-shrink: 0; }
.tracker-ai-fab-icon { width: 15px; height: 14px; color: #111817; }
.tracker-ai-fab-text { flex-direction: row; align-items: baseline; gap: 8px; }
.tracker-ai-fab-title { color: #111817; font-size: 16px; letter-spacing: 0.2px; }
.tracker-ai-fab-soon {
  color: #111817;
  opacity: 0.6;
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
}

/* ---- Walk timer: pace picker + estimate framing ---- */
.walk-pace {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 4px 0 14px;
}
.walk-pace-btn {
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.walk-pace-btn.is-active {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.08);
}
.walk-pace.is-locked { opacity: 0.5; pointer-events: none; }

/* ============================================
   PRICING PAGE (Profile → Subscriptions)
   ============================================ */
.pricing-page {
  padding: var(--space-2) var(--space-6) var(--space-8);
}

.pricing-page__region {
  margin: 0 0 var(--space-5);
  font-size: var(--type-caption-1);
  color: var(--text-muted);
  text-align: center;
}

.pricing-page__cycle {
  width: 100%;
  margin-bottom: var(--space-6);
}
.pricing-page__cycle .profile-toggle-btn {
  flex: 1;
  text-align: center;
}

.pricing-page__plans {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.pricing-plan-option {
  width: 100%;
}
.pricing-plan-option__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: var(--space-3);
}
.pricing-plan-option__price {
  font-size: var(--type-title-2);
  font-weight: var(--weight-bold);
  color: var(--text);
  white-space: nowrap;
}
.pricing-plan-option__period {
  font-size: var(--type-caption-1);
  font-weight: 600;
  color: var(--text-muted);
}
.pricing-plan-option .goal-option-badge { margin-top: var(--space-2); }

.pricing-page__upgrade-hint {
  margin: var(--space-3) 0 0;
  font-size: var(--type-caption-1);
  color: var(--text-muted);
  text-align: center;
}

.pricing-page__seats {
  margin-bottom: var(--space-5);
}
.pricing-page__seats-label {
  margin: 0 0 var(--space-3);
  font-size: var(--type-caption-1);
  font-weight: 600;
  color: var(--text-muted);
}
.pricing-seat-grid {
  grid-template-columns: repeat(3, 1fr);
}
.pricing-seat-option {
  align-items: center;
  text-align: center;
  min-height: 64px;
}

.pricing-page__summary {
  text-align: center;
  padding: var(--space-5) 0 var(--space-6);
}
.pricing-page__total {
  margin: 0;
  font-size: var(--type-hero);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.pricing-page__total-period {
  font-size: var(--type-title-2);
  font-weight: 600;
  color: var(--text-muted);
}
.pricing-page__effective {
  margin: var(--space-2) 0 0;
  font-size: var(--type-body-2);
  color: var(--text-muted);
}
.pricing-page__savings {
  display: inline-block;
  margin-top: var(--space-3);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  background: rgba(74, 222, 128, 0.12);
  color: var(--success);
  font-size: var(--type-caption-1);
  font-weight: 700;
}

.pricing-page__cta {
  display: block;
  width: 100%;
  text-align: center;
}
.pricing-page__cancel {
  display: block;
  width: 100%;
  margin-top: var(--space-4);
  padding: var(--space-2);
  background: none;
  border: 0;
  font-family: inherit;
  font-size: var(--type-body-2);
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  cursor: pointer;
}
.pricing-page__disclaimer {
  margin: var(--space-4) 0 0;
  font-size: var(--type-caption-3);
  color: var(--text-faint);
  text-align: center;
  line-height: 1.4;
}

/* ---- Discount code entry + applied state ---- */
.pricing-page__promo-link {
  display: block;
  width: 100%;
  margin-top: var(--space-4);
  padding: var(--space-2);
  background: none;
  border: 0;
  font-family: inherit;
  font-size: var(--type-body-2);
  font-weight: 600;
  color: var(--primary);
  text-align: center;
  cursor: pointer;
}
.pricing-page__promo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
}
.pricing-page__promo-field {
  flex: 1;
  min-width: 0;
}
.pricing-page__promo-field input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: var(--type-base);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.pricing-page__promo-field input::placeholder {
  color: var(--text-faint);
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
}
.pricing-page__promo-apply {
  flex-shrink: 0;
  min-height: 44px;
  padding: 0 var(--space-5);
  border: 0;
  border-radius: 999px;
  background: var(--primary-fill);
  color: var(--primary-ink);
  font-family: inherit;
  font-size: var(--type-body-2);
  font-weight: 700;
  cursor: pointer;
}
.pricing-page__promo-apply:disabled { opacity: 0.6; cursor: not-allowed; }
.pricing-page__promo-error {
  margin: var(--space-2) 0 0;
  font-size: var(--type-caption-1);
  color: var(--error);
  text-align: center;
}
.pricing-page__promo-applied {
  text-align: center;
  padding: var(--space-6) 0 var(--space-5);
}
.pricing-page__promo-code {
  margin: var(--space-3) 0 0;
  font-size: var(--type-body-1);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.pricing-page__promo-sub {
  margin: var(--space-2) 0 0;
  font-size: var(--type-body-2);
  color: var(--text-muted);
}
