/* XinHammer Health — Botanical Editorial Wellness Workbench */
:root {
  --h-bg: #f5f8f4;
  --h-surface: #ffffff;
  --h-surface-soft: #f2f7f3;
  --h-border: #d8e5db;
  --h-border-strong: #b9d0bf;
  --h-ink: #152c22;
  --h-muted: #4b6156;
  --h-accent: #1b6848;
  --h-accent-hover: #145238;
  --h-accent-soft: #e6f4eb;
  --h-accent-tint: #eff8f2;
  --h-sun: #d98a1c;
  --h-sun-soft: #fff7e6;
  --h-sun-border: #efd192;
  --h-coral: #b93628;
  --h-coral-soft: #fdf0ee;
  --h-coral-border: #f0beb6;
  --h-cobalt: #1c43a9;
  --h-cobalt-soft: #eef3fe;
  --h-shadow: 0 10px 30px rgba(21, 52, 38, 0.055);
  --h-radius: 1.25rem;
  --h-radius-sm: .85rem;
}

body.health-body {
  background: var(--h-bg);
  color: var(--h-ink);
  overflow-x: clip;
}

.health-main {
  padding-bottom: clamp(2.5rem, 6vw, 5rem);
}

.health-main button,
.health-main input,
.health-main select {
  font-family: inherit;
}

.h-card {
  background: var(--h-surface);
  border: 1px solid var(--h-border);
  border-radius: var(--h-radius);
  box-shadow: var(--h-shadow);
  min-width: 0;
}

/* Buttons */
.h-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 44px;
  padding: .55rem 1.15rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: .94rem;
  font-weight: 640;
  line-height: 1.3;
  white-space: nowrap;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .14s ease, box-shadow .16s ease;
}

.h-btn:disabled {
  opacity: .48;
  cursor: not-allowed;
}

.h-btn-primary {
  background: var(--h-accent);
  color: #fff;
}
.h-btn-primary:hover:not(:disabled),
.h-btn-primary:focus-visible:not(:disabled) {
  background: var(--h-accent-hover);
  box-shadow: 0 6px 18px rgba(27, 104, 72, 0.22);
}

.h-btn-secondary {
  background: var(--h-surface);
  border-color: var(--h-border-strong);
  color: var(--h-ink);
}
.h-btn-secondary:hover:not(:disabled),
.h-btn-secondary:focus-visible:not(:disabled) {
  background: var(--h-accent-tint);
  border-color: var(--h-accent);
  color: var(--h-accent);
}

.h-btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--h-accent);
  padding-inline: .75rem;
}
.h-btn-ghost:hover:not(:disabled),
.h-btn-ghost:focus-visible:not(:disabled) {
  background: var(--h-accent-soft);
}

.h-btn-cloud {
  background: var(--h-cobalt-soft);
  border-color: #c8d7f5;
  color: var(--h-cobalt);
}
.h-btn-cloud:hover:not(:disabled),
.h-btn-cloud:focus-visible:not(:disabled) {
  background: var(--h-cobalt);
  border-color: var(--h-cobalt);
  color: #fff;
}

.h-btn-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: .2rem .45rem;
  border: 0;
  border-radius: .5rem;
  background: transparent;
  color: var(--h-accent);
  font-size: .88rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: .25em;
}
.h-btn-link:hover,
.h-btn-link:focus-visible {
  background: var(--h-accent-soft);
}

/* Hero */
.health-hero {
  padding-top: clamp(1rem, 2.6vw, 2rem);
}

.health-hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, .94fr);
  align-items: center;
  gap: clamp(1.25rem, 4vw, 3.5rem);
  padding: clamp(1.35rem, 3.6vw, 3rem);
  border-radius: clamp(1.25rem, 2.5vw, 1.85rem);
  border: 1px solid #d4e6d8;
  background:
    radial-gradient(circle at 86% 14%, rgba(255, 224, 130, 0.34), transparent 42%),
    radial-gradient(circle at 8% 92%, rgba(167, 220, 183, 0.34), transparent 46%),
    linear-gradient(135deg, #f3faf4 0%, #e7f4ea 100%);
  box-shadow: 0 14px 36px rgba(24, 62, 43, 0.06);
}

.health-hero-copy {
  min-width: 0;
}

.health-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .3rem .8rem .3rem .4rem;
  border-radius: 999px;
  border: 1px solid #cbe0d0;
  background: rgba(255, 255, 255, 0.88);
  color: var(--h-accent);
  font-size: .86rem;
  font-weight: 650;
}
.health-eyebrow img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
}

.health-hero-copy h1 {
  margin-top: .85rem;
  font-size: clamp(2.15rem, 4.7vw, 4.1rem);
  line-height: 1.14;
  color: var(--h-ink);
}

.health-hero-lead {
  margin-top: .9rem;
  max-width: 34em;
  color: #354d42;
  font-size: clamp(.96rem, 1.18vw, 1.08rem);
  line-height: 1.78;
}

.health-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem;
  margin-top: 1.25rem;
}

.health-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem 1rem;
  margin-top: 1.05rem;
  color: var(--h-muted);
  font-size: .84rem;
  font-weight: 560;
}
.health-hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.health-hero-meta span::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2e8f62;
}

/* Mobile-only elements hidden cleanly on desktop & tablet (>= 768px) */
.hero-mobile-glance,
.mobile-plan-live,
.foods-mobile-switch,
.mobile-add-more-btn,
.mobile-tray-fab,
.subnav-pill .pill-short,
.subnav-pill .pill-badge {
  display: none;
}
.tray-head-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex: none;
}

.health-hero-visual {
  position: relative;
  min-width: 0;
}
.health-hero-visual img {
  width: 100%;
  aspect-ratio: 1280 / 854;
  object-fit: cover;
  border-radius: 1.15rem;
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 14px 30px rgba(24, 62, 43, 0.12);
}
.health-hero-float {
  position: absolute;
  left: .8rem;
  bottom: .8rem;
  right: .8rem;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  width: fit-content;
  max-width: calc(100% - 1.6rem);
  padding: .45rem .85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--h-ink);
  font-size: .82rem;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(17, 45, 31, 0.12);
}
.float-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #279960;
}

/* Sticky Subnav */
.health-subnav-wrap {
  position: sticky;
  top: 0;
  z-index: 20;
  margin-top: clamp(1rem, 2.2vw, 1.6rem);
  border-block: 1px solid rgba(206, 223, 211, 0.9);
  background: rgba(245, 248, 244, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.health-subnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding-block: .55rem;
}

.health-subnav-links {
  display: flex;
  align-items: center;
  gap: .4rem;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
  padding-right: .4rem;
}
.health-subnav-links::-webkit-scrollbar {
  display: none;
}

.subnav-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  flex: none;
  min-height: 40px;
  padding: .35rem .9rem;
  border-radius: 999px;
  border: 1px solid transparent;
  color: #42564d;
  font-size: .9rem;
  font-weight: 620;
  white-space: nowrap;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.subnav-pill .pill-num {
  font-size: .76rem;
  font-variant-numeric: tabular-nums;
  opacity: .72;
}
.subnav-pill:hover,
.subnav-pill:focus-visible {
  color: var(--h-accent);
  background: var(--h-accent-soft);
}
.subnav-pill.is-active {
  background: var(--h-accent);
  color: #fff;
}
.subnav-pill.is-active .pill-num {
  opacity: .88;
}

.subnav-tray-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  min-height: 36px;
  padding: .25rem .8rem;
  border-radius: 999px;
  border: 1px solid var(--h-accent);
  background: var(--h-accent-soft);
  color: var(--h-accent);
  font-size: .84rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Sections */
.health-section {
  padding-top: clamp(2.1rem, 4.4vw, 3.6rem);
  scroll-margin-top: 4.5rem;
}

.health-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: .8rem 1.5rem;
  margin-bottom: clamp(1rem, 2.2vw, 1.6rem);
}

.health-kicker {
  color: var(--h-accent);
  font-size: .84rem;
  font-weight: 700;
  letter-spacing: .06em;
}

.health-section-head h2 {
  margin-top: .28rem;
  font-size: clamp(1.5rem, 2.8vw, 2.35rem);
  line-height: 1.24;
  letter-spacing: -.035em;
  color: var(--h-ink);
}

.health-section-desc {
  margin-top: .45rem;
  max-width: 44rem;
  color: var(--h-muted);
  font-size: .95rem;
  line-height: 1.7;
}
.health-section-desc code {
  padding: .08rem .38rem;
  border-radius: .35rem;
  background: var(--h-accent-soft);
  color: var(--h-accent);
  font-size: .88em;
}

.head-status-group {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
}

.save-badge,
.count-pill {
  display: inline-flex;
  align-items: center;
  padding: .28rem .72rem;
  border-radius: 999px;
  background: var(--h-accent-soft);
  color: var(--h-accent);
  font-size: .82rem;
  font-weight: 630;
}

.hint-small {
  color: var(--h-muted);
  font-size: .84rem;
  line-height: 1.5;
}

.action-feedback {
  margin-top: .6rem;
  min-height: 1.35em;
  color: var(--h-accent);
  font-size: .86rem;
  font-weight: 620;
}

/* Module 1: Plan Calculator */
.plan-grid {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: clamp(1rem, 2.2vw, 1.5rem);
  align-items: start;
}

.plan-form,
.plan-result {
  padding: clamp(1.1rem, 2.4vw, 1.65rem);
}

.form-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: 1rem;
}
.form-row-head h3 {
  margin: 0;
  font-size: 1.12rem;
}

.field-group {
  border: 0;
  padding: 0;
  margin: 1rem 0 0;
}
.field-group legend {
  padding: 0;
  margin-bottom: .5rem;
  font-size: .9rem;
  font-weight: 660;
  color: var(--h-ink);
}

.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: .3rem;
  padding: .25rem;
  border-radius: .85rem;
  background: var(--h-surface-soft);
  border: 1px solid var(--h-border);
}
.seg-btn {
  min-height: 40px;
  padding: .35rem .5rem;
  border: 0;
  border-radius: .65rem;
  background: transparent;
  color: var(--h-muted);
  font-size: .92rem;
  font-weight: 620;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.seg-btn.is-active {
  background: var(--h-surface);
  color: var(--h-accent);
  box-shadow: 0 2px 8px rgba(21, 52, 38, 0.09);
}

.triple-inputs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .7rem;
  margin-top: 1rem;
}

.num-field {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: .7rem .75rem;
  border-radius: var(--h-radius-sm);
  border: 1px solid var(--h-border);
  background: var(--h-surface-soft);
  min-width: 0;
}
.num-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: .84rem;
  font-weight: 640;
  color: var(--h-ink);
}
.num-label small {
  color: var(--h-muted);
  font-weight: 500;
}
.num-field input[type="number"] {
  width: 100%;
  min-width: 0;
  padding: .25rem .45rem;
  border: 1px solid #c5d6c9;
  border-radius: .5rem;
  background: #fff;
  color: var(--h-ink);
  font-size: 1.12rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.num-field input[type="range"] {
  width: 100%;
  accent-color: var(--h-accent);
  margin: .1rem 0 0;
  cursor: pointer;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
}
.choice-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: .22rem;
  padding: .72rem .8rem;
  border-radius: var(--h-radius-sm);
  border: 1px solid var(--h-border);
  background: var(--h-surface);
  min-height: 68px;
  min-width: 0;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.choice-card strong {
  font-size: .92rem;
  color: var(--h-ink);
}
.choice-card span {
  font-size: .78rem;
  line-height: 1.45;
  color: var(--h-muted);
}
.choice-card:hover {
  border-color: var(--h-accent);
  background: var(--h-accent-tint);
}
.choice-card.is-active {
  border-color: var(--h-accent);
  background: var(--h-accent-soft);
  box-shadow: inset 0 0 0 1px var(--h-accent);
}
.choice-card.is-active strong {
  color: var(--h-accent);
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}
.kpi-tile {
  padding: .95rem 1rem;
  border-radius: 1rem;
  border: 1px solid var(--h-border);
  background: var(--h-surface-soft);
  min-width: 0;
}
.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .4rem;
}
.kpi-label {
  font-size: .82rem;
  font-weight: 650;
  color: var(--h-muted);
}
.kpi-chip,
.status-tag {
  display: inline-flex;
  align-items: center;
  padding: .16rem .55rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 680;
  white-space: nowrap;
}
.kpi-chip {
  background: #fff;
  border: 1px solid var(--h-border);
  color: var(--h-accent);
}
.status-tag[data-tone="ok"],
.status-tag:not([data-tone]) {
  background: #def2e4;
  color: #165d3c;
}
.status-tag[data-tone="info"] {
  background: #e5effc;
  color: #1d4e9a;
}
.status-tag[data-tone="warn"] {
  background: var(--h-sun-soft);
  color: #935805;
}
.status-tag[data-tone="alert"] {
  background: var(--h-coral-soft);
  color: var(--h-coral);
}

.kpi-value {
  margin-top: .35rem;
  display: flex;
  align-items: baseline;
  gap: .3rem;
  font-variant-numeric: tabular-nums;
}
.kpi-value strong {
  font-size: clamp(1.45rem, 2.3vw, 1.9rem);
  line-height: 1.15;
  letter-spacing: -.03em;
  color: var(--h-ink);
}
.kpi-value span {
  font-size: .82rem;
  color: var(--h-muted);
  font-weight: 600;
}

.kpi-sub {
  margin-top: .4rem;
  font-size: .8rem;
  color: var(--h-muted);
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.kpi-sub strong {
  color: var(--h-ink);
}

/* BMI Gauge */
.bmi-scale {
  position: relative;
  margin-top: .5rem;
  padding-top: 4px;
}
.bmi-scale-track {
  display: grid;
  grid-template-columns: 19.4fr 30.6fr 22.2fr 27.8fr;
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  gap: 2px;
}
.bmi-scale-track .seg-low { background: #7ab3ef; }
.bmi-scale-track .seg-ok { background: #2ca067; }
.bmi-scale-track .seg-warn { background: #e8a434; }
.bmi-scale-track .seg-high { background: #d95748; }
.bmi-marker {
  position: absolute;
  top: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--h-ink);
  transform: translateX(-50%);
  transition: left .22s ease;
}
.bmi-ticks {
  display: flex;
  justify-content: space-between;
  padding-inline: 15% 22%;
  margin-top: .22rem;
  font-size: .7rem;
  color: var(--h-muted);
  font-variant-numeric: tabular-nums;
}

.plan-note-banner {
  margin-top: .85rem;
  padding: .7rem .9rem;
  border-radius: .8rem;
  border: 1px solid #cce3d3;
  background: var(--h-accent-tint);
  color: #1f4f38;
  font-size: .88rem;
  line-height: 1.55;
}

/* Macro Box */
.macro-box {
  margin-top: .95rem;
  padding: .95rem 1rem;
  border-radius: 1rem;
  border: 1px solid var(--h-border);
  background: #fff;
}
.macro-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: .35rem .8rem;
}
.macro-head h3 {
  margin: 0;
  font-size: .96rem;
}
.macro-bar {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #e7efe9;
  margin-top: .65rem;
  gap: 2px;
}
.bar-pro { background: #237855; }
.bar-carb { background: #e09b2d; }
.bar-fat { background: #5272b8; }

.macro-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.15rem;
  margin-top: .6rem;
  font-size: .85rem;
  color: var(--h-muted);
  font-variant-numeric: tabular-nums;
}
.macro-legend strong { color: var(--h-ink); }
.macro-legend em { font-style: normal; font-size: .8rem; }
.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: .35rem;
  vertical-align: middle;
}
.dot-pro { background: #237855; }
.dot-carb { background: #e09b2d; }
.dot-fat { background: #5272b8; }

.meal-budget-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .5rem;
  margin-top: .85rem;
  padding-top: .75rem;
  border-top: 1px dashed var(--h-border);
}
.meal-budget-row div {
  padding: .48rem .55rem;
  border-radius: .65rem;
  background: var(--h-surface-soft);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.meal-budget-row span {
  display: block;
  font-size: .75rem;
  color: var(--h-muted);
}
.meal-budget-row strong {
  display: block;
  margin-top: .12rem;
  font-size: .9rem;
  color: var(--h-ink);
}

/* Details */
.plan-details-row {
  display: grid;
  gap: .55rem;
  margin-top: .9rem;
}
.h-details {
  border: 1px solid var(--h-border);
  border-radius: .8rem;
  background: var(--h-surface-soft);
  padding: .55rem .85rem;
}
.h-details summary {
  cursor: pointer;
  font-size: .88rem;
  font-weight: 630;
  color: var(--h-ink);
  min-height: 30px;
  display: flex;
  align-items: center;
  list-style: none;
}
.h-details summary::-webkit-details-marker {
  display: none;
}
.h-details summary::before {
  content: '▸';
  display: inline-block;
  margin-right: .45rem;
  color: var(--h-accent);
  font-size: .88rem;
  transition: transform .15s ease;
  flex: none;
}
.h-details[open] > summary::before {
  transform: rotate(90deg);
}
.hr-zones-list {
  display: grid;
  gap: .4rem;
  margin-top: .65rem;
}
.hr-zone-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: .55rem;
  align-items: center;
  padding: .45rem .65rem;
  border-radius: .6rem;
  background: #fff;
  border: 1px solid var(--h-border);
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
}
.hr-zone-row.is-featured {
  border-color: var(--h-accent);
  background: var(--h-accent-soft);
}
.hr-zone-badge {
  font-weight: 700;
  color: var(--h-accent);
}
.hr-zone-bpm {
  font-weight: 700;
  color: var(--h-ink);
  white-space: nowrap;
}
.formula-list {
  margin: .55rem 0 .2rem;
  padding-left: 1.15rem;
  color: var(--h-muted);
  font-size: .83rem;
  line-height: 1.65;
}
.formula-list li + li { margin-top: .32rem; }

.plan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: 1rem;
}

/* Module 2: Food & Purine Workbench */
.foods-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  gap: clamp(1rem, 2.2vw, 1.5rem);
  align-items: start;
}

.foods-explorer {
  min-width: 0;
  display: grid;
  gap: .95rem;
}

.search-panel {
  padding: clamp(1rem, 2vw, 1.35rem);
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: .95rem;
  font-size: 1.15rem;
  color: var(--h-muted);
  pointer-events: none;
}
#food-search {
  width: 100%;
  min-height: 48px;
  padding: .65rem 2.75rem .65rem 2.45rem;
  border: 1.5px solid var(--h-border-strong);
  border-radius: .95rem;
  background: #fff;
  color: var(--h-ink);
  font-size: .98rem;
}
#food-search:focus {
  border-color: var(--h-accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(27, 104, 72, 0.14);
}
.search-clear {
  position: absolute;
  right: .4rem;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--h-muted);
  font-size: 1.25rem;
  display: grid;
  place-items: center;
}
.search-clear:hover {
  background: var(--h-surface-soft);
  color: var(--h-ink);
}

.hot-queries {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  margin-top: .7rem;
}
.hot-label {
  font-size: .82rem;
  color: var(--h-muted);
  font-weight: 600;
}
.hot-chip {
  min-height: 32px;
  padding: .18rem .68rem;
  border: 1px solid var(--h-border);
  border-radius: 999px;
  background: var(--h-surface-soft);
  color: var(--h-ink);
  font-size: .82rem;
  font-weight: 560;
}
.hot-chip:hover {
  border-color: var(--h-accent);
  background: var(--h-accent-soft);
  color: var(--h-accent);
}

.scene-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .42rem;
  margin-top: .85rem;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: .28rem .8rem;
  border-radius: 999px;
  border: 1px solid var(--h-border);
  background: #fff;
  color: var(--h-ink);
  font-size: .84rem;
  font-weight: 600;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.filter-pill:hover {
  border-color: var(--h-accent);
  background: var(--h-accent-tint);
}
.filter-pill.is-active {
  border-color: var(--h-accent);
  background: var(--h-accent);
  color: #fff;
}
.filter-pill.pill-low.is-active { background: #1c7c4d; border-color: #1c7c4d; }
.filter-pill.pill-med.is-active { background: #b86f09; border-color: #b86f09; }
.filter-pill.pill-high.is-active { background: #b93628; border-color: #b93628; }

.cat-and-sort {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  margin-top: .75rem;
  padding-top: .75rem;
  border-top: 1px solid var(--h-border);
}

.cat-filters {
  display: flex;
  align-items: center;
  gap: .35rem;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: .15rem;
  min-width: 0;
  flex: 1;
}
.cat-pill {
  flex: none;
  min-height: 34px;
  padding: .2rem .68rem;
  border-radius: .6rem;
  border: 1px solid transparent;
  background: var(--h-surface-soft);
  color: var(--h-muted);
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
}
.cat-pill:hover {
  color: var(--h-accent);
  background: var(--h-accent-soft);
}
.cat-pill.is-active {
  background: #dcefe3;
  border-color: #9ec8ae;
  color: #145238;
}

.sort-box {
  flex: none;
}
#food-sort {
  min-height: 36px;
  padding: .25rem .65rem;
  border: 1px solid var(--h-border-strong);
  border-radius: .6rem;
  background: #fff;
  color: var(--h-ink);
  font-size: .83rem;
  font-weight: 600;
}

.result-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .4rem 1rem;
  margin-top: .7rem;
  font-size: .84rem;
  color: var(--h-muted);
}

/* Estimator Card */
.estimator-card {
  padding: 1.05rem 1.15rem;
  border-color: #b8d8c4;
  background: linear-gradient(180deg, #f3faf5 0%, #ffffff 100%);
}
.estimator-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
}
.estimator-head h3 { margin: 0; font-size: 1rem; color: var(--h-accent); }
.estimator-head p { margin-top: .25rem; font-size: .84rem; color: var(--h-muted); }

.estimator-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 9.5rem;
  gap: .65rem;
  margin-top: .8rem;
}
.est-input {
  display: flex;
  flex-direction: column;
  gap: .28rem;
  font-size: .82rem;
  font-weight: 620;
  color: var(--h-ink);
}
.est-input input {
  min-height: 42px;
  padding: .4rem .7rem;
  border: 1px solid var(--h-border-strong);
  border-radius: .65rem;
  background: #fff;
  color: var(--h-ink);
  font-size: .94rem;
}
.est-preset-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .75rem;
}
.est-preset-btn {
  min-height: 36px;
  padding: .25rem .72rem;
  border-radius: 999px;
  border: 1px solid var(--h-border);
  background: #fff;
  color: var(--h-ink);
  font-size: .82rem;
  font-weight: 600;
}
.est-preset-btn.is-active {
  border-color: var(--h-accent);
  background: var(--h-accent);
  color: #fff;
}
.est-preview-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  margin-top: .85rem;
  padding-top: .75rem;
  border-top: 1px dashed var(--h-border);
}
.est-preview-nums {
  font-size: .88rem;
  font-weight: 620;
  color: var(--h-ink);
  font-variant-numeric: tabular-nums;
}

/* Food Cards */
.food-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}
.food-card {
  display: flex;
  flex-direction: column;
  gap: .52rem;
  padding: .95rem 1rem;
  border-radius: 1rem;
  border: 1px solid var(--h-border);
  background: #fff;
  min-width: 0;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.food-card:hover {
  border-color: #9ec6ad;
  box-shadow: 0 8px 20px rgba(21, 52, 38, 0.06);
}
.food-card.in-tray {
  border-color: var(--h-accent);
  background: #f6fcf8;
}
.food-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .5rem;
}
.food-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--h-ink);
}
.food-cat {
  flex: none;
  font-size: .74rem;
  font-weight: 600;
  padding: .14rem .48rem;
  border-radius: .45rem;
  background: var(--h-surface-soft);
  color: var(--h-muted);
}
.food-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.f-badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .12rem .5rem;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 660;
}
.f-badge.purine-low { background: #e8f7ee; color: #17623e; }
.f-badge.purine-medium { background: var(--h-sun-soft); color: #8c5306; }
.f-badge.purine-high { background: var(--h-coral-soft); color: var(--h-coral); }
.f-badge.health-healthy { background: #edf5ff; color: #1e529d; }
.f-badge.health-limit { background: #fff1eb; color: #9c3b19; }

.food-portion-line {
  font-size: .9rem;
  color: var(--h-ink);
  font-variant-numeric: tabular-nums;
}
.food-portion-line strong {
  color: var(--h-accent);
  font-size: 1rem;
}
.food-macro-line {
  font-size: .78rem;
  color: var(--h-muted);
  font-variant-numeric: tabular-nums;
}
.food-card-foot {
  margin-top: auto;
  padding-top: .35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.food-add-btn {
  width: 100%;
  min-height: 40px;
  padding: .35rem .75rem;
  border-radius: .7rem;
  border: 1px solid #b8d5c2;
  background: var(--h-accent-tint);
  color: var(--h-accent);
  font-size: .86rem;
  font-weight: 660;
  transition: background-color .14s ease, color .14s ease, border-color .14s ease;
}
.food-add-btn:hover,
.food-add-btn:focus-visible {
  background: var(--h-accent);
  border-color: var(--h-accent);
  color: #fff;
}
.food-card.in-tray .food-add-btn {
  background: var(--h-accent);
  border-color: var(--h-accent);
  color: #fff;
}

.food-empty {
  padding: 1.25rem;
  border-radius: 1rem;
  border: 1px dashed var(--h-border-strong);
  background: #fff;
  text-align: center;
  color: var(--h-muted);
}
.food-more-wrap {
  display: flex;
  justify-content: center;
}

/* Sticky Tray Panel */
.tray-panel {
  position: sticky;
  top: 4.7rem;
  padding: clamp(1rem, 2.2vw, 1.4rem);
  scroll-margin-top: 4.8rem;
}
.tray-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .65rem;
}
.tray-head h3 {
  margin: 0;
  font-size: 1.15rem;
}
.tray-slots {
  margin-top: .8rem;
}

.tray-summary {
  margin-top: .9rem;
  padding: .9rem;
  border-radius: .95rem;
  background: var(--h-surface-soft);
  border: 1px solid var(--h-border);
}
.tray-kcal-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .5rem;
  flex-wrap: wrap;
}
.tray-kcal-big {
  font-variant-numeric: tabular-nums;
}
.tray-kcal-big strong {
  font-size: 1.85rem;
  line-height: 1.1;
  color: var(--h-ink);
}
.tray-kcal-big span {
  font-size: .85rem;
  color: var(--h-muted);
  font-weight: 600;
}
.tray-budget-text {
  font-size: .82rem;
  color: var(--h-muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.tray-progress {
  height: 7px;
  border-radius: 999px;
  background: #dce9e0;
  overflow: hidden;
  margin-top: .55rem;
}
.tray-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--h-accent);
  transition: width .22s ease, background-color .22s ease;
}
.tray-progress-fill.is-over {
  background: var(--h-sun);
}
.tray-macro-bar {
  height: 7px;
  margin-top: .55rem;
}
.tray-macro-nums {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .3rem;
  margin-top: .55rem;
  font-size: .78rem;
  color: var(--h-muted);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.tray-macro-nums strong {
  display: block;
  color: var(--h-ink);
  font-size: .84rem;
}

/* Purine Traffic Light Card */
.purine-card {
  margin-top: .8rem;
  padding: .8rem .9rem;
  border-radius: .9rem;
  border: 1px solid var(--h-border);
  background: #fff;
}
.purine-card-head {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .9rem;
}
.purine-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #96ad9f;
  flex: none;
}
.purine-card p {
  margin-top: .32rem;
  font-size: .82rem;
  line-height: 1.55;
  color: var(--h-muted);
}
.purine-card[data-tone="low"] {
  background: #eef9f1;
  border-color: #b8dfc4;
}
.purine-card[data-tone="low"] .purine-dot { background: #1f9256; }
.purine-card[data-tone="low"] strong { color: #145c38; }

.purine-card[data-tone="medium"] {
  background: var(--h-sun-soft);
  border-color: var(--h-sun-border);
}
.purine-card[data-tone="medium"] .purine-dot { background: var(--h-sun); }
.purine-card[data-tone="medium"] strong { color: #8a5105; }

.purine-card[data-tone="high"] {
  background: var(--h-coral-soft);
  border-color: var(--h-coral-border);
}
.purine-card[data-tone="high"] .purine-dot { background: #d64334; }
.purine-card[data-tone="high"] strong { color: var(--h-coral); }

/* Exercise strip */
.exercise-strip {
  margin-top: .75rem;
  padding: .7rem .8rem;
  border-radius: .85rem;
  background: var(--h-surface-soft);
  border: 1px solid var(--h-border);
}
.exercise-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .4rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.exercise-row div {
  padding: .35rem .25rem;
  border-radius: .55rem;
  background: #fff;
  border: 1px solid #e1ece4;
}
.exercise-row span {
  display: block;
  font-size: .74rem;
  color: var(--h-muted);
}
.exercise-row strong {
  display: block;
  margin-top: .1rem;
  font-size: .88rem;
  color: var(--h-accent);
}
.exercise-row em {
  font-style: normal;
}
.exercise-caption {
  margin-top: .45rem;
  font-size: .76rem;
  color: var(--h-muted);
  text-align: center;
}

/* Sample Meals */
.tray-samples {
  margin-top: .85rem;
}
.samples-title {
  font-size: .83rem;
  color: var(--h-muted);
  font-weight: 600;
  margin-bottom: .5rem;
}
.sample-btns {
  display: grid;
  gap: .45rem;
}
.sample-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: .15rem;
  padding: .62rem .8rem;
  border-radius: .8rem;
  border: 1px solid var(--h-border);
  background: #fff;
}
.sample-btn:hover {
  border-color: var(--h-accent);
  background: var(--h-accent-tint);
}
.sample-btn strong { font-size: .88rem; color: var(--h-ink); }
.sample-btn span { font-size: .78rem; color: var(--h-muted); }

/* Tray Items List */
.tray-list {
  list-style: none;
  margin: .85rem 0 0;
  padding: 0;
  display: grid;
  gap: .55rem;
  max-height: 22rem;
  overflow-y: auto;
}
.tray-item {
  padding: .68rem .75rem;
  border-radius: .85rem;
  border: 1px solid var(--h-border);
  background: #fff;
  display: grid;
  gap: .45rem;
}
.tray-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .45rem;
}
.tray-item-name {
  font-size: .9rem;
  font-weight: 680;
  color: var(--h-ink);
  min-width: 0;
}
.tray-item-right {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  flex: none;
}
.tray-item-kcal {
  font-size: .86rem;
  font-weight: 700;
  color: var(--h-accent);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.tray-item-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  flex-wrap: nowrap;
}
.tray-unit-select {
  min-height: 36px;
  max-width: 8.6rem;
  min-width: 0;
  flex: 1 1 auto;
  padding: .2rem .45rem;
  border: 1px solid var(--h-border-strong);
  border-radius: .5rem;
  background: var(--h-surface-soft);
  color: var(--h-ink);
  font-size: .8rem;
  font-weight: 600;
}
.stepper {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  flex: none;
}
.step-btn {
  width: 36px;
  height: 36px;
  border-radius: .55rem;
  border: 1px solid var(--h-border-strong);
  background: #fff;
  color: var(--h-ink);
  font-size: 1.05rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.step-btn:hover {
  border-color: var(--h-accent);
  background: var(--h-accent-soft);
  color: var(--h-accent);
}
.step-val {
  min-width: 3.1rem;
  text-align: center;
  font-size: .82rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.tray-del-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--h-muted);
  font-size: 1.1rem;
  line-height: 1;
  display: inline-grid;
  place-items: center;
}
.tray-del-btn:hover {
  background: var(--h-coral-soft);
  color: var(--h-coral);
}

.tray-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .9rem;
}
.tray-actions .h-btn {
  flex: 1;
}

/* Module 3: Relax */
.relax-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2.2vw, 1.5rem);
  align-items: stretch;
}
.relax-card {
  display: flex;
  flex-direction: column;
  padding: clamp(1.1rem, 2.4vw, 1.6rem);
}
.relax-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
}
.relax-card-head h3 {
  margin: 0;
  font-size: 1.15rem;
}
.sound-toggle,
.step-badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: .2rem .72rem;
  border-radius: 999px;
  border: 1px solid var(--h-border-strong);
  background: var(--h-surface-soft);
  color: var(--h-ink);
  font-size: .8rem;
  font-weight: 620;
  white-space: nowrap;
}
.sound-toggle[aria-pressed="true"] {
  border-color: var(--h-accent);
  background: var(--h-accent-soft);
  color: var(--h-accent);
}

.relax-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .85rem;
}

/* Breathing Ring */
.breath-stage {
  position: relative;
  width: 224px;
  height: 224px;
  margin: 1.2rem auto 1rem;
  display: grid;
  place-items: center;
}
.breath-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.breath-track {
  fill: none;
  stroke: #e2ede5;
  stroke-width: 8;
}
.breath-progress {
  fill: none;
  stroke: var(--h-accent);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset .25s linear, opacity .2s ease;
}
.breath-stage[data-started="false"] .breath-progress {
  opacity: 0;
}
.breath-orb {
  position: absolute;
  width: 146px;
  height: 146px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d8f2e1, #9ed5b4);
  opacity: .55;
  transform: scale(0.76);
  transition: transform var(--breath-dur, 1.2s) ease-in-out, opacity .4s ease;
}
.breath-stage[data-phase="inhale"] .breath-orb {
  transform: scale(1.16);
  opacity: .85;
}
.breath-stage[data-phase="hold"] .breath-orb {
  transform: scale(1.16);
  opacity: .75;
}
.breath-stage[data-phase="exhale"] .breath-orb {
  transform: scale(0.74);
  opacity: .45;
}
.breath-stage[data-phase="rest"] .breath-orb {
  transform: scale(0.74);
  opacity: .38;
}

.breath-center {
  position: relative;
  z-index: 1;
  text-align: center;
  padding-inline: .8rem;
}
.breath-phase {
  display: block;
  font-size: .96rem;
  font-weight: 700;
  color: var(--h-ink);
}
.breath-timer {
  display: block;
  margin-top: .15rem;
  font-size: 2.05rem;
  line-height: 1.1;
  color: var(--h-accent);
  font-variant-numeric: tabular-nums;
}
.breath-sub {
  display: block;
  margin-top: .25rem;
  font-size: .76rem;
  color: var(--h-muted);
  font-variant-numeric: tabular-nums;
}

.breath-footer {
  margin-top: auto;
  display: grid;
  gap: .75rem;
}
.duration-group {
  display: flex;
  justify-content: center;
  gap: .4rem;
}
.dur-btn {
  min-height: 36px;
  padding: .25rem .85rem;
  border-radius: 999px;
  border: 1px solid var(--h-border);
  background: var(--h-surface-soft);
  color: var(--h-muted);
  font-size: .84rem;
  font-weight: 620;
}
.dur-btn.is-active {
  border-color: var(--h-accent);
  background: var(--h-accent-soft);
  color: var(--h-accent);
}

.relax-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: .55rem;
}

/* Stretch Card */
.stretch-dots {
  display: flex;
  gap: .4rem;
  margin-top: 1rem;
}
.stretch-dot {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: #dfeae2;
  transition: background-color .2s ease;
}
.stretch-dot.is-done { background: #77ba96; }
.stretch-dot.is-current { background: var(--h-accent); }

.stretch-stage {
  margin-top: 1rem;
  padding: 1.05rem 1.1rem;
  border-radius: 1rem;
  border: 1px solid var(--h-border);
  background: var(--h-surface-soft);
  display: grid;
  gap: 1rem;
  flex: 1;
}
.stretch-clock-row {
  display: flex;
  gap: .85rem;
  align-items: flex-start;
}
.stretch-icon {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: .9rem;
  background: #fff;
  border: 1px solid var(--h-border);
  display: grid;
  place-items: center;
  font-size: 1.55rem;
}
.stretch-clock-meta h4 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--h-ink);
}
.stretch-clock-meta p {
  margin-top: .32rem;
  font-size: .9rem;
  line-height: 1.65;
  color: var(--h-muted);
}

.stretch-timer-box {
  margin-top: auto;
  padding-top: .75rem;
  border-top: 1px dashed var(--h-border);
}
.stretch-time {
  display: block;
  font-size: 2.15rem;
  line-height: 1.1;
  color: var(--h-accent);
  font-variant-numeric: tabular-nums;
}
.stretch-bar {
  height: 8px;
  border-radius: 999px;
  background: #dce8df;
  overflow: hidden;
  margin: .5rem 0 .45rem;
}
.stretch-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--h-accent);
  transition: width .25s linear;
}
.stretch-controls {
  margin-top: 1rem;
  justify-content: flex-start;
}

/* Micro-care & Hydration Pace daily strip */
.micro-care-card {
  margin-top: 1.15rem;
  padding: 1.1rem 1.25rem;
  display: grid;
  gap: 1rem;
  background: linear-gradient(135deg, #ffffff 0%, #f1f8f3 100%);
}
.micro-care-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  padding-top: .95rem;
  border-top: 1px dashed var(--h-border);
}
.micro-care-mascot h4 {
  margin: 0;
  font-size: 1rem;
}
.micro-care-mascot {
  display: flex;
  align-items: center;
  gap: .85rem;
  min-width: 0;
}
.micro-care-mascot img {
  flex: none;
  width: 66px;
  height: 66px;
  border-radius: 1rem;
  background: #fff;
  border: 1px solid var(--h-border);
  object-fit: contain;
  padding: .2rem;
}
.micro-care-mascot h3 {
  margin: 0;
  font-size: 1rem;
}
.care-date {
  font-size: .8rem;
  font-weight: 560;
  color: var(--h-accent);
  margin-left: .35rem;
}
.micro-care-checks {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.care-chip {
  display: inline-flex;
  align-items: center;
  gap: .42rem;
  min-height: 40px;
  padding: .35rem .82rem;
  border-radius: 999px;
  border: 1px solid var(--h-border-strong);
  background: #fff;
  color: var(--h-ink);
  font-size: .86rem;
  font-weight: 600;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.care-mark {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid #9ab9a6;
  display: inline-grid;
  place-items: center;
  font-size: .72rem;
}
.care-chip[aria-pressed="true"] {
  border-color: var(--h-accent);
  background: var(--h-accent-soft);
  color: var(--h-accent);
}
.care-chip[aria-pressed="true"] .care-mark {
  background: var(--h-accent);
  border-color: var(--h-accent);
  color: #fff;
}
.care-chip[aria-pressed="true"] .care-mark::after {
  content: "✓";
}

/* Module 4: Cloud Continuity */
.cloud-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .95rem;
}
.cloud-card {
  display: flex;
  flex-direction: column;
  padding: 1.2rem 1.3rem;
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.cloud-card:hover,
.cloud-card:focus-visible {
  border-color: var(--h-cobalt);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(28, 67, 169, 0.08);
}
.cloud-tag {
  align-self: flex-start;
  padding: .16rem .6rem;
  border-radius: 999px;
  background: var(--h-cobalt-soft);
  color: var(--h-cobalt);
  font-size: .76rem;
  font-weight: 680;
}
.cloud-card h3 {
  margin: .55rem 0 .4rem;
  font-size: 1.08rem;
  color: var(--h-ink);
}
.cloud-card p {
  color: var(--h-muted);
  font-size: .9rem;
  line-height: 1.68;
}
.cloud-go {
  margin-top: auto;
  padding-top: .85rem;
  color: var(--h-cobalt);
  font-size: .88rem;
  font-weight: 660;
}

.community-card {
  margin-top: 1.15rem;
  padding: 1.15rem 1.35rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
}
.community-left {
  display: flex;
  align-items: center;
  gap: .95rem;
  max-width: 38rem;
  min-width: 0;
}
.community-left img {
  flex: none;
  width: 58px;
  height: 58px;
  border-radius: .95rem;
  border: 1px solid var(--h-border);
  background: #fff;
}
.community-left h3 { margin: 0; font-size: 1.04rem; }
.community-left p { margin-top: .25rem; font-size: .88rem; color: var(--h-muted); line-height: 1.6; }
.community-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}

.health-disclaimer {
  margin-top: 1.25rem;
  padding: .9rem 1.1rem;
  border-radius: .9rem;
  border: 1px solid var(--h-border);
  background: rgba(255, 255, 255, 0.72);
  color: var(--h-muted);
  font-size: .82rem;
  line-height: 1.7;
}

/* V2: 4-High Metabolic Focuses, Risk Badges, Tea Sweetness & 4-Light Shield */
.legend-sub {
  font-weight: 500;
  color: var(--h-muted);
  font-size: .8rem;
}

.focus-card {
  position: relative;
  padding-right: 2rem;
}
.focus-card::after {
  content: "";
  position: absolute;
  top: .72rem;
  right: .72rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid #a8c4b2;
  background: #fff;
  display: grid;
  place-items: center;
  font-size: .72rem;
  font-weight: 700;
  color: #fff;
}
.focus-card.is-active::after {
  content: "✓";
  border-color: var(--h-accent);
  background: var(--h-accent);
}

/* Extended food risk & positive badges */
.f-badge.risk-combo { background: #fbe4e1; color: #9c1f14; border: 1px solid #f0b5ad; }
.f-badge.risk-sugar { background: #fff0e6; color: #b24107; }
.f-badge.risk-gi { background: var(--h-sun-soft); color: #8c5306; }
.f-badge.risk-lipid { background: #fdf0ee; color: var(--h-coral); }
.f-badge.risk-sodium { background: #f3effc; color: #5b32a8; }
.f-badge.risk-goodfat { background: #ebf6f2; color: #196850; }
.f-badge.risk-sweet { background: #eef4ff; color: var(--h-cobalt); }
.f-badge.risk-four-ok { background: #e5f6ec; color: #145e39; }

/* Estimator & In-tray tea sweetness pills */
.est-sweet-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem .6rem;
  margin-top: .75rem;
}
.est-sweet-label {
  font-size: .82rem;
  font-weight: 650;
  color: var(--h-ink);
}
.sweet-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .32rem;
}
.sweet-pill {
  min-height: 32px;
  padding: .16rem .62rem;
  border-radius: 999px;
  border: 1px solid var(--h-border-strong);
  background: #fff;
  color: var(--h-muted);
  font-size: .78rem;
  font-weight: 620;
  transition: background-color .14s ease, border-color .14s ease, color .14s ease;
}
.sweet-pill:hover {
  border-color: var(--h-accent);
  color: var(--h-accent);
}
.sweet-pill.is-active {
  border-color: var(--h-accent);
  background: var(--h-accent);
  color: #fff;
}

.tray-sweet-box {
  padding-top: .45rem;
  border-top: 1px dashed #e1ebe4;
  display: grid;
  gap: .35rem;
}
.tray-sweet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .4rem;
  flex-wrap: wrap;
  font-size: .76rem;
  color: var(--h-muted);
}
.tray-sweet-saved {
  color: #166a42;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
}
.tray-sweet-box .sweet-pills {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .28rem;
}
.tray-sweet-box .sweet-pill {
  padding-inline: .2rem;
  text-align: center;
  white-space: nowrap;
}

/* 4-High Shield Dashboard inside Meal Tray */
.shield-box {
  margin-top: .85rem;
  padding: .85rem;
  border-radius: .95rem;
  border: 1px solid var(--h-border);
  background: #fff;
  display: grid;
  gap: .7rem;
}
.shield-box[data-tone="low"] {
  background: #f2faf5;
  border-color: #bfe2cb;
}
.shield-box[data-tone="medium"] {
  background: #fffcf4;
  border-color: #eed6a1;
}
.shield-box[data-tone="high"] {
  background: #fff8f7;
  border-color: #f0c5be;
}

.shield-lights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .38rem;
}
.shield-light {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .16rem;
  padding: .48rem .28rem;
  border-radius: .7rem;
  border: 1px solid var(--h-border);
  background: var(--h-surface-soft);
  min-width: 0;
}
.shield-light.is-focused {
  box-shadow: inset 0 0 0 1.5px var(--h-accent);
}
.shield-light-label {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  font-size: .74rem;
  font-weight: 660;
  color: var(--h-muted);
}
.shield-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9fb4a7;
  flex: none;
}
.shield-light-status {
  font-size: .76rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--h-ink);
}
.shield-light[data-tone="low"] { background: #ecf8f0; border-color: #bee2ca; }
.shield-light[data-tone="low"] .shield-dot { background: #1f9256; }
.shield-light[data-tone="low"] .shield-light-status { color: #145c38; }

.shield-light[data-tone="medium"] { background: var(--h-sun-soft); border-color: var(--h-sun-border); }
.shield-light[data-tone="medium"] .shield-dot { background: var(--h-sun); }
.shield-light[data-tone="medium"] .shield-light-status { color: #8a5105; }

.shield-light[data-tone="high"] { background: var(--h-coral-soft); border-color: var(--h-coral-border); }
.shield-light[data-tone="high"] .shield-dot { background: #d64334; }
.shield-light[data-tone="high"] .shield-light-status { color: var(--h-coral); }

/* Sugar Cube Visual Strip */
.sugar-cube-bar {
  padding: .68rem .78rem;
  border-radius: .78rem;
  border: 1px solid #f2d5a4;
  background: #fffaf0;
  display: grid;
  gap: .36rem;
}
.sugar-cube-bar.is-ok {
  border-color: #c2e2cd;
  background: #f1faf4;
}
.sugar-cube-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .4rem;
  flex-wrap: wrap;
  font-size: .83rem;
  color: var(--h-ink);
  font-variant-numeric: tabular-nums;
}
.sugar-saved-badge {
  display: inline-flex;
  align-items: center;
  padding: .12rem .5rem;
  border-radius: 999px;
  background: #dcf4e4;
  color: #145e39;
  font-size: .74rem;
  font-weight: 680;
}
.sugar-cubes-visual {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}
.sugar-cube-unit {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: linear-gradient(135deg, #ffffff 0%, #f5e6cc 100%);
  border: 1px solid #ddb573;
  box-shadow: 0 1px 2px rgba(155, 98, 16, 0.14);
}
.sugar-cube-unit.is-half {
  width: 8px;
}
.sugar-cube-more {
  font-size: .74rem;
  font-weight: 700;
  color: #9b4b08;
  margin-left: 2px;
}
.sugar-cube-sub {
  font-size: .76rem;
  color: var(--h-muted);
  line-height: 1.45;
}

.shield-advice {
  display: grid;
  gap: .38rem;
}
.shield-empty-tip {
  font-size: .82rem;
  color: var(--h-muted);
  line-height: 1.55;
}
.shield-advice-item {
  font-size: .81rem;
  line-height: 1.55;
  color: var(--h-ink);
  padding: .42rem .58rem;
  border-radius: .6rem;
  background: rgba(255, 255, 255, 0.85);
  border-left: 3px solid #9db7a6;
}
.shield-advice-item[data-tone="high"] {
  border-left-color: #d64334;
}
.shield-advice-item[data-tone="medium"] {
  border-left-color: var(--h-sun);
}
.shield-advice-item[data-tone="low"] {
  border-left-color: #1f9256;
  color: #145c38;
}
.shield-advice-item strong {
  margin-right: .25rem;
}

@media (max-width: 28rem) {
  .shield-lights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* V3: Daily & Weekly Recommended Recipes Module */
.recipe-shell {
  padding: clamp(1.1rem, 2.5vw, 1.7rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.05rem;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.recipe-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .8rem 1.2rem;
}
.recipe-scene-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem .65rem;
  min-width: 0;
}
.toolbar-label {
  font-size: .86rem;
  font-weight: 660;
  color: var(--h-muted);
  white-space: nowrap;
}
.scene-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .38rem;
}
.recipe-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .48rem;
}

.weekday-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .6rem 1.2rem;
  padding-top: .85rem;
  border-top: 1px solid var(--h-border);
}
.weekday-pills {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .35rem;
  width: min(100%, 30rem);
}
.weekday-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 44px;
  padding: .25rem .2rem;
  border-radius: .7rem;
  border: 1px solid var(--h-border);
  background: var(--h-surface-soft);
  color: var(--h-muted);
  font-size: .84rem;
  font-weight: 640;
  line-height: 1.15;
  white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.weekday-btn small {
  font-size: .66rem;
  font-weight: 600;
  color: var(--h-accent);
  margin-top: .08rem;
}
.weekday-btn:hover {
  border-color: var(--h-accent);
  color: var(--h-accent);
}
.weekday-btn.is-active {
  border-color: var(--h-accent);
  background: var(--h-accent);
  color: #fff;
}
.weekday-btn.is-active small {
  color: #d7f4e2;
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .9rem;
}

.recipe-card {
  display: flex;
  flex-direction: column;
  gap: .68rem;
  padding: 1.05rem 1.15rem;
  border-radius: 1rem;
  border: 1px solid var(--h-border);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbf8 100%);
  min-width: 0;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.recipe-card:hover {
  border-color: #a4cbb2;
  box-shadow: 0 8px 22px rgba(21, 52, 38, 0.06);
}
.recipe-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .6rem;
}
.recipe-slot-tag {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .78rem;
  font-weight: 700;
  color: var(--h-accent);
}
.recipe-slot-tag span {
  font-weight: 500;
  color: var(--h-muted);
}
.recipe-card-title {
  margin: .2rem 0 0;
  font-size: 1.08rem;
  font-weight: 720;
  color: var(--h-ink);
  line-height: 1.3;
}
.recipe-card-kcal {
  flex: none;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.recipe-card-kcal strong {
  display: block;
  font-size: 1.18rem;
  line-height: 1.15;
  color: var(--h-accent);
}
.recipe-card-kcal span {
  font-size: .74rem;
  color: var(--h-muted);
}

.recipe-dish-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .38rem;
}
.recipe-dish-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .42rem .62rem;
  border-radius: .65rem;
  background: #fff;
  border: 1px solid #e4eee6;
  font-size: .88rem;
}
.recipe-dish-name {
  font-weight: 630;
  color: var(--h-ink);
  min-width: 0;
}
.recipe-dish-portion {
  flex: none;
  color: var(--h-muted);
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.recipe-dish-portion strong {
  color: var(--h-ink);
  font-weight: 660;
}

.recipe-tip {
  font-size: .82rem;
  line-height: 1.55;
  color: #365245;
  padding: .5rem .7rem;
  border-radius: .68rem;
  background: var(--h-accent-tint);
  border-left: 3px solid var(--h-accent);
}

.recipe-card-foot {
  margin-top: auto;
  padding-top: .25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  flex-wrap: wrap;
}
.recipe-mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: .25rem .78rem;
  border-radius: 999px;
  border: 1px solid var(--h-border-strong);
  background: #fff;
  color: var(--h-ink);
  font-size: .83rem;
  font-weight: 630;
  transition: background-color .14s ease, border-color .14s ease, color .14s ease;
}
.recipe-mini-btn:hover,
.recipe-mini-btn:focus-visible {
  border-color: var(--h-accent);
  background: var(--h-accent-soft);
  color: var(--h-accent);
}
.recipe-mini-btn.is-primary {
  border-color: #b7d7c2;
  background: var(--h-accent-soft);
  color: var(--h-accent);
}
.recipe-mini-btn.is-primary:hover,
.recipe-mini-btn.is-primary:focus-visible {
  border-color: var(--h-accent);
  background: var(--h-accent);
  color: #fff;
}

/* Full-day Recipe Summary Bar */
.recipe-summary-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .85rem 1.25rem;
  padding: .95rem 1.1rem;
  border-radius: .95rem;
  border: 1px solid #cce2d3;
  background: linear-gradient(135deg, #f1f8f3 0%, #ffffff 100%);
}
.recipe-sum-left {
  display: grid;
  gap: .3rem;
  font-variant-numeric: tabular-nums;
}
.recipe-sum-kcal {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .35rem;
  font-size: .92rem;
  color: var(--h-muted);
  font-weight: 620;
}
.recipe-sum-kcal strong {
  font-size: 1.55rem;
  line-height: 1.1;
  color: var(--h-ink);
}
.recipe-match-pill {
  font-style: normal;
  padding: .12rem .55rem;
  border-radius: 999px;
  background: #dcf3e4;
  color: #145e39;
  font-size: .76rem;
  font-weight: 680;
}
.recipe-sum-macros {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1rem;
  font-size: .84rem;
  color: var(--h-muted);
}
.recipe-sum-macros strong {
  color: var(--h-ink);
}
.recipe-sum-lights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .38rem;
  min-width: min(100%, 24rem);
}

/* Grocery / Ordering Cheat Sheet */
.recipe-shopping-details summary {
  flex-wrap: wrap;
  gap: .35rem .8rem;
}
.recipe-shopping-details summary .hint-small {
  margin-left: auto;
}
.shopping-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  margin-top: .75rem;
}
.shopping-group {
  padding: .75rem .9rem;
  border-radius: .8rem;
  border: 1px solid var(--h-border);
  background: #fff;
}
.shopping-group h4 {
  margin: 0 0 .42rem;
  font-size: .88rem;
  color: var(--h-accent);
}
.shopping-group ul {
  margin: 0;
  padding-left: 1.05rem;
  font-size: .83rem;
  color: var(--h-ink);
  line-height: 1.7;
  font-variant-numeric: tabular-nums;
}
.shopping-actions {
  margin-top: .8rem;
}

@media (max-width: 52rem) {
  .recipe-grid,
  .shopping-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .recipe-sum-lights {
    width: 100%;
  }
}

@media (max-width: 30rem) {
  .recipe-sum-lights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .recipe-toolbar-actions {
    width: 100%;
  }
  .recipe-toolbar-actions .h-btn {
    flex: 1 1 auto;
  }
}

/* ================================================================
 * V5 Upgrades: Healthy Swaps, Recipe Exclusions/Recovery/Weekly,
 * Food 1v1 PK, Deep Sleep Sanctuary, White Noise & Water Tracker
 * ================================================================ */

/* 1. Recipe V5: Exclusions, Recovery Mode & Weekly Shopping Switch */
.recipe-prefs-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .6rem 1rem;
  padding: .68rem .85rem;
  border-radius: .85rem;
  background: var(--h-surface-soft);
  border: 1px solid var(--h-border);
}
.recovery-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: .42rem;
  min-height: 36px;
  padding: .24rem .82rem;
  border-radius: 999px;
  border: 1px solid #bcdbc6;
  background: #fff;
  color: #175c3c;
  font-size: .83rem;
  font-weight: 660;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.recovery-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #249b62;
  flex: none;
}
.recovery-toggle-btn[aria-pressed="true"] {
  background: #166544;
  border-color: #166544;
  color: #fff;
}
.recovery-toggle-btn[aria-pressed="true"] .recovery-dot {
  background: #a3f5c8;
}
.recipe-excl-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .5rem;
  min-width: 0;
}
.recipe-excl-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .32rem;
}
.excl-pill {
  min-height: 32px;
  padding: .16rem .62rem;
  border-radius: 999px;
  border: 1px solid var(--h-border);
  background: #fff;
  color: var(--h-muted);
  font-size: .79rem;
  font-weight: 600;
  transition: background-color .14s ease, color .14s ease, border-color .14s ease;
}
.excl-pill:hover {
  border-color: var(--h-accent);
  color: var(--h-accent);
}
.excl-pill.is-active {
  border-color: #b45309;
  background: #fef3c7;
  color: #92400e;
}
.shopping-head-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  margin-top: .7rem;
}
.shopping-scope-seg {
  max-width: 19rem;
}

/* 2. Foods V5: 1v1 PK Bar/Panel + Card PK Button + Tray Red-Light Swaps */
.pk-bar {
  padding: .82rem 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .65rem;
  min-width: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #ffffff 0%, #f4f9f5 100%);
}
.pk-bar-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem .6rem;
  min-width: 0;
}
.pk-bar-title {
  font-size: .84rem;
  font-weight: 680;
  color: var(--h-ink);
  white-space: nowrap;
}
.pk-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  min-width: 0;
  max-width: 100%;
}
.pk-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  min-width: 0;
  padding: .42rem .68rem;
  border-radius: .65rem;
  background: #e9f5ee;
  color: #145238;
  font-size: .82rem;
  font-weight: 620;
}
.pk-panel {
  padding-top: .45rem;
  border-top: 1px dashed var(--h-border);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .7rem;
  min-width: 0;
}
.pk-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
}
.pk-col {
  padding: .78rem .88rem;
  border-radius: .85rem;
  border: 1px solid var(--h-border);
  background: #fff;
  display: grid;
  gap: .42rem;
  min-width: 0;
}
.pk-col.is-winner {
  border-color: #1b6848;
  background: #f5fcf7;
  box-shadow: 0 4px 14px rgba(27, 104, 72, 0.08);
}
.pk-col-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .4rem;
}
.pk-col-head h4 {
  margin: 0;
  font-size: .96rem;
  color: var(--h-ink);
}
.pk-win-tag {
  flex: none;
  padding: .1rem .45rem;
  border-radius: 999px;
  background: #1b6848;
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
}
.pk-stat-line {
  font-size: .82rem;
  color: var(--h-muted);
  font-variant-numeric: tabular-nums;
}
.pk-stat-line strong {
  color: var(--h-accent);
  font-size: .95rem;
}
.pk-lights-mini {
  display: flex;
  flex-wrap: wrap;
  gap: .28rem;
}
.pk-light-pill {
  padding: .08rem .42rem;
  border-radius: 999px;
  font-size: .71rem;
  font-weight: 650;
}
.pk-light-pill[data-tone="low"] { background: #e8f7ee; color: #17623e; }
.pk-light-pill[data-tone="medium"] { background: #fff4df; color: #8c5306; }
.pk-light-pill[data-tone="high"] { background: #fdecea; color: #b93628; }
.pk-verdicts {
  margin: 0;
  padding: .55rem .8rem .55rem 1.4rem;
  border-radius: .75rem;
  background: #eff7f1;
  color: #1d4332;
  font-size: .82rem;
  line-height: 1.6;
}
.pk-foot-actions {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
}

.food-pk-btn {
  flex: none;
  min-height: 40px;
  padding: .3rem .65rem;
  border-radius: .7rem;
  border: 1px solid var(--h-border-strong);
  background: #fff;
  color: var(--h-muted);
  font-size: .8rem;
  font-weight: 660;
  white-space: nowrap;
  transition: background-color .14s ease, color .14s ease, border-color .14s ease;
}
.food-pk-btn:hover {
  border-color: var(--h-accent);
  color: var(--h-accent);
}
.food-pk-btn.is-picked {
  border-color: #1b6848;
  background: #e5f5eb;
  color: #145238;
}

.tray-swaps-box {
  margin-top: .65rem;
  padding-top: .65rem;
  border-top: 1px dashed #d6e4da;
}
.tray-swaps-title {
  margin: 0 0 .45rem;
  font-size: .8rem;
  font-weight: 680;
  color: #175c3c;
}
.tray-swaps-list {
  display: grid;
  gap: .38rem;
}
.tray-swap-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .46rem .72rem;
  border-radius: .72rem;
  border: 1px solid #b8dbc4;
  background: #f4fbf6;
  color: #154d35;
  text-align: left;
  font-size: .82rem;
  font-weight: 650;
  transition: background-color .14s ease, border-color .14s ease, color .14s ease;
}
.tray-swap-btn:hover {
  background: #1b6848;
  border-color: #1b6848;
  color: #fff;
}
.tray-swap-btn span {
  font-size: .75rem;
  font-weight: 600;
  opacity: .86;
  white-space: nowrap;
}

/* 3. Deep Sleep Sanctuary V5 */
.sleep-workbench {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.sleep-card {
  padding: clamp(1rem, 2.2vw, 1.45rem);
  display: flex;
  flex-direction: column;
  gap: .85rem;
  background: linear-gradient(180deg, #ffffff 0%, #f6faf8 100%);
}
.sleep-card-head h3 {
  margin: 0;
  font-size: 1.08rem;
  color: var(--h-ink);
}
.sleep-card-head p {
  margin-top: .22rem;
}
.sleep-mode-seg {
  width: 100%;
}
.sleep-wake-controls {
  display: grid;
  gap: .55rem;
}
.sleep-wake-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .6rem;
}
.sleep-time-field,
.sleep-latency-field {
  display: grid;
  gap: .28rem;
  font-size: .8rem;
  font-weight: 640;
  color: var(--h-muted);
}
.sleep-time-field input,
.sleep-latency-field select {
  min-height: 42px;
  padding: .35rem .65rem;
  border-radius: .7rem;
  border: 1px solid var(--h-border-strong);
  background: #fff;
  color: var(--h-ink);
  font-size: .95rem;
  font-weight: 640;
}
.sleep-quick-times {
  display: flex;
  flex-wrap: wrap;
  gap: .36rem;
}
.sleep-quick-times .hot-chip.is-active,
.sleep-qual-pills .hot-chip.is-active {
  border-color: var(--h-accent);
  background: var(--h-accent);
  color: #fff;
}
.sleep-cycles-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem;
}
.sleep-cycle-tile {
  padding: .72rem .75rem;
  border-radius: .85rem;
  border: 1px solid var(--h-border);
  background: #fff;
  display: grid;
  gap: .22rem;
  font-variant-numeric: tabular-nums;
}
.sleep-cycle-tile.is-featured {
  border-color: #1b6848;
  background: linear-gradient(145deg, #edf8f1 0%, #ffffff 100%);
  box-shadow: 0 6px 16px rgba(27, 104, 72, 0.08);
}
.sleep-cycle-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .25rem;
  font-size: .74rem;
  color: var(--h-muted);
  font-weight: 640;
}
.sleep-cycle-badge {
  padding: .06rem .38rem;
  border-radius: 999px;
  background: #e6f3eb;
  color: #145c38;
  font-size: .68rem;
  font-weight: 700;
}
.sleep-cycle-tile.is-featured .sleep-cycle-badge {
  background: #1b6848;
  color: #fff;
}
.sleep-cycle-time {
  font-size: 1.42rem;
  line-height: 1.15;
  color: var(--h-ink);
  font-weight: 760;
}
.sleep-cycle-sub {
  font-size: .74rem;
  color: var(--h-muted);
  line-height: 1.38;
}
.sleep-sub-heading {
  margin: 0 0 .5rem;
  font-size: .84rem;
  font-weight: 680;
  color: var(--h-accent);
}
.sleep-timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .42rem;
}
.sleep-timeline-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .6rem;
  align-items: flex-start;
  padding: .52rem .68rem;
  border-radius: .75rem;
  border: 1px solid #e3ede6;
  background: #fff;
}
.sleep-tl-time {
  padding: .16rem .5rem;
  border-radius: .55rem;
  background: #edf6f0;
  color: #154d35;
  font-size: .82rem;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.sleep-tl-body strong {
  display: block;
  font-size: .84rem;
  color: var(--h-ink);
}
.sleep-tl-body span {
  display: block;
  margin-top: .14rem;
  font-size: .76rem;
  color: var(--h-muted);
  line-height: 1.45;
}

/* Symptom Prescription & White Noise */
.sleep-symptom-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.sleep-rx-output {
  display: grid;
  gap: .55rem;
}
.sleep-rx-headline {
  margin: 0;
  font-size: .85rem;
  font-weight: 680;
  color: var(--h-accent);
}
.sleep-rx-meta {
  margin: 0;
  padding: .55rem .72rem;
  border-radius: .72rem;
  background: #f2f7f4;
  border-left: 3px solid #2b7a57;
  font-size: .8rem;
  color: #2e4e3f;
  line-height: 1.55;
}
.sleep-rx-item {
  padding: .68rem .8rem;
  border-radius: .8rem;
  border: 1px solid #d7e7dd;
  background: #fff;
  display: grid;
  gap: .36rem;
}
.sleep-rx-item h4 {
  margin: 0;
  font-size: .9rem;
  color: var(--h-ink);
}
.sleep-rx-item ul {
  margin: 0;
  padding-left: 1.05rem;
  font-size: .8rem;
  color: var(--h-muted);
  line-height: 1.58;
}
.sleep-rx-act {
  justify-self: start;
  margin-top: .15rem;
}

.sleep-sound-box {
  margin-top: auto;
  padding: .85rem .95rem;
  border-radius: .95rem;
  border: 1px solid #cfe3d6;
  background: linear-gradient(135deg, #eef7f1 0%, #f9fcf9 100%);
  display: grid;
  gap: .62rem;
}
.sleep-sound-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
}
.sleep-sound-head h4 {
  margin: 0;
  font-size: .92rem;
  color: var(--h-ink);
}
.sleep-sound-timer {
  flex: none;
  padding: .16rem .55rem;
  border-radius: 999px;
  background: #1b6848;
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.sleep-sound-pills {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .38rem;
}
.sleep-sound-pills .filter-pill {
  justify-content: center;
  min-height: 36px;
  padding: .2rem .35rem;
  font-size: .8rem;
}
.sleep-sound-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .55rem .8rem;
}
.sleep-sound-durs {
  display: inline-flex;
  gap: .28rem;
}
.sleep-vol-wrap {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .78rem;
  color: var(--h-muted);
  font-weight: 600;
}
.sleep-vol-wrap input {
  width: 5.5rem;
  accent-color: var(--h-accent);
}

/* Last-Night Sleep Debt + Bedtime Ritual */
.sleep-debt-card {
  padding: clamp(1rem, 2.2vw, 1.35rem);
  margin-bottom: 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 1rem 1.4rem;
  background: linear-gradient(135deg, #ffffff 0%, #f3f9f5 100%);
}
.sleep-debt-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .45rem;
}
.sleep-debt-head h3 {
  margin: 0;
  font-size: 1rem;
}
.sleep-debt-badge {
  padding: .16rem .62rem;
  border-radius: 999px;
  background: #e6f6ec;
  color: #145e39;
  font-size: .78rem;
  font-weight: 680;
}
.sleep-debt-badge[data-tone="mild"] { background: #fff4df; color: #8c5306; }
.sleep-debt-badge[data-tone="warn"] { background: #fdecea; color: #b93628; }
.sleep-debt-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem .8rem;
  margin-top: .65rem;
}
.sleep-hours-pills,
.sleep-qual-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .32rem;
}
.sleep-debt-tips {
  margin-top: .65rem;
  padding: .62rem .78rem;
  border-radius: .78rem;
  background: #fff;
  border: 1px solid var(--h-border);
  display: grid;
  gap: .35rem;
  font-size: .82rem;
  color: var(--h-muted);
  line-height: 1.55;
}
.sleep-debt-tips p { margin: 0; }
.tip-tag { color: var(--h-accent); }
.sleep-ritual-right {
  display: grid;
  gap: .55rem;
  align-content: start;
}
.sleep-ritual-right h4 {
  margin: 0;
  font-size: .92rem;
  color: var(--h-ink);
}
.sleep-ritual-checks {
  display: grid;
  gap: .38rem;
}
.breath-head-toggles {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  flex: none;
}

/* 4. Interactive Hydration Pace Cup Tracker */
.water-tracker-box {
  display: grid;
  gap: .65rem;
}
.water-tracker-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .6rem 1rem;
}
.water-tracker-head h3 {
  margin: 0;
  font-size: 1.02rem;
}
.water-tracker-actions {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}
.water-add-btn {
  min-height: 38px;
  padding: .3rem .88rem;
  font-size: .86rem;
}
.water-progress-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem .9rem;
}
.water-progress-bar {
  flex: 1 1 14rem;
  height: 12px;
  border-radius: 999px;
  background: #dcece2;
  overflow: hidden;
}
.water-progress-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2b8dc4 0%, #1d7a64 100%);
  transition: width .25s ease;
}
.water-progress-text {
  font-size: .88rem;
  color: var(--h-accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .breath-orb,
  .breath-progress,
  .bmi-marker,
  .tray-progress-fill,
  .stretch-bar span,
  .cloud-card,
  .h-btn {
    transition: none !important;
  }
  .breath-stage[data-phase] .breath-orb {
    transform: scale(0.95);
  }
}

/* Responsive Breakpoints: Tablet (768px - 1024px) keeps full multi-section scroll */
@media (max-width: 64rem) {
  .plan-grid,
  .foods-workbench,
  .sleep-workbench,
  .sleep-debt-card,
  .relax-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .tray-panel {
    position: static;
  }
}

@media (max-width: 52rem) {
  .health-hero-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.2rem;
  }
  .cloud-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ================================================================
 * Dedicated Mobile Phone App Experience (<= 767px / 47.99rem)
 * Desktop (>= 1024px) & Tablet (>= 768px) stay untouched!
 * ================================================================ */
@media (max-width: 47.99rem) {
  :root {
    --gutter: .88rem;
  }

  button,
  a {
    -webkit-tap-highlight-color: transparent;
  }

  /* Prevent iOS Safari input auto-zoom */
  .num-field input[type="number"],
  #food-search,
  #food-sort,
  .est-input input,
  .tray-unit-select {
    font-size: 16px;
  }

  /* 1. Sleek Compact Mobile Hero */
  .health-hero {
    padding-top: .45rem;
  }
  .health-hero-card {
    padding: .9rem 1rem;
    gap: .5rem;
    border-radius: 1.15rem;
  }
  .health-hero-visual,
  .health-hero-actions,
  .health-hero-meta,
  .health-hero-lead {
    display: none;
  }
  .health-hero-copy {
    gap: .48rem;
  }
  .health-eyebrow {
    padding: .22rem .6rem .22rem .3rem;
    font-size: .78rem;
  }
  .health-eyebrow img {
    width: 20px;
    height: 20px;
  }
  .health-hero-copy .display {
    font-size: 1.42rem;
    line-height: 1.2;
  }
  .health-hero-copy .display br {
    display: none;
  }
  .hero-mobile-glance {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem .55rem;
    margin-top: .15rem;
    font-size: .78rem;
    color: var(--h-muted);
    font-variant-numeric: tabular-nums;
  }
  .hero-mobile-glance span {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    padding: .18rem .52rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(27, 104, 72, 0.14);
  }
  .hero-mobile-glance strong {
    color: var(--h-accent);
    font-weight: 720;
  }

  /* 2. Sticky 5-Tab Native Mobile App Bar (all 5 visible, zero clipping) */
  .health-subnav-wrap {
    margin-top: .65rem;
    background: rgba(245, 248, 244, 0.96);
    box-shadow: 0 2px 10px rgba(21, 52, 38, 0.05);
  }
  .health-subnav {
    padding-block: .42rem;
    gap: 0;
  }
  .health-subnav-links {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .24rem;
    width: 100%;
    overflow: visible;
    padding-right: 0;
  }
  .subnav-tray-pill {
    display: none !important;
  }
  .subnav-pill {
    justify-content: center;
    gap: .18rem;
    min-width: 0;
    min-height: 38px;
    padding: .28rem .15rem;
    border-radius: .72rem;
    font-size: .84rem;
    font-weight: 660;
    text-align: center;
  }
  .subnav-pill .pill-num,
  .subnav-pill .pill-full {
    display: none;
  }
  .subnav-pill .pill-short {
    display: inline;
  }
  .subnav-pill .pill-badge:not([hidden]) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #c93a2b;
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    line-height: 1;
  }
  .subnav-pill.is-active .pill-badge:not([hidden]) {
    background: #fff;
    color: var(--h-accent);
  }

  /* Single-panel mobile workspace: only active tab shown */
  .health-section {
    padding-block: .9rem 2rem;
  }
  .health-section:not(.is-mobile-active) {
    display: none;
  }
  #foods.has-mobile-fab {
    padding-bottom: 5.5rem;
  }

  .health-section-head {
    margin-bottom: .75rem;
    gap: .45rem;
  }
  .health-kicker {
    font-size: .74rem;
    margin-bottom: .12rem;
  }
  .health-section-head h2 {
    font-size: 1.24rem;
    line-height: 1.28;
  }
  .health-section-desc {
    font-size: .83rem;
    margin-top: .28rem;
    line-height: 1.5;
  }

  /* 3. Tab 1: Plan — sticky live bar appears smoothly once Hero scrolls out (zero top duplication!) */
  .mobile-plan-live {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .45rem;
    position: sticky;
    top: 3.35rem;
    z-index: 15;
    padding: .5rem .72rem;
    margin-bottom: .7rem;
    border-radius: .85rem;
    background: #145036;
    color: #e4f5ea;
    box-shadow: 0 8px 18px rgba(20, 80, 54, 0.22);
    font-size: .78rem;
    font-variant-numeric: tabular-nums;
    transition: opacity .18s ease, transform .18s ease;
  }
  .mobile-plan-live.is-at-top {
    display: none;
  }
  .mobile-plan-live-nums {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .2rem .55rem;
    min-width: 0;
  }
  .mobile-plan-live-nums strong {
    color: #fff;
    font-size: .9rem;
  }
  .mobile-plan-live-go {
    flex: none;
    padding: .24rem .58rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: .76rem;
    font-weight: 660;
    white-space: nowrap;
  }

  .plan-form,
  .plan-result {
    padding: .92rem;
    border-radius: 1.05rem;
  }
  .plan-result {
    scroll-margin-top: 7.2rem;
  }
  .triple-inputs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .42rem;
  }
  .num-field {
    padding: .48rem .46rem .42rem;
    border-radius: .72rem;
    gap: .26rem;
  }
  .num-label {
    font-size: .74rem;
  }
  .num-field input[type="number"] {
    padding: .22rem .25rem;
    text-align: center;
    min-height: 36px;
  }
  .choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .42rem;
  }
  .choice-card {
    padding: .54rem .6rem;
    border-radius: .75rem;
  }
  .choice-card strong {
    font-size: .84rem;
  }
  .choice-card span {
    font-size: .72rem;
    line-height: 1.32;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
  }
  .kpi-tile {
    padding: .68rem .72rem;
    border-radius: .85rem;
  }
  .kpi-top {
    gap: .25rem;
  }
  .kpi-label {
    font-size: .74rem;
  }
  .kpi-chip,
  .status-tag {
    font-size: .66rem;
    padding: .08rem .36rem;
  }
  .kpi-value {
    margin-top: .25rem;
  }
  .kpi-value strong {
    font-size: 1.35rem;
  }
  .kpi-value span {
    font-size: .74rem;
  }
  .kpi-sub {
    font-size: .72rem;
    line-height: 1.35;
    margin-top: .24rem;
  }
  .meal-budget-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .plan-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .46rem;
  }
  .plan-actions .h-btn {
    width: 100%;
    min-height: 42px;
    padding: .35rem .5rem;
    font-size: .83rem;
  }

  /* 4. Tab 2: Recipes — 2x2 scenes + single-row 3-action bar */
  .recipe-shell {
    padding: .88rem;
    gap: .78rem;
    border-radius: 1.05rem;
  }
  .recipe-toolbar {
    gap: .62rem;
  }
  .recipe-scene-group {
    width: 100%;
    gap: .35rem;
  }
  .scene-pills {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .38rem;
    width: 100%;
  }
  .scene-pills .filter-pill {
    justify-content: center;
    width: 100%;
    min-height: 36px;
    padding: .24rem .4rem;
    font-size: .82rem;
  }
  .recipe-toolbar-actions {
    display: grid;
    grid-template-columns: 1.25fr 1fr 1fr;
    gap: .36rem;
    width: 100%;
  }
  .recipe-toolbar-actions .h-btn {
    width: 100%;
    min-height: 40px;
    padding: .28rem .35rem;
    font-size: .82rem;
    white-space: nowrap;
  }
  .weekday-row {
    padding-top: .62rem;
    gap: .42rem;
  }
  .recipe-card {
    padding: .84rem .88rem;
    gap: .52rem;
  }
  .recipe-card-title {
    font-size: .98rem;
  }
  .recipe-dish-row {
    padding: .36rem .52rem;
    font-size: .84rem;
  }
  .recipe-tip {
    font-size: .79rem;
    padding: .44rem .6rem;
  }
  .recipe-summary-bar {
    padding: .8rem .85rem;
    gap: .62rem;
  }
  .recipe-sum-lights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* 5. Tab 3: Foods — sub-tab Explore <-> Tray + swipe filters + floating tray bar */
  .foods-mobile-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .28rem;
    padding: .26rem;
    margin-bottom: .72rem;
    border-radius: .9rem;
    background: #e4efe7;
    border: 1px solid var(--h-border);
  }
  .fms-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    min-height: 40px;
    border: 0;
    border-radius: .68rem;
    background: transparent;
    color: var(--h-muted);
    font-size: .88rem;
    font-weight: 660;
    transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
  }
  .fms-btn.is-active {
    background: #fff;
    color: var(--h-accent);
    box-shadow: 0 3px 10px rgba(21, 52, 38, 0.1);
  }
  .fms-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #d3e7da;
    color: #145238;
    font-size: .74rem;
    font-weight: 700;
  }
  .fms-btn.is-active .fms-badge {
    background: var(--h-accent);
    color: #fff;
  }

  .foods-workbench[data-mobile-view="explore"] .tray-panel {
    display: none;
  }
  .foods-workbench[data-mobile-view="tray"] .foods-explorer {
    display: none;
  }

  .mobile-add-more-btn {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: .2rem .66rem;
    border-radius: 999px;
    border: 1px solid #b7d7c2;
    background: var(--h-accent-soft);
    color: var(--h-accent);
    font-size: .8rem;
    font-weight: 660;
    white-space: nowrap;
  }

  .search-panel {
    padding: .82rem;
    border-radius: 1.05rem;
  }
  #food-search {
    min-height: 44px;
    padding: .5rem 2.5rem .5rem 2.3rem;
  }
  #food-search::placeholder {
    font-size: 14px;
  }
  .hot-queries,
  .scene-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: .14rem;
    gap: .36rem;
  }
  .hot-queries::-webkit-scrollbar,
  .scene-filters::-webkit-scrollbar {
    display: none;
  }
  .hot-label,
  .hot-chip,
  .scene-filters .filter-pill {
    flex: none;
    white-space: nowrap;
  }
  .scene-filters {
    margin-top: .65rem;
  }
  .scene-filters .filter-pill {
    min-height: 34px;
    padding: .2rem .68rem;
    font-size: .8rem;
  }
  .cat-and-sort {
    margin-top: .62rem;
    padding-top: .62rem;
  }
  .estimator-fields {
    grid-template-columns: minmax(0, 1fr);
  }
  .food-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: .55rem;
  }
  .food-card {
    padding: .76rem .85rem;
    gap: .36rem;
    border-radius: .9rem;
  }
  .food-name {
    font-size: .95rem;
  }
  .food-portion-line {
    font-size: .86rem;
  }
  .food-add-btn {
    min-height: 38px;
    font-size: .84rem;
  }
  .tray-panel {
    padding: .9rem;
    border-radius: 1.05rem;
  }
  .tray-actions {
    flex-direction: column;
  }
  .tray-actions .h-btn {
    width: 100%;
  }

  /* Floating Bottom Tray Bar */
  .mobile-tray-fab:not([hidden]) {
    display: block;
    position: fixed;
    left: .85rem;
    right: .85rem;
    bottom: max(.75rem, env(safe-area-inset-bottom));
    z-index: 40;
  }
  .mobile-tray-fab-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .55rem;
    min-height: 52px;
    padding: .5rem .65rem .5rem .9rem;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #154d35 0%, #1d6b4a 100%);
    color: #fff;
    box-shadow: 0 12px 26px rgba(17, 56, 39, 0.34);
    font-variant-numeric: tabular-nums;
  }
  .mtf-left {
    display: flex;
    align-items: center;
    gap: .45rem;
    min-width: 0;
  }
  .mtf-count {
    padding: .14rem .48rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    font-size: .76rem;
    font-weight: 660;
    white-space: nowrap;
  }
  .mtf-kcal {
    font-size: .98rem;
    font-weight: 740;
    white-space: nowrap;
  }
  .mtf-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }
  .mtf-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.72);
  }
  .mtf-dot[data-tone="low"] { background: #4ade80; }
  .mtf-dot[data-tone="medium"] { background: #fbbf24; }
  .mtf-dot[data-tone="high"] { background: #f87171; }
  .mtf-go {
    flex: none;
    padding: .3rem .72rem;
    border-radius: 999px;
    background: #fff;
    color: #145238;
    font-size: .82rem;
    font-weight: 720;
    white-space: nowrap;
  }

  /* 6. Tab 4: Sleep Sanctuary & Relax — crisp mobile rhythm */
  .sleep-card,
  .sleep-debt-card {
    padding: .9rem;
    border-radius: 1.05rem;
  }
  .sleep-wake-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sleep-time-field input,
  .sleep-latency-field select {
    font-size: 16px;
  }
  .sleep-cycles-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .38rem;
  }
  .sleep-cycle-tile {
    padding: .55rem .48rem;
  }
  .sleep-cycle-top {
    flex-direction: column;
    align-items: flex-start;
    gap: .16rem;
    font-size: .7rem;
  }
  .sleep-cycle-badge {
    white-space: nowrap;
  }
  .sleep-cycle-time {
    font-size: 1.15rem;
  }
  .sleep-cycle-sub {
    font-size: .68rem;
  }
  .sleep-sound-pills {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sleep-sound-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: .55rem;
  }
  .sleep-sound-durs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .sleep-sound-controls .h-btn {
    width: 100%;
  }
  .recipe-prefs-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: .55rem;
    padding: .68rem .74rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  .recovery-toggle-btn {
    width: 100%;
    justify-content: center;
  }
  .recipe-excl-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .42rem;
    width: 100%;
    min-width: 0;
  }
  .recipe-excl-pills {
    display: flex;
    flex-wrap: wrap;
    overflow: visible;
    gap: .36rem;
    width: 100%;
    min-width: 0;
  }
  .excl-pill {
    flex: 0 1 auto;
    white-space: nowrap;
    font-size: .78rem;
    padding: .22rem .64rem;
  }
  .recipe-card {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }
  .recipe-card-foot {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr);
    gap: .38rem;
    width: 100%;
  }
  .recipe-mini-btn {
    padding: .34rem .48rem;
    font-size: .76rem;
    justify-content: center;
    text-align: center;
    min-width: 0;
  }
  .recipe-summary-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: .65rem;
    min-width: 0;
    max-width: 100%;
  }
  .recipe-shopping-details {
    min-width: 0;
    max-width: 100%;
  }
  .recipe-shopping-details summary {
    flex-wrap: wrap;
    align-items: center;
    gap: .2rem .35rem;
  }
  .recipe-shopping-details summary .hint-small {
    margin-left: 0;
    flex: 1 0 100%;
    padding-left: 1.15rem;
    font-size: .78rem;
  }
  .shopping-head-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: .55rem;
  }
  .shopping-scope-seg {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
  .shopping-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: .42rem;
  }
  .shopping-actions .h-btn {
    width: 100%;
    padding-inline: .5rem;
    font-size: .76rem;
  }
  .pk-bar {
    padding: .75rem .8rem;
  }
  .pk-quick-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    width: 100%;
    padding-bottom: .1rem;
  }
  .pk-quick-chips::-webkit-scrollbar { display: none; }
  .pk-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .42rem;
  }
  .pk-col {
    padding: .58rem .6rem;
    gap: .34rem;
  }
  .pk-col-head h4 {
    font-size: .86rem;
  }
  .pk-col .recipe-mini-btn {
    width: 100%;
    font-size: .74rem;
    padding: .28rem .35rem;
    min-height: 34px;
    line-height: 1.25;
    white-space: normal;
    text-align: center;
  }
  .breath-head-toggles {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .relax-card {
    padding: .9rem;
    gap: .65rem;
    border-radius: 1.05rem;
  }
  .breath-mode-pills {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .32rem;
    width: 100%;
  }
  .breath-mode-pills .filter-pill {
    justify-content: center;
    width: 100%;
    min-height: 36px;
    padding: .2rem .22rem;
    font-size: .78rem;
    white-space: nowrap;
  }
  .breath-stage {
    width: 192px;
    height: 192px;
  }
  .breath-svg {
    width: 192px;
    height: 192px;
  }
  .breath-timer {
    font-size: 2.05rem;
  }
  .stretch-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .4rem;
  }
  #stretch-toggle-btn {
    grid-column: 1 / -1;
    width: 100%;
  }
  .micro-care-card {
    padding: .88rem .92rem;
  }
  .micro-care-checks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .42rem;
  }
  .care-chip {
    justify-content: flex-start;
    font-size: .8rem;
    padding: .35rem .55rem;
  }

  /* 7. Tab 5: Cloud */
  .cloud-card {
    padding: .9rem .98rem;
    border-radius: 1rem;
  }
  .community-card {
    padding: .92rem;
    gap: .72rem;
  }
  .community-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: .46rem;
  }
  .community-actions .h-btn {
    width: 100%;
  }
}

/* Ultra-narrow screens (<= 350px, e.g. 320px iPhone SE) */
@media (max-width: 22rem) {
  .subnav-pill {
    font-size: .76rem;
  }
  .kpi-grid,
  .choice-grid,
  .sleep-cycles-grid,
  .sleep-wake-row,
  .pk-grid,
  .micro-care-checks {
    grid-template-columns: minmax(0, 1fr);
  }
  .recipe-toolbar-actions .h-btn {
    font-size: .74rem;
  }
  .weekday-pills {
    gap: .18rem;
  }
  .weekday-btn {
    font-size: .72rem;
    padding: .22rem .08rem;
  }
  .weekday-btn small {
    font-size: .58rem;
  }
  .breath-mode-pills .filter-pill {
    font-size: .72rem;
  }
  .tray-macro-nums {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =====================================================================
 * V6: Cloud Account Strip, Direct Sync, Favorites, 7-Day Care & Night Lamp
 * ===================================================================== */
.h-btn-xs {
  padding: .34rem .72rem;
  font-size: .78rem;
  min-height: 2rem;
  border-radius: 999px;
}

.health-cloud-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .55rem .9rem;
  margin: 0 0 1rem;
  padding: .65rem .95rem;
  border-radius: 1rem;
  border: 1px solid #cce6d5;
  background: linear-gradient(135deg, #eef9f2 0%, #f3f7ff 100%);
  color: #164e34;
  font-size: .84rem;
  line-height: 1.45;
}
.health-cloud-strip[data-signed-in="true"] {
  border-color: #a9dbc0;
  background: linear-gradient(135deg, #e7f7ee 0%, #eef5ff 100%);
}
.health-cloud-main {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-width: 0;
  flex: 1 1 16rem;
}
.health-cloud-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  background: #94a3b8;
}
.health-cloud-strip[data-signed-in="true"] .health-cloud-dot {
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, .2);
}
.health-cloud-actions {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
}

.shopping-actions {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
}
.recipe-mini-btn.is-cloud {
  background: #edf4ff;
  border-color: #c5dafc;
  color: #1d4ed8;
  text-decoration: none;
}
.recipe-mini-btn.is-cloud:hover {
  background: #e0ecff;
  border-color: #93b8fa;
}

.food-card-top-right {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  flex: none;
}
.food-fav-btn {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--h-border);
  background: var(--h-card);
  color: var(--h-muted);
  font-size: .92rem;
  line-height: 1;
  cursor: pointer;
  transition: transform .12s ease, border-color .15s ease, color .15s ease, background-color .15s ease;
}
.food-fav-btn:hover {
  border-color: #f59e0b;
  color: #d97706;
}
.food-fav-btn.is-fav {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #d97706;
}
.filter-pill.pill-fav.is-active {
  background: #d97706;
  border-color: #d97706;
  color: #fff;
}

.sleep-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.btn-night-mode {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-night-mode.is-on {
  background: #232c33;
  border-color: #d99b43;
  color: #f7d89c;
}
.btn-bedtime-go.is-active {
  background: #b45309;
  border-color: #d97706;
  color: #fff;
}
.sleep-list-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem .8rem;
  margin: 0 0 .9rem;
  padding: .68rem .95rem;
  border-radius: .95rem;
  border: 1px solid #bfdbfe;
  background: linear-gradient(135deg, #eff6ff, #f0fdf4);
  color: #1e3a8a;
  font-size: .84rem;
}
.sleep-sync-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .45rem .7rem;
  margin-top: .75rem;
  padding-top: .7rem;
  border-top: 1px dashed var(--h-border);
}
.sleep-goodnight-row {
  margin-top: .65rem;
}

.care-week-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .85rem 1.1rem;
  margin-top: 1rem;
  padding-top: .95rem;
  border-top: 1px dashed var(--h-border);
}
.care-week-left {
  display: grid;
  gap: .45rem;
  min-width: 0;
}
.care-week-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .3rem .65rem;
  font-size: .86rem;
}
.care-week-dots {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .38rem;
  max-width: 24rem;
}
.care-day-pill {
  display: grid;
  justify-items: center;
  gap: .18rem;
}
.care-day-dot {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  border: 1.5px solid var(--h-border);
  background: var(--h-card);
  color: transparent;
  font-size: .78rem;
  font-weight: 800;
}
.care-day-pill.is-done .care-day-dot {
  border-color: #1b6848;
  background: #1b6848;
  color: #fff;
}
.care-day-pill.is-today .care-day-dot {
  box-shadow: 0 0 0 2px rgba(27, 104, 72, .22);
}
.care-day-pill small {
  font-size: .68rem;
  color: var(--h-muted);
  white-space: nowrap;
}
.care-pass-bar {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .38rem;
}
.care-pass-meta {
  font-size: .78rem;
  color: var(--h-muted);
}

@media (max-width: 47.99rem) {
  .health-cloud-strip {
    padding: .6rem .78rem;
    font-size: .8rem;
  }
  .health-cloud-actions,
  .shopping-actions {
    width: 100%;
  }
  .health-cloud-actions .h-btn,
  .shopping-actions .h-btn {
    flex: 1 1 auto;
    justify-content: center;
  }
  .sleep-head-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sleep-head-actions #btn-copy-sleep {
    grid-column: 1 / -1;
  }
  .care-week-box {
    flex-direction: column;
    align-items: stretch;
  }
  .care-pass-bar {
    align-items: stretch;
  }
  .care-pass-bar .h-btn {
    width: 100%;
  }
  .water-tracker-actions {
    flex-wrap: wrap;
  }
}

/* =====================================================================
 * Low-Blue-Light Night Lamp Theme (html[data-theme="night"]) & OS Dark Mode
 * Exhaustive token + component overrides ensuring WCAG AA+ contrast across all 5 tabs
 * ===================================================================== */
@media (max-width: 23.5rem) {
  .recipe-card-foot {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .recipe-card-foot .recipe-mini-btn.is-cloud {
    grid-column: 1 / -1;
  }
}

html[data-theme="night"] {
  --h-bg: #0f1417;
  --h-surface: #171f24;
  --h-surface-soft: #131a1f;
  --h-card: #171f24;
  --h-ink: #efeae0;
  --h-muted: #b1bcc2;
  --h-border: #2a363f;
  --h-border-strong: #394954;
  --h-accent: #52c48c;
  --h-accent-hover: #3ea874;
  --h-accent-deep: #246848;
  --h-accent-soft: #183026;
  --h-accent-tint: #152820;
  --h-sun: #f0b65a;
  --h-sun-soft: #2e2413;
  --h-sun-border: #5d4520;
  --h-coral: #f89286;
  --h-coral-soft: #361c1d;
  --h-coral-border: #6b3133;
  --h-cobalt: #8ab4ff;
  --h-cobalt-soft: #17253a;
  --h-amber: #f0b65a;
  --h-shadow: 0 12px 30px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

html[data-theme="night"] body.health-body {
  background: var(--h-bg);
  color: var(--h-ink);
}

/* Header, Brand, Account Pill, Subnav & Footer */
html[data-theme="night"] .site-header.studio-nav,
html[data-theme="night"] .health-subnav-wrap {
  background: rgba(15, 20, 23, .94);
  border-color: var(--h-border);
}
html[data-theme="night"] .site-header.studio-nav a,
html[data-theme="night"] .brand-wordmark {
  color: var(--h-ink);
}
html[data-theme="night"] body > header.site-header.studio-nav .identity .brand-name {
  background: linear-gradient(135deg, #ffffff 0%, #9ce8c2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #f4f8f5;
}
html[data-theme="night"] body > header.site-header.studio-nav .identity .wordmark {
  background: linear-gradient(135deg, #dce6ed 0%, #86d7af 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #cdd9e2;
}
html[data-theme="night"] .site-account-pill {
  background: #1b252c !important;
  border-color: #344450 !important;
  color: #efeae0 !important;
}
html[data-theme="night"] .site-account-pill .site-account-label {
  color: #efeae0 !important;
}
html[data-theme="night"] .subnav-pill {
  color: var(--h-muted);
}
html[data-theme="night"] .subnav-pill:hover {
  background: #1a242b;
  color: var(--h-ink);
}
html[data-theme="night"] .subnav-tray-pill {
  background: #183026;
  border-color: #2f5a46;
  color: #a9e8c8;
}
html[data-theme="night"] .site-footer,
html[data-theme="night"] .site-footer span,
html[data-theme="night"] .site-footer a {
  color: var(--h-muted);
  border-color: var(--h-border);
}
html[data-theme="night"] .site-footer .footer-brand {
  color: var(--h-ink);
}
html[data-theme="night"] .skip-link {
  background: #1d2930;
  color: #efeae0;
}

/* Hero Banner */
html[data-theme="night"] .health-hero-card {
  background:
    radial-gradient(circle at 86% 14%, rgba(240, 182, 90, 0.14), transparent 44%),
    radial-gradient(circle at 8% 92%, rgba(82, 196, 140, 0.14), transparent 48%),
    linear-gradient(145deg, #13221c 0%, #151e24 58%, #1a2320 100%);
  border-color: #2a3b34;
  color: var(--h-ink);
  box-shadow: 0 14px 36px rgba(0, 0, 0, .42);
}
html[data-theme="night"] .health-hero-lead {
  color: #c5d1d7;
}
html[data-theme="night"] .health-eyebrow,
html[data-theme="night"] .health-hero-float,
html[data-theme="night"] .hero-mobile-glance span {
  background: rgba(19, 28, 33, .92);
  border-color: #2f433c;
  color: #dbe6df;
}
html[data-theme="night"] .health-eyebrow img {
  background: #172329;
}
html[data-theme="night"] .health-eyebrow span,
html[data-theme="night"] .hero-mobile-glance strong {
  color: #82e3b3;
}
html[data-theme="night"] .health-hero-visual img {
  border-color: rgba(164, 210, 184, .22);
}

/* Cards & Primary Surfaces */
html[data-theme="night"] .h-card,
html[data-theme="night"] .food-card,
html[data-theme="night"] .recipe-card,
html[data-theme="night"] .sleep-card,
html[data-theme="night"] .sleep-debt-card,
html[data-theme="night"] .micro-care-card,
html[data-theme="night"] .sleep-cycle-tile,
html[data-theme="night"] .sleep-sound-box,
html[data-theme="night"] .pk-panel,
html[data-theme="night"] .pk-card,
html[data-theme="night"] .tray-panel,
html[data-theme="night"] .tray-item,
html[data-theme="night"] .tray-swap-card,
html[data-theme="night"] .estimator-card,
html[data-theme="night"] .cloud-card,
html[data-theme="night"] .community-card,
html[data-theme="night"] .kpi-tile,
html[data-theme="night"] .macro-box,
html[data-theme="night"] .meal-split-box,
html[data-theme="night"] .shopping-group,
html[data-theme="night"] .h-details,
html[data-theme="night"] .stretch-stage {
  background: var(--h-surface);
  border-color: var(--h-border);
  color: var(--h-ink);
}

/* Recessed Soft Surfaces (formerly hardcoded #fff / #f2f7f3 / #f6fcf8 / gradients) */
html[data-theme="night"] .num-field,
html[data-theme="night"] .choice-btn,
html[data-theme="night"] .focus-chip,
html[data-theme="night"] .recipe-dish-row,
html[data-theme="night"] .recipe-prefs-row,
html[data-theme="night"] .recipe-summary-bar,
html[data-theme="night"] .recipe-tip,
html[data-theme="night"] .shopping-group li,
html[data-theme="night"] .pk-bar,
html[data-theme="night"] .pk-col,
html[data-theme="night"] .pk-stat-line,
html[data-theme="night"] .pk-head-bar,
html[data-theme="night"] .tray-macro-box,
html[data-theme="night"] .tray-sugar-box,
html[data-theme="night"] .tray-exercise-box,
html[data-theme="night"] .exercise-row div,
html[data-theme="night"] .purine-card,
html[data-theme="night"] .shield-box,
html[data-theme="night"] .food-empty,
html[data-theme="night"] .hr-zone-row,
html[data-theme="night"] .sample-btn,
html[data-theme="night"] .search-input-wrap,
html[data-theme="night"] .sleep-rx-card,
html[data-theme="night"] .sleep-rx-meta,
html[data-theme="night"] .sleep-rx-item,
html[data-theme="night"] .sleep-timeline-item,
html[data-theme="night"] .sleep-debt-tips,
html[data-theme="night"] .sleep-metabolic-note,
html[data-theme="night"] .water-tracker-box,
html[data-theme="night"] .stretch-icon,
html[data-theme="night"] .hr-table tr,
html[data-theme="night"] .hr-table th,
html[data-theme="night"] .hr-table td,
html[data-theme="night"] .h-details summary,
html[data-theme="night"] .health-disclaimer {
  background: var(--h-surface-soft);
  border-color: var(--h-border);
  color: var(--h-ink);
}
html[data-theme="night"] .health-disclaimer,
html[data-theme="night"] .health-disclaimer strong {
  color: var(--h-muted);
}
html[data-theme="night"] .micro-care-mascot img,
html[data-theme="night"] .community-left img {
  background: #1b272e;
}
html[data-theme="night"] .kpi-chip {
  background: #142b21;
  border-color: #2c5442;
  color: #9be8c3;
}
html[data-theme="night"] .status-tag[data-tone="ok"],
html[data-theme="night"] .status-tag:not([data-tone]) {
  background: #163326;
  color: #9feac4;
}
html[data-theme="night"] .status-tag[data-tone="info"] {
  background: #172b47;
  color: #9fc4ff;
}
html[data-theme="night"] .status-tag[data-tone="warn"] {
  background: #332512;
  color: #fbd282;
}
html[data-theme="night"] .status-tag[data-tone="alert"] {
  background: #3b1c1f;
  color: #ffb3b3;
}
html[data-theme="night"] .bmi-marker {
  background: #efeae0;
  border-color: #0f1417;
}
html[data-theme="night"] .plan-note-banner {
  background: #142a21;
  border-color: #295240;
  color: #cdeee0;
}
html[data-theme="night"] .hr-zone-row.is-featured {
  background: #183026;
  border-color: #49a87a;
}
html[data-theme="night"] .hr-zone-badge {
  color: #7fe0b2;
}
html[data-theme="night"] .focus-card::after {
  background: #131b20;
  border-color: #3a4f5c;
  color: #ffffff;
}
html[data-theme="night"] .focus-card.is-active::after {
  background: #216e4b;
  border-color: #52c48c;
  color: #ffffff;
}
html[data-theme="night"] .pk-status-row {
  background: #162e24;
  border: 1px solid #2c5744;
  color: #c8f2de;
}
html[data-theme="night"] .pk-col.is-winner,
html[data-theme="night"] .pk-card.is-winner {
  background: linear-gradient(145deg, #162e24 0%, #171f24 100%);
  border-color: #49a87a;
}
html[data-theme="night"] .pk-light-pill[data-tone="low"] {
  background: #153125;
  color: #9ce6c0;
}
html[data-theme="night"] .pk-light-pill[data-tone="medium"] {
  background: #352512;
  color: #fbd282;
}
html[data-theme="night"] .pk-light-pill[data-tone="high"] {
  background: #3b1c1f;
  color: #ffb3b3;
}
html[data-theme="night"] .pk-verdicts {
  background: #142720;
  color: #d1efe0;
}
html[data-theme="night"] .sleep-cycle-tile.is-featured,
html[data-theme="night"] .food-card.in-tray {
  background: linear-gradient(145deg, #172e24 0%, #171f24 100%);
  border-color: #49a87a;
}

/* Controls, Pills, Segmented, Inputs */
html[data-theme="night"] .segmented,
html[data-theme="night"] .foods-mobile-switch,
html[data-theme="night"] .filter-pill,
html[data-theme="night"] .hot-chip,
html[data-theme="night"] .cat-pill,
html[data-theme="night"] .food-cat,
html[data-theme="night"] .excl-pill,
html[data-theme="night"] .sweet-pill,
html[data-theme="night"] .est-preset-btn,
html[data-theme="night"] .weekday-btn,
html[data-theme="night"] .recovery-toggle-btn,
html[data-theme="night"] .dur-btn,
html[data-theme="night"] .care-chip,
html[data-theme="night"] .sound-toggle,
html[data-theme="night"] .step-badge,
html[data-theme="night"] .h-btn-secondary,
html[data-theme="night"] .h-btn-ghost,
html[data-theme="night"] .recipe-mini-btn,
html[data-theme="night"] .food-add-btn,
html[data-theme="night"] .food-pk-btn,
html[data-theme="night"] .tray-sweet-btn,
html[data-theme="night"] .step-btn,
html[data-theme="night"] .fms-btn,
html[data-theme="night"] .num-field input[type="number"],
html[data-theme="night"] .est-input input,
html[data-theme="night"] .sleep-time-field input,
html[data-theme="night"] .sleep-latency-field select,
html[data-theme="night"] #food-search,
html[data-theme="night"] #food-sort,
html[data-theme="night"] input,
html[data-theme="night"] select {
  background: #131b20;
  border-color: #2f3e48;
  color: #ece7dd;
}
html[data-theme="night"] .mobile-add-more-btn {
  background: #173025;
  border-color: #2f5c47;
  color: #9ce6c0;
}
html[data-theme="night"] input::placeholder {
  color: #88969e;
}
html[data-theme="night"] .seg-btn {
  color: var(--h-muted);
}
html[data-theme="night"] .fms-btn.is-active {
  background: #216e4b;
  color: #ffffff;
}
html[data-theme="night"] .fms-badge {
  background: #23333d;
  color: #d7e5dd;
}
html[data-theme="night"] .fms-btn.is-active .fms-badge {
  background: #133f2b;
  color: #e6faef;
}

/* High-Contrast Active Primary States (white text on deep forest green >= 6.4:1) */
html[data-theme="night"] .filter-pill.is-active,
html[data-theme="night"] .cat-pill.is-active,
html[data-theme="night"] .seg-btn.is-active,
html[data-theme="night"] .hot-chip.is-active,
html[data-theme="night"] .dur-btn.is-active,
html[data-theme="night"] .sweet-pill.is-active,
html[data-theme="night"] .est-preset-btn.is-active,
html[data-theme="night"] .weekday-btn.is-active,
html[data-theme="night"] .choice-btn.is-active,
html[data-theme="night"] .focus-chip.is-active,
html[data-theme="night"] .recovery-toggle-btn[aria-pressed="true"],
html[data-theme="night"] .tray-sweet-btn.is-active,
html[data-theme="night"] .subnav-pill.is-active,
html[data-theme="night"] .h-btn-primary,
html[data-theme="night"] .recipe-mini-btn.is-primary,
html[data-theme="night"] .food-card.in-tray .food-add-btn,
html[data-theme="night"] .care-chip[aria-pressed="true"] .care-mark {
  background: #216e4b;
  border-color: #49a87a;
  color: #ffffff;
}
html[data-theme="night"] .recipe-mini-btn.is-primary:hover,
html[data-theme="night"] .recipe-mini-btn.is-primary:focus-visible,
html[data-theme="night"] .h-btn-primary:hover:not(:disabled),
html[data-theme="night"] .h-btn-primary:focus-visible:not(:disabled) {
  background: #288057;
  border-color: #62c496;
  color: #ffffff;
}
html[data-theme="night"] .excl-pill.is-active {
  background: #4e310a;
  border-color: #d99230;
  color: #ffebc2;
}
html[data-theme="night"] .weekday-btn.is-active small,
html[data-theme="night"] .choice-btn.is-active small,
html[data-theme="night"] .subnav-pill.is-active span {
  color: #e2f8ec;
}
html[data-theme="night"] .subnav-pill.is-active .pill-badge:not([hidden]) {
  background: #ffffff;
  color: #164e34;
}
html[data-theme="night"] .h-btn-cloud {
  background: #2558b8;
  border-color: #4f82e0;
  color: #ffffff;
}
html[data-theme="night"] .cloud-tag {
  background: #192b44;
  color: #9bc0ff;
}
html[data-theme="night"] .cloud-go,
html[data-theme="night"] .h-btn-link {
  color: #8ab4ff;
}
html[data-theme="night"] .food-pk-btn.is-picked {
  background: #1b2f4a;
  border-color: #4f82e0;
  color: #b4d0ff;
}
html[data-theme="night"] .food-add-btn:hover,
html[data-theme="night"] .food-add-btn:focus-visible {
  background: #1b362a;
  border-color: #49a87a;
  color: #d8f7e6;
}
html[data-theme="night"] .care-chip[aria-pressed="true"] {
  background: #183428;
  border-color: #49a87a;
  color: #d7f5e5;
}
html[data-theme="night"] .care-day-pill.is-done .care-day-dot {
  background: #247852;
  border-color: #52c48c;
  color: #ffffff;
}

/* 4-High Shield Lights, Sugar Cubes, Swaps & Metabolic Badges in Dark Mode */
html[data-theme="night"] .shield-box[data-tone="low"],
html[data-theme="night"] .purine-card[data-tone="low"] {
  background: #12251d;
  border-color: #26503e;
}
html[data-theme="night"] .shield-box[data-tone="medium"],
html[data-theme="night"] .purine-card[data-tone="medium"] {
  background: #261e12;
  border-color: #57411c;
}
html[data-theme="night"] .shield-box[data-tone="high"],
html[data-theme="night"] .purine-card[data-tone="high"] {
  background: #2b1618;
  border-color: #632c30;
}
html[data-theme="night"] .purine-card[data-tone="low"] strong {
  color: #9ce6c0;
}
html[data-theme="night"] .purine-card[data-tone="medium"] strong {
  color: #fbd282;
}
html[data-theme="night"] .purine-card[data-tone="high"] strong {
  color: #ffb3b3;
}
html[data-theme="night"] .shield-light[data-tone="low"],
html[data-theme="night"] .shield-light[data-tone="good"] {
  background: #142b21;
  border-color: #295943;
  color: #a9ebca;
}
html[data-theme="night"] .shield-light[data-tone="medium"],
html[data-theme="night"] .shield-light[data-tone="warn"] {
  background: #2f2412;
  border-color: #63491d;
  color: #fbd385;
}
html[data-theme="night"] .shield-light[data-tone="high"],
html[data-theme="night"] .shield-light[data-tone="bad"] {
  background: #36191b;
  border-color: #6e3035;
  color: #ffb3b3;
}
html[data-theme="night"] .shield-light .shield-light-label,
html[data-theme="night"] .shield-light .shield-light-status,
html[data-theme="night"] .shield-light[data-tone="low"] .shield-light-status,
html[data-theme="night"] .shield-light[data-tone="medium"] .shield-light-status,
html[data-theme="night"] .shield-light[data-tone="high"] .shield-light-status {
  color: inherit;
}
html[data-theme="night"] .sugar-cube-bar {
  background: #282013;
  border-color: #5b451f;
  color: var(--h-ink);
}
html[data-theme="night"] .sugar-cube-bar.is-ok {
  background: #142a21;
  border-color: #2a5441;
}
html[data-theme="night"] .sugar-saved-badge {
  background: #173528;
  color: #9feac4;
}
html[data-theme="night"] .sugar-cube-unit {
  background: linear-gradient(135deg, #f3e4c6 0%, #d4b078 100%);
  border-color: #b48a4a;
}
html[data-theme="night"] .sugar-cube-more {
  color: #fbd282;
}
html[data-theme="night"] .shield-advice-item {
  background: rgba(23, 33, 39, .92);
  color: var(--h-ink);
}
html[data-theme="night"] .shield-advice-item[data-tone="low"] {
  color: #a6ebc8;
}
html[data-theme="night"] .tray-sweet-box {
  border-top-color: var(--h-border);
}
html[data-theme="night"] .tray-sweet-saved {
  color: #7ee0b0;
}
html[data-theme="night"] .tray-swaps-box {
  border-top-color: var(--h-border);
}
html[data-theme="night"] .tray-swaps-title {
  color: #9be6c1;
}
html[data-theme="night"] .tray-swap-btn {
  background: #152b22;
  border-color: #2d5945;
  color: #d6f5e6;
}
html[data-theme="night"] .tray-swap-btn:hover {
  background: #1c3a2e;
  border-color: #49a87a;
}
html[data-theme="night"] .f-badge.purine-low,
html[data-theme="night"] .f-badge.risk-goodfat,
html[data-theme="night"] .f-badge.risk-four-ok {
  background: #163226;
  color: #9be5be;
}
html[data-theme="night"] .f-badge.health-healthy,
html[data-theme="night"] .f-badge.risk-sweet {
  background: #192b44;
  color: #a4c6ff;
}
html[data-theme="night"] .f-badge.health-limit,
html[data-theme="night"] .f-badge.risk-sugar,
html[data-theme="night"] .f-badge.risk-gi,
html[data-theme="night"] .f-badge.purine-medium {
  background: #352512;
  color: #fccf7e;
}
html[data-theme="night"] .f-badge.risk-combo,
html[data-theme="night"] .f-badge.risk-lipid,
html[data-theme="night"] .f-badge.purine-high {
  background: #3b1c1f;
  color: #ffb0b0;
  border-color: #70343a;
}
html[data-theme="night"] .f-badge.risk-sodium {
  background: #2b1f40;
  color: #d6baff;
}

/* Cloud Strip, Sleep Banners, Badges, Night Button & Breathing Orb */
html[data-theme="night"] .health-cloud-strip,
html[data-theme="night"] .sleep-list-banner {
  background: #152520;
  border-color: #2b4a3e;
  color: #d6efe2;
}
html[data-theme="night"] .health-cloud-strip[data-signed-in="true"] {
  background: linear-gradient(135deg, #142a22 0%, #162438 100%);
  border-color: #2f5c4a;
  color: #d8f2e6;
}
html[data-theme="night"] .sleep-tl-time,
html[data-theme="night"] .sleep-cycle-badge,
html[data-theme="night"] .sleep-debt-badge,
html[data-theme="night"] .sleep-rx-act,
html[data-theme="night"] .sleep-sound-timer,
html[data-theme="night"] .save-badge,
html[data-theme="night"] .count-pill,
html[data-theme="night"] .recipe-match-pill,
html[data-theme="night"] .bmi-tag {
  background: #1c3128;
  border-color: #2f5444;
  color: #b4ebd0;
}
html[data-theme="night"] .sleep-cycle-tile.is-featured .sleep-cycle-badge {
  background: #216e4b;
  color: #ffffff;
}
html[data-theme="night"] .sleep-debt-badge[data-tone="mild"] {
  background: #352512;
  color: #fbd385;
}
html[data-theme="night"] .sleep-debt-badge[data-tone="warn"] {
  background: #3b1c1f;
  color: #ffb0b0;
}
html[data-theme="night"] .btn-night-mode {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-night-mode.is-on {
  background: #242f36;
  border-color: #d99b43;
  color: #f7d89c;
}
html[data-theme="night"] .recipe-mini-btn.is-cloud {
  background: #182a42;
  border-color: #305586;
  color: #a4c8ff;
}
html[data-theme="night"] .recipe-mini-btn.is-cloud:hover {
  background: #1f3757;
  border-color: #4f82e0;
  color: #c7deff;
}
html[data-theme="night"] .breath-orb {
  box-shadow: 0 0 38px rgba(73, 168, 122, .32);
}
html[data-theme="night"] .breath-phase,
html[data-theme="night"] .breath-timer,
html[data-theme="night"] .sleep-cycle-time {
  color: #f3e8d2;
}
html[data-theme="night"] .food-fav-btn.is-fav {
  background: rgba(217, 119, 6, .24);
  border-color: #e2a857;
  color: #f6c471;
}
html[data-theme="night"] .filter-pill.pill-fav.is-active {
  background: #a15c07;
  border-color: #e2a857;
  color: #ffffff;
}
html[data-theme="night"] .mobile-plan-live {
  background: #1a4b35;
  color: #ffffff;
}
html[data-theme="night"] .mobile-tray-fab {
  background: #1a4b35;
  color: #ffffff;
}
html[data-theme="night"] .mtf-go {
  background: #efeae0;
  color: #123e2a;
}
html[data-theme="night"] .tray-bar-track,
html[data-theme="night"] .tray-progress,
html[data-theme="night"] .water-progress-bar,
html[data-theme="night"] .stretch-dot,
html[data-theme="night"] .stretch-bar,
html[data-theme="night"] .macro-bar {
  background: #232f37;
}
html[data-theme="night"] code {
  background: #1d2a32;
  color: #a6e3c2;
}


/* =====================================================================
 * V7: Minimal 4-Tab Light-App Architecture (Desktop + Tablet + Mobile)
 * Cuts 65% prose noise, collapses low-frequency tools, unifies Light & Dark
 * ===================================================================== */
@keyframes healthTabIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.health-main {
  padding-bottom: 1.5rem;
}

/* 1. Sticky Compact App Bar */
.health-appbar-wrap {
  position: sticky;
  top: 0;
  z-index: 32;
  background: rgba(246, 249, 246, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--h-border);
}
.health-appbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .85rem;
  min-height: 3.6rem;
  padding-block: .42rem;
}
.appbar-brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
}
.appbar-brand img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex: none;
  box-shadow: 0 2px 6px rgba(27, 104, 72, 0.14);
}
.appbar-title-col {
  display: flex;
  align-items: baseline;
  gap: .45rem;
  min-width: 0;
}
.appbar-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 760;
  letter-spacing: -.01em;
  color: var(--h-ink);
  white-space: nowrap;
}
.appbar-sub {
  font-size: .72rem;
  font-weight: 600;
  color: var(--h-accent);
  background: var(--h-accent-soft);
  padding: .1rem .48rem;
  border-radius: 999px;
  white-space: nowrap;
}
.health-appbar .health-subnav-links {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .22rem;
  border-radius: 999px;
  background: var(--h-surface-soft);
  border: 1px solid var(--h-border);
  overflow: visible;
}
.health-appbar .subnav-pill {
  min-height: 34px;
  padding: .24rem .95rem;
  font-size: .86rem;
  font-weight: 660;
  gap: .32rem;
}
.health-appbar .subnav-pill .pill-badge:not([hidden]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: #c93a2b;
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
}
.health-appbar .subnav-pill.is-active .pill-badge:not([hidden]) {
  background: #fff;
  color: #165639;
}
.appbar-right {
  display: inline-flex;
  align-items: center;
  gap: .42rem;
  justify-self: end;
}

/* 2. Single-View Tab Panels (Desktop + Mobile Unified!) */
.health-section {
  display: none;
  padding-block: 1.05rem 1.8rem;
}
.health-section.is-tab-active {
  display: block;
  animation: healthTabIn .18s ease;
}
@media (prefers-reduced-motion: reduce) {
  .health-section.is-tab-active { animation: none; }
}

/* Compact View Head */
.view-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .55rem .9rem;
  margin-bottom: .85rem;
}
.view-head-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem .75rem;
  min-width: 0;
}
.view-head h2 {
  margin: 0;
  font-size: clamp(1.22rem, 1.8vw, 1.48rem);
  line-height: 1.2;
  color: var(--h-ink);
}
.view-head-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
}
.view-head-hint {
  font-size: .8rem;
}

/* 3. Tab 1: Today Dashboard (Now Coach + 4 KPIs + Compact Macro + Micro-Care + Collapsible Profile) */
.health-cloud-strip {
  padding: .48rem .85rem;
  margin-bottom: .75rem;
  border-radius: .85rem;
  font-size: .81rem;
}
.now-coach-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1rem;
  padding: .78rem 1rem;
  margin-bottom: .8rem;
  background: linear-gradient(135deg, #f0f9f3 0%, #ffffff 70%, #f5f9ff 100%);
  border-color: #cde3d4;
}
.now-coach-left {
  display: flex;
  align-items: center;
  gap: .7rem;
  min-width: 0;
}
.now-coach-icon {
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: .75rem;
  background: var(--h-accent-soft);
  font-size: 1.15rem;
  flex: none;
}
.now-coach-copy {
  min-width: 0;
}
.now-coach-copy strong {
  display: inline-block;
  font-size: .84rem;
  color: var(--h-accent);
  margin-right: .35rem;
}
.now-coach-copy p {
  margin: .08rem 0 0;
  font-size: .88rem;
  color: var(--h-ink);
  line-height: 1.45;
}
.now-coach-actions {
  flex: none;
}

.today-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
  margin-bottom: .8rem;
}
.today-kpi-grid .kpi-tile {
  padding: .85rem .95rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: .32rem;
  min-width: 0;
}
.today-kpi-grid .kpi-value {
  margin-top: .12rem;
}
.today-kpi-grid .kpi-value strong {
  font-size: clamp(1.32rem, 1.9vw, 1.65rem);
}
.today-kpi-grid .kpi-sub {
  margin-top: .15rem;
  font-size: .77rem;
}
.today-mini-bar {
  height: 6px;
  border-radius: 999px;
  background: #e1ece5;
  overflow: hidden;
  margin-top: .15rem;
}
.today-mini-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--h-accent);
  transition: width .22s ease;
}
.today-mini-bar span.is-over {
  background: var(--h-coral);
}
.kpi-water-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .35rem;
  font-variant-numeric: tabular-nums;
}
.kpi-water-row .water-progress-text {
  font-size: 1.05rem;
  font-weight: 760;
  color: var(--h-ink);
}
.kpi-water-cups {
  font-size: .74rem;
  color: var(--h-muted);
}
.today-kpi-grid .water-progress-bar {
  flex: 0 0 auto;
  height: 8px;
  width: 100%;
  margin: .14rem 0;
}
.water-inline-actions {
  display: flex;
  align-items: center;
  gap: .32rem;
  margin-top: .25rem;
}
.water-inline-actions .step-btn {
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
}
.water-inline-actions .water-add-btn {
  flex: 1 1 auto;
  justify-content: center;
}
.kpi-link-chip {
  padding: .12rem .48rem;
  border-radius: 999px;
  border: 1px solid var(--h-border);
  background: var(--h-surface-soft);
  color: var(--h-accent);
  font-size: .73rem;
  font-weight: 660;
  cursor: pointer;
}
.kpi-link-chip:hover {
  border-color: var(--h-accent);
  background: var(--h-accent-soft);
}

/* Compact Macro & Plan Bar */
.macro-compact {
  margin-top: 0;
  margin-bottom: .8rem;
  padding: .85rem 1rem;
}
.macro-compact .macro-legend {
  margin-top: 0;
  gap: .35rem .9rem;
  font-size: .83rem;
}
.macro-compact .meal-budget-row {
  margin-top: .65rem;
  padding-top: .6rem;
}
.plan-compact-foot {
  margin-top: .7rem;
}
.plan-compact-foot .plan-actions {
  margin-top: 0;
  gap: .42rem;
}
.plan-info-details {
  margin-top: .65rem;
  padding: .42rem .75rem;
}
.tdee-line {
  margin: .45rem 0 0;
  display: block;
}

/* Compact Micro-Care Card on Today Tab */
.health-section .micro-care-card {
  margin-top: 0;
  margin-bottom: .8rem;
  padding: .85rem 1rem;
}
.micro-care-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .7rem 1rem;
}
.micro-care-top .micro-care-mascot {
  display: flex;
  align-items: center;
  gap: .65rem;
}
.micro-care-top .micro-care-mascot img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}
.micro-care-top .micro-care-mascot h3 {
  margin: 0;
  font-size: .95rem;
  display: flex;
  align-items: baseline;
  gap: .4rem;
}
.micro-care-top .care-date {
  font-size: .74rem;
  font-weight: 500;
  color: var(--h-muted);
}
.micro-care-card .care-week-box {
  margin-top: .75rem;
  padding-top: .72rem;
}
.micro-care-card .care-pass-bar {
  flex-direction: row;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}

/* Collapsible 1-Line Personal Profile Drawer */
.profile-drawer {
  padding: 0;
  margin-bottom: .8rem;
  overflow: hidden;
}
.profile-drawer-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem 1rem;
  padding: .78rem 1rem;
  user-select: none;
}
.profile-drawer-summary::-webkit-details-marker {
  display: none;
}
.profile-sum-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .65rem;
  min-width: 0;
}
.profile-sum-title {
  font-size: .92rem;
  color: var(--h-ink);
  white-space: nowrap;
}
.profile-sum-meta {
  font-size: .82rem;
  color: var(--h-muted);
  font-variant-numeric: tabular-nums;
}
.profile-focus-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: .28rem;
}
.profile-focus-tag {
  padding: .08rem .46rem;
  border-radius: 999px;
  background: var(--h-accent-soft);
  color: var(--h-accent);
  font-size: .72rem;
  font-weight: 660;
}
.profile-edit-pill {
  flex: none;
  padding: .24rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--h-border-strong);
  background: var(--h-surface-soft);
  color: var(--h-ink);
  font-size: .78rem;
  font-weight: 650;
  white-space: nowrap;
}
.profile-drawer[open] .profile-edit-pill {
  background: var(--h-accent-soft);
  border-color: var(--h-accent);
  color: var(--h-accent);
}
.profile-drawer-body {
  padding: .85rem 1rem 1rem;
  border-top: 1px dashed var(--h-border);
  border-radius: 0;
  border-inline: 0;
  border-bottom: 0;
  box-shadow: none;
  background: transparent;
}
.profile-row-top {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: .75rem;
}
.choice-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .45rem;
}
.choice-grid-4 .choice-card {
  padding: .55rem .65rem;
}
.profile-drawer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: .75rem;
  padding-top: .65rem;
  border-top: 1px dashed var(--h-border);
}

/* Slim Ecosystem Link Strip */
.eco-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .65rem 1rem;
  padding: .78rem 1rem;
  margin-bottom: .65rem;
}
.eco-strip-left {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem .65rem;
}
.eco-strip-left strong {
  font-size: .9rem;
  color: var(--h-ink);
}
.eco-strip-links {
  display: flex;
  flex-wrap: wrap;
  gap: .38rem;
}
.eco-pill {
  display: inline-flex;
  align-items: center;
  padding: .24rem .68rem;
  border-radius: 999px;
  border: 1px solid var(--h-border);
  background: var(--h-surface-soft);
  color: var(--h-cobalt);
  font-size: .79rem;
  font-weight: 630;
  text-decoration: none;
  transition: border-color .14s ease, background-color .14s ease;
}
.eco-pill:hover {
  border-color: var(--h-cobalt);
  background: var(--h-cobalt-soft);
}
.health-disclaimer-slim {
  margin: .35rem 0 0;
  font-size: .75rem;
  color: var(--h-muted);
  text-align: center;
}

/* 4. Tab 2: Compact Recipes Toolbar & Cards */
.recipe-scene-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem .85rem;
}
.recipe-prefs-toggle {
  flex: none;
  gap: .32rem;
}
.prefs-count-badge:not([hidden]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--h-accent);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
}
.recipe-tip {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding: .4rem .62rem;
  font-size: .79rem;
  line-height: 1.48;
}
.recipe-card-foot {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr);
  gap: .38rem;
}
.recipe-card-foot .recipe-mini-btn {
  min-height: 34px;
  padding: .22rem .55rem;
  font-size: .79rem;
}

/* 5. Tab 3: Compact Foods Search (2-Row) & Unified Tray Daily Bar */
.search-panel {
  padding: .82rem .92rem;
  gap: .58rem;
}
.search-top-row {
  display: flex;
  align-items: center;
  gap: .45rem;
}
.search-top-row .search-input-wrap {
  flex: 1 1 auto;
  min-width: 0;
}
.search-tool-btns {
  display: inline-flex;
  align-items: center;
  gap: .32rem;
  flex: none;
}
.scene-filters-strip {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: .1rem;
  -webkit-overflow-scrolling: touch;
}
.scene-filters-strip::-webkit-scrollbar {
  display: none;
}
.scene-filters-strip .filter-pill {
  flex: none;
  white-space: nowrap;
}
.more-filters-drawer {
  display: grid;
  gap: .55rem;
  padding-top: .58rem;
  border-top: 1px dashed var(--h-border);
}
.more-filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .32rem;
}
.pk-close-btn {
  margin-left: auto;
}
.tray-daily-link {
  margin-top: .32rem;
  font-size: .75rem;
  font-weight: 600;
  color: var(--h-accent);
  font-variant-numeric: tabular-nums;
}
.sample-btns-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .4rem;
}
.sample-btns-grid .sample-btn {
  padding: .48rem .58rem;
}
.sample-btns-grid .sample-btn strong {
  font-size: .8rem;
}
.sample-btns-grid .sample-btn span {
  font-size: .71rem;
}

/* 6. Tab 4: Sleep & Calm Split Panes + Collapsed Accordions */
.relax-subtabs {
  padding: .18rem;
}
.relax-subtabs .seg-btn {
  min-height: 32px;
  padding: .2rem .78rem;
  font-size: .82rem;
}
.sleep-card {
  align-content: start;
}
.sleep-card-head {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  flex-wrap: wrap;
}
.sleep-card .sleep-sound-box {
  margin-top: 0;
}
.sleep-ritual-box {
  margin-top: .85rem;
  padding-top: .82rem;
  border-top: 1px dashed var(--h-border);
  display: grid;
  gap: .6rem;
}
.sleep-ritual-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  flex-wrap: wrap;
}
.sleep-ritual-head h4 {
  margin: 0;
  font-size: .92rem;
}
.sleep-accordions {
  display: grid;
  gap: .65rem;
  margin-top: .85rem;
}
.sleep-accordion {
  padding: .65rem .9rem;
}
.sleep-accordion summary {
  justify-content: flex-start;
  gap: .25rem .45rem;
  flex-wrap: wrap;
}
.sleep-accordion summary .hint-small,
.sleep-accordion summary .sleep-debt-badge {
  margin-left: auto;
}
.sleep-acc-body {
  margin-top: .75rem;
  display: grid;
  gap: .7rem;
}

/* 7. Mobile Fixed Bottom 4-Tab Bar (hidden on desktop) */
.health-mobile-tabbar {
  display: none;
}

/* =====================================================================
 * V7 Responsive Breakpoints (Tablet + Mobile Native Bottom Bar)
 * ===================================================================== */
@media (max-width: 62rem) {
  .today-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .choice-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 47.99rem) {
  /* Mobile Top App Bar: clean 1-row (brand left, theme toggle right) */
  .health-appbar {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 3.1rem;
    padding-block: .35rem;
    gap: .5rem;
  }
  .health-appbar .health-subnav-links,
  .appbar-list-link {
    display: none;
  }
  .appbar-brand img {
    width: 26px;
    height: 26px;
  }
  .appbar-title {
    font-size: .96rem;
  }
  .appbar-sub {
    font-size: .68rem;
  }

  /* Fixed Bottom 4-Tab Bar */
  .health-mobile-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 42;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .2rem;
    padding: .36rem .5rem calc(.38rem + env(safe-area-inset-bottom, 0px));
    background: rgba(250, 252, 250, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--h-border);
    box-shadow: 0 -6px 20px rgba(21, 52, 38, 0.06);
  }
  .m-tab-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .14rem;
    min-height: 46px;
    padding: .22rem .1rem;
    border-radius: .75rem;
    color: #465b51;
    font-size: .72rem;
    font-weight: 640;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
  }
  .m-tab-btn.is-active {
    background: var(--h-accent-soft);
    color: var(--h-accent);
  }
  .m-tab-badge:not([hidden]) {
    position: absolute;
    top: 3px;
    right: calc(50% - 20px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #c93a2b;
    color: #fff;
    font-size: .64rem;
    font-weight: 700;
  }

  .health-section {
    padding-block: .75rem 1.4rem;
  }
  .site-footer {
    padding-bottom: calc(5.2rem + env(safe-area-inset-bottom, 0px));
  }
  .mobile-tray-fab {
    bottom: calc(4.4rem + env(safe-area-inset-bottom, 0px));
  }

  /* Today Mobile Polish */
  .now-coach-card {
    flex-direction: column;
    align-items: stretch;
    gap: .55rem;
    padding: .75rem .85rem;
  }
  .now-coach-actions .h-btn {
    width: 100%;
    justify-content: center;
  }
  .today-kpi-grid {
    gap: .52rem;
  }
  .today-kpi-grid .kpi-tile {
    padding: .72rem .74rem;
  }
  .today-kpi-grid .kpi-value strong {
    font-size: 1.24rem;
  }
  .kpi-water-row .water-progress-text {
    font-size: .88rem;
  }
  .water-inline-actions {
    gap: .22rem;
  }
  .water-inline-actions .h-btn-xs {
    padding: .24rem .42rem;
    font-size: .72rem;
    min-height: 30px;
  }
  .profile-row-top {
    grid-template-columns: minmax(0, 1fr);
  }
  .profile-drawer-summary {
    flex-wrap: wrap;
    padding: .72rem .85rem;
  }

  /* Recipes & Foods Mobile Polish */
  .view-head {
    margin-bottom: .65rem;
  }
  .view-head-hint {
    display: none;
  }
  .recipe-scene-bar {
    gap: .4rem;
  }
  .recipe-scene-bar .scene-pills {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .3rem;
  }
  .recipe-scene-bar .filter-pill {
    padding: .28rem .2rem;
    font-size: .76rem;
    justify-content: center;
    text-align: center;
  }
  .recipe-prefs-toggle {
    width: 100%;
    justify-content: center;
  }
  .search-top-row {
    flex-wrap: wrap;
  }
  .search-tool-btns {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .search-tool-btns .h-btn {
    justify-content: center;
  }
  .sleep-accordion summary .hint-small {
    margin-left: 0;
    flex: 1 0 100%;
    padding-left: 1.15rem;
  }
  .micro-care-card .care-pass-bar {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 23.5rem) {
  .today-kpi-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .recipe-scene-bar .scene-pills {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sample-btns-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* =====================================================================
 * V7 Dark Mode Harmony (html[data-theme="night"])
 * ===================================================================== */
html[data-theme="night"] .health-appbar-wrap {
  background: rgba(15, 20, 23, 0.92);
  border-color: var(--h-border);
}
html[data-theme="night"] .appbar-title {
  color: var(--h-ink);
}
html[data-theme="night"] .appbar-sub {
  background: #173025;
  color: #9be8c3;
}
html[data-theme="night"] .health-appbar .health-subnav-links {
  background: #131b20;
  border-color: var(--h-border);
}
html[data-theme="night"] .health-mobile-tabbar {
  background: rgba(15, 20, 23, 0.95);
  border-top-color: var(--h-border);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.45);
}
html[data-theme="night"] .m-tab-btn {
  color: #a6b4bc;
}
html[data-theme="night"] .m-tab-btn.is-active {
  background: #183428;
  color: #9be8c3;
}
html[data-theme="night"] .now-coach-card {
  background: linear-gradient(135deg, #132820 0%, #171f24 68%, #152130 100%);
  border-color: #294a3c;
}
html[data-theme="night"] .now-coach-icon {
  background: #1a3529;
}
html[data-theme="night"] .now-coach-copy strong {
  color: #84e4b4;
}
html[data-theme="night"] .today-mini-bar {
  background: #232f37;
}
html[data-theme="night"] .kpi-link-chip {
  background: #152b22;
  border-color: #2d5543;
  color: #9be8c3;
}
html[data-theme="night"] .profile-drawer-summary {
  color: var(--h-ink);
}
html[data-theme="night"] .profile-focus-tag {
  background: #173226;
  color: #9ce6c0;
}
html[data-theme="night"] .profile-edit-pill {
  background: #131b20;
  border-color: #32434e;
  color: #e6e0d6;
}
html[data-theme="night"] .profile-drawer[open] .profile-edit-pill {
  background: #1a3629;
  border-color: #49a87a;
  color: #a4ecc8;
}
html[data-theme="night"] .eco-strip {
  background: var(--h-surface);
  border-color: var(--h-border);
}
html[data-theme="night"] .eco-pill {
  background: #152436;
  border-color: #29466a;
  color: #a4c8ff;
}
html[data-theme="night"] .eco-pill:hover {
  background: #1c314b;
  border-color: #4f82e0;
}
html[data-theme="night"] .prefs-count-badge:not([hidden]) {
  background: #216e4b;
  color: #ffffff;
}
html[data-theme="night"] .tray-daily-link {
  color: #8ce5b8;
}
html[data-theme="night"] .sleep-accordion {
  background: var(--h-surface);
  border-color: var(--h-border);
}
html[data-theme="night"] .sleep-accordion summary {
  background: transparent;
}


/* =====================================================================
 * V7.1: Restore Live Side-by-Side Profile & 4-High <-> Right KPIs Split
 * Desktop (>=60rem): Always-open Left Controls + Live Reacting Right KPIs
 * Mobile (<60rem): KPIs First + Collapsible Drawer with Sticky Live Readout
 * ===================================================================== */
.today-workbench {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: .82rem;
  align-items: start;
  margin-bottom: .8rem;
}
.today-dashboard-col {
  display: grid;
  gap: .72rem;
  min-width: 0;
}
.today-dashboard-col .today-kpi-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .7rem;
  margin-bottom: 0;
}
.today-dashboard-col .macro-compact {
  margin-bottom: 0;
}
.today-workbench .profile-drawer {
  margin-bottom: 0;
}
.choice-grid-2x2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .42rem;
}
.choice-grid-2x2 .choice-card {
  padding: .48rem .62rem;
}
.choice-grid-2x2 .choice-card strong {
  font-size: .84rem;
}
.choice-grid-2x2 .choice-card span {
  font-size: .72rem;
}
.choice-grid-2x2 .focus-card {
  padding-right: 1.85rem;
}
.choice-grid-2x2 .focus-card::after {
  top: .55rem;
  right: .55rem;
}
.mobile-profile-live {
  display: none;
}

@media (min-width: 60rem) {
  .today-workbench .profile-drawer-summary {
    pointer-events: none;
    cursor: default;
    padding: .75rem 1rem .5rem;
  }
  .today-workbench .profile-sum-meta,
  .today-workbench .profile-edit-pill,
  .today-workbench #btn-close-profile-drawer {
    display: none;
  }
  .today-workbench .profile-drawer-body {
    padding: .55rem 1rem .82rem;
    border-top: 0;
    gap: .65rem;
  }
  .today-workbench .profile-drawer-body .field-group {
    gap: .32rem;
  }
  .today-workbench .profile-drawer-body .num-field {
    padding: .45rem .55rem;
  }
  .today-workbench .profile-drawer-foot {
    margin-top: .25rem;
    padding-top: .5rem;
  }
}

@media (max-width: 59.99rem) {
  .today-workbench {
    display: flex;
    flex-direction: column;
    gap: .72rem;
  }
  .today-dashboard-col {
    order: 1;
  }
  .today-workbench .profile-drawer {
    order: 2;
  }
  .mobile-profile-live {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: .35rem .55rem;
    position: sticky;
    top: 3.35rem;
    z-index: 12;
    padding: .46rem .75rem;
    margin-bottom: .25rem;
    border-radius: .75rem;
    background: #175c3c;
    color: #e9f9f0;
    font-size: .8rem;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 6px 16px rgba(20, 80, 54, .2);
  }
  .mobile-profile-live strong {
    color: #ffffff;
    font-weight: 760;
  }
}

html[data-theme="night"] .mobile-profile-live {
  background: #1d5a3e;
  border: 1px solid #3c8e67;
  color: #e4f8ed;
}


/* =====================================================================
 * V7.2: Eaten Check-in Loop, Live Pulse Toast, GPU Subnav Slider,
 * Horizontal Filter Scroll-Fade & Clickable Stretch Step Dots
 * ===================================================================== */

/* 1. Desktop 4-Tab Smooth GPU Spring Slider */
.health-appbar .health-subnav-links {
  position: relative;
}
.subnav-slider {
  position: absolute;
  top: .22rem;
  bottom: .22rem;
  left: 0;
  border-radius: 999px;
  background: var(--h-accent);
  box-shadow: 0 3px 10px rgba(27, 104, 72, 0.22);
  pointer-events: none;
  opacity: 0;
  transition: transform .26s cubic-bezier(.22, 1, .36, 1), width .24s cubic-bezier(.22, 1, .36, 1), opacity .14s ease;
  z-index: 0;
}
.health-appbar .health-subnav-links.has-slider .subnav-slider {
  opacity: 1;
}
.health-appbar .health-subnav-links .subnav-pill {
  position: relative;
  z-index: 1;
}
.health-appbar .health-subnav-links.has-slider .subnav-pill.is-active {
  background: transparent;
}
@media (prefers-reduced-motion: reduce) {
  .subnav-slider { transition: none; }
}

/* 2. Right-Side Live Pulse & 4-High Linkage Toast */
@keyframes kpiCardPulse {
  0% { box-shadow: 0 0 0 0 rgba(27, 104, 72, .35); border-color: var(--h-accent); }
  100% { box-shadow: 0 0 0 8px rgba(27, 104, 72, 0); }
}
.kpi-tile.is-pulse,
.macro-compact.is-pulse {
  animation: kpiCardPulse .38s ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .kpi-tile.is-pulse,
  .macro-compact.is-pulse { animation: none; }
}
.plan-live-toast {
  padding: .42rem .75rem;
  border-radius: .72rem;
  background: var(--h-accent-soft);
  border: 1px solid #b5dac2;
  color: #145437;
  font-size: .8rem;
  font-weight: 650;
  line-height: 1.4;
  transition: opacity .18s ease, transform .18s ease;
}
.kpi-top-right {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
.kpi-reset-mini {
  padding: .08rem .38rem;
  border-radius: 999px;
  border: 1px solid var(--h-border);
  background: transparent;
  color: var(--h-muted);
  font-size: .68rem;
  font-weight: 600;
  cursor: pointer;
}
.kpi-reset-mini:hover {
  border-color: var(--h-coral);
  color: var(--h-coral);
}

/* 3. Recipe Meal "✓ 已吃" Check-in Pill */
.recipe-eaten-btn {
  margin-top: .22rem;
  padding: .12rem .5rem;
  border-radius: 999px;
  border: 1px solid var(--h-border-strong);
  background: var(--h-surface-soft);
  color: var(--h-muted);
  font-size: .72rem;
  font-weight: 660;
  cursor: pointer;
  transition: background-color .14s ease, color .14s ease, border-color .14s ease;
}
.recipe-eaten-btn:hover {
  border-color: var(--h-accent);
  color: var(--h-accent);
}
.recipe-eaten-btn.is-eaten {
  background: var(--h-accent);
  border-color: var(--h-accent);
  color: #ffffff;
}
.recipe-card.is-eaten {
  border-color: #93cca7;
}

/* 4. Foods Horizontal Filter Strip Soft Edge Fade Hints */
.scene-strip-wrap {
  position: relative;
  min-width: 0;
}
.scene-strip-wrap::before,
.scene-strip-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: .1rem;
  width: 24px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .16s ease;
  z-index: 2;
}
.scene-strip-wrap::before {
  left: 0;
  background: linear-gradient(90deg, var(--h-surface) 0%, transparent 100%);
}
.scene-strip-wrap::after {
  right: 0;
  background: linear-gradient(270deg, var(--h-surface) 0%, transparent 100%);
}
.scene-strip-wrap.can-scroll-left::before { opacity: 1; }
.scene-strip-wrap.can-scroll-right::after { opacity: 1; }

/* 5. Tray Swaps Above Advice Polish */
.tray-swaps-box {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.tray-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: .38rem;
}
.tray-actions .h-btn {
  justify-content: center;
  text-align: center;
}

/* 6. Clickable Stretch Step Dots */
.stretch-dots {
  gap: .38rem;
}
button.stretch-dot {
  border: 0;
  padding: 0;
  height: 9px;
  cursor: pointer;
  transition: transform .14s ease, background-color .16s ease;
}
button.stretch-dot:hover {
  transform: scaleY(1.35);
}

/* V7.2 Dark Mode Overrides */
html[data-theme="night"] .subnav-slider {
  background: #216e4b;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .38);
}
html[data-theme="night"] .health-appbar .health-subnav-links.has-slider .subnav-pill.is-active {
  background: transparent;
  color: #ffffff;
}
html[data-theme="night"] .plan-live-toast {
  background: #163024;
  border-color: #2f5c47;
  color: #a8eccb;
}
html[data-theme="night"] .recipe-eaten-btn {
  background: #131b20;
  border-color: #32434e;
  color: #b7c4cb;
}
html[data-theme="night"] .recipe-eaten-btn.is-eaten {
  background: #216e4b;
  border-color: #49a87a;
  color: #ffffff;
}
html[data-theme="night"] .recipe-card.is-eaten {
  border-color: #3d8e66;
}
html[data-theme="night"] .kpi-reset-mini {
  border-color: #33434e;
  color: #aebbc3;
}
html[data-theme="night"] button.stretch-dot.is-done {
  background: #2d7c58;
}
html[data-theme="night"] button.stretch-dot.is-current {
  background: #52c48c;
}
.footer-links {
  display: inline-flex;
  align-items: center;
  gap: .9rem;
}

/* =====================================================================
 * V7.3: Multi-Dish Combo Bar, Cross-Tab Relax Pill, Weight Mini Sparkline,
 * Current Meal Highlight & Native Touch Micro-Press Polish
 * ===================================================================== */

/* 1. Multi-Dish Quick Combo Bar (Tab 3 Foods) */
#food-search::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}
.food-combo-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .55rem .8rem;
  padding: .62rem .78rem;
  border-radius: .85rem;
  background: #edf7f0;
  border: 1px solid #b5dac2;
}
.food-combo-left {
  display: flex;
  flex-direction: column;
  gap: .32rem;
  min-width: 0;
  flex: 1 1 14rem;
}
.food-combo-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
}
.food-combo-chip {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  padding: .14rem .5rem;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #c7e2cf;
  color: #152c22;
  font-size: .78rem;
  font-weight: 640;
  line-height: 1.35;
}
.food-combo-chip em {
  font-style: normal;
  font-size: .72rem;
  font-weight: 700;
  color: #165e3f;
  font-variant-numeric: tabular-nums;
}
.food-combo-meta {
  font-size: .76rem;
  color: #2f5443;
  font-weight: 560;
}
.food-combo-add-btn {
  flex: none;
  white-space: nowrap;
}

/* 2. Cross-Tab Appbar Relax Mini Pill (White Noise / Breathing Live Countdown) */
@keyframes arpPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.82); }
}
.appbar-relax-pill {
  display: inline-flex;
  align-items: center;
  gap: .22rem;
  padding: .16rem .22rem .16rem .5rem;
  border-radius: 999px;
  background: #e6f4ec;
  border: 1px solid #9bd0b1;
  color: #124d33;
  font-size: .78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.appbar-relax-pill.is-paused {
  opacity: .84;
}
.arp-jump {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .12rem .18rem .12rem 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.arp-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1c8b55;
  flex: none;
  animation: arpPulse 2s ease-in-out infinite;
}
.appbar-relax-pill.is-paused .arp-dot {
  animation: none;
  background: #6c8578;
}
.arp-toggle {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #175c3c;
  color: #ffffff;
  font-size: .68rem;
  line-height: 1;
  cursor: pointer;
  flex: none;
}
.arp-toggle:hover {
  background: #11492f;
}

/* 3. BMI Card Lightweight Weight Log & Mini Sparkline */
.kpi-value-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .4rem;
}
.kpi-log-weight-btn {
  padding: .16rem .52rem;
  border-radius: 999px;
  border: 1px solid var(--h-border-strong);
  background: var(--h-surface-soft);
  color: #165c3d;
  font-size: .72rem;
  font-weight: 660;
  line-height: 1.3;
  cursor: pointer;
  white-space: nowrap;
  flex: none;
  transition: background-color .14s ease, border-color .14s ease, transform .12s ease;
}
.kpi-log-weight-btn:hover {
  border-color: var(--h-accent);
  background: var(--h-accent-soft);
}
.kpi-log-weight-btn.is-logged {
  background: #e4f4ea;
  border-color: #96cfa9;
  color: #124d33;
}
.bmi-pace-hint {
  color: #165c3d;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.weight-trend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .45rem;
  margin-top: .18rem;
  padding-top: .34rem;
  border-top: 1px dashed var(--h-border);
}
.weight-spark-svg {
  flex: 1 1 auto;
  max-width: 116px;
  height: 24px;
  overflow: visible;
}
.weight-spark-area {
  fill: rgba(27, 104, 72, 0.13);
}
.weight-spark-line {
  stroke: #1b6848;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.weight-spark-dot {
  fill: #1b6848;
}
.weight-trend-delta {
  flex: none;
  font-size: .72rem;
  font-weight: 700;
  color: #165c3d;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.weight-trend-delta[data-dir="up"] {
  color: #9a5708;
}
.weight-trend-delta[data-dir="flat"] {
  color: var(--h-muted);
}

/* 4. Current-Meal Auto Highlight on Today's Recipes */
.recipe-card.is-now-meal {
  border-color: #5ea980;
  background: linear-gradient(180deg, #f3fbf6 0%, #ffffff 42%);
  box-shadow: 0 6px 20px rgba(27, 104, 72, 0.09);
}
.recipe-now-badge {
  display: inline-flex;
  align-items: center;
  padding: .08rem .42rem;
  border-radius: 999px;
  background: #175c3c;
  color: #ffffff;
  font-style: normal;
  font-size: .68rem;
  font-weight: 700;
  line-height: 1.25;
}

/* 6. Native Touch Manipulation & Subtle Tactile Micro-Press */
.health-body button,
.health-body a,
.health-body summary,
.health-body input[type="range"] {
  touch-action: manipulation;
}
.health-body .h-btn:active:not(:disabled),
.health-body .filter-pill:active,
.health-body .choice-card:active,
.health-body .m-tab-btn:active,
.health-body .step-btn:active,
.health-body .kpi-log-weight-btn:active,
.health-body .recipe-eaten-btn:active,
.health-body .arp-toggle:active {
  transform: scale(0.97);
}
@media (prefers-reduced-motion: reduce) {
  .arp-dot { animation: none; }
  .health-body .h-btn:active:not(:disabled),
  .health-body .filter-pill:active,
  .health-body .choice-card:active,
  .health-body .m-tab-btn:active,
  .health-body .step-btn:active,
  .health-body .kpi-log-weight-btn:active,
  .health-body .recipe-eaten-btn:active,
  .health-body .arp-toggle:active { transform: none; }
}

/* Mobile Narrow Viewport Safeguards for V7.3 */
@media (max-width: 47.99rem) {
  .health-appbar.has-relax-pill .appbar-sub {
    display: none;
  }
  .appbar-relax-pill {
    font-size: .73rem;
    padding: .14rem .18rem .14rem .42rem;
  }
  .arp-toggle {
    width: 20px;
    height: 20px;
  }
  .food-combo-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .food-combo-left {
    flex: 0 0 auto;
  }
  .food-combo-add-btn {
    width: 100%;
    justify-content: center;
  }
}
@media (max-width: 23.5rem) {
  .health-appbar.has-relax-pill .appbar-brand img {
    display: none;
  }
}

/* V7.3 Dark Mode Harmony (High Contrast >= 4.5:1) */
html[data-theme="night"] .food-combo-bar {
  background: #142b21;
  border-color: #2d5b46;
}
html[data-theme="night"] .food-combo-chip {
  background: #10191e;
  border-color: #2c434d;
  color: #eef4f1;
}
html[data-theme="night"] .food-combo-chip em {
  color: #7de2ae;
}
html[data-theme="night"] .food-combo-meta {
  color: #b4d8c5;
}
html[data-theme="night"] .appbar-relax-pill {
  background: #163024;
  border-color: #31694e;
  color: #b7f0d3;
}
html[data-theme="night"] .arp-dot {
  background: #52d190;
}
html[data-theme="night"] .arp-toggle {
  background: #216e4b;
  color: #ffffff;
}
html[data-theme="night"] .arp-toggle:hover {
  background: #29845a;
}
html[data-theme="night"] .kpi-log-weight-btn {
  background: #131b20;
  border-color: #344854;
  color: #9de8c2;
}
html[data-theme="night"] .kpi-log-weight-btn.is-logged {
  background: #183628;
  border-color: #3d8c65;
  color: #aef0ce;
}
html[data-theme="night"] .bmi-pace-hint {
  color: #8ce5b8;
}
html[data-theme="night"] .weight-spark-area {
  fill: rgba(95, 211, 153, 0.16);
}
html[data-theme="night"] .weight-spark-line {
  stroke: #5fd399;
}
html[data-theme="night"] .weight-spark-dot {
  fill: #79e6af;
}
html[data-theme="night"] .weight-trend-delta {
  color: #9be8c3;
}
html[data-theme="night"] .weight-trend-delta[data-dir="up"] {
  color: #f0b85a;
}
html[data-theme="night"] .recipe-card.is-now-meal {
  border-color: #42996e;
  background: linear-gradient(180deg, #162c22 0%, #151e23 48%);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}
html[data-theme="night"] .recipe-now-badge {
  background: #216e4b;
  color: #ffffff;
}

/* V7.3.1: Headphone Eyes-Closed Breath Audio Legend */
.breath-audio-legend {
  margin: .35rem 0 0;
  padding: .34rem .62rem;
  border-radius: .68rem;
  background: var(--h-accent-tint);
  border: 1px solid #cce3d3;
  color: #1c563b;
  font-size: .76rem;
  font-weight: 560;
  line-height: 1.4;
}
html[data-theme="night"] .breath-audio-legend {
  background: #142a21;
  border-color: #285240;
  color: #a6e3c4;
}
