/* Calorama: black and green for now. Every colour is a variable here, so the later
   white-and-green theme is a swap of this block, not a rewrite. */
:root {
  --bg: #000000;
  --surface: #0e130f;      /* raised panels */
  --field: #151c17;        /* inputs, options */
  --line: #253028;         /* borders */
  --line-strong: #3a4a3f;
  --text: #f1f5f0;
  --muted: #a0aca3;
  --green: #35c46f;        /* cilantro: buttons, progress, selection, the live number */
  --green-hover: #52d686;
  --green-soft: rgba(53, 196, 111, 0.14);
  --green-line: rgba(53, 196, 111, 0.55);
  --on-green: #02170a;     /* text on green */
  --error: #ff9a8a;
  --warm: #ffb35c;         /* over today's number: noticed, not alarming */
  --disabled-text: #66726a;
  --placeholder: #6d7a71;
  --seg-bmr: #2b3a30;      /* the "where it comes from" bar */
  --seg-life: rgba(53, 196, 111, 0.45);
  --seg-steps: rgba(53, 196, 111, 0.7);
  --seg-digesting: #5d6b61;
  --shadow: rgba(0, 0, 0, 0.75);
  --shadow-soft: rgba(0, 0, 0, 0.6);
  --glow: rgba(53, 196, 111, 0.22); /* a food just added */
  --toast-bg: rgba(10, 18, 12, 0.96);
  --live-bg: rgba(6, 12, 8, 0.94);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --r-chip: 999px;
  --r-control: 12px;
  --r-option: 16px;
  --r-panel: 22px;
  color-scheme: dark;
}

/* White and green: the same variables, swapped (docs/superpowers/specs/2026-11-08-calorama-light-theme-design.md) */
:root[data-theme="light"] {
  --bg: #f6f8f6;
  --surface: #ffffff;
  --field: #eef3ef;
  --line: #dbe3dd;
  --line-strong: #b9c6bd;
  --text: #102016;
  --muted: #536257;
  --green: #17803f;
  --green-hover: #126b34;
  --green-soft: rgba(23, 128, 63, 0.1);
  --green-line: rgba(23, 128, 63, 0.45);
  --on-green: #ffffff;
  --error: #b3261e;
  --warm: #a65300;
  --disabled-text: #6b7a70;
  --placeholder: #6b7a70;
  --seg-bmr: #c9d6cd;
  --seg-life: rgba(23, 128, 63, 0.45);
  --seg-steps: rgba(23, 128, 63, 0.7);
  --seg-digesting: #8a9a8f;
  --shadow: rgba(16, 32, 22, 0.18);
  --shadow-soft: rgba(16, 32, 22, 0.14);
  --glow: rgba(23, 128, 63, 0.16);
  --toast-bg: rgba(255, 255, 255, 0.97);
  --live-bg: rgba(255, 255, 255, 0.94);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.125rem/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
body.has-live { padding-bottom: 92px; }
button, input { font: inherit; color: inherit; }
a { color: var(--green); text-underline-offset: 3px; }
a:hover { color: var(--green-hover); }
:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
::selection { background: var(--green); color: var(--on-green); }

/* ---------- the panorama mark ---------- */
.mark { display: block; flex: none; }
.mark rect { fill: var(--green); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 650 1.1875rem/1 var(--font-display); letter-spacing: -0.01em; }

/* ---------- page and screen ---------- */
.screen { max-width: 560px; margin: 0 auto; padding: 20px 20px 48px; }
.topbar { display: flex; align-items: center; gap: 18px; margin-bottom: 26px; }
.progress { flex: 1; height: 6px; border-radius: 6px; background: var(--field); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--green); border-radius: inherit; transition: width .35s ease; }
.back {
  display: inline-flex; align-items: center; gap: 6px; min-height: 48px; margin: -8px 0 6px -10px; padding: 0 10px;
  border: 0; border-radius: var(--r-control); background: none; color: var(--muted); cursor: pointer;
}
.back:hover { color: var(--text); background: var(--surface); }
.back svg { width: 18px; height: 18px; }
h1 { margin: 0 0 8px; font: 650 1.875rem/1.2 var(--font-display); letter-spacing: -0.015em; text-wrap: balance; }
h1:focus { outline: none; }
h2 { margin: 0 0 12px; font: 650 1.375rem/1.25 var(--font-display); }
.sub { margin: 0 0 26px; color: var(--muted); max-width: 46ch; }
.body { display: grid; gap: 16px; }
.actions { margin-top: 30px; }
.note { margin: 0; color: var(--muted); font-size: 1rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 26px; border: 1px solid var(--line-strong); border-radius: var(--r-control);
  background: var(--surface); color: var(--text); font-weight: 600; cursor: pointer;
}
.btn:hover { border-color: var(--green-line); }
.btn.primary { width: 100%; border: 0; background: var(--green); color: var(--on-green); font-weight: 700; }
.btn.primary:hover { background: var(--green-hover); }
.btn:disabled, .btn.primary:disabled { background: var(--field); color: var(--disabled-text); border-color: var(--line); cursor: not-allowed; }
.btn.quiet { min-height: 48px; border-color: transparent; background: none; color: var(--muted); }
.btn.quiet:hover { color: var(--text); background: var(--surface); }
.linkish { padding: 0; border: 0; background: none; color: var(--green); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; min-height: 48px; }

/* ---------- fields ---------- */
.field { display: grid; gap: 8px; }
.field > label, .label { font-weight: 600; }
.input-row { display: flex; align-items: center; gap: 10px; }
.input {
  width: 100%; min-height: 56px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: var(--r-control);
  background: var(--field); color: var(--text); font-size: 1.25rem;
}
.input:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 3px var(--green-soft); }
.input::placeholder { color: var(--placeholder); }
.input.num { font-variant-numeric: tabular-nums; max-width: 180px; }
.unit { color: var(--muted); }
.field-msg { margin: 0; min-height: 1.4em; color: var(--muted); font-size: 1rem; }
.field.invalid .input { border-color: var(--error); }
.field.invalid .field-msg { color: var(--error); }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 60px; }
.eye {
  position: absolute; right: 4px; top: 4px; width: 48px; height: 48px; display: grid; place-items: center;
  border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer;
}
.eye:hover { color: var(--text); background: var(--surface); }
.eye svg { width: 22px; height: 22px; }

/* password checklist */
.rules { display: grid; gap: 4px; margin: 2px 0 0; padding: 0; list-style: none; font-size: 1rem; color: var(--muted); }
.rules li { display: flex; align-items: center; gap: 8px; }
.rules li::before { content: ""; width: 16px; height: 16px; flex: none; border-radius: 50%; border: 2px solid var(--line-strong); }
.rules li.met { color: var(--text); }
.rules li.met::before { border-color: var(--green); background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%2302170a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }
.rules li.bad { color: var(--error); }

/* checkbox */
.check { display: flex; align-items: flex-start; gap: 14px; min-height: 48px; padding: 4px 0; cursor: pointer; }
.check input { appearance: none; flex: none; width: 26px; height: 26px; margin: 2px 0 0; border: 2px solid var(--line-strong); border-radius: 7px; background: var(--field); cursor: pointer; }
.check input:checked { border-color: var(--green); background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3L12.5 5' fill='none' stroke='%2302170a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat; }

/* ---------- choices ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  min-height: 48px; padding: 0 20px; border: 1px solid var(--line-strong); border-radius: var(--r-chip);
  background: var(--field); color: var(--text); cursor: pointer; font-variant-numeric: tabular-nums;
}
.chip:hover { border-color: var(--green-line); }
.chip[aria-pressed="true"] { border-color: var(--green); background: var(--green); color: var(--on-green); font-weight: 650; }
.chip:disabled { opacity: .45; cursor: not-allowed; }
.chips.days .chip { min-width: 52px; padding: 0 12px; }
.options { display: grid; gap: 12px; }
.option {
  display: grid; gap: 3px; width: 100%; min-height: 64px; padding: 14px 18px; text-align: left;
  border: 1px solid var(--line-strong); border-radius: var(--r-option); background: var(--field); cursor: pointer;
}
.option:hover { border-color: var(--green-line); }
.option b { font-weight: 650; }
.option span { color: var(--muted); font-size: 1rem; }
.option[aria-pressed="true"] { border-color: var(--green); background: var(--green-soft); box-shadow: inset 0 0 0 1px var(--green); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; width: 100%; padding: 0 4px; border: 0; background: none; text-align: left; cursor: pointer; }
.switch i { position: relative; flex: none; width: 52px; height: 30px; border-radius: 30px; background: var(--line-strong); transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--text); transition: transform .2s; }
.switch[aria-checked="true"] i { background: var(--green); }
.switch[aria-checked="true"] i::after { transform: translateX(22px); background: var(--on-green); }

.input.num.short { max-width: 96px; text-align: center; }

/* tape measuring */
.tape-how { display: grid; grid-template-columns: 150px 1fr; gap: 18px; align-items: center; }
.tape-how ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.tape-figure { width: 150px; height: auto; }
.tape-body { fill: none; stroke: var(--line-strong); stroke-width: 2; }
.tape-line { stroke: var(--green); stroke-width: 3; stroke-dasharray: 5 4; stroke-linecap: round; }
.tape-label { fill: var(--text); font: 600 0.9375rem var(--font); }
.tape-result { margin: 0; min-height: 1.5em; font-weight: 650; color: var(--green); }
.tape-result.bad { color: var(--error); font-weight: 500; }
@media (max-width: 460px) { .tape-how { grid-template-columns: 1fr; } }

/* exercise */
.acts { display: grid; gap: 16px; }
.acts:empty { display: none; }
.act { display: grid; gap: 18px; }
.act-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.act-h h2 { margin: 0; }
.icon-btn { flex: none; width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--r-control); background: none; color: var(--muted); cursor: pointer; }
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.icon-btn svg { width: 20px; height: 20px; }
.three .options { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.three .option { padding: 12px; min-height: 72px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile {
  display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 14px; text-align: left;
  border: 1px dashed var(--line-strong); border-radius: var(--r-option); background: none; color: var(--text); cursor: pointer;
}
.tile:hover { border-style: solid; border-color: var(--green-line); background: var(--green-soft); }
.tile svg { width: 18px; height: 18px; color: var(--green); }
@media (max-width: 420px) { .three .options { grid-template-columns: 1fr; } }

/* ---------- result ---------- */
.result { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; } /* a long name can't widen the page */
.result .topbar { margin-bottom: 4px; }
.grow { flex: 1; }
.hero-number { padding: 10px 0 8px; }
.hero-number h1 { margin: 0; font: 600 1.375rem/1.35 var(--font-display); letter-spacing: 0; max-width: 22ch; }
.hero-number .n {
  display: block; margin: 4px 0 6px; color: var(--green);
  font: 700 5.25rem/0.95 var(--font-display); letter-spacing: -0.045em; font-variant-numeric: tabular-nums;
}
.hero-number .range { margin: 12px 0 0; color: var(--muted); }
.week-total { margin: 0 0 4px; font: 650 1.25rem/1.35 var(--font-display); }

/* the panorama: the week as seven bars */
.panorama { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin: 22px 0 10px; }
.pday { display: grid; grid-template-rows: auto 170px auto; gap: 8px; justify-items: center; min-width: 0; }
.pnum { font: 600 0.875rem/1 var(--font); font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.pbar { position: relative; width: 100%; max-width: 46px; height: 100%; }
.pbar i { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 10px 10px 4px 4px; }
.pbar .fill { background: var(--green); transform-origin: bottom; }
.pbar .ghost { border: 2px dashed var(--green-line); border-bottom: 0; }
.pday-name { color: var(--muted); font-size: 0.9375rem; }

.pnum svg { width: 12px; height: 12px; margin-right: 2px; vertical-align: -1px; color: var(--green); }

/* calorie cycling */
.cycling .chips { margin: 14px 0 6px; flex-wrap: nowrap; }
.cycling .chips .chip { flex: 1; padding: 0 10px; font-size: 1rem; }
.cy-body { display: grid; gap: 12px; }
.cy-rows { margin: 0; padding: 0; list-style: none; display: grid; }
.cy-row { display: flex; align-items: center; gap: 12px; min-height: 56px; border-top: 1px solid var(--line); }
.cy-row:first-child { border-top: 0; }
.cy-day { width: 52px; flex: none; color: var(--muted); }
.cy-val { flex: 1; font-weight: 650; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 6px; }
.cy-val svg { width: 16px; height: 16px; color: var(--green); }
.cy-row.pinned .cy-val { color: var(--green); }
.cy-row .btn.quiet { color: var(--green); }
.cy-row.editing { display: grid; gap: 8px; padding: 12px 0; }
.cy-row.editing .row { flex-wrap: wrap; }
.btn.narrow { width: auto; }
.cy-rows.manual .cy-row { padding: 6px 0; }
.cy-rows.manual .field { width: 100%; grid-template-columns: 52px 1fr; align-items: center; column-gap: 12px; }
.cy-rows.manual .field > label { color: var(--muted); font-weight: 400; }
.cy-rows.manual .field-msg { grid-column: 2; }
.cy-outcome { display: grid; gap: 6px; margin-top: 8px; }
.cy-outcome p { margin: 0; }
.cy-sum { font-weight: 600; }

/* where it comes from */
.stack { display: flex; height: 22px; border-radius: 8px; overflow: hidden; gap: 2px; margin-bottom: 18px; }
.seg-bmr { background: var(--seg-bmr); }
.seg-life { background: var(--seg-life); }
.seg-steps { background: var(--seg-steps); }
.seg-exercise { background: var(--green); }
.seg-digesting { background: var(--seg-digesting); }
.legend { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.legend li { display: grid; grid-template-columns: 18px 1fr; gap: 12px; align-items: start; }
.legend .swatch { width: 18px; height: 18px; border-radius: 5px; margin-top: 3px; }
.legend div { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; }
.legend b { font-weight: 650; }
.legend .pval { font-variant-numeric: tabular-nums; font-weight: 650; }
.legend p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 1rem; }

/* goal */
.goal-out { display: grid; gap: 8px; }
.goal-out p { margin: 0; }
.goal-target { font: 650 1.25rem/1.35 var(--font-display); color: var(--green); }

/* more numbers */
.more { margin: 0; display: grid; gap: 16px; }
.more > div { display: grid; gap: 2px; }
.more dt { color: var(--muted); font-size: 1rem; }
.more dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.more small { display: block; color: var(--muted); font-weight: 400; font-size: 1rem; }
/* equal boxes in a row; a box moves to the next line only when its words don't fit ("Carbohidratos" at 320 px) */
.macros { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 6px; }
.macros div { flex: 1 1 0; min-width: max-content; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-control); background: var(--field); display: grid; }
.macros span { color: var(--muted); font-weight: 400; font-size: 1rem; }
.macros b { font-size: 1.375rem; }

.tips, .answers { margin: 0; padding: 0; list-style: none; display: grid; }
.tips li, .answers li { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.tips li:first-child, .answers li:first-child { border-top: 0; }
.tips .btn { min-height: 48px; }
.answers .aname { display: block; color: var(--muted); font-size: 1rem; }
.answers .aval { display: block; }
.answers .btn.quiet { color: var(--green); }
.disclaimer { padding: 8px 2px 0; color: var(--muted); font-size: 1rem; display: grid; gap: 6px; justify-items: start; }
.disclaimer p { margin: 0; max-width: 64ch; }
.disclaimer a { margin-right: 14px; }
.disclaimer .btn { margin-top: 14px; }
@media (max-width: 420px) {
  .hero-number .n { font-size: 4.25rem; }
  .panorama { gap: 4px; }
  .pnum { font-size: 0.71875rem; }
  .pday { grid-template-rows: auto 140px auto; }
}

.panel { padding: 20px; border: 1px solid transparent; border-radius: var(--r-panel); background: var(--surface); } /* round 57: a surface, no outline (the belt's look gives it one back) */
.error-text { margin: 0; color: var(--error); }

/* ---------- tabs: Today and My plan ---------- */
.tabs { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: var(--r-chip); background: var(--field); }
.tab {
  min-height: 44px; padding: 0 16px; border: 0; border-radius: var(--r-chip); background: none;
  color: var(--muted); font-weight: 600; white-space: nowrap; cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab[aria-current="page"] { background: var(--green); color: var(--on-green); }
.hero-cta { margin-top: 20px; }

/* ---------- today: design B, the week as the hero ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.kbd-hint { color: var(--muted); font-size: 0.9375rem; }
kbd { display: inline-block; min-width: 24px; padding: 1px 7px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; background: var(--field); color: var(--text); font: 600 0.875rem/1.4 ui-monospace, "Cascadia Mono", Consolas, monospace; text-align: center; }
@media (hover: none), (pointer: coarse), (max-width: 639px) { .kbd-hint { display: none; } }

/* the band: today's number on the left, the week's on the right */
.band { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 40px; padding: 8px 4px 0; }
.band h1 { margin: 0; max-width: none; color: var(--muted); font: 500 1.125rem/1.3 var(--font-display); }
.band .big { margin: 6px 0 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; }
.band .big .n { display: inline; margin: 0; font-size: 7rem; line-height: .92; }
.band .big .range { margin: 0; max-width: 13ch; color: var(--muted); font-size: 1.3125rem; line-height: 1.3; }
.band .big.over .n { color: var(--warm); }
.weekly { display: grid; gap: 6px; max-width: 440px; text-align: right; }
.weekly b { font: 650 1.875rem/1.15 var(--font-display); font-variant-numeric: tabular-nums; }
.weekly-notes { display: grid; gap: 4px; }
.back-today { margin: 8px 0 0 -12px; }
.back-today svg { width: 18px; height: 18px; }

/* the stage: this week as seven tall bars */
.stage { padding: 22px 24px 18px; }
.stage { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: center; }
.stage > h2 { margin: 0 0 2px; }
.stage > .note, .stage > .panorama { grid-column: 1 / -1; }
.week-nav { display: flex; gap: 8px; } /* round 32: the week arrows */
.week-nav .icon-btn:disabled { opacity: .35; cursor: default; }
.stage .strip { gap: 14px; margin: 16px 0 4px; }
.stage .pday {
  display: grid; grid-template-rows: 22px auto 260px auto; gap: 8px; justify-items: center; min-width: 0;
  padding: 12px 0 10px; border: 0; border-radius: 16px; background: none; color: inherit; font: inherit; cursor: pointer;
}
.stage .pday:hover:not(:disabled) { background: var(--field); }
.stage .pday:disabled { cursor: default; }
.stage .pday.today { background: var(--green-soft); }
.stage .pday.sel { box-shadow: inset 0 0 0 1px var(--green-line); }
.stage .pday.sel .pday-name { color: var(--green); font-weight: 700; }
.stage .pbar { max-width: 78px; }
.stage .pbar i { border-radius: 14px 14px 5px 5px; }
.stage .pnum { font-size: 1.0625rem; }
.stage .pnum.muted, .stage .pday.later .pnum { color: var(--muted); }
.tag { min-height: 22px; padding: 0 10px; border-radius: 999px; background: var(--green); color: var(--on-green); font-size: 0.8125rem; font-weight: 700; line-height: 22px; white-space: nowrap; }
.tag:empty { visibility: hidden; }
.pbar .fill.over { background: var(--warm); }

/* the add row */
.add-food { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.addrow { display: grid; grid-template-columns: minmax(0, 1fr) 190px 130px 220px; gap: 14px; align-items: start; }
.addrow .input.num { max-width: none; min-width: 0; }
.addrow .field-msg:empty { display: none; }
.spacer { visibility: hidden; }
.subrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; }
.group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.group > .label { margin-right: 4px; color: var(--muted); font-size: 1rem; }
.chip.food { display: inline-flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; text-align: left; }
.chip.food .fname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.food .fcal { flex: none; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip.food.hl { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }

/* the food list's dropdown under the name box; on a wide screen it reaches across Calories and How many */
.namebox { position: relative; }
.drop {
  position: absolute; z-index: 5; top: calc(100% + 6px); left: 0; right: calc(-190px - 130px - 28px);
  padding: 6px; border: 1px solid var(--line-strong); border-radius: var(--r-option);
  background: linear-gradient(var(--surface), var(--surface)), var(--bg); /* solid even where --surface is see-through */
  box-shadow: 0 18px 50px var(--shadow); animation: drop-in .18s var(--ease) both;
}
.drop-list { margin: 0; padding: 0; list-style: none; }
.opt {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 84px; align-items: center; gap: 4px 18px;
  min-height: 56px; padding: 8px 14px; border-radius: var(--r-control); cursor: pointer;
}
.opt:hover { background: var(--field); }
.opt.hl { background: var(--green-soft); box-shadow: inset 0 0 0 1px var(--green-line); }
.oname { min-width: 0; overflow-wrap: anywhere; font-size: 1.0625rem; line-height: 1.3; }
.oport { color: var(--muted); font-size: 0.9375rem; white-space: nowrap; }
.ocal { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.yours { display: inline-block; margin-left: 8px; padding: 0 8px; border: 1px solid var(--green-line); border-radius: var(--r-chip); color: var(--green); font-size: 0.75rem; font-weight: 700; line-height: 20px; vertical-align: 2px; }
.drop-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin-top: 4px; padding: 10px 14px 6px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.875rem; }
.drop-empty { margin: 0; padding: 14px; color: var(--muted); font-size: 1rem; }
@keyframes drop-in { from { opacity: 0; transform: translateY(-4px); } }
@media (hover: none), (pointer: coarse), (max-width: 639px) { .drop-foot .keys { display: none; } }

/* the picked food: its portions and what it adds */
.chip .pg { margin-left: 6px; color: var(--muted); font-size: 0.9375rem; }
.chip[aria-pressed="true"] .pg { color: inherit; opacity: .75; }
.adds { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0; color: var(--muted); font-size: 1rem; }
.adds b { color: var(--text); font-weight: 600; }
.vits { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-option); animation: drop-in .2s var(--ease) both; }
.vits-h { grid-column: 1 / -1; margin: 0 0 2px; color: var(--muted); font-size: 0.875rem; }
.vit { display: grid; gap: 2px; min-width: 0; }
.vit span { color: var(--muted); font-size: 0.875rem; }
.vit b { font: 650 1.375rem/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.eport { display: block; color: var(--muted); font-size: 0.875rem; }
.credit { margin: 6px 0 0; color: var(--muted); font-size: 0.9375rem; }

/* Display: Dark, Light, Same as my device (My plan, the website only) */
.display-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 12px; }
.display-row > .label { min-width: 7em; color: var(--muted); font-weight: 600; }

/* the language switch, at the right of every top bar */
.lang-switch { min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-chip); background: none; color: var(--muted); font: 600 0.9375rem/1 var(--font); cursor: pointer; white-space: nowrap; }
.lang-switch:hover { color: var(--text); border-color: var(--line-strong); }
.welcome-lang { display: flex; justify-content: flex-end; margin-bottom: 8px; }

/* round 57: the tabs carry an icon for the phone's bar; on wide screens they're words only */
.tab { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.tab svg { display: none; width: 24px; height: 24px; }

/* round 19: water */
/* the title and the count share the first row; the panel's title stays its direct child (the belt styles .panel > h2) */
.water { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; padding-top: 18px; padding-bottom: 14px; }
.water > h2 { margin: 0; }
.water > .glasses, .water > .note { flex: 1 1 100%; }
.water-count { color: var(--muted); font-variant-numeric: tabular-nums; }
.glasses { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 4px; }
.glass { display: grid; place-items: center; width: 44px; height: 52px; padding: 0; border: 0; border-radius: var(--r-control); background: none; cursor: pointer; }
.glass:hover { background: var(--field); }
.glass svg { width: 28px; height: 34px; }
.glass .cup { fill: none; stroke: var(--line-strong); stroke-width: 1.6; stroke-linejoin: round; }
.glass .level { fill: transparent; transition: fill .2s; }
.glass.on .cup { stroke: var(--green); }
.glass.on .level { fill: var(--green); }
.water .note { margin: 4px 0 0; }
.water .note.done { color: var(--green); font-weight: 600; }

/* round 18: the week in review */
.review-panel { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.review-panel > h2 { margin: 0; }
.review-panel > .review-body { flex: 1 1 100%; }
.review-body p { margin: 0 0 8px; max-width: 75ch; }
.review-cal { font-weight: 600; }
.review-nutri { margin: 6px 0 8px; padding-left: 20px; display: grid; gap: 4px; }
.review-nutri li.warm { color: var(--warm); }

/* round 17: recipes */
.recipes-head { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-bottom: 8px; }
.recipes-head .btn { width: auto; padding: 0 22px; }
.recipe-rows { margin: 0; padding: 0; list-style: none; }
.recipe-rows li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 10px; min-height: 64px; border-bottom: 1px solid var(--line); }
.recipe-rows li:last-child { border-bottom: 0; }
.recipe-rows .rname { display: grid; gap: 2px; min-width: 0; }
.recipe-rows .rname b { overflow-wrap: anywhere; }
.recipe-rows .btn { width: auto; padding: 0 16px; min-height: 44px; }
.recipe-editor { display: grid; gap: 14px; }
.recipe-editor > h2, .recipe-editor > h3 { margin: 0; }
.recipe-editor > h3 { font: 600 1rem/1.3 var(--font-display); color: var(--muted); }
.recipe-top { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 14px; align-items: start; }
.recipe-top .field-msg:empty, .ingredients .field-msg:empty { display: none; }
.ingredients { margin: 0; padding: 0; list-style: none; }
.ingredients li { display: grid; grid-template-columns: minmax(0, 1fr) 130px 90px 44px; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ingredients li.note { display: block; border-bottom: 0; }
.ingredients .iname { display: grid; gap: 6px; min-width: 0; }
.ingredients .iname b { overflow-wrap: anywhere; font-weight: 600; }
.ingredients .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ingredients .chip { min-height: 36px; padding: 0 12px; font-size: 0.9375rem; }
.ingredients .field > label { font-size: 0.875rem; color: var(--muted); }
.icals { font-variant-numeric: tabular-nums; font-weight: 650; text-align: right; }
.recipe-results { display: flex; flex-wrap: wrap; gap: 8px; }
.recipe-totals { padding: 12px 14px; border: 1px solid var(--green-line); border-radius: var(--r-control); background: var(--green-soft); }
.recipe-totals p { margin: 0; }
.recipe-totals .note { margin-top: 4px; }
.recipe-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.recipe-actions .btn { width: auto; padding: 0 22px; }
@media (max-width: 639px) {
  .recipe-top { grid-template-columns: minmax(0, 1fr); }
  .ingredients li { grid-template-columns: minmax(0, 1fr) auto 44px; grid-template-areas: "name name x" "qty cal x"; }
  .ingredients .iname { grid-area: name; }
  .ingredients li > .field { grid-area: qty; }
  .ingredients .icals { grid-area: cal; }
  .ingredients li > .icon-btn { grid-area: x; }
}

/* round 16: your real burn */
.burn-panel > h2 { margin: 0 0 8px; }
.burn-panel > p { margin: 0; max-width: 70ch; }
.burn-panel .nudge-actions { margin-top: 12px; }
.burn-panel .note { margin-top: 10px; }
.adjust-line { margin: 0 0 12px; color: var(--muted); }

/* round 11: past weeks, and your data */
.weeks-panel > h2 { margin: 0; }
.weeks-panel > .note { margin: 4px 0 12px; }
.weeks { margin: 0; padding: 0; list-style: none; }
.weeks > li { border-bottom: 1px solid var(--line); }
.weeks > li:last-child { border-bottom: 0; }
.week-row {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .8fr) minmax(0, .8fr) minmax(0, 1.4fr); grid-template-areas: "range days eaten cmp" "bar bar bar bar";
  align-items: center; gap: 6px 16px; width: 100%; min-height: 56px; padding: 10px 4px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.week-row:hover { background: var(--field); }
.wk-range { grid-area: range; font-weight: 600; }
.wk-days { grid-area: days; color: var(--muted); }
.wk-eaten { grid-area: eaten; font-variant-numeric: tabular-nums; }
.wk-cmp { grid-area: cmp; color: var(--muted); }
.wk-cmp.over { color: var(--warm); }
.wk-bar { grid-area: bar; position: relative; height: 6px; border-radius: var(--r-chip); background: var(--field); overflow: hidden; }
.wk-bar i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--green); }
.wk-bar.over i { background: var(--warm); }
.wk-daylist { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0 4px 14px; color: var(--muted); font-size: 1rem; font-variant-numeric: tabular-nums; }
.wk-daylist b { color: var(--text); font-weight: 600; }
.your-data .data-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.your-data .data-actions .btn { width: auto; padding: 0 20px; }
.your-data .data-msg:empty { display: none; }
.data-confirm { margin-top: 14px; padding: 14px 16px; border: 1px solid var(--green-line); border-radius: var(--r-control); background: var(--green-soft); }
.data-confirm p { margin: 0; }
@media (max-width: 639px) {
  .week-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "range eaten" "days cmp" "bar bar"; }
  .wk-cmp { text-align: right; }
}

/* round 10: Progress, the weight tab */
.weekly b.quiet { font-size: 1.25rem; font-weight: 600; }
.nudge { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 18px 22px; border: 1px solid var(--green-line); border-radius: var(--r-option); background: var(--green-soft); }
.nudge p { margin: 0; max-width: 70ch; }
.nudge-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.nudge-actions .btn { width: auto; padding: 0 22px; }
.progress-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: start; }
.chart-panel > h2, .log-panel > h2 { margin: 0 0 14px; }
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .labels text { fill: var(--muted); font: 0.8125rem var(--font); }
.chart .goalline { stroke: var(--muted); stroke-width: 2; stroke-dasharray: 6 6; opacity: .7; }
.chart .dots circle { fill: var(--muted); opacity: .75; }
.chart .trendline { fill: none; stroke: var(--green); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.chart .now { fill: var(--green); }
.entering .chart .trendline { stroke-dasharray: 1; animation: draw-line 1.1s var(--ease) .35s both; }
@keyframes draw-line { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.legend { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 10px; color: var(--muted); font-size: 0.9375rem; }
.legend i { display: inline-block; margin-right: 8px; vertical-align: middle; }
.legend .k-trend { width: 18px; height: 3px; background: var(--green); }
.legend .k-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.legend .k-goal { width: 18px; border-top: 2px dashed var(--muted); }
.log-panel { display: grid; gap: 14px; }
.log-panel .field-msg:empty { display: none; }
.log-panel .btn { width: 100%; }
.log-panel input[type="date"] { width: 100%; }
.weigh-list { margin: 4px 0 0; padding: 0; list-style: none; }
.weigh-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; min-height: 56px; border-bottom: 1px solid var(--line); }
.weigh-list li:last-child { border-bottom: 0; }
.weigh-list .wday { color: var(--muted); }
.weigh-list b { font-variant-numeric: tabular-nums; }
@media (min-width: 1000px) { .progress-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }

/* round 9: changing a logged food, logging a meal again, saved meals */
.editing-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 8px 8px 8px 14px; border: 1px solid var(--green-line); border-radius: var(--r-control); background: var(--green-soft); }
.editing-bar b { font-weight: 650; }
.ename-btn { padding: 11px 0; margin: -11px 0; border: 0; /* a 44 px tap area around the name, same look */ background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; overflow-wrap: anywhere; }
.ename-btn:hover { text-decoration-color: var(--green); }
.entries li.editing { background: var(--green-soft); box-shadow: inset 0 0 0 1px var(--green-line); padding-left: 6px; padding-right: 6px; }
.again { display: grid; gap: 4px; width: 100%; margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-control); background: var(--field); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.again:hover { border-color: var(--green-line); }
.again b { color: var(--green); font-weight: 650; font-size: 1rem; }
.again span { color: var(--muted); font-size: 0.875rem; overflow-wrap: anywhere; }
.meal-foot { display: flex; justify-content: flex-end; padding-top: 4px; }
.meal-foot .linkish { margin-right: -10px; }
.nameform { display: grid; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-strong); }
.nameform label { color: var(--muted); font-size: 0.9375rem; }
.nameform .input { min-height: 48px; font-size: 1.0625rem; }
.nameform .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.nameform .btn { width: auto; min-height: 48px; padding: 0 18px; }
.meal-chip { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; }
.forget { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: var(--r-control); background: none; color: var(--muted); cursor: pointer; }
.forget:hover { color: var(--text); background: var(--field); }
.forget svg { width: 14px; height: 14px; }

/* the day's nutrients, after the meals */
.nutri > h2 { margin: 0; }
.nutri > .note { margin: 6px 0 0; }
.nutri-none { margin: 14px 0 0; color: var(--muted); }
.nutri-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; margin-top: 20px; }
.ncol h3 { margin: 0 0 12px; color: var(--muted); font: 600 0.9375rem/1.3 var(--font-display); }
.mac { display: grid; gap: 6px; margin-bottom: 16px; }
.mac-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; }
.mac-top b { font: 650 1.375rem/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.mac-top span { color: var(--muted); font-size: 1rem; }
.nbar { position: relative; height: 10px; border-radius: var(--r-chip); background: var(--field); overflow: hidden; }
.nbar.thin { height: 6px; }
.nbar i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: var(--green); transition: width .6s var(--ease); }
.nline { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 1.0625rem; }
.nline:last-child { border-bottom: 0; }
.nline span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.nline span.warm { color: var(--warm); }
.nvits { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px 20px; }
.nvits + .nvits { margin-top: 12px; }
.nvit { display: grid; gap: 5px; min-width: 0; }
.nvit-top { display: flex; justify-content: space-between; gap: 8px; font-size: 1rem; }
.nvit-top b { flex: none; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nvit-top span { min-width: 0; }
.vits-col .linkish { margin-top: 10px; margin-left: -10px; }
@media (min-width: 640px) {
  .nutri-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .vits-col { grid-column: 1 / -1; }
  .vits-col .nvits { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .nutri-cols { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.4fr); gap: 32px; }
  .vits-col { grid-column: auto; }
  .vits-col .nvits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* the day, one column per meal */
.meals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: start; }
.meal { min-height: 140px; padding: 18px 18px 8px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.meal.empty { background: none; border-style: dashed; }
.meal-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.meal-h h3 { margin: 0; font: 650 1.0625rem/1.3 var(--font-display); }
.meal.empty .meal-h h3 { color: var(--muted); }
.meal-h span { color: var(--muted); font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.nothing { margin: 14px 0 0; color: var(--muted); font-size: 1rem; }
.entries { margin: 0; padding: 0; list-style: none; }
.entries li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; min-height: 58px; padding: 6px 0; border-bottom: 1px solid var(--line); border-radius: 8px; }
.entries li:last-child { border-bottom: 0; }
.ename { min-width: 0; overflow-wrap: anywhere; font-size: 1rem; line-height: 1.35; }
.eqty { color: var(--muted); white-space: nowrap; }
.ecal { font-weight: 650; font-variant-numeric: tabular-nums; font-size: 1rem; }
@keyframes row-in { from { opacity: 0; transform: translateY(-6px); } }
@keyframes glow { from { background: var(--glow); } to { background: transparent; } }
.entries li.is-new { animation: row-in .35s var(--ease) both, glow 1.4s ease-out; }
.entries li.leaving { overflow: hidden; min-height: 0; padding: 0; opacity: 0; border-bottom-width: 0; transition: height .25s var(--ease), opacity .2s, padding .25s; }

/* the toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 6; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px; max-width: calc(100% - 32px); padding: 8px 10px 8px 20px;
  border: 1px solid var(--green-line); border-radius: 14px; background: var(--toast-bg); box-shadow: 0 10px 40px var(--shadow-soft);
}
.toast.show { animation: toast-in .32s var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 14px); } }
.toast .linkish { padding: 0 12px; border-radius: 8px; font-weight: 650; text-decoration: none; }
.toast .linkish:hover { background: var(--green-soft); }

/* sizes: wide from 1,000 px; two lines and two meal columns below that; one column on a phone */
@media (min-width: 1000px) { .screen.result { max-width: 1240px; padding: 28px 32px 56px; } }
@media (min-width: 640px) and (max-width: 999px) { .screen.today { max-width: 780px; } }

/* My plan: the band (your number, the week's total), the week, then the panels in two columns on a wide screen */
.plan-band { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.plan-band .weekly { text-align: left; }
.plan-band .week-total { font: 650 1.375rem/1.3 var(--font-display); font-variant-numeric: tabular-nums; }
.plan-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
@media (min-width: 1000px) {
  .plan-band { grid-template-columns: minmax(0, 1fr) minmax(0, 420px); align-items: end; column-gap: 40px; }
  .plan-band .weekly { text-align: right; }
  .plan-band .hero-number .n { font-size: 6.5rem; }
  .plan-band .hero-cta { width: auto; padding: 0 30px; }
  .result:not(.today) .panorama { gap: 14px; }
  .result:not(.today) .pday { grid-template-rows: auto 240px auto; }
  .result:not(.today) .pbar { max-width: 72px; }
  .result:not(.today) .pnum { font-size: 1rem; }
  .plan-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
  .plan-grid > .span { grid-column: 1 / -1; }
}
@media (max-width: 999px) {
  .drop { right: 0; }
  .vits { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .addrow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .addrow .wide { grid-column: 1 / -1; }
  .addrow .spacer { display: none; }
  .meals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 639px) {
  .opt { grid-template-columns: minmax(0, 1fr) auto; }
  .oport { grid-column: 1; grid-row: 2; }
  .ocal { grid-column: 2; grid-row: 1 / span 2; }
  .vits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .band .big .n { font-size: 4.75rem; }
  .weekly { text-align: left; }
  .weekly b { font-size: 1.5rem; }
  .stage { padding: 18px 14px 14px; }
  .stage .strip { gap: 3px; }
  .stage .pday { grid-template-rows: 10px auto 150px auto; padding: 8px 0 6px; border-radius: 10px; }
  .stage .pnum { font-size: 0.71875rem; }
  .tag { width: 8px; height: 8px; min-height: 8px; padding: 0; overflow: hidden; font-size: 0; }
  .meals { grid-template-columns: minmax(0, 1fr); }
  .meal, .meal.empty { min-height: 0; }
}

/* ---------- welcome (sign up / sign in) ---------- */
.welcome { max-width: 560px; margin: 0 auto; padding: 36px 20px 56px; }
.hero { margin-bottom: 34px; }
.hero .mark { margin-bottom: 26px; }
.hero .name { margin: 0; font: 700 3.25rem/1 var(--font-display); letter-spacing: -0.035em; }
.hero .slogan { margin: 12px 0 0; font: 600 1.5rem/1.25 var(--font-display); color: var(--green); }
.hero .lead { margin: 14px 0 0; color: var(--muted); max-width: 40ch; }
.welcome form { display: grid; gap: 20px; }
.switch-line { margin: 22px 0 0; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* ---------- the live number ---------- */
.live {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--green-line); background: var(--live-bg); backdrop-filter: blur(8px);
}
.live div { max-width: 560px; margin: 0 auto; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.live span { color: var(--muted); }
.live b { color: var(--green); font: 700 1.625rem/1 var(--font-display); font-variant-numeric: tabular-nums; }

/* ---------- legal pages ---------- */
.doc { max-width: 680px; margin: 0 auto; padding: 32px 20px 64px; }
.doc .draft { margin: 22px 0 28px; padding: 14px 18px; border: 1px solid var(--green-line); border-radius: var(--r-control); background: var(--green-soft); font-weight: 600; }
.doc h2 { margin-top: 32px; }
.doc p, .doc li { color: var(--text); max-width: 68ch; }

@media (max-width: 420px) {
  h1 { font-size: 1.625rem; }
  .hero .name { font-size: 2.75rem; }
}
/* ---------- motion ---------- */
/* One quiet entrance when Today or My plan first opens, then movement only when something changes. */
:root { --ease: cubic-bezier(.2, .8, .2, 1); }
button { transition: transform .12s var(--ease), background-color .2s, border-color .2s, color .2s, box-shadow .2s; }
button:active:not(:disabled) { transform: scale(.97); }
.input { transition: border-color .15s, box-shadow .2s; }
.hero-number .n { transition: color .35s; }
.pbar i { transition: height .6s var(--ease), background-color .35s; }

/* between screens (js/motion.js swap): the new screen's parts arrive, sliding for the questionnaire, fading for the
   tabs; the top bar stays put */
@keyframes arrive-forward { from { opacity: 0; transform: translateX(24px); } }
@keyframes arrive-back { from { opacity: 0; transform: translateX(-24px); } }
@keyframes arrive-fade { from { opacity: 0; } }
.arrive-forward > :not(.topbar) { animation: arrive-forward .28s var(--ease) both; }
.arrive-back > :not(.topbar) { animation: arrive-back .28s var(--ease) both; }
.arrive-fade > :not(.topbar) { animation: arrive-fade .25s ease both; }

/* the entrance: sections fade up one after another, the week's bars rise */
@keyframes enter { from { opacity: 0; transform: translateY(10px); } }
@keyframes rise { from { transform: scaleY(0); } }
.entering > * { animation: enter .55s var(--ease) both; animation-delay: calc(var(--d, 0) * 70ms); }
.entering > .topbar { animation: none; }
.entering > :nth-child(3) { --d: 1; } .entering > :nth-child(4) { --d: 2; } .entering > :nth-child(5) { --d: 3; }
.entering > :nth-child(6) { --d: 4; } .entering > :nth-child(7) { --d: 5; } .entering > :nth-child(n+8) { --d: 6; }
.entering .pbar { transform-origin: bottom; animation: rise .8s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms + 240ms); }

/* less motion: the system setting, or the Utility Belt's calm mode */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
:root.calm *, :root.calm *::before, :root.calm *::after { transition: none !important; animation: none !important; }

/* round 21: the report for your doctor */
.your-data .data-report { margin: 18px 0 0; }
@media (min-width: 1000px) { .screen.result.report { max-width: 980px; } }
.report-head { display: grid; gap: 10px; }
.report-head h1 { margin: 0; }
.report-meta { margin: 0; color: var(--muted); }
.report-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.report-actions .btn { width: auto; padding: 0 20px; }
.report-dl > div { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.report-dl > div:last-child { padding-bottom: 0; border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.report-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.report-table th, .report-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: right; vertical-align: top; }
.report-table th:first-child, .report-table td:first-child { padding-left: 0; text-align: left; }
.report-table th:last-child, .report-table td:last-child { padding-right: 0; }
.report-table thead th { color: var(--muted); font-weight: 600; font-size: .9375rem; }
.report-table tbody th { font-weight: 600; }
.report-table tfoot th, .report-table tfoot td { border-bottom: 0; font-weight: 700; }
.report-amounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px 20px; margin: 0; }
.report-amounts > div { display: grid; gap: 2px; }
.report-amounts dt { color: var(--muted); }
.report-amounts dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.report .panel h3 { margin: 18px 0 8px; font: 600 1rem/1.3 var(--font-display); color: var(--muted); }
.report-shares { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 20px; margin: 0; padding: 0; list-style: none; }
.report-shares li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.report-shares b { font-variant-numeric: tabular-nums; }
/* phones: each week's dates on their own line, its four numbers in a row below */
@media (max-width: 639px) {
  .report-table, .report-table thead, .report-table tbody, .report-table tfoot { display: block; }
  .report-table tr { display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr)); gap: 2px 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .report-table tfoot tr { border-bottom: 0; }
  .report-table th, .report-table td { padding: 0; border: 0; }
  .report-table td { white-space: nowrap; }
  .report-table th:first-child, .report-table td:first-child { grid-column: 1 / -1; }
  .report-table thead th:first-child { display: none; }
}

/* Printing: white paper, black text, no buttons, bars or menus. The colours are the variables, set again for paper. */
@media print {
  :root[data-theme="light"], :root {
    --bg: #ffffff;
    --surface: #ffffff;
    --field: #ffffff;
    --line: #b4b4b4;
    --line-strong: #808080;
    --text: #000000;
    --muted: #3c3c3c;
    --green: #000000;
    --warm: #000000;
    --shadow: rgba(0, 0, 0, 0);
    --shadow-soft: rgba(0, 0, 0, 0);
    color-scheme: light;
  }
  body { background: var(--bg); }
  .topbar, .back, .report-actions, .toast, #live, .skip-link { display: none !important; }
  .screen.result.report { max-width: none; padding: 0; }
  .report .plan-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
  .report .plan-grid > .span { grid-column: 1 / -1; }
  .report .panel { padding: 12px 14px; border-radius: 8px; break-inside: avoid; }
  .report .table-wrap { overflow: visible; }
  .report .disclaimer { font-size: .8125rem; }
}

/* round 22: first-time tips */
.coach {
  position: fixed; left: 50%; bottom: 16px; z-index: 7; transform: translateX(-50%);
  width: min(520px, calc(100% - 32px)); display: grid; gap: 8px; padding: 18px 20px 14px;
  border: 1px solid var(--green-line); border-radius: var(--r-panel); background: var(--surface);
  box-shadow: 0 10px 40px var(--shadow-soft); animation: toast-in .32s var(--ease) both;
}
.coach-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.coach-head h2 { margin: 0; outline: none; }
.coach-count { color: var(--muted); font-variant-numeric: tabular-nums; }
.coach p { margin: 0; }
.coach-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 6px; }
.coach-actions .btn { width: auto; padding: 0 24px; }
.tip-on { outline: 3px solid var(--green); outline-offset: 6px; border-radius: var(--r-panel); }
.tabs.tip-on { border-radius: var(--r-chip); }
.today .day-empty { margin: 0 0 4px; }
.disclaimer .tips-again { margin: 0 0 6px -2px; }

/* round 26: your month */
.month-panel { display: grid; gap: 12px; }
.month-panel h2 { margin: 0; }
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.month-name { margin: 0; font: 650 1.125rem/1.3 var(--font-display); text-align: center; }
.month-nav .icon-btn:disabled { opacity: .35; cursor: default; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.month-grid .wd { padding-bottom: 2px; color: var(--muted); font-size: .875rem; text-align: center; }
@media (max-width: 420px) { .month-grid .wd { font-size: .75rem; } } /* "Dom", "Sáb" fit a 31 px column at Larger text */
.cal-day {
  position: relative; display: grid; place-items: center; min-width: 0; min-height: 2.75rem; padding: 0 0 7px;
  border: 1px solid transparent; border-radius: 10px; background: var(--field); color: var(--text);
  font: 600 1rem/1 var(--font); font-variant-numeric: tabular-nums; cursor: pointer;
}
.cal-day:hover { border-color: var(--line-strong); }
.cal-day[aria-pressed="true"] { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.cal-day.today .num { color: var(--green); }
.cal-day:disabled { background: none; color: var(--disabled-text); cursor: default; }
.cal-day:disabled:hover { border-color: transparent; }
.month-panel .bar { display: block; height: 5px; border-radius: 3px; }
.cal-day .bar { position: absolute; left: 24%; right: 24%; bottom: 6px; }
.month-panel .bar.s-on, .cal-day.s-on .bar { background: var(--green); }
.month-panel .bar.s-under, .cal-day.s-under .bar { box-shadow: inset 0 0 0 1.5px var(--green); } /* hollow: shape, not only shade */
.month-panel .bar.s-over, .cal-day.s-over .bar { background: var(--warm); }
.month-panel .dot { display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.cal-day .dot { position: absolute; top: 5px; right: 5px; }
.month-day { margin: 0; min-height: 3em; }
.month-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: .9375rem; }
.month-legend li { display: flex; align-items: center; gap: 8px; }
.month-legend .bar { width: 18px; }
.month-panel > .note { margin: 0; }
@media (min-width: 1000px) { .history-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } } /* the month beside past weeks */

/* round 27: milestones */
.cheer {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 16px 14px 18px;
  border: 1px solid var(--green-line); border-radius: var(--r-panel); background: var(--green-soft);
}
.cheer .mark { flex: none; }
.cheer .mark rect { fill: var(--green); transform-box: fill-box; transform-origin: bottom; animation: cheer-rise .9s var(--ease) both; }
.cheer .mark rect:nth-child(2) { animation-delay: .08s; } .cheer .mark rect:nth-child(3) { animation-delay: .16s; }
.cheer .mark rect:nth-child(4) { animation-delay: .24s; } .cheer .mark rect:nth-child(5) { animation-delay: .32s; }
.cheer .mark rect:nth-child(6) { animation-delay: .40s; } .cheer .mark rect:nth-child(7) { animation-delay: .48s; }
@keyframes cheer-rise { 0% { transform: scaleY(.15); } 70% { transform: scaleY(1.12); } 100% { transform: scaleY(1); } }
.cheer p { flex: 1 1 14rem; margin: 0; font-weight: 600; }
.cheer .btn { width: auto; padding: 0 22px; }

/* round 28: waist. Phones: chart, weight, waist. Wide screens: the waist under the chart, the weigh-ins beside both. */
.waist-panel { display: grid; gap: 14px; align-content: start; }
.waist-panel > h2 { margin: 0; }
.waist-info, .waist-form { display: grid; gap: 12px; align-content: start; }
.waist-info .note { margin: 0; }
.waist-form .field-msg:empty { display: none; }
.waist-form .btn, .waist-form input[type="date"] { width: 100%; }
.waist-now { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0; }
.waist-now b { font: 700 2rem/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
@media (min-width: 1000px) {
  .weight-grid { grid-template-areas: "chart log" "waist log"; grid-template-rows: auto 1fr; }
  .weight-grid > .chart-panel { grid-area: chart; }
  .weight-grid > .log-panel { grid-area: log; }
  .weight-grid > .waist-panel { grid-area: waist; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 28px; }
  .waist-panel > h2, .waist-panel > .weigh-list { grid-column: 1 / -1; }
}

/* round 29: sharing a recipe */
.recipe-share { display: grid; gap: 12px; }
.recipe-share > h2, .recipe-share > .note { margin: 0; }
.recipe-share > h2:focus { outline: none; } /* focused by the app, like the screen titles */
.share-text { width: 100%; min-height: 9rem; padding: 12px 14px; font: 400 .9375rem/1.45 var(--font); resize: vertical; overflow-wrap: anywhere; }
.recipe-share .field-msg:empty { display: none; }
@media (max-width: 600px) { /* the name on its own line, the buttons under it, wrapping when the words are long */
  .recipe-rows li { display: flex; flex-wrap: wrap; padding: 10px 0; }
  .recipe-rows .rname { flex: 1 1 100%; }
  .recipe-rows .icon-btn { margin-left: auto; }
}

/* round 30: room for years */
.save-warn { margin: 0; padding: 12px 20px; border-bottom: 2px solid var(--error); background: var(--surface); color: var(--text); font-weight: 600; text-align: center; }
.your-data .data-room:empty { display: none; }
.your-data .data-room { margin-top: 14px; }
.your-data .data-room > .note { margin: 0; }
.warn-text { color: var(--warm); }

/* round 32: Open this day, under the calendar's picked day */
.month-panel > .btn { justify-self: start; width: auto; padding: 0 20px; }

/* round 33: yesterday, and whole days */
.today .yday { padding: 14px 18px; }
/* the meals are a grid of columns: these lines take a whole row (round 22's empty-day line took a meal's column) */
.meals > .day-empty, .meals > .day-again, .meals > .copy-today { grid-column: 1 / -1; }
.meals > .day-again { margin: 0 0 4px; }
.meals > .copy-today { justify-self: start; }

/* round 34: your saved meals, on the recipes screen */
.saved-meals > h2 { margin: 0 0 8px; }
.saved-meals .recipe-rows li { grid-template-columns: minmax(0, 1fr) auto auto auto; } /* Edit, Share and the x (Edit since round 54) */
.saved-meals > .note { margin: 0; }

/* round 35: a shopping list */
.shop-panel { display: grid; gap: 12px; }
.shop-panel > h2, .shop-panel > .note, .shop-panel > h3 { margin: 0; }
.shop-panel > h2:focus { outline: none; }
.shop-panel > h3 { font: 600 1rem/1.3 var(--font-display); color: var(--muted); margin-top: 6px; }
.shop-picks, .shop-list { margin: 0; padding: 0; list-style: none; }
.shop-picks li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; border-bottom: 1px solid var(--line); }
.shop-picks li:last-child { border-bottom: 0; }
.shop-picks .sname { min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.stepper { display: flex; align-items: center; gap: 8px; flex: none; }
.stepper b { min-width: 2.5em; text-align: center; font-variant-numeric: tabular-nums; }
.stepper .icon-btn:disabled { opacity: .35; cursor: default; }
.shop-list li { padding: 8px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.shop-list li:last-child { border-bottom: 0; }
@media print {
  .print-shop > *:not(.shop-panel) { display: none !important; }
  .print-shop .shop-panel > .note, .print-shop .shop-picks, .print-shop .shop-actions { display: none !important; }
}

/* round 36: your protein target, under the macros on My plan */
.protein-pick { display: grid; gap: 10px; margin: 14px 0 6px; font-weight: 400; }
.more dd .note { font-weight: 400; } /* notes under a number read as notes, not as the number */
.protein-pick .note { margin: 0; }
.protein-pick .field-msg:empty { display: none; }

/* round 38: extra activity on Today */
.extra { display: grid; gap: 12px; }
.extra > h2, .extra > .note { margin: 0; }
.extra-list { margin: 0; padding: 0; list-style: none; }
.extra-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; min-height: 52px; border-bottom: 1px solid var(--line); }
.extra-list li:last-child { border-bottom: 0; }
.extra-list b { color: var(--green); font-variant-numeric: tabular-nums; }
.extra-form { display: grid; gap: 12px; align-items: end; }
.extra-form .field-msg:empty { display: none; }
.extra-form select { width: 100%; font: inherit; color: var(--text); } /* a select doesn't take the page's font on its own */
.extra-form .chips { min-height: 3.5rem; align-items: center; } /* as tall as the inputs, so the labels line up */
.extra-form .btn { width: 100%; }
@media (min-width: 1000px) {
  .extra-form { grid-template-columns: minmax(0, 1.2fr) minmax(0, .9fr) auto auto; }
  .extra-form .btn { width: auto; padding: 0 22px; }
}

/* round 39: a note on the day */
.day-note { display: grid; gap: 8px; }
.day-note > .linkish { justify-self: start; }
.day-note-shown { display: grid; gap: 6px; padding: 12px 16px; border-left: 3px solid var(--green-line); background: var(--surface); border-radius: 0 var(--r-control) var(--r-control) 0; }
.day-note-text { margin: 0; font-style: italic; overflow-wrap: anywhere; }
.day-note-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.day-note-actions .btn { width: auto; padding: 0 22px; }
.day-note-form { display: grid; gap: 8px; max-width: 40rem; }
.month-panel .note-mark { display: block; width: 8px; height: 3px; border-radius: 2px; background: var(--text); }
.cal-day .note-mark { position: absolute; top: 7px; left: 6px; }
.report-notes { margin: 0; padding: 0; list-style: none; }
.report-notes li { padding: 8px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.report-notes li:last-child { border-bottom: 0; }

/* round 40: carbs by meal */
.meal-carbs { margin: -4px 0 8px; color: var(--muted); font-size: .9375rem; font-variant-numeric: tabular-nums; }
.meals > .day-carbs { grid-column: 1 / -1; margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.display > .note { margin: 4px 0 0; }

/* round 41: portion hints */
/* the hint and the help each take a line under the portion chips */
.group > .portion-hint, .group > .portion-help { flex-basis: 100%; }
.portion-hint { margin: 2px 0 0; color: var(--text); }
.portion-help { margin-top: -4px; }
.portion-help summary { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; }
.portion-help ul { margin: 4px 0 0; padding: 0 0 0 1.2em; color: var(--muted); }
.portion-help li { margin: 4px 0; }

/* round 42: a Monday recap on Today */
.recap .recap-text { display: grid; gap: 4px; max-width: 70ch; }
.recap h2 { margin: 0 0 4px; font-size: 1.125rem; }

/* round 43: Today's cards under the big number show one at a time; the wrapper adds no row of its own */
.top-cards { display: contents; }
.top-cards > :not([hidden]) ~ * { display: none !important; }

/* round 44: what fits now */
.chip.food .yours { flex: none; margin-left: 0; vertical-align: 0; }

/* round 45: your meal names */
.meal-names .display-row { align-items: flex-start; }
.meal-name-boxes { display: grid; flex: 1 1 26em; grid-template-columns: repeat(auto-fit, minmax(10em, 1fr)); gap: 12px 14px; min-width: 0; }
.meal-name-boxes > .field > label { color: var(--muted); font-size: 1rem; }
.meal-names > .note { margin: 4px 0 0; }

/* round 46: water your way */
.water > .water-set { flex: 1 1 100%; margin-top: 2px; }
.water-set > summary { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; }
.water-set .display-row { margin-top: 8px; }

/* round 47: your way to the goal */
.goal-way .way-line { margin: 2px 0 18px; font-size: 1.125rem; }
.goal-way .way-line b { color: var(--green); font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.way-track { position: relative; height: 12px; margin: 0 11px; border-radius: var(--r-chip); background: var(--field); box-shadow: inset 0 0 0 1px var(--line); }
.way-fill { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--green); transition: width .8s var(--ease); }
.way-mark { position: absolute; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border: 3px solid var(--green); border-radius: 50%; background: var(--surface); transition: left .8s var(--ease); }
.way-ends { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; margin: 14px 0 0; color: var(--muted); font-size: 1rem; }

/* round 48: favorite foods */
.fav-chip { display: inline-flex; align-items: center; gap: 8px; }
.fav-chip svg { width: 20px; height: 20px; flex: none; }
/* pressed, it reads as a mark on the food, not as one more option like the meal chips beside it */
.chip.fav-chip[aria-pressed="true"] { border-color: var(--green-line); background: var(--green-soft); color: var(--text); }
.chip.fav-chip[aria-pressed="true"] svg { color: var(--green); fill: currentColor; }
.fstar { width: 16px; height: 16px; flex: none; color: var(--green); fill: currentColor; }
.oname .fstar { margin-left: 6px; vertical-align: -2px; }

/* round 50: a skippable question looks skippable: outlined in green, the width of Next, which stays the one filled button */
.btn.alt { width: 100%; border-color: var(--green-line); background: none; color: var(--green); }
.btn.alt:hover { border-color: var(--green); background: var(--green-soft); }

/* round 51: why protein matters while losing */
/* it sits inside a <dd>, whose values are bold: this is a sentence, so normal weight */
.protein-why { margin: 14px 0 10px; padding: 12px 14px; border-radius: var(--r-control); background: var(--green-soft); color: var(--text); font-weight: 400; line-height: 1.5; }
.protein-why b { color: var(--green); }
.pace-row { display: grid; gap: 16px; }

/* round 53: protein, carbs and fat from the label, for a food typed in */
.facts-row { margin-top: 8px; }
.facts-open { display: inline-flex; align-items: center; min-height: 44px; }
/* minmax(0, 1fr): the fields' grid takes the row's width instead of growing to fit three boxes */
.facts-box { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 6px 0 4px; }
.facts-note { margin: 0; color: var(--muted); font-size: 1rem; }
/* as many columns as the words allow: three on a computer, fewer when "Carbohidratos" at Larger text needs the room */
/* rem, so the columns follow the text size like the labels do; the boxes shrink to their column */
.facts-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 12px; max-width: 36rem; }
.facts-fields > .field, .facts-fields .input-row { min-width: 0; }
.facts-fields .input.num { width: 100%; max-width: none; min-width: 0; }
.facts-fields .field-msg:empty { display: none; }

/* round 54: preset meals */
.recipe-rows .daily-row { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 0 0 12px; }
.recipe-rows .daily-row > .label { color: var(--muted); }
.own-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 10px; margin-top: 8px; }
.own-fields > .field, .own-fields .input-row { min-width: 0; }
.own-fields .input.num { width: 100%; max-width: none; min-width: 0; }
.own-fields .field-msg:empty { display: none; }
.own-chip { color: var(--green); border-color: var(--green-line); }

/* round 55: the meals usually had share the width (2 meals: 2 wide columns); phones keep one column */
.meals[data-cols="1"] { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) {
  .meals[data-cols="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meals[data-cols="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.more-meals { color: var(--muted); border-style: dashed; }
.meals-pick .chip { min-width: 9rem; }

/* round 56: the "not in the list" line with its button; the exercise tiles' plus signs keep their size */
.drop-empty > p { margin: 0; }
.drop-empty > .linkish { margin-top: 4px; min-height: 44px; }
.tile svg { flex: none; }

/* round 57: an app, not a page. Phones: the tabs are a bar at the bottom, where the thumb is; the top bar is one line. */
@media (max-width: 759px) {
  .topbar { flex-wrap: nowrap; }
  .topbar .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border: 0; border-top: 1px solid var(--line); border-radius: 0;
    background: var(--bg); /* solid: nothing shows through */
  }
  .topbar .tab {
    flex-direction: column; gap: 4px; min-height: 56px; padding: 6px 2px 4px; border-radius: 12px;
    font-size: 0.8125rem; font-weight: 600; line-height: 1.1;
  }
  .topbar .tab svg { display: block; }
  .topbar .tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .topbar .tab[aria-current="page"] { background: none; color: var(--green); }
  .topbar .tab[aria-current="page"] svg { stroke-width: 2.4; }
  .screen.result { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
}

/* round 58: Today, logging first. Empty, the panel is the box and Quick add; the rest comes with a food. */
.add-food.is-empty .addrow > :not(.field-name), .add-food.is-empty .meal-group { display: none; }
.add-food.is-empty .addrow { grid-template-columns: minmax(0, 1fr); }
.add-food.is-empty .subrow:not(:has(> :not([hidden]):not(.meal-group))) { display: none; }
.add-food .field-name .input { min-height: 60px; font-size: 1.1875rem; }
.quick { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; } /* the panel's width, not the content's */
.quick > .group.off { display: none; }
.quick > .group > .label { display: none; } /* the switch names them */
/* a segmented switch: equal parts on one row while they fit */
.quick-switch .chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(4.25rem, 1fr)); gap: 6px; max-width: 34rem; }
.quick-switch .chip { justify-content: center; min-height: 44px; padding: 2px 6px; font-size: 0.9375rem; line-height: 1.15; text-align: center; }
@media (max-width: 759px) {
  /* one row that scrolls sideways */
  .quick > .group { flex-wrap: nowrap; overflow-x: auto; margin: 0 -20px; padding: 2px 20px 6px; scrollbar-width: none; }
  .quick > .group::-webkit-scrollbar { display: none; }
  .quick > .group > * { flex: none; }
  .quick > .group .chip.food { max-width: 16rem; }
}

/* round 59: explanations behind a small "?" at the end of a section's title (a 44 px target around a small dot) */
.why { display: inline-grid; place-items: center; width: 44px; height: 44px; margin: -12px 0 -12px -4px; padding: 0; border: 0;
  background: none; color: var(--muted); vertical-align: middle; cursor: pointer; }
.why-dot { display: grid; place-items: center; width: 22px; height: 22px; border: 1.5px solid var(--line-strong); border-radius: 50%;
  font: 700 0.75rem/1 var(--font); letter-spacing: 0; text-transform: none; }
.why:hover .why-dot, .why[aria-expanded="true"] .why-dot { border-color: var(--green); color: var(--green); }
.why-note { margin-top: 0; }

/* round 60: the feedback link */
.disclaimer .feedback a { color: var(--green); font-weight: 600; }

/* round 61: polish. Extra activity's button; Recipes' two buttons stack on phones, the main one first. */
.extra .extra-open { justify-self: start; width: auto; padding: 0 20px; }
@media (max-width: 759px) {
  .recipes-head { flex-direction: column; align-items: stretch; }
  .recipes-head .btn { width: 100%; }
}

/* round 62: the test site's welcome */
.welcome-note { margin: 18px 0 22px; color: var(--muted); }
.welcome-start { width: 100%; }
