/* SassPan (formerly Daily Fuel) — layout: one-column phone app (header, protein ring summary, log list),
   fixed tab bar + floating "Add food" button, bottom sheets for adding and recipe cards.
   Widens to a two-column summary at 768px and a wider canvas at 1200px. */

:root {
  --bg: #f2f8f4;
  --surface: #ffffff;
  --surface-2: #f7fbf8;
  --ink: #16241d;
  --muted: #536a5e;
  --line: #d5e8dd;
  --accent: #3e9b74;
  --accent-ink: #ffffff;
  --accent-text: #2c7a59;
  --accent-soft: #dff0e6;
  --track: #d5e8dd;
  --goal: #b9790c;
  --celebrate: #ffe27a;
  --grape: #8a5cc9;
  --heads-up: #ff8a3d;
  --danger: #e23d5b;
  --shadow: rgba(22, 36, 29, 0.12);
  --scrim: rgba(17, 28, 23, 0.45);

  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, Helvetica, Arial, sans-serif;
  --font-data: "DM Sans", system-ui, Helvetica, Arial, sans-serif;

  --radius: 14px;
  --radius-sm: 10px;
  --tabbar-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111c17;
    --surface: #1c2b24;
    --surface-2: #21382d;
    --ink: #eaf6ef;
    --muted: #9db5a8;
    --line: #2a4237;
    --accent: #3e9b74;
    --accent-ink: #ffffff;
    --accent-text: #6fcb9f;
    --accent-soft: #21382d;
    --track: #2a4237;
    --goal: #ffe27a;
    --celebrate: #ffe27a;
    --grape: #a982e0;
    --heads-up: #ff8a3d;
    --danger: #f06a83;
    --shadow: rgba(0, 0, 0, 0.45);
    --scrim: rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #111c17;
  --surface: #1c2b24;
  --surface-2: #21382d;
  --ink: #eaf6ef;
  --muted: #9db5a8;
  --line: #2a4237;
  --accent: #3e9b74;
  --accent-ink: #ffffff;
  --accent-text: #6fcb9f;
  --accent-soft: #21382d;
  --track: #2a4237;
  --goal: #ffe27a;
  --celebrate: #ffe27a;
  --grape: #a982e0;
  --heads-up: #ff8a3d;
  --danger: #f06a83;
  --shadow: rgba(0, 0, 0, 0.45);
  --scrim: rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-variant-numeric: tabular-nums;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}

h1,
h2,
h3,
p,
dl,
dd,
ul,
ol {
  margin: 0;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

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

.icon {
  width: 20px;
  height: 20px;
  flex: none;
}

/* ---------- App shell ---------- */

.app {
  max-width: 560px;
  margin: 0 auto;
  padding-inline: 16px;
  padding-block: 8px calc(var(--tabbar-h) + 96px);
}

.topbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 12px;
  background: var(--bg);
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  color: var(--accent-text);
}

.topbar__logo {
  width: 32px;
  height: 32px;
  flex: none;
}

.datenav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
}

.datenav__btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
}

.datenav__btn:hover {
  background: var(--surface-2);
}

.datenav__btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.datenav__label {
  border: 0;
  background: transparent;
  font-weight: 600;
  font-size: 0.95rem;
  min-width: 96px;
  text-align: center;
}

.main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.view {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---------- Notices ---------- */

.notice {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--goal);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.92rem;
}

.notice--section {
  border-left-color: var(--danger);
}

.empty {
  color: var(--muted);
  padding-block: 18px;
  font-size: 0.95rem;
}

.hint {
  color: var(--muted);
  font-size: 0.88rem;
}

/* ---------- Summary ---------- */

.summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px 18px;
  box-shadow: 0 1px 2px var(--shadow);
}

.ring {
  position: relative;
  width: 200px;
  max-width: 100%;
  aspect-ratio: 1;
}

.ring__svg {
  width: 100%;
  height: 100%;
}

.ring__track {
  stroke: var(--track);
}

.ring__fill {
  stroke: var(--accent);
  transition: stroke-dashoffset 0.6s ease;
}

.ring__fill.is-done {
  stroke: var(--goal);
}

.ring__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ring__value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 3rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.ring__unit {
  font-size: 1.25rem;
  margin-left: 2px;
  color: var(--muted);
}

.ring__caption {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 6px;
}

.summary__side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  min-width: 0;
}

.summary__status {
  text-align: center;
  font-weight: 600;
  text-wrap: balance;
}

.macros {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.macros__item {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  text-align: center;
}

.macros__label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.macros__value {
  font-family: var(--font-data);
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

/* ---------- Section heads ---------- */

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

.section-head__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
}

.section-head__title--page {
  font-size: 1.6rem;
  font-weight: 800;
}

.section-head__action {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}

.section-head__action.is-loading .icon {
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Log ---------- */

.log {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.log__list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.meal-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.meal-group__head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding-inline: 4px;
}

.meal-group__protein {
  font-family: var(--font-data);
  letter-spacing: 0;
}

.entry-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  text-align: left;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.entry-row + .entry-row {
  margin-top: 6px;
}

.entry-row__qty {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.85rem;
}

.entry-row__main {
  flex: 1;
  min-width: 0;
}

.entry-row__name {
  display: block;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* "Where it's from" line under any food name */
.from {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0;
}

.sheet__titles {
  min-width: 0;
}

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

.sheet__sub:empty {
  display: none;
}

.entry-row__meta {
  color: var(--muted);
  font-size: 0.85rem;
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums;
}

.entry-row__protein {
  font-family: var(--font-data);
  font-weight: 500;
  color: var(--accent-text);
  white-space: nowrap;
}

.entry-row__remove {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.entry-row__remove:hover {
  background: var(--surface-2);
  color: var(--danger);
}

.entry-row__confirm {
  display: flex;
  gap: 6px;
}

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

.btn {
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  border: 1px solid transparent;
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn--primary:disabled {
  opacity: 0.5;
  cursor: default;
}

.btn--ghost {
  background: transparent;
  border-color: var(--line);
}

.btn--small {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.btn--danger {
  background: var(--danger);
  color: var(--accent-ink);
}

.link-btn {
  border: 0;
  background: transparent;
  color: var(--accent-text);
  font-weight: 600;
  padding: 8px 0;
  text-align: left;
}

/* ---------- FAB & tab bar ---------- */

.fab {
  position: fixed;
  right: 16px;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 16px);
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  box-shadow: 0 6px 18px var(--shadow);
}

.fab__icon {
  display: grid;
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 6px 12px calc(6px + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.tabbar__tab {
  flex: 1;
  max-width: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.tabbar__tab.is-active {
  color: var(--accent-text);
  background: var(--accent-soft);
}

.tabbar__icon {
  display: grid;
}

/* ---------- Search & chips ---------- */

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  color: var(--muted);
}

.search__icon {
  display: grid;
}

.search__input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  outline: none;
}

.search:focus-within {
  border-color: var(--accent);
}

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

.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
}

.chip.is-active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-text);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 1px 8px;
}

/* ---------- Food list ---------- */

.food-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.food-group__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding-inline: 4px;
}

.food-list--tight {
  gap: 6px;
}

/* ---------- Swipe rows (swipe left = log one serving) ---------- */

.swipe {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
}

.swipe--tile {
  border-radius: var(--radius);
}

.swipe__action {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding-right: 18px;
  color: var(--accent-text);
  font-weight: 700;
}

.swipe.is-armed {
  background: var(--accent);
}

.swipe__action--del {
  justify-content: flex-start;
  padding-right: 0;
  padding-left: 18px;
  color: var(--danger);
  visibility: hidden;
}

.swipe.is-right {
  background: rgba(226, 61, 91, 0.16);
}

.swipe.is-right .swipe__action {
  visibility: hidden;
}

.swipe.is-right .swipe__action--del {
  visibility: visible;
}

.swipe.is-right.is-armed {
  background: var(--danger);
}

.swipe.is-right.is-armed .swipe__action--del {
  color: #ffffff;
}

.swipe.is-armed .swipe__action {
  color: var(--accent-ink);
}

.swipe__content {
  position: relative;
  width: 100%;
  transform: translateX(var(--swipe-x, 0px));
  transition: transform 0.22s ease;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.swipe.is-dragging .swipe__content {
  transition: none;
}

.food-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  text-align: left;
  background: var(--surface);
  padding: 14px 14px;
}

.food-row__name {
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
}

.food-row__fav {
  color: var(--goal);
  margin-right: 4px;
}

.food-row__protein {
  font-family: var(--font-data);
  color: var(--accent-text);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.food-row__note {
  font-size: 0.85rem;
  color: var(--muted);
}

.food-row__meta {
  font-family: var(--font-data);
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Star (favorite) ---------- */

.star {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  flex: none;
}

.star.is-on {
  color: var(--goal);
  border-color: var(--goal);
}

.star.is-on .icon {
  fill: currentColor;
}

/* ---------- This-time parts ---------- */

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

.parts__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.parts__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
}

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

.part {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 8px 8px 8px 12px;
}

.part__name {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
  font-size: 0.92rem;
}

.part__unit {
  display: block;
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--muted);
}

.part.is-changed .part__name {
  color: var(--accent-text);
}

/* ---------- Recipes ---------- */

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

.recipe-tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  border: 0;
  background: var(--surface);
  padding: 16px;
}

.recipe-tile__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  text-wrap: balance;
}

.recipe-tile__desc {
  color: var(--muted);
  font-size: 0.92rem;
}

.recipe-tile__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.recipe-tile__macro {
  font-family: var(--font-data);
  font-size: 0.8rem;
  color: var(--muted);
}

.recipe-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 8px;
}

.recipe-card__desc {
  color: var(--muted);
}

.recipe-card__facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.recipe-card__fact {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.recipe-card__fact-label {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.recipe-card__fact-value {
  font-weight: 600;
}

.recipe-card__heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.recipe-card__list {
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recipe-card__list li::marker {
  color: var(--accent-text);
  font-weight: 700;
}

.recipe-card__nutrition {
  font-family: var(--font-data);
  font-size: 0.85rem;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

/* ---------- Sheets ---------- */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet__backdrop {
  position: absolute;
  inset: 0;
  background: var(--scrim);
}

.sheet__panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  padding: 16px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sheet__panel--tall {
  max-height: 94vh;
}

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

.sheet__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  text-wrap: balance;
}

.sheet__tools {
  display: flex;
  gap: 8px;
  flex: none;
}

.sheet__close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  flex: none;
}

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

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

/* ---------- Entry form ---------- */

.entry {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.entry__food {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.entry__custom {
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.field__label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}

.field__input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

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

.qty__label {
  font-weight: 600;
}

.qty__stepper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty__btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.qty__input {
  width: 72px;
  text-align: center;
  font-family: var(--font-data);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 8px 4px;
}

.meals {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.meals__opt {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 8px 4px;
  font-size: 0.85rem;
  font-weight: 600;
}

.meals__opt.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.entry__preview {
  font-family: var(--font-data);
  font-size: 0.9rem;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.entry__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 84px);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 6px 18px var(--shadow);
  max-width: calc(100% - 32px);
}

.toast__text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.toast__action {
  border: 0;
  background: transparent;
  color: var(--accent-soft);
  font-weight: 700;
  text-decoration: underline;
  padding: 2px 0;
  flex: none;
}

/* ---------- Reports ---------- */

.report {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}

.report__quip {
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-weight: 500;
}

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

.tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tile__label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.tile__value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.tile__unit {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  margin-left: 2px;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.card__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.card__sub {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: -6px;
}

.chart {
  position: relative;
}

.chart__svg {
  display: block;
  width: 100%;
  height: 180px;
  overflow: visible;
  touch-action: pan-y;
}

.chart__svg:focus-visible {
  outline-offset: 4px;
}

.chart__grid {
  stroke: var(--line);
  stroke-width: 1;
}

.chart__goal {
  stroke: var(--muted);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
}

.chart__bar {
  fill: var(--accent);
}

.chart__bar.is-active {
  fill: var(--accent-text);
}

.chart__axis {
  fill: var(--muted);
  font-size: 11px;
  font-family: var(--font-body);
}

.chart__tip {
  position: absolute;
  top: 0;
  pointer-events: none;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.8rem;
  line-height: 1.35;
  white-space: nowrap;
  transform: translateX(-50%);
  box-shadow: 0 4px 14px var(--shadow);
}

.chart__tip strong {
  font-size: 0.95rem;
}

.chart__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 0.8rem;
}

.chart__key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart__swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--accent);
}

.chart__dash {
  width: 14px;
  border-top: 2px dashed var(--muted);
}

.details summary {
  cursor: pointer;
  color: var(--accent-text);
  font-weight: 600;
  font-size: 0.85rem;
}

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

.rank__item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
}

.rank__num {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 700;
  font-size: 0.85rem;
}

.rank__name {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 500;
  line-height: 1.3;
}

.rank__meta {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 400;
}

.rank__value {
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

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

.firsts__item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}

.firsts__item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.firsts__date {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--grape);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  vertical-align: middle;
}

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.table th,
.table td {
  padding: 6px 6px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.table th:first-child,
.table td:first-child {
  text-align: left;
}

.table th {
  color: var(--muted);
  font-weight: 500;
}

.delta {
  color: var(--muted);
  font-size: 0.75rem;
  margin-left: 4px;
}

.report__two {
  display: grid;
  gap: 16px;
}

/* ---------- Goals & export ---------- */

.section-head__tools {
  display: flex;
  gap: 8px;
}

.btn__icon {
  display: inline-grid;
  vertical-align: -4px;
  margin-right: 6px;
}

.btn__icon .icon {
  width: 16px;
  height: 16px;
}

.macros__goal {
  display: block;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.72rem;
}

.macros__goal:empty {
  display: none;
}

.goals__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.goal {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.goal__name {
  font-weight: 600;
}

.goal__input {
  width: 110px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  text-align: right;
}

.goal__type {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.goal-check {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.goal-check__item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.goal-check__value {
  font-weight: 700;
  white-space: nowrap;
}

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

.export {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
}

.export:disabled {
  opacity: 0.6;
  cursor: progress;
}

.export__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  flex: none;
}

.export__name {
  font-weight: 600;
}

/* ---------- Barcode ---------- */

.search-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-row .search {
  flex: 1;
  min-width: 0;
}

.scan-btn {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent-text);
}

.scan__status {
  font-weight: 500;
  margin-bottom: 12px;
}

.scan__status:empty {
  display: none;
}

.scan__manual {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.scan__manual .field__input {
  width: auto;
  flex: 1 1 180px;
  min-width: 0;
}

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

.pick-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 12px 14px;
  text-align: left;
}

.pick-row + .pick-row {
  margin-top: 6px;
}

.pick-row__name {
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
}

.pick-row__protein {
  color: var(--accent-text);
  font-weight: 700;
  white-space: nowrap;
}

/* ---------- Food photos ---------- */

.thumb {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 12px;
  object-fit: cover;
  background: var(--accent-soft);
}

.thumb--empty {
  display: grid;
  place-items: center;
  color: var(--accent-text);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
}

.food-row__lead {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.recipe-tile__img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.photo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}

.photo:empty {
  display: none;
}

.photo__img {
  width: 100%;
  max-height: 260px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
}

/* Cut-out package shots and nutrition labels show whole, on a soft tile. */
.photo__img--pack,
.photo__img--label {
  object-fit: contain;
  background: var(--accent-soft);
  padding: 10px;
}

.photo__img--label {
  background: #fff;
}

.thumb--pack {
  object-fit: contain;
  padding: 3px;
}

.photo__gallery {
  display: grid;
  gap: 8px;
  width: 100%;
}

.photo__slides {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
}

.photo__slides::-webkit-scrollbar {
  display: none;
}

.photo__slides .photo__img {
  flex: 0 0 100%;
  scroll-snap-align: center;
}

.photo__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.photo__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--line);
  cursor: pointer;
}

.photo__dot.is-on {
  background: var(--accent);
  width: 20px;
}

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

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

/* ---------- Entry card & display settings ---------- */

.entry-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.entry-card__facts {
  color: var(--muted);
  font-weight: 500;
}

.entry-card__ask {
  font-weight: 600;
}

.macros--four {
  grid-template-columns: repeat(2, 1fr);
}

.macros__item.is-main {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.entry__actions .btn .icon {
  width: 16px;
  height: 16px;
  vertical-align: -3px;
  margin-right: 6px;
}

.display-pick {
  border: 0;
  margin: 0 0 16px;
  padding: 0;
}

.display-pick__opts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.ring__fill.is-over {
  stroke: var(--heads-up);
}

/* ---------- Hello line, confirm, Me ---------- */

.hello {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  margin: 4px 2px 12px;
}

.hello:empty {
  display: none;
}

.log__list .swipe + .swipe {
  margin-top: 6px;
}

.sheet--confirm .sheet__panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.confirm__text {
  color: var(--muted);
}

.me-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 4px 0 16px;
}

.me-head__avatar {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
}

#view-me .card + .card {
  margin-top: 14px;
}

.me-row {
  display: flex;
  gap: 8px;
}

.me-row .field__input {
  flex: 1;
  min-width: 0;
  width: auto;
}

.field__input {
  color: var(--ink);
  font: inherit;
}

.toggles {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
}

.toggle__label {
  font-weight: 600;
}

.toggle__input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.toggle__track {
  position: relative;
  flex: none;
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: var(--track);
  transition: background 0.2s ease;
}

.toggle__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #ffffff;
  transition: transform 0.2s ease;
}

.toggle__input:checked + .toggle__track {
  background: var(--accent);
}

.toggle__input:checked + .toggle__track::after {
  transform: translateX(18px);
}

.toggle__input:focus-visible + .toggle__track {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.toggle__time {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.toggle__time .field__input {
  width: auto;
}

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

.feedback__text,
textarea[data-autogrow] {
  resize: none;
  overflow: hidden;
  min-height: 96px;
  line-height: 1.5;
}

.display-pick__opts--three {
  grid-template-columns: repeat(3, 1fr);
}

.me-account {
  font-weight: 500;
}

.me-about {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  margin: 22px 0 8px;
}

.me-about__name {
  font-weight: 600;
  color: var(--ink);
}

/* ---------- Editing, reminders, avatar, feedback list ---------- */

.food-group__edit {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
}

.food-group__edit .icon {
  width: 15px;
  height: 15px;
}

.food-group__edit:hover {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.edit {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.edit .display-pick {
  margin: 0;
}

.reminder {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.reminder:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.reminder__when {
  display: flex;
  gap: 8px;
}

.reminder__time,
.reminder__day {
  width: auto;
}

.me-head__avatar {
  border: 0;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
}

.me-head__avatar:disabled {
  cursor: default;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tab-avatar {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  object-fit: cover;
}

.feedback-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.feedback-list:empty {
  display: none;
}

.feedback-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.feedback-item summary {
  cursor: pointer;
  list-style: none;
}

.feedback-item summary::-webkit-details-marker {
  display: none;
}

.feedback-item__title {
  font-weight: 600;
}

.feedback-item__body {
  margin-top: 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------- Kitchen ---------- */

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  margin: 10px 0 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.segmented__opt {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 8px 6px;
}

.segmented__opt.is-active {
  background: var(--accent);
  color: var(--accent-ink);
}

.kitchen {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.k-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  text-align: left;
  background: var(--surface);
  padding: 12px 14px;
}

.k-row__main {
  flex: 1;
  min-width: 0;
}

.k-row__name {
  display: block;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.k-row__name.is-done {
  text-decoration: line-through;
  color: var(--muted);
}

.k-row__qty {
  flex: none;
  color: var(--accent-text);
  font-weight: 700;
  white-space: nowrap;
}

.from--warn {
  color: var(--ink);
  font-weight: 600;
}

.chip__count {
  display: inline-block;
  min-width: 18px;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 0.72rem;
}

.check {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 999px;
  border: 2px solid var(--line);
  color: var(--accent-ink);
}

.check.is-on {
  background: var(--accent);
  border-color: var(--accent);
}

.check .icon {
  width: 16px;
  height: 16px;
}

.k-quickadd {
  display: flex;
  align-items: center;
  gap: 8px;
}

.k-quickadd .field__input {
  flex: 1;
  min-width: 0;
  width: auto;
}

.k-cart {
  margin-top: 6px;
}

.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.week-nav__label {
  border: 0;
  background: transparent;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  text-align: center;
}

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

.day-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
}

.day-card.is-today {
  border-color: var(--accent);
}

.day-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px;
}

.day-card__title {
  display: block;
  font-weight: 700;
}

.day-card__empty {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0 4px 4px;
}

.day-card .k-row {
  background: var(--surface-2);
}

.entry__actions--center {
  justify-content: center;
}

.entry__actions--wrap {
  flex-wrap: wrap;
}

.entry__actions .btn .icon,
.btn .icon {
  width: 16px;
  height: 16px;
  vertical-align: -3px;
  margin-right: 6px;
}

.build-list,
.putaway {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.build-item {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
}

.build-item input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
  flex: none;
}

.putaway__item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.k-sheet {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mini-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 10px;
}

.mini-btn .icon {
  width: 15px;
  height: 15px;
  color: var(--accent-text);
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
}

.link-btn--quiet {
  color: var(--muted);
}

.display-pick__opts--two {
  grid-template-columns: repeat(2, 1fr);
}

.today-plan {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.plan-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px dashed var(--accent);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

/* ---------- Suggestions (replaces <datalist>, which covers the keyboard on phones) ---------- */

.suggest {
  display: flex;
  flex-direction: column;
  margin-top: -4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}

.suggest[hidden] {
  display: none;
}

.suggest__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.suggest__item:first-child {
  border-top: 0;
}

.suggest__item:active,
.suggest__item:focus-visible {
  background: var(--accent-soft);
}

.suggest__name {
  font-weight: 600;
}

/* ---------- Kitchen: spots, sections, use-by ---------- */

.k-row--split {
  padding: 0;
  gap: 0;
}

.k-row__tap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 12px 4px 12px 14px;
}

.k-row__more {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  align-self: stretch;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.loc-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.loc-pick .meals__opt {
  flex: 1 1 auto;
  min-width: 84px;
  padding: 8px 10px;
}

.exp-pick {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exp-pick__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.field__input--small {
  padding: 6px 10px;
  font-size: 0.9rem;
  width: auto;
}

.toggle--small .toggle__label {
  font-size: 0.92rem;
}

.chip--quiet {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  border-style: dashed;
}

.chip--quiet .icon {
  width: 14px;
  height: 14px;
}

.putaway__head {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.putaway__where[hidden] {
  display: none;
}

.putaway__exp {
  display: flex;
  align-items: center;
  gap: 10px;
}

.putaway__group {
  margin-top: 6px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  margin-top: 4px;
}

.check-line input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.use-soon {
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 10px;
  background: var(--accent-soft);
}

.use-soon .food-group__title .icon {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
}

.food-group__title .link-btn,
.section-head .link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.85rem;
  padding: 4px 0;
}

.food-group__title .link-btn .icon,
.section-head .link-btn .icon {
  width: 15px;
  height: 15px;
}

.use-soon__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ideas {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-left: 18px;
  margin: 0 0 6px;
}

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

.spots__row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.spots__row .field__input {
  flex: 1;
  min-width: 0;
  width: auto;
}

.spots__row .from {
  flex: none;
  min-width: 52px;
  text-align: right;
}

.today-plan--soon .plan-chip {
  border-style: solid;
  border-color: var(--line);
}

.field-row--two {
  grid-template-columns: repeat(2, 1fr);
}

@media (prefers-reduced-motion: reduce) {
  .swipe__content,
  .ring__fill,
  .section-head__action.is-loading .icon {
    transition: none;
    animation: none;
  }
}

/* ---------- Breakpoints ---------- */

@media (max-width: 480px) {
  .ring {
    width: 180px;
  }

  .ring__value {
    font-size: 2.6rem;
  }

  .meals__opt {
    font-size: 0.78rem;
  }
}

@media (min-width: 768px) {
  .app {
    max-width: 760px;
  }

  .tiles {
    grid-template-columns: repeat(4, 1fr);
  }

  .report__two {
    grid-template-columns: repeat(2, 1fr);
  }

  .summary {
    flex-direction: row;
    gap: 28px;
    padding: 26px;
  }

  .summary__status {
    text-align: left;
  }

  .recipe-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .field-row {
    grid-template-columns: repeat(4, 1fr);
  }

  .field-row--two {
    grid-template-columns: repeat(2, 1fr);
  }

  .sheet {
    align-items: center;
  }

  .sheet__panel {
    border-radius: 20px;
    max-height: 86vh;
  }
}

@media (min-width: 1200px) {
  .app {
    max-width: 960px;
  }

  .recipe-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Prices on the shopping list */
.price-sum {
  display: grid;
  gap: 4px;
  margin: 4px 0 6px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--accent-soft);
}
.price-sum .chips { margin: 0 0 4px; }
.price-sum__total { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.price-sum__label { color: var(--muted); }
.price-sum__num {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--accent-text);
}
.price-sum .from { margin: 0; }
.k-row__price {
  display: grid;
  justify-items: end;
  flex: none;
  margin-left: auto;
  font-weight: 700;
  color: var(--accent-text);
  white-space: nowrap;
}
.k-row__price .from { font-weight: 400; }
.price-list { display: grid; gap: 6px; margin-bottom: 10px; }
.price-list__row { display: flex; align-items: center; gap: 10px; margin: 0; }
.price-add { display: grid; gap: 8px; }

/* Full-screen photo / label viewer */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: calc(16px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: rgba(10, 18, 14, 0.92);
  touch-action: pinch-zoom;
}
.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #fff;
  border-radius: var(--radius-sm);
}
.lightbox__close {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: max(12px, env(safe-area-inset-right, 0px));
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}
.photo__img { cursor: zoom-in; }

/* ---------- Cook planner ---------- */
.cook-row {
  gap: 10px;
  align-items: center;
}
.cook-row > .check {
  cursor: pointer;
  background: none;
  padding: 0;
}
.cook-row > .check.is-on {
  background: var(--accent);
}
.check--off {
  border-style: dashed;
  opacity: 0.5;
}
.cook-row.is-short .k-row__tap {
  opacity: 0.55;
  filter: grayscale(0.7);
}
.cook-row.is-picked {
  box-shadow: inset 3px 0 0 var(--accent);
}
.cook-sum {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.cook-sum__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cook-lines {
  display: grid;
  gap: 10px;
}
.cook-line {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.cook-line .k-row__main {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.cook-line__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.cook-batches {
  display: inline-grid;
  place-items: center;
  min-width: 2.5em;
  font-variant-numeric: tabular-nums;
}
.cook-row {
  padding-left: 12px;
}

/* Kitchen sections as an icon strip */
.segmented--icons .segmented__opt {
  display: grid;
  place-items: center;
  padding: 8px 0;
}
.segmented--icons .segmented__opt .icon {
  width: 22px;
  height: 22px;
}
.segmented--icons {
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 4px;
}
.segmented__caption {
  margin: 0 0 12px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
