/* Gorgeous Eating: bold and clean, black, white and platinum with a champagne-gold accent, sharp
   corners, capitalized display type (Anton, an Impact-style face) over Arial. The light page was
   cream until Nov 10, 2026; that version is in design-archive/cream-page.css. */
:root {
  --bg: #e9eaec;
  --surface: #f8f8f9;
  --ink: #0a0a0a;
  --muted: #5f5f5f;
  --line: #e2e2e2;
  --leaf: #0a0a0a;
  --leaf-strong: #000000;
  --leaf-soft: #e3e5e8;
  --on-leaf: #ffffff;
  --carrot: #8a6a3b;
  --gold: #c9a66b;
  --gold-foil: linear-gradient(100deg, #a8844f 0%, #f6e7b6 24%, #c9a66b 46%, #fff4c9 62%, #b48d55 82%, #ead08e 100%);
  --card-edge: #d9bf8a;
  --card-shadow: 0 8px 24px rgba(10, 12, 16, 0.08);
  --pick-bg: #dfe1e4;
  --pick-edge: #9aa0a6;
  --hover-bg: #e6e8ea;
  --check: #a8844f;
  --cta-bg: var(--gold-foil);
  --cta-fg: #000000;
  --band-bg: #000000;
  --band-fg: #ffffff;
  --warn-bg: #fbf3e2;
  --warn-line: #e6d3a8;
  --warn-fg: #5e4714;
  --dv-high-bg: #00694a;
  --dv-high-fill: linear-gradient(135deg, #00737b 0%, #005462 100%);
  --dv-high-edge: #c9a66b;
  --dv-high-fg: #f3d58c;
  --dv-good-bg: #3ed6a0;
  --dv-good-fg: #003322;
  --dv-some-bg: #f0fbf6;
  --dv-some-fg: #0b6b4b;
  --dv-some-line: #bfebd7;

  --font-display: "Anton", Impact, "Arial Narrow", sans-serif;
  --font-body: Arial, Arimo, "Helvetica Neue", Helvetica, sans-serif;
  --font-data: Arial, Arimo, "Helvetica Neue", Helvetica, sans-serif;

  --radius: 2px;
  --radius-pill: 2px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --surface: #0e0e0e;
    --ink: #f5f5f5;
    --muted: #a3a3a3;
    --line: #2a2a2a;
    --leaf: #f5f5f5;
    --leaf-strong: #ffffff;
    --leaf-soft: #1a1a1a;
    --on-leaf: #000000;
    --carrot: #d4b07a;
    --gold: #c9a66b;
    --card-edge: #2a2a2a;
    --card-shadow: none;
    --pick-bg: #1a1a1a;
    --pick-edge: #2a2a2a;
    --hover-bg: #1a1a1a;
    --check: #f5f5f5;
    --cta-bg: #f5f5f5;
    --cta-fg: #000000;
    --band-bg: #000000;
    --band-fg: #ffffff;
    --warn-bg: #2a2212;
    --warn-line: #4d3e1e;
    --warn-fg: #ecd38f;
    --dv-high-bg: #2ee6a6;
    --dv-high-fill: linear-gradient(135deg, #00737b 0%, #005462 100%);
    --dv-high-edge: #c9a66b;
    --dv-high-fg: #f3d58c;
    --dv-good-bg: #2bd99a;
    --dv-good-fg: #002417;
    --dv-some-bg: #0a1f18;
    --dv-some-fg: #5fe3b1;
    --dv-some-line: #1e5c45;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #000000;
  --surface: #0e0e0e;
  --ink: #f5f5f5;
  --muted: #a3a3a3;
  --line: #2a2a2a;
  --leaf: #f5f5f5;
  --leaf-strong: #ffffff;
  --leaf-soft: #1a1a1a;
  --on-leaf: #000000;
  --carrot: #d4b07a;
  --gold: #c9a66b;
  --card-edge: #2a2a2a;
  --card-shadow: none;
  --pick-bg: #1a1a1a;
  --pick-edge: #2a2a2a;
  --hover-bg: #1a1a1a;
  --check: #f5f5f5;
  --cta-bg: #f5f5f5;
  --cta-fg: #000000;
  --band-bg: #000000;
  --band-fg: #ffffff;
  --warn-bg: #2a2212;
  --warn-line: #4d3e1e;
  --warn-fg: #ecd38f;
  --dv-high-bg: #2ee6a6;
  --dv-high-fill: linear-gradient(135deg, #00737b 0%, #005462 100%);
  --dv-high-edge: #c9a66b;
  --dv-high-fg: #f3d58c;
  --dv-good-bg: #2bd99a;
  --dv-good-fg: #002417;
  --dv-some-bg: #0a1f18;
  --dv-some-fg: #5fe3b1;
  --dv-some-line: #1e5c45;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-wrap: balance;
  line-height: 1.1;
}

.gutter {
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.app-header {
  background: var(--band-bg);
  color: var(--band-fg);
  padding-block: 32px 24px;
  border-bottom: 1px solid var(--gold);
}

.app-header-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
}

.app-header h1 {
  margin: 0;
  font-size: clamp(2.2rem, 8vw, 3.4rem);
  letter-spacing: 0.03em;
  line-height: 1;
}

.tagline {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
}

.sync-status {
  max-width: 900px;
  margin: 10px auto 0;
  font-size: 0.78rem;
  opacity: 0.85;
}

.sync-status[data-state="error"] {
  opacity: 1;
  font-weight: 700;
}

.app-tabs {
  max-width: 900px;
  margin: 18px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab {
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--band-fg);
  background: transparent;
  color: var(--band-fg);
  cursor: pointer;
  opacity: 0.85;
}

.tab:hover { opacity: 1; }

.tab.is-active {
  background: var(--band-fg);
  color: var(--band-bg);
  opacity: 1;
}

.tab:focus-visible {
  outline: 2px solid var(--carrot);
  outline-offset: 2px;
}

#app {
  max-width: 900px;
  margin: 0 auto;
  padding-block: 28px 48px;
}

.view.hidden { display: none; }

.view-intro { max-width: 62ch; margin-bottom: 20px; }
.view-intro h2 { margin: 0 0 6px; font-size: 1.6rem; }
.view-intro p { color: var(--muted); margin: 0; }

/* ---------- Questionnaire ---------- */

#category-sections {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.category-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.category-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 14px 18px;
  background: var(--leaf-soft);
  cursor: pointer;
  user-select: none;
}

.category-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--leaf-strong);
  min-width: 0;
}

.category-toggle {
  font-family: var(--font-data);
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--muted);
  margin-left: 6px;
}

.category-actions {
  display: flex;
  gap: 12px;
}

.category-actions button {
  background: none;
  border: none;
  color: var(--leaf-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  padding: 2px;
}

.food-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  gap: 4px;
  padding: 12px 14px;
}

.food-grid.collapsed { display: none; }

.food-subgroup {
  grid-column: 1 / -1;
  padding: 14px 10px 4px;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--carrot);
}

.food-subgroup:first-child {
  padding-top: 4px;
  border-top: none;
}

.food-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
}

.food-item:hover { background: var(--leaf-soft); }

.food-item:has(input:checked) {
  background: var(--leaf-soft);
  border-color: var(--line);
}

.food-item input {
  margin-top: 4px;
  accent-color: var(--leaf);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.food-item-label {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.food-item-name { font-weight: 700; }

.food-item-benefit {
  font-size: 0.8rem;
  color: var(--muted);
}

.food-item-serving {
  font-size: 0.75rem;
  color: var(--muted);
}

.meal-amount {
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--muted);
}

.food-item-warning,
.meal-warnings {
  font-size: 0.78rem;
  font-style: italic;
  color: var(--warn-fg);
}

.meal-warnings {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 6px;
}

/* ---------- Vitamin & mineral chips ---------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-block: 4px;
}

.chip {
  font-family: var(--font-data);
  font-size: 0.7rem;
  line-height: 1.5;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--leaf-strong);
  white-space: nowrap;
}

/* Vitamin and mineral tags in metallic green, darkest for the most: emerald (High), jade (Good),
   mint (Some). Metal looks the same in light and dark mode. Earlier looks are saved in
   design-archive/: vitamin-tags-green.css (flat green), vitamin-tags-silver.css (charcoal,
   platinum, pearl) and vitamin-tags-copper-trial.css (copper). */
.chip-high {
  background: linear-gradient(115deg, #05261a 0%, #1d6a4a 22%, #0a3826 45%, #3d9470 60%, #072e1f 80%, #165a3d 100%);
  border-color: #3d8f6a;
  color: #ffffff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
}
.chip-good {
  background: linear-gradient(115deg, #22603f 0%, #5fa983 22%, #2c7351 45%, #78bc97 60%, #276a4a 80%, #4e9672 100%);
  border-color: #23603f;
  color: #f6dc8e;
  text-shadow: 0 1px 1px rgba(0, 20, 10, 0.85);
}
.chip-some {
  background: linear-gradient(115deg, #d3ecdf 0%, #f5fcf8 22%, #c5e4d3 42%, #ebf8f1 58%, #cce8d8 78%, #f8fdfa 100%);
  border-color: #9cc9b0;
  color: #2b5842;
}

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

.dv-key {
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--muted);
}

.dv-key .dv-key-caption {
  margin: 0 0 6px;
}

.dv-key ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}

.dv-key li {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.chip-count {
  margin-left: 6px;
  color: var(--carrot);
  font-variant-numeric: tabular-nums;
}

.questionnaire-footer {
  position: sticky;
  bottom: 0;
  background: var(--bg);
  margin-top: 16px;
  padding-block: 14px calc(14px + env(safe-area-inset-bottom, 0px));
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
}

.selection-count {
  min-width: 0;
  font-family: var(--font-data);
  font-size: 0.9rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.questionnaire-footer .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .selection-count { font-size: 0.8rem; }
  .questionnaire-footer .btn { padding: 11px 16px; }
}

/* ---------- Buttons ---------- */

.btn {
  border: none;
  border-radius: var(--radius-pill);
  padding: 12px 22px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.btn:focus-visible,
.category-actions button:focus-visible,
.food-item input:focus-visible {
  outline: 2px solid var(--carrot);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--leaf);
  color: var(--on-leaf);
}
.btn-secondary {
  background: var(--surface);
  color: var(--leaf-strong);
  border: 1.5px solid var(--leaf);
}

.btn-tertiary {
  background: none;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Meal plan ---------- */

.plan-warnings:empty { display: none; }
.plan-warnings { margin-bottom: 16px; }

.plan-warning {
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.9rem;
  color: var(--warn-fg);
}

.plan-nutrients:empty { display: none; }

.plan-nutrients {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 18px;
}

.plan-nutrients h3 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}

.plan-nutrients p {
  margin: 0 0 10px;
  font-size: 0.88rem;
  color: var(--muted);
}

.plan-nutrients .chip {
  font-size: 0.8rem;
  padding: 3px 10px;
}

#plan-days {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.day-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.day-card h3 {
  margin: 0;
  padding: 12px 18px;
  background: var(--band-bg);
  color: var(--band-fg);
  font-size: 1.05rem;
}

.meal-block {
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}

.day-card h3 + .meal-block { border-top: none; }

.meal-block h4 {
  margin: 0 0 6px;
  color: var(--carrot);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.meal-foods {
  font-weight: 700;
  margin: 0 0 6px;
}

.meal-benefits {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.meal-macros {
  font-family: var(--font-data);
  font-size: 0.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Weekly check-in ---------- */

#checkin-days {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.checkin-day h3 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.checkin-week {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-bottom: 16px;
}

.checkin-week label { font-weight: 700; }

.checkin-week select {
  font: inherit;
  font-size: 1rem;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.checkin-week select:focus-visible {
  outline: 2px solid var(--carrot);
  outline-offset: 2px;
}

.checkin-week .report-note { flex-basis: 100%; }

.checkin-date {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.9rem;
  opacity: 0.85;
}

.checkin-day.is-today { border-color: var(--leaf); border-width: 2px; }

.checkin-count {
  font-family: var(--font-data);
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
}

.checkin-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 18px;
}

.quick-adds {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.usual-foods {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--leaf-soft);
}

.usual-title {
  margin: 0;
  font-weight: 700;
  font-size: 0.9rem;
}

.usual-hint {
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--muted);
  margin-left: 6px;
}

.usual-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.usual-btn {
  font: inherit;
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--leaf);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.usual-btn.is-logged {
  border-color: var(--line);
  color: var(--muted);
}

.usual-amount {
  font-size: 0.75rem;
  color: var(--muted);
}

.usual-toggle {
  align-self: flex-start;
  font: inherit;
  font-size: 0.85rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--leaf-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.usual-btn:focus-visible,
.usual-toggle:focus-visible {
  outline: 2px solid var(--carrot);
  outline-offset: 2px;
}

.logged-list {
  display: flex;
  flex-direction: column;
}

.logged-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-block: 10px;
  border-top: 1px solid var(--line);
}

.logged-row:first-child { border-top: none; padding-top: 0; }

.logged-top {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  padding-right: 28px;
}

/* Pinned top-right so it never wraps under a long name. */
.logged-top .logged-remove {
  position: absolute;
  top: -2px;
  right: 0;
}

.logged-name { font-weight: 700; }

.logged-amount {
  /* Keeps its natural width, so a short amount like "½ cup" drops under a long name whole. */
  flex: 1 0 auto;
  max-width: 100%;
  font-size: 0.8rem;
  color: var(--muted);
}

.amount-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.amount-btn {
  font: inherit;
  font-size: 0.82rem;
  min-width: 32px;
  padding: 4px 5px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.amount-btn.is-active {
  background: var(--leaf);
  border-color: var(--leaf);
  color: var(--on-leaf);
}

.amount-weigh { padding-inline: 6px; }

/* Oils and fats: a row of tablespoons, a row of teaspoons, then Weigh it. */
.amount-spoons { align-items: center; flex-wrap: nowrap; }

.amount-unit {
  flex: 0 0 5.6em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
}

.amount-note {
  align-self: center;
  font-size: 0.78rem;
  color: var(--muted);
}

/* Finished days stay folded until this is tapped. */
.day-log-toggle { align-self: stretch; }

.weigh-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.weigh-form input,
.weigh-form select {
  font: inherit;
  font-size: 1rem;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.weigh-form input { width: 7rem; }

.logged-estimate {
  font-size: 0.75rem;
  font-style: italic;
  color: var(--muted);
}

.quick-add {
  font: inherit;
  font-size: 0.82rem;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--leaf);
  background: var(--surface);
  color: var(--leaf-strong);
  cursor: pointer;
}

.quick-add.is-added {
  background: var(--leaf);
  color: var(--on-leaf);
}

.logged-remove {
  font: inherit;
  line-height: 1;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.logged-remove:hover { background: var(--surface); color: var(--ink); }

.logged-empty {
  font-size: 0.85rem;
  color: var(--muted);
}

.add-food {
  display: flex;
  gap: 8px;
}

.add-food input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 1rem;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.add-food input:focus-visible,
.quick-add:focus-visible,
.logged-remove:focus-visible,
.amount-btn:focus-visible,
.weigh-form input:focus-visible,
.weigh-form select:focus-visible {
  outline: 2px solid var(--carrot);
  outline-offset: 2px;
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.9rem;
}

.food-choices {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.choice-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.choice-btn {
  font: inherit;
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--leaf);
  background: var(--surface);
  color: var(--leaf-strong);
  cursor: pointer;
}

.choice-btn.choice-cancel {
  border-color: var(--line);
  color: var(--muted);
}

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

.add-food-error {
  margin: 0;
  font-size: 0.8rem;
  color: var(--warn-fg);
}

.report-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.report-card h3 {
  margin: 0 0 4px;
  font-size: 1.25rem;
}

.report-card h4 {
  margin: 18px 0 8px;
  color: var(--carrot);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.report-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.report-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.report-list .chips { margin-block: 4px 0; }

.report-tip {
  display: block;
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--muted);
}

.report-new {
  font-size: 0.8rem;
  color: var(--muted);
}

.report-macros {
  margin: 0;
  font-family: var(--font-data);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 20px 0 8px;
}

/* ---------- Approach picker ---------- */

.approach-picker {
  border: none;
  margin: 0 0 6px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 10px;
}

.approach-picker legend {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 8px;
  padding: 0;
}

.approach-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}

.approach-option:has(input:checked) {
  border-color: var(--leaf);
  background: var(--leaf-soft);
}

.approach-option input {
  margin-top: 4px;
  accent-color: var(--leaf);
  flex-shrink: 0;
}

.approach-option strong { display: block; }

.approach-summary {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
}

.approach-option:focus-within {
  outline: 2px solid var(--carrot);
  outline-offset: 2px;
}

.approach-disclaimer {
  margin: 0 0 18px;
  font-size: 0.78rem;
  color: var(--muted);
}

/* ---------- Explorer cheat sheet ---------- */

#explorer-sheet {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sheet-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
}

.sheet-section h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  color: var(--leaf-strong);
}

.sheet-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: 10px 16px;
}

.sheet-list li {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sheet-name { font-weight: 700; }

.sheet-serving {
  font-size: 0.78rem;
  color: var(--muted);
}

/* ---------- Journey ---------- */

#checkin-journey,
#journey-history { margin-top: 16px; }

.feeling-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.feeling-btn {
  font: inherit;
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.feeling-btn.is-active {
  background: var(--leaf);
  border-color: var(--leaf);
  color: var(--on-leaf);
}

.feeling-btn:focus-visible,
.next-week select:focus-visible {
  outline: 2px solid var(--carrot);
  outline-offset: 2px;
}

.next-week {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 20px 0 8px;
}

.next-week label { font-weight: 700; }

.next-week select {
  font: inherit;
  font-size: 1rem;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.journey-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.journey-week {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-block: 12px;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
}

.journey-week:first-child { border-top: none; padding-top: 0; }

.journey-head {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
  font-size: 1rem;
}

.journey-date {
  font-size: 0.78rem;
  color: var(--muted);
}

/* ---------- Footer ---------- */

.app-footer {
  max-width: 900px;
  margin: 0 auto;
  padding-block: 8px 40px;
  font-size: 0.78rem;
  color: var(--muted);
}

.app-footer p { margin: 0 0 8px; max-width: 75ch; }

#plan-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

#plan-empty[hidden] { display: none; }

.plan-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  justify-content: center;
  padding-block: 24px 8px;
}

/* ---------- Gorgeous Eating type treatment ----------
   Capitalized labels and names with a little tracking; longer sentences stay in normal case
   so they're easy to read. */

.tab,
.btn,
.chip,
.quick-add,
.amount-btn,
.usual-btn,
.choice-btn,
.feeling-btn,
.category-actions button,
.usual-toggle,
.selection-count,
.food-item-name,
.logged-name,
.sheet-name,
.usual-title,
.approach-option strong,
.approach-picker legend,
.next-week label,
.checkin-week label,
.dv-key-caption,
.meal-foods,
.checkin-count {
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tab,
.btn {
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
}

.btn { padding: 13px 24px; }

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink);
}

.btn-tertiary { letter-spacing: 0.1em; }

.btn-primary:hover { opacity: 0.85; }

.btn-secondary:hover {
  background: var(--ink);
  color: var(--bg);
}

.chip {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.food-item-name,
.logged-name,
.sheet-name {
  font-weight: 700;
  font-size: 0.92rem;
}

/* Amounts inside capitalized labels stay as typed ("3 large", "½ cup"). */
.meal-amount,
.usual-amount,
.usual-hint {
  text-transform: none;
  letter-spacing: 0;
}

.meal-foods { font-size: 0.9rem; }

.approach-picker legend,
.usual-title {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.04em;
}

.approach-picker legend { font-size: 1.3rem; }

.view-intro h2 { font-size: clamp(1.8rem, 6vw, 2.4rem); }

.category-header h3,
.sheet-section h3,
.report-card h3 { letter-spacing: 0.04em; }

.day-card h3 {
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--gold);
}

.meal-block h4,
.report-card h4,
.food-subgroup {
  letter-spacing: 0.16em;
}

.selection-count {
  font-size: 0.75rem;
  font-weight: 700;
}

/* ---------- Section headings: black bar, gold-foil lettering ---------- */

.category-header {
  background: var(--band-bg);
  border-bottom: 1px solid var(--gold);
}

.category-header h3 { color: var(--gold); }

.category-header .category-toggle {
  color: inherit;
  opacity: 0.8;
}

.category-header .category-actions button { color: var(--band-fg); }

/* Metallic lettering where the browser can paint text with a gradient; plain gold otherwise. */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .category-header h3 {
    background: var(--gold-foil);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

/* In dark mode the black heading bar sits on a near-black page, so it gets a gold rim. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .category-header { border: 1px solid var(--gold); }
}

:root[data-theme="dark"] .category-header { border: 1px solid var(--gold); }

/* ---------- Header: gold-foil name, white tagline ---------- */

.app-header h1 { color: var(--gold); }

.app-header .tagline { color: var(--band-fg); }

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .app-header h1 {
    background: var(--gold-foil);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

/* ---------- Active tab: gold foil with black lettering ---------- */

.tab.is-active {
  background: var(--gold-foil);
  border-color: var(--gold);
  color: #000000;
}

/* ---------- Luxe cards, gold picks and a black bottom bar ----------
   Light mode: gold-rimmed white cards with a soft lift on a champagne-ivory page, gold-lit
   selections and a gold-foil main button. Dark mode keeps its look through the same tokens. */

.category-section,
.day-card,
.report-card,
.sheet-section,
.plan-nutrients {
  border-color: var(--card-edge);
  box-shadow: var(--card-shadow);
}

.food-item:hover { background: var(--hover-bg); }

.food-item:has(input:checked) {
  background: var(--pick-bg);
  border-color: var(--pick-edge);
}

.food-item input,
.approach-option input { accent-color: var(--check); }

.btn-primary {
  background: var(--cta-bg);
  color: var(--cta-fg);
  border: 1px solid var(--gold);
}

.questionnaire-footer {
  background: var(--band-bg);
  border-top: 1px solid var(--gold);
  padding-inline: 16px;
}

.questionnaire-footer .selection-count {
  color: var(--band-fg);
  opacity: 0.85;
}

.questionnaire-footer .btn-primary {
  background: var(--gold-foil);
  color: #000000;
}

/* Slim bottom bar: it stays on screen while scrolling, so it should take little room. */
.questionnaire-footer {
  margin-top: 12px;
  padding-block: 6px;
  padding-inline: 12px;
}

.questionnaire-footer .btn {
  padding: 7px 14px;
  font-size: 0.72rem;
}

.questionnaire-footer .selection-count { font-size: 0.68rem; }

/* Tabs: one row of equal-width buttons, even on a phone. */
.app-tabs {
  flex-wrap: nowrap;
  gap: 6px;
}

.tab {
  flex: 1 1 0;
  min-width: 0;
  max-width: 200px;
  padding: 9px 4px;
  white-space: nowrap;
  text-align: center;
  font-size: clamp(0.64rem, 2.9vw, 0.82rem);
  letter-spacing: 0.1em;
}

/* App name sized to fill the header's width (see fitAppName in app.js); this size is the
   starting point and the fallback if the script doesn't run. */
.app-header h1 {
  display: inline-block;
  white-space: nowrap;
  font-size: clamp(2.4rem, 11vw, 4.6rem);
  letter-spacing: 0.02em;
}

.app-header-inner { flex-direction: column; align-items: flex-start; gap: 8px; }

/* ---------- Approach picker: black cards with gold-foil names; the pick turns gold ---------- */

.approach-picker { gap: 12px; }

.approach-option {
  position: relative;
  padding: 18px 18px 16px;
  background: var(--band-bg);
  color: var(--band-fg);
  border: 1px solid var(--gold);
  box-shadow: var(--card-shadow);
}

/* The native radio is hidden but still focusable; the whole card is the control. */
.approach-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.approach-tag {
  display: block;
  margin-bottom: 2px;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--band-fg);
  opacity: 0.7;
}

.approach-option strong {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.7rem;
  line-height: 1.1;
  letter-spacing: 0.04em;
  color: var(--gold);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .approach-option strong {
    background: var(--gold-foil);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.approach-option .approach-summary {
  margin-top: 4px;
  color: #bdbdbd;
}

.approach-option:has(input:checked) {
  background: var(--gold-foil);
  border-color: var(--gold);
  box-shadow: 0 6px 22px rgba(201, 166, 107, 0.4);
}

.approach-option:has(input:checked) strong {
  background: none;
  color: #000000;
}

.approach-option:has(input:checked) .approach-summary,
.approach-option:has(input:checked) .approach-tag {
  color: #2a2007;
  opacity: 1;
}

.approach-option:has(input:checked)::after {
  content: "✓ Your plan";
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #000000;
}

/* ---------- Gold-foil lettering helper (for text sitting on a black bar) ---------- */

.foil { color: var(--gold); }

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .foil {
    background: var(--gold-foil);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

/* Day cards get a gold rim in dark mode, like the food sections. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .day-card { border-color: var(--gold); }
}

:root[data-theme="dark"] .day-card { border-color: var(--gold); }

/* ---------- "Vitamins & minerals in your week": black card, gold details ---------- */

.plan-nutrients {
  background: var(--band-bg);
  color: var(--band-fg);
  border: 1px solid var(--gold);
}

.plan-nutrients h3 { color: var(--gold); }

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .plan-nutrients h3 {
    background: var(--gold-foil);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.plan-nutrients p { color: #bdbdbd; }

.plan-nutrients .chip {
  background: transparent;
  border-color: var(--gold);
  color: var(--band-fg);
}

.plan-nutrients .chip-count { color: var(--gold); }

/* A usual food already logged today turns polished platinum, like the vitamin tags. */
.usual-btn.is-logged {
  background: linear-gradient(115deg, #b9bdc3 0%, #eceef0 24%, #cdd0d4 46%, #f7f8f9 62%, #c3c7cc 82%, #e1e3e6 100%);
  border-color: #8a8f96;
  color: #000000;
}

/* Usual foods sit on a soft silver panel. */
.usual-foods {
  background: linear-gradient(180deg, #eef0f2 0%, #e3e5e8 100%);
  border: 1px solid #c6cacf;
}
.usual-btn { background: #ffffff; border-color: #000000; }

/* ---------- Day totals: "Add up today's nutrients" ----------
   A gold-foil button at the end of each logged day opens a black, gold-rimmed card with
   calories, macros and every tracked vitamin/mineral as a bar toward 100% of daily needs.
   Bars use the chip colors: sapphire = met, jade = partway, mint = low. */

.btn-totals {
  width: 100%;
  margin-top: 6px;
  background: var(--cta-bg);
  color: var(--cta-fg);
  border: none;
}

.btn-totals[aria-expanded="true"] {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--gold);
}

.day-totals {
  background: var(--band-bg);
  color: var(--band-fg);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: 16px;
}

.day-totals h4 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .day-totals h4 {
    background: var(--gold-foil);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.totals-macros {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(201, 166, 107, 0.4);
}

.totals-macros div {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.totals-macros strong {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1.1;
}

.totals-macros span {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #bdbdbd;
}

.totals-macros .totals-cal {
  grid-column: 1 / -1;
}

.totals-macros .totals-cal strong {
  font-size: 2.2rem;
  color: var(--gold);
}

.day-totals h5 {
  margin: 14px 0 8px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--gold);
}

.totals-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.totals-row {
  display: grid;
  grid-template-columns: 6.5rem 1fr 3rem;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
}

.totals-name {
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.totals-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  overflow: hidden;
}

.totals-bar span {
  display: block;
  height: 100%;
}

.totals-met .totals-bar span {
  background: var(--dv-high-fill);
  box-shadow: inset 0 0 0 1px var(--dv-high-edge);
}
.totals-partway .totals-bar span { background: #3ed6a0; }
.totals-low .totals-bar span { background: #bfebd7; }

.totals-pct {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.totals-met .totals-pct { color: var(--gold); font-weight: 700; }

.totals-note {
  margin: 14px 0 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #bdbdbd;
}

/* "Suggest foods to hit my targets": inside today's totals card. */
.ideas-toggle {
  width: 100%;
  margin-top: 14px;
  background: var(--gold-foil);
  color: #0a0a0a;
  border: none;
}
.ideas-toggle[aria-expanded="true"] {
  background: transparent;
  color: var(--gold);
  border: 1.5px solid var(--gold);
}
.ideas { margin-top: 12px; font-size: 0.85rem; line-height: 1.45; }
.ideas p { margin: 0 0 8px; }
.ideas-intro { color: #bdbdbd; }
.ideas-message { color: var(--gold); font-weight: 700; }
.ideas-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ideas-list li { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ideas-list li.ideas-gap { display: block; margin-top: 4px; font-size: 0.72rem; color: #bdbdbd; letter-spacing: 0.04em; }
.ideas-gap span { text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; color: var(--gold); margin-right: 4px; }
.ideas-food { min-width: 0; }
.ideas-helps { display: block; font-size: 0.75rem; color: #3ed6a0; margin-top: 2px; }
.ideas-maybe { font-size: 0.7rem; color: #bdbdbd; font-style: italic; }
.ideas-warning { display: block; font-size: 0.72rem; color: #f2b3a8; margin-top: 2px; }
.ideas-add {
  flex: none;
  padding: 6px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.ideas-add:hover { background: rgba(201, 166, 107, 0.15); }

/* ---------- My foods: "Clear all" and report "Other foods" ---------- */

.selection-info {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  min-width: 0;
}

.clear-all {
  font: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0;
  border: none;
  background: none;
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.clear-all[hidden] { display: none; }

.clear-all:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.report-more {
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--muted);
}

.report-more summary {
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.report-more[open] summary { margin-bottom: 2px; }

/* ---------- Daily calorie goal ----------
   A one-line goal at the top of the check-in; "Change" opens a short form that estimates a goal
   from height, weight, age, sex and activity. The day totals card shows a bar toward it. */

.checkin-goal { margin-bottom: 16px; }

.goal-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 0;
}

.goal-label,
.goal-form label,
.weight-form label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.goal-line strong {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.4rem;
  line-height: 1;
}

.goal-edit {
  font: inherit;
  font-size: 0.78rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.goal-form,
.weight-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--card-edge);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 16px;
}

.goal-form h3,
.weight-form h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.goal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.goal-form label,
.weight-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.goal-pair {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.85rem;
}

.goal-form input,
.goal-form select,
.weight-form input,
.weight-form select {
  font: inherit;
  font-size: 1rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
}

.goal-pair input { width: 4.2em; }
#goal-own { width: 6.5em; }
.goal-grid > label > input,
.goal-grid > label > select { width: 100%; }

.goal-form input:focus-visible,
.goal-form select:focus-visible,
.weight-form input:focus-visible,
.weight-form select:focus-visible,
.goal-edit:focus-visible {
  outline: 2px solid var(--carrot);
  outline-offset: 2px;
}

.goal-estimate {
  margin: 0;
  padding: 10px 12px;
  background: var(--band-bg);
  color: var(--band-fg);
  border-left: 3px solid var(--gold);
  font-size: 0.88rem;
  line-height: 1.45;
}

.goal-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.goal-form .report-note { margin: 0; }

/* Day totals: progress toward the goal, and the top sources of calories and fat. */
.totals-goal {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.78rem;
  color: #d8d8d8;
  text-align: center;
}

/* The macro grid centers its cells; the goal bar needs the full width. */
.totals-macros .totals-goal { align-items: stretch; }

.totals-goal .totals-bar span { background: var(--gold-foil); }
.totals-goal.is-over .totals-bar span { background: #e8796b; }
.totals-goal.is-over { color: #f2b3a8; }

.totals-sources {
  margin: 0 0 6px;
  font-size: 0.8rem;
  line-height: 1.45;
}

.totals-sources span {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #bdbdbd;
}

/* Shown after the log is cleared, so an accidental clear can be undone. */
.undo-week {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 12px 14px;
  background: var(--band-bg);
  color: var(--band-fg);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  font-size: 0.88rem;
}

.undo-week .btn-primary {
  background: var(--gold-foil);
  color: #000000;
}

/* Goal line: the week's daily average so far, under the goal. */
.goal-week {
  margin: 8px 0 0;
  font-size: 0.86rem;
  line-height: 1.5;
}

.goal-week .goal-label { display: block; }

.goal-week strong {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.1rem;
}

.goal-week.is-over strong { color: #c0392b; }

.goal-hint {
  display: block;
  font-size: 0.76rem;
  opacity: 0.7;
}

.goal-item { white-space: nowrap; }

/* Past days: one line per food ("Red Bell Pepper – 1 medium"); tap to change it. */
.logged-row.is-compact { padding-block: 6px; }

.logged-compact {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.logged-compact .logged-amount { font-size: 0.86rem; }

.logged-compact:focus-visible,
.logged-done:focus-visible {
  outline: 2px solid var(--carrot);
  outline-offset: 2px;
}

.logged-hint {
  margin: 4px 0 0;
  font-size: 0.76rem;
  color: var(--muted);
}

.logged-done {
  margin-left: auto;
  padding: 4px 2px;
  border: none;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* Guessed, then weighed: how close the guess was. */
.logged-guess {
  flex-basis: 100%;
  font-size: 0.78rem;
  color: var(--ink);
}

/* Start next week: asks in words and waits for an answer. */
.next-week-confirm {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 8px;
  padding: 14px;
  background: var(--band-bg);
  color: var(--band-fg);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
}

.next-week-confirm p {
  flex-basis: 100%;
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
}

.next-week-confirm .btn-primary {
  background: var(--gold-foil);
  color: #000000;
}

.next-week-confirm .btn-secondary {
  background: transparent;
  color: var(--band-fg);
  border-color: var(--band-fg);
}

/* A finished week in the journey, food by food. */
.journey-foods { margin-top: 8px; }

.journey-foods summary {
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.journey-foods h5 {
  margin: 12px 0 4px;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.journey-foods ul {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Last week: a short card at the top of the check-in. */
.last-week-card {
  margin: 0 0 16px;
  padding: 14px;
  background: var(--band-bg);
  color: var(--band-fg);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  font-size: 0.92rem;
  line-height: 1.5;
}

.last-week-card p { margin: 8px 0 0; }

.last-week-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.last-week-head h3 {
  margin: 0;
  color: var(--gold);
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.last-week-toggle {
  padding: 4px 0 4px 12px;
  background: none;
  border: none;
  color: var(--band-fg);
  font: inherit;
  font-size: 0.82rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.last-week-card .last-week-note {
  display: block;
  font-size: 0.78rem;
  opacity: 0.75;
}

.last-week-card .report-more,
.last-week-card .report-more summary { color: var(--band-fg); }

.last-week-table {
  width: 100%;
  margin-top: 12px;
  border-collapse: collapse;
}

.last-week-table th,
.last-week-table td {
  padding: 10px 0;
  border-top: 1px solid var(--gold);
  text-align: left;
  vertical-align: top;
}

.last-week-table th {
  width: 84px;
  padding-right: 12px;
  font-weight: 700;
}

.last-week-table th span {
  display: block;
  color: var(--gold);
  font-size: 1.1rem;
}

.last-week-table ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.last-week-table li + li { margin-top: 6px; }
.last-week-table td p { margin: 6px 0 0; }
.last-week-table td > p:first-child { margin-top: 0; }
.last-week-table .report-more { margin-top: 6px; }
.last-week-table .report-more ul { margin-top: 6px; }

/* Foods that help with several nutrients: its own titled section under the table. */
.last-week-overlaps {
  padding-top: 12px;
  border-top: 1px solid var(--gold);
}

.last-week-overlaps h4 {
  margin: 0;
  color: var(--gold);
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.last-week-overlaps + .last-week-note { margin-top: 12px; }

/* Weigh-ins: one line once there's a weight, and the full list folded under it. */
.weight-when { font-size: 0.85rem; }

.weight-message {
  margin: 8px 0 0;
  font-size: 0.85rem;
}

.weight-rows {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.weight-rows li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
}

.weight-rows li:first-child { border-top: none; }
.weight-late { color: var(--muted); font-size: 0.8rem; }
.weight-confirm { display: flex; flex-wrap: wrap; gap: 12px; }

/* What this food's amount adds up to, so people learn the energy in each food as they log. */
.logged-macros {
  margin: 4px 0 0;
  font-size: 0.86rem;
  color: var(--ink);
}

/* ---------- Your path: the questions My Plan starts with ---------- */

.path-step {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 640px;
}

.path-eyebrow {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--carrot);
}

.path-step h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.5rem, 5.5vw, 1.9rem);
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.path-hint {
  margin: 0;
  color: var(--muted);
}

.path-options {
  display: grid;
  gap: 10px;
}

/* Black cards with gold-foil names, like the rest of the app; a pick turns gold with a check. */
.path-option {
  position: relative;
  padding: 14px 48px 14px 16px;
  font: inherit;
  text-align: left;
  background: var(--band-bg);
  color: var(--band-fg);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  cursor: pointer;
}

.path-option strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1.15;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .path-option strong {
    background: var(--gold-foil);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.path-detail {
  display: block;
  margin-top: 4px;
  font-size: 0.86rem;
  color: #bdbdbd;
}

.path-option::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  border: 1.5px solid var(--gold);
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 700;
}

.path-option.is-picked {
  background: var(--gold-foil);
  box-shadow: 0 6px 22px rgba(201, 166, 107, 0.4);
}

.path-option.is-picked strong {
  background: none;
  color: #000000;
}

.path-option.is-picked .path-detail { color: #2a2007; }

.path-option.is-picked::after {
  content: "✓";
  border-color: #000000;
  color: #000000;
}

.path-option:focus-visible,
.path-edit:focus-visible {
  outline: 2px solid var(--carrot);
  outline-offset: 2px;
}

.path-note,
.path-explain {
  margin: 0;
  padding: 12px 14px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  color: var(--warn-fg);
  font-size: 0.9rem;
}

.path-explain p { margin: 0 0 6px; }
.path-explain p:last-child { margin-bottom: 0; }

.path-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.path-actions .btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.path-summary {
  margin-bottom: 22px;
  padding: 16px 18px;
  background: var(--band-bg);
  color: var(--band-fg);
  border: 1px solid var(--gold);
  box-shadow: var(--card-shadow);
}

.path-summary-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.path-summary h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.path-edit {
  padding: 4px 2px;
  border: none;
  background: none;
  color: var(--gold);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* One grid for all rows, so the answers line up just past the longest label (Weigh-ins). */
.path-summary dl {
  margin: 10px 0 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 12px;
}

.path-summary dl div { display: contents; }

.path-summary dt {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  padding-top: 2px;
}

.path-summary dd {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.3;
}

.path-goals {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.path-small {
  margin: 10px 0 0;
  font-size: 0.78rem;
  color: #bdbdbd;
}

/* ---- A day off from logging ---- */
.day-skip { align-self: flex-start; }

.day-off-note {
  margin: 0;
  padding: 12px 14px;
  border-left: 3px solid var(--gold);
  background: var(--warn-bg);
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.5;
}

.day-off-note p { margin: 0 0 6px; }
.day-off-note p:last-child { margin-bottom: 0; }

/* ---- My foods: a red No, yellow Maybe and green Yes box beside each food ---- */
/* Plain bold colors, no metal. */
:root {
  --rate-no: #ff3b30;
  --rate-maybe: #ffcc00;
  --rate-yes: #22c55e;
}

.rate-key {
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 1px solid var(--card-edge);
  background: var(--surface);
}
.rate-key-caption {
  margin: 0 0 6px;
  font-size: 0.85rem;
  color: var(--muted);
}
.rate-key ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.rate-key li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.95rem;
}

.food-item {
  cursor: default;
}
.food-item:hover { background: transparent; }

.rate-row {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
  padding-top: 1px;
}

/* Every box is its bold color. Picking one puts a black check in it. */
.rate-box {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 4px;
  background: var(--box);
  cursor: pointer;
}
.rate-no { --box: var(--rate-no); }
.rate-maybe { --box: var(--rate-maybe); }
.rate-yes { --box: var(--rate-yes); }
.rate-box.is-on::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 2px;
  width: 6px;
  height: 12px;
  border: solid #000000;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}
.rate-box:focus-visible {
  outline: 2px solid var(--carrot);
  outline-offset: 2px;
}

.report-maybe {
  display: block;
  margin-top: 4px;
}
.last-week-maybe {
  margin: 8px 0 2px;
  font-weight: 700;
}

/* ---------- My meals ----------
   Saved meals and big pots, below the days on My check-in. Each meal shows one serving's
   numbers and tags; "Make a meal" opens the builder in the same card. */

.my-meals-wrap { margin-bottom: 16px; }

.my-meals {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.my-meals .report-note { margin: 0; }

.meal-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.meal-row p { margin: 0; }

.meal-row-name {
  font-weight: 700;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.meal-row-makes {
  font-size: 0.82rem;
  color: var(--muted);
}

.meal-warning {
  font-size: 0.78rem;
  font-style: italic;
  color: var(--warn-fg);
}

.meal-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: 4px;
}

.goal-edit.is-confirming {
  font-weight: 700;
  color: var(--warn-fg);
}

.meal-message {
  margin: 0;
  font-size: 0.85rem;
}

.meal-new { align-self: flex-start; }

.meal-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--card-edge);
  border-radius: var(--radius);
  background: var(--bg);
}

.meal-form h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.meal-label {
  margin: 6px 0 0;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.meal-input,
.meal-add input {
  font: inherit;
  font-size: 1rem;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.meal-add {
  display: flex;
  gap: 8px;
}

.meal-add input { flex: 1; }

.meal-ingredients {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meal-ingredient {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.meal-ingredient .logged-amount { flex: 1; }

.choice-btn.is-picked {
  background: var(--leaf);
  border-color: var(--leaf);
  color: var(--on-leaf);
}

.meal-pot {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meal-pot label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.meal-number { width: 5em; }

.meal-preview p { margin: 0; }
.meal-preview .meal-label { margin-top: 6px; }

.meal-input:focus-visible,
.meal-add input:focus-visible {
  outline: 2px solid var(--carrot);
  outline-offset: 2px;
}

.meal-form .goal-actions .btn { white-space: nowrap; }

/* ---------- My plan: the suggested path and this week's focus ---------- */

.approach-suggestion {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-left: 3px solid var(--gold);
  background: var(--surface);
}

.approach-suggestion p { margin: 0; font-size: 0.92rem; line-height: 1.45; }

.approach-suggestion-label,
.focus-eyebrow {
  display: block;
  margin-bottom: 2px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--carrot);
}

.approach-suggested { font-weight: 700; }

#plan-focus { margin-bottom: 20px; }

.plan-focus {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-color: var(--card-edge);
}

.plan-focus p { margin: 0; }

.focus-main {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.focus-progress,
.focus-result {
  font-size: 0.9rem;
}

.focus-result {
  padding-bottom: 10px;
  margin-bottom: 6px !important;
  border-bottom: 1px solid var(--line);
}

.focus-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: 4px;
}

.focus-reset {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* Anything hidden stays hidden, even when a style gives it a display. */
[hidden] { display: none !important; }

/* "Make this my usual" under a logged food. */
.usual-pin-line { margin: 6px 0 0; font-size: 0.78rem; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.usual-pin-set { color: var(--carrot); font-weight: 700; }
.usual-pin {
  padding: 4px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}
.usual-pin:hover { background: rgba(201, 166, 107, 0.15); }
