/* SassPan polish layer (v23) — loaded after styles.css.
   Direction: "Pickle Party, refined." Basil still leads; Grape carries personality; Tangerine and
   Lemonade appear only as small section accents. Depth comes from layered soft shadows, a frosted
   header and a floating dock. Everything is tighter: icon controls with one caption that names
   what's selected, single-row strips that never wrap, smaller headings. */

:root {
  --grape-soft: #efe6fb;
  --grape-text: #6a3fae;
  --tang: #ff8a3d;
  --tang-soft: #ffeedf;
  --tang-text: #b4541a;
  --lemon: #ffe27a;
  --lemon-soft: #fff6d1;
  --lemon-text: #8a6a00;
  --basil-deep: #2f7f5d;
  --hairline: rgba(22, 36, 29, 0.07);
  --elev-1: 0 1px 2px rgba(22, 36, 29, 0.06), 0 4px 14px -8px rgba(22, 36, 29, 0.18);
  --elev-2: 0 2px 6px rgba(22, 36, 29, 0.06), 0 18px 40px -18px rgba(22, 36, 29, 0.35);
  --glass: rgba(242, 248, 244, 0.78);
  --dock: rgba(255, 255, 255, 0.86);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --grape-soft: #2a2140;
    --grape-text: #c3a6f0;
    --tang-soft: #3a2616;
    --tang-text: #ffb27f;
    --lemon-soft: #36301a;
    --lemon-text: #ffe27a;
    --basil-deep: #2f7f5d;
    --hairline: rgba(234, 246, 239, 0.07);
    --elev-1: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 6px 18px -10px rgba(0, 0, 0, 0.7);
    --elev-2: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 22px 50px -18px rgba(0, 0, 0, 0.8);
    --glass: rgba(17, 28, 23, 0.72);
    --dock: rgba(28, 43, 36, 0.86);
  }
}

:root[data-theme="dark"] {
  --grape-soft: #2a2140;
  --grape-text: #c3a6f0;
  --tang-soft: #3a2616;
  --tang-text: #ffb27f;
  --lemon-soft: #36301a;
  --lemon-text: #ffe27a;
  --basil-deep: #2f7f5d;
  --hairline: rgba(234, 246, 239, 0.07);
  --elev-1: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 6px 18px -10px rgba(0, 0, 0, 0.7);
  --elev-2: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 22px 50px -18px rgba(0, 0, 0, 0.8);
  --glass: rgba(17, 28, 23, 0.72);
  --dock: rgba(28, 43, 36, 0.86);
}

/* ---------- Canvas ---------- */

body {
  background:
    radial-gradient(1200px 520px at 110% -10%, color-mix(in srgb, var(--grape) 14%, transparent), transparent 60%),
    radial-gradient(900px 480px at -20% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--glass);
}

.app {
  padding-block: 4px calc(var(--tabbar-h) + 110px);
}

.main,
.view {
  gap: 14px;
}

/* ---------- Header ---------- */

.topbar {
  margin-inline: -16px;
  padding: 10px 16px;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--hairline);
}

.topbar__brand {
  font-size: 1.2rem;
  color: var(--ink);
}

.topbar__logo {
  width: 58px;   /* master pan: body flat, handle swung down to ~26deg, 1.61:1 */
  height: 36px;
  object-fit: contain;
  display: block;
  filter: none;
}

.datenav {
  border-color: var(--hairline);
  box-shadow: var(--elev-1);
  padding: 3px;
}

.datenav__btn {
  width: 30px;
  height: 30px;
}

.datenav__label {
  font-size: 0.88rem;
  min-width: 84px;
}

/* ---------- Headings ---------- */

.section-head {
  align-items: center;
}

.section-head__title {
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.section-head__title--page {
  font-size: 1.55rem;
  letter-spacing: -0.025em;
}

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

.food-group__title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--grape-text);
  padding: 2px 4px;
}

.food-group__title > span:first-child::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 999px;
  background: var(--grape);
  vertical-align: 1px;
}

/* ---------- Cards & surfaces ---------- */

.summary,
.card,
.report > section,
.cook-sum {
  border: 1px solid var(--hairline);
  box-shadow: var(--elev-1);
}

.summary {
  position: relative;
  overflow: hidden;
  padding: 18px 16px;
  gap: 14px;
  border-radius: 22px;
  background:
    radial-gradient(420px 220px at 100% 0%, color-mix(in srgb, var(--grape) 12%, transparent), transparent 70%),
    radial-gradient(360px 220px at 0% 100%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%),
    var(--surface);
}

.card {
  border-radius: 18px;
}

.ring {
  width: 176px;
}

.ring__fill {
  stroke: url(#ring-grad);
  filter: drop-shadow(0 4px 8px color-mix(in srgb, var(--accent) 35%, transparent));
}

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

.ring__value {
  font-size: 2.7rem;
  letter-spacing: -0.03em;
}

/* Macro tiles get their own colors so the numbers read at a glance. */
.macros__item {
  position: relative;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
}

.macros__item::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 12px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.macros__item[data-macro="calories"]::before { background: var(--grape); }
.macros__item[data-macro="fat_g"]::before { background: var(--tang); }
.macros__item[data-macro="carbs_g"]::before { background: var(--lemon); box-shadow: 0 0 0 1px color-mix(in srgb, var(--lemon-text) 40%, transparent); }

.macros__label {
  padding-left: 12px;
}

.report__quip {
  background: var(--grape-soft);
  color: var(--grape-text);
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 500;
  font-size: 0.92rem;
}

/* ---------- Rows: each one a soft tile ---------- */

.food-list {
  gap: 14px;
}

.food-group {
  gap: 6px;
}

.swipe {
  border-radius: 16px;
  box-shadow: var(--elev-1);
}

.food-row,
.k-row {
  padding: 10px 12px;
  background: var(--surface);
}

.swipe__content {
  border-radius: 16px;
  transition: transform 0.22s var(--ease), background-color 0.15s ease;
}

.swipe__content:active {
  background: var(--surface-2);
}

.food-row__name,
.k-row__name {
  font-weight: 600;
  letter-spacing: -0.005em;
}

.from {
  font-size: 0.8rem;
}

.thumb {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  box-shadow: 0 0 0 1px var(--hairline);
}

.thumb--pack {
  background: var(--surface-2);
}

.thumb--empty {
  background: linear-gradient(135deg, var(--accent-soft), var(--grape-soft));
  color: var(--grape-text);
}

.k-row__qty,
.food-row__protein {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

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

.btn {
  transition: transform 0.12s var(--ease), box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn:active,
.icon-btn:active,
.chip:active,
.segmented__opt:active,
.tabbar__tab:active {
  transform: scale(0.96);
}

.btn--primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, white), var(--basil-deep));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 6px 16px -6px color-mix(in srgb, var(--accent) 70%, transparent);
}

.btn--ghost {
  background: var(--surface);
  border-color: var(--hairline);
  box-shadow: var(--elev-1);
}

.link-btn {
  color: var(--grape-text);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--elev-1);
  transition: transform 0.12s var(--ease), background-color 0.2s ease;
}

.icon-btn--primary {
  border: 0;
  color: #fff;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, white), var(--basil-deep));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 6px 16px -6px color-mix(in srgb, var(--accent) 70%, transparent);
}

.icon-btn .icon {
  width: 19px;
  height: 19px;
}

.section-head__tools {
  gap: 8px;
}

.food-group__edit {
  color: var(--grape-text);
  opacity: 0.8;
}

/* ---------- Chips: one row, scroll sideways if needed ---------- */

.chips {
  gap: 6px;
}

.chips--scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  margin-inline: -16px;
  padding: 2px 16px 4px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 16px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 16px), transparent);
}

.chips--scroll::-webkit-scrollbar {
  display: none;
}

.chips--scroll > * {
  flex: none;
}

.chip {
  padding: 5px 12px;
  font-size: 0.82rem;
  border-color: var(--hairline);
  box-shadow: var(--elev-1);
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.12s var(--ease);
}

.chip.is-active {
  background: var(--grape);
  border-color: var(--grape);
  color: #fff;
}

.chip--icon {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--grape-text);
}

.chip--icon .icon {
  width: 16px;
  height: 16px;
}

.chip__count {
  background: color-mix(in srgb, currentColor 16%, transparent);
  color: inherit;
}

/* ---------- Icon strips (Kitchen sections, Foods filter) ---------- */

.segmented {
  margin: 4px 0 4px;
  padding: 4px;
  gap: 4px;
  border: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

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

.segmented--icons .segmented__opt {
  padding: 7px 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  color: var(--muted);
  transition: background-color 0.22s var(--ease), color 0.22s ease, box-shadow 0.22s ease, transform 0.12s var(--ease);
}

.segmented--icons .segmented__opt.is-active {
  color: #fff;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, white), var(--basil-deep));
  box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--accent) 70%, transparent);
}

/* each section gets its own color */
.segmented__opt[data-ktab="cook"].is-active,
.segmented__opt[data-filter="ingredients"].is-active {
  background: linear-gradient(180deg, #ffa264, #f0742a);
  box-shadow: 0 4px 12px -4px rgba(255, 138, 61, 0.7);
}
.segmented__opt[data-ktab="plan"].is-active,
.segmented__opt[data-filter="recipes"].is-active {
  background: linear-gradient(180deg, #a07ad8, #7647b8);
  box-shadow: 0 4px 12px -4px rgba(138, 92, 201, 0.7);
}
.segmented__opt[data-ktab="shop"].is-active {
  color: #4a3a00;
  background: linear-gradient(180deg, #ffeb9e, #f7cf45);
  box-shadow: 0 4px 12px -4px rgba(222, 180, 40, 0.7);
}

.segmented__caption {
  margin: 0 0 6px;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  transition: color 0.2s ease;
}

/* ---------- Search ---------- */

.search {
  padding: 8px 14px;
  border-color: var(--hairline);
  box-shadow: var(--elev-1);
}

.search:focus-within {
  border-color: var(--grape);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--grape) 18%, transparent);
}

.scan-btn {
  border-color: var(--hairline);
  box-shadow: var(--elev-1);
}

/* ---------- Floating dock + add button ---------- */

.tabbar {
  left: 12px;
  right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  max-width: 520px;
  margin-inline: auto;
  padding: 6px;
  gap: 2px;
  border: 1px solid var(--hairline);
  border-radius: 24px;
  background: var(--dock);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  backdrop-filter: saturate(1.6) blur(18px);
  box-shadow: var(--elev-2);
}

.tabbar__tab {
  flex-direction: row;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 6px;
  border-radius: 18px;
  font-size: 0.8rem;
  transition: flex-grow 0.3s var(--ease), background-color 0.25s ease, color 0.2s ease;
}

/* Only the selected tab shows its name. */
.tabbar__label {
  display: none;
}

.tabbar__tab.is-active {
  flex-grow: 1.9;
  color: #fff;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, white), var(--basil-deep));
  box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--accent) 75%, transparent);
}

.tabbar__tab.is-active .tabbar__label {
  display: inline;
}

#tab-foods.is-active,
#tab-me.is-active {
  background: linear-gradient(180deg, #a07ad8, #7647b8);
  box-shadow: 0 6px 14px -6px rgba(138, 92, 201, 0.75);
}

#tab-reports.is-active {
  background: linear-gradient(180deg, #ffa264, #f0742a);
  box-shadow: 0 6px 14px -6px rgba(255, 138, 61, 0.75);
}

.fab {
  right: max(18px, env(safe-area-inset-right, 0px));
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 24px);
  width: 56px;
  height: 56px;
  padding: 0;
  justify-content: center;
  border-radius: 20px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 80%, white), var(--basil-deep));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 14px 28px -10px color-mix(in srgb, var(--accent) 85%, transparent), 0 0 0 4px color-mix(in srgb, var(--grape) 14%, transparent);
  transition: transform 0.15s var(--ease);
}

.fab:active {
  transform: scale(0.94) rotate(-4deg);
}

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

.fab__icon .icon {
  width: 24px;
  height: 24px;
}

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

.sheet__panel {
  border-radius: 26px 26px 0 0;
  padding-top: 22px;
  background: var(--bg);
  box-shadow: 0 -20px 50px -20px rgba(0, 0, 0, 0.35);
}

.sheet__panel::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 38px;
  height: 4px;
  margin-left: -19px;
  border-radius: 999px;
  background: var(--line);
}

.sheet__title {
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.sheet__close,
.star {
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--elev-1);
}

.meals__opt.is-active {
  background: var(--grape);
  border-color: var(--grape);
  color: #fff;
}

/* ---------- Photos ---------- */

.photo__img,
.photo__slides {
  border-radius: 18px;
}

.photo__img--pack {
  background:
    radial-gradient(circle at 50% 40%, var(--surface), var(--surface-2));
  box-shadow: inset 0 0 0 1px var(--hairline);
}

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

.toast {
  border-radius: 16px;
  box-shadow: var(--elev-2);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* ---------- Motion ---------- */

.view:not([hidden]) {
  animation: sp-in 0.28s var(--ease) both;
}

@keyframes sp-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .view:not([hidden]) {
    animation: none;
  }
  .btn:active,
  .icon-btn:active,
  .chip:active,
  .segmented__opt:active,
  .tabbar__tab:active,
  .fab:active {
    transform: none;
  }
}

/* ---------- No pill buttons, anywhere (Taylor, 10/18). Controls use rounded rectangles. ---------- */
.btn,
.btn--small,
.chip,
.chip--icon,
.icon-btn,
.mini-btn,
.meals__opt,
.scan-btn,
.sheet__close,
.star,
.qty__btn,
.photo__btn,
.toast__action,
.export,
.link-btn,
.datenav__btn,
.datenav__label,
.section-head__action,
.food-group__edit,
.k-row__more,
.segmented__opt,
.tabbar__tab,
.fab {
  border-radius: 12px;
}
.btn--small,
.chip,
.chip--icon,
.mini-btn,
.datenav__btn,
.segmented__opt {
  border-radius: 10px;
}
.tabbar__tab {
  border-radius: 16px;
}
.fab {
  border-radius: 18px;
}
.segmented,
.datenav,
.search,
.tag,
.chip__count,
.cook-sum {
  border-radius: 14px;
}
.segmented,
.datenav {
  border-radius: 13px;
}
.tag,
.chip__count {
  border-radius: 6px;
}
.photo__dot,
.photo__dot.is-on {
  border-radius: 3px;
}
.entry-row__remove,
.lightbox__close,
.export__icon,
.badge,
.toast {
  border-radius: 12px;
}
.badge {
  border-radius: 6px;
}
/* switches: squared track and knob, not a pill */
.toggle__track {
  border-radius: 9px;
}
.toggle__track::after {
  border-radius: 6px;
}

/* ======================= v25 ======================= */

/* A few more shades so sections aren't all green. */
:root {
  --sky: #3f7fd9;
  --sky-soft: #e4eefc;
  --sky-text: #285fae;
  --mint: #2fb5a0;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sky-soft: #1c2a40;
    --sky-text: #8db6f2;
  }
}
:root[data-theme="dark"] {
  --sky-soft: #1c2a40;
  --sky-text: #8db6f2;
}

/* ---------- Header: flush to the top, full width ---------- */
.app {
  padding-top: 0;
}
body::before {
  display: none;
}
.topbar {
  top: 0;
  margin-top: calc(-1 * env(safe-area-inset-top, 0px));
  margin-inline: calc(50% - 50vw);
  width: 100vw;
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  padding-bottom: 10px;
  padding-inline: max(16px, calc((100vw - 528px) / 2), env(safe-area-inset-left, 0px));
  border-radius: 0;
}

/* ---------- Bottom nav: flush to the bottom, full width ---------- */
.tabbar {
  left: 0;
  right: 0;
  bottom: 0;
  max-width: none;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--hairline);
  border-radius: 0;
  padding: 6px max(10px, calc((100vw - 540px) / 2)) calc(6px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 30px -18px rgba(0, 0, 0, 0.35);
}
.fab {
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 14px);
}
#tab-me.is-active {
  background: linear-gradient(180deg, #6b9ee6, #2f6cc4);
  box-shadow: 0 6px 14px -6px rgba(63, 127, 217, 0.75);
}
.segmented__opt[data-ktab="plan"].is-active {
  background: linear-gradient(180deg, #6b9ee6, #2f6cc4);
  box-shadow: 0 4px 12px -4px rgba(63, 127, 217, 0.7);
}

/* ---------- Sheets ---------- */
.sheet__panel {
  max-height: 92dvh;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px calc(16px + env(safe-area-inset-bottom, 0px));
  gap: 12px;
  will-change: transform;
}
.sheet__panel--tall {
  max-height: 96dvh;
}
.sheet__panel::before {
  display: none;
}
.sheet__head::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  width: 38px;
  height: 4px;
  margin-left: -19px;
  border-radius: 3px;
  background: var(--line);
}
/* the title row stays put while the card scrolls */
.sheet__head {
  position: sticky;
  top: 0;
  z-index: 2;
  margin-inline: -16px;
  padding: 14px 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.sheet__titles {
  min-width: 0;
}
.sheet__title {
  font-size: 1.15rem;
  line-height: 1.2;
}
.sheet__sub {
  font-size: 0.8rem;
  color: var(--muted);
}
.sheet__tools {
  gap: 6px;
}
.sheet__close,
.star {
  width: 34px;
  height: 34px;
}
/* actions stay reachable at the bottom of long cards */
.sheet__panel .entry__actions {
  position: sticky;
  bottom: calc(-16px - env(safe-area-inset-bottom, 0px));
  z-index: 2;
  margin-inline: -16px;
  margin-bottom: calc(-16px - env(safe-area-inset-bottom, 0px));
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, transparent, var(--bg) 28%);
  gap: 8px;
}
.sheet__panel .entry__actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
}
.sheet__panel .entry__actions .btn--primary {
  flex: 1;
}
.sheet__panel .entry__actions .btn .icon {
  width: 17px;
  height: 17px;
}
.sheet--confirm .sheet__panel .entry__actions {
  position: static;
  margin: 0;
  padding: 0;
  background: none;
}

/* slide up + fade in */
.sheet.is-entering .sheet__panel {
  animation: sheet-up 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.sheet.is-entering .sheet__backdrop {
  animation: sheet-fade 0.25s ease both;
}
@keyframes sheet-up {
  from { transform: translateY(40px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}
@keyframes sheet-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .sheet.is-entering .sheet__panel,
  .sheet.is-entering .sheet__backdrop {
    animation: none;
  }
}
.sheet__backdrop {
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

/* compact fields inside cards */
.sheet__panel .field__label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.sheet__panel .field__input {
  border-radius: 12px;
  border-color: var(--hairline);
  background: var(--surface);
}
.qty {
  padding: 8px 10px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--hairline);
}
.qty__btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

/* meal picker: icon over a tiny word */
.meals {
  gap: 6px;
}
.meals__opt {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 8px 2px 6px;
  border-color: var(--hairline);
  background: var(--surface);
  color: var(--muted);
  box-shadow: var(--elev-1);
}
.meals__opt .icon {
  width: 20px;
  height: 20px;
}
.meals__word {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.meals__opt[data-meal="breakfast"].is-active,
.meals__opt[data-k-mealval="breakfast"].is-active { background: linear-gradient(180deg, #ffa264, #f0742a); border-color: transparent; color: #fff; }
.meals__opt[data-meal="lunch"].is-active,
.meals__opt[data-k-mealval="lunch"].is-active { background: linear-gradient(180deg, #ffeb9e, #f7cf45); border-color: transparent; color: #4a3a00; }
.meals__opt[data-meal="dinner"].is-active,
.meals__opt[data-k-mealval="dinner"].is-active { background: linear-gradient(180deg, #6b9ee6, #2f6cc4); border-color: transparent; color: #fff; }
.meals__opt[data-meal="snack"].is-active,
.meals__opt[data-k-mealval="snack"].is-active { background: linear-gradient(180deg, #a07ad8, #7647b8); border-color: transparent; color: #fff; }

/* parts list and cook lines read as one grouped card */
.parts,
.cook-lines {
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--hairline);
}
.cook-line + .cook-line {
  padding-top: 10px;
  border-top: 1px solid var(--hairline);
}
.entry__preview {
  font-size: 0.85rem;
  color: var(--muted);
}
/* small confirm cards: no sticky bar, comfortable padding */
.sheet--confirm .sheet__panel {
  padding: 22px 18px calc(18px + env(safe-area-inset-bottom, 0px));
}
.sheet__head {
  position: sticky;
}
html {
  overflow-x: clip;
}

/* ---------- v27: breathing room under the header, centered icons, swipeable day card ---------- */
.topbar {
  margin-bottom: 8px;
}
.view {
  scroll-margin-top: 70px;
}
/* every icon sits dead-center in its box */
[data-icon],
.btn__icon,
.tabbar__icon,
.fab__icon,
.search__icon {
  display: inline-grid;
  place-items: center;
  line-height: 0;
}
.icon {
  display: block;
}
.btn__icon {
  vertical-align: middle;
  margin-right: 0;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.icon-btn,
.chip--icon,
.scan-btn,
.sheet__close,
.star,
.qty__btn,
.datenav__btn,
.section-head__action,
.export__icon,
.lightbox__close,
.mini-btn,
.food-group__edit,
.k-row__more,
.check {
  display: inline-grid;
  place-items: center;
  line-height: 0;
}
.icon-btn > *,
.segmented__opt > *,
.chip--icon > * {
  display: grid;
  place-items: center;
}
.section-head__tools {
  align-items: center;
}
#view-today .summary {
  touch-action: pan-y;
  will-change: transform;
}



/* Not on today: Tangerine outline, a little dot that breathes, and the label in Tangerine.
   Tapping the label jumps back to today. */
.datenav {
  position: relative;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}
.datenav.is-away {
  border-color: transparent;
  box-shadow: 0 0 0 2px var(--tang), 0 6px 16px -8px rgba(255, 138, 61, 0.7);
  background: var(--tang-soft);
}
.datenav.is-away .datenav__label {
  color: var(--tang-text);
  font-weight: 700;
}
.datenav.is-away::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -3px;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--tang);
  box-shadow: 0 0 0 2px var(--bg);
  animation: away-dot 1.6s ease-in-out infinite;
}
@keyframes away-dot {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.25) rotate(45deg); }
}
@media (prefers-reduced-motion: reduce) {
  .datenav.is-away::after { animation: none; }
}

/* ---------- v30: nutrition as icons ---------- */
/* one color per macro, same everywhere */
[data-macro="protein_g"] { --m: var(--accent); --m-soft: var(--accent-soft); --m-text: var(--accent-text); }
[data-macro="calories"] { --m: var(--grape); --m-soft: var(--grape-soft); --m-text: var(--grape-text); }
[data-macro="fat_g"] { --m: var(--tang); --m-soft: var(--tang-soft); --m-text: var(--tang-text); }
[data-macro="carbs_g"] { --m: #e2b316; --m-soft: var(--lemon-soft); --m-text: var(--lemon-text); }

.mstrip {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: 6px;
  width: 100%;
}
.mstrip__cell {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  min-width: 0;
  padding: 8px 4px;
  border-radius: 12px;
  background: var(--m-soft);
  color: var(--m-text);
}
.mstrip__cell .icon {
  width: 17px;
  height: 17px;
  color: var(--m);
}
.mstrip__num {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.mstrip__num small,
.hichip small {
  font-size: 0.7em;
  font-weight: 600;
  margin-left: 1px;
  color: var(--muted);
}
.mstrip__note {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--m-text);
  opacity: 0.85;
  white-space: nowrap;
}
.mstrip--lg .mstrip__cell { padding: 10px 4px; }
.mstrip--lg .mstrip__cell .icon { width: 20px; height: 20px; }
.mstrip--lg .mstrip__num { font-size: 1.1rem; }
.mstrip--sm { gap: 4px; }
.mstrip--sm .mstrip__cell { padding: 4px 2px; border-radius: 8px; grid-auto-flow: column; gap: 3px; }
.mstrip--sm .mstrip__cell .icon { width: 13px; height: 13px; }
.mstrip--sm .mstrip__num { font-size: 0.75rem; }
.mstrip__cell.is-main {
  box-shadow: inset 0 0 0 1.5px var(--m);
}

/* the summary's other three numbers are just this strip now */
#macros {
  display: block;
}
#macros .mstrip__cell {
  border: 0;
}

.hichip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 8px;
  background: var(--m-soft);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
}
.hichip .icon {
  width: 14px;
  height: 14px;
  color: var(--m);
}

.food-row__meta,
.recipe-card__nutrition,
.entry__preview {
  display: grid;
  gap: 6px;
}
.recipe-tile__macro {
  display: block;
  margin-top: 4px;
}

/* entry card */
.entry-card__facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}
.meal-badge,
.meal-group__name {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
}
.meal-badge {
  padding: 4px 9px 4px 7px;
  border-radius: 9px;
  color: #fff;
  font-size: 0.8rem;
}
.meal-badge .icon,
.meal-group__name .icon {
  width: 15px;
  height: 15px;
}
.meal-badge[data-meal-badge="breakfast"] { background: linear-gradient(180deg, #ffa264, #f0742a); }
.meal-badge[data-meal-badge="lunch"] { background: linear-gradient(180deg, #ffeb9e, #f7cf45); color: #4a3a00; }
.meal-badge[data-meal-badge="dinner"] { background: linear-gradient(180deg, #6b9ee6, #2f6cc4); }
.meal-badge[data-meal-badge="snack"] { background: linear-gradient(180deg, #a07ad8, #7647b8); }
.meal-group__name[data-meal-badge="breakfast"] .icon { color: var(--tang); }
.meal-group__name[data-meal-badge="lunch"] .icon { color: #e2b316; }
.meal-group__name[data-meal-badge="dinner"] .icon { color: var(--sky); }
.meal-group__name[data-meal-badge="snack"] .icon { color: var(--grape); }

.icon-btn--danger {
  color: var(--danger);
}
.sheet__panel .entry__actions .icon-btn {
  width: 42px;
  height: 42px;
}
#entry-edit .icon {
  width: 17px;
  height: 17px;
}

/* ======================= v31: review pass 1 ======================= */

/* Nutrition names: always shown on the Today summary (where you learn them), and on every strip for a
   few seconds after you tap one. No text-selection when tapping. */
.mstrip { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; cursor: pointer; }
.mstrip__word {
  display: none;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--m-text);
}
#macros .mstrip__word,
.show-macro-names .mstrip__word { display: block; }
.show-macro-names .mstrip--sm .mstrip__word { display: none; }

/* spacing between the nutrition row and whatever follows */
.food-row__meta { margin-bottom: 4px; }
.food-row__note {
  margin-top: 2px;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}
.entry__food {
  display: grid;
  gap: 12px;
}

/* Action tiles: icon over a short word, roomy, never scrunched */
.acts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.act {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 5px;
  min-width: 60px;
  min-height: 56px;
  padding: 9px 8px 8px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--elev-1);
  font: inherit;
  transition: transform 0.12s var(--ease), background-color 0.2s ease;
}
.act .icon { width: 19px; height: 19px; color: var(--grape-text); }
.act span {
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  color: var(--muted);
}
.act:active { transform: scale(0.96); background: var(--surface-2); }
.act--wide { min-height: 58px; }
.sheet__panel .entry__actions {
  align-items: stretch;
}
.sheet__panel .entry__actions .act { flex: none; }
.sheet__panel .entry__actions .btn--primary {
  min-height: 56px;
  font-size: 1rem;
}

/* Cook list: short recipes are dimmer but still readable */
.cook-row.is-short .k-row__tap { opacity: 0.72; filter: grayscale(0.45); }
.check { border-radius: 8px; }
.check--off { border-style: dashed; opacity: 0.6; }

/* small buttons get real padding */
.mini-btn {
  padding: 6px 10px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: var(--elev-1);
}
.cook-line__btns { gap: 6px; margin-top: 6px; }
.exp-pick__quick { gap: 6px; }

/* explanations are quiet: smaller, softer, out of the way */
.hint {
  font-size: 0.76rem;
  line-height: 1.45;
  opacity: 0.8;
}

/* group headings: one marker, not two */
.food-group__title > span:first-child::before { display: none; }

/* protein ring glow is never clipped */
.ring, .ring__svg { overflow: visible; }
.summary { overflow: visible; }
.summary { isolation: isolate; }
.ring__fill { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 45%, transparent)); }

/* quick-add field and its button line up */
.k-quickadd .btn { min-height: 44px; }
/* pass 2 */
.hichip, .hichip * { text-transform: none; letter-spacing: 0; }
.meal-group__head { align-items: center; }
.sheet__panel .entry__actions { background: linear-gradient(180deg, transparent, var(--bg) 22%); padding-top: 18px; }
/* the day card flies off-screen when you swipe days; never let that widen the page */
.main { overflow-x: clip; }
body { overflow-x: clip; }

/* ---------- v32: nutrition confidence (label / close / guess) ---------- */
.segmented--four { grid-template-columns: repeat(4, 1fr); }
.display-pick__opts--three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.conf-badge {
  display: inline-flex; vertical-align: -2px; margin-left: 5px;
  color: var(--tang-text, #B5531A);
}
.conf-badge .icon { width: 14px; height: 14px; }

.conf {
  margin: 10px 0 2px; border-radius: 14px;
  background: var(--c-soft); color: var(--c-text);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-text) 14%, transparent);
}
.conf > summary {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  list-style: none; cursor: pointer; font-size: 0.86rem;
}
.conf > summary::-webkit-details-marker { display: none; }
.conf > summary b { font-weight: 700; flex: 1; }
.conf > summary .icon { width: 18px; height: 18px; color: var(--c-icon, var(--c-text)); }
.conf > summary .icon:last-child { width: 16px; height: 16px; opacity: 0.6; transition: transform 0.2s var(--ease); }
.conf[open] > summary .icon:last-child { transform: rotate(180deg); }
.conf__more { display: grid; gap: 8px; padding: 0 12px 10px; }
.conf__note { margin: 0; font-size: 0.8rem; color: color-mix(in srgb, var(--c-text) 78%, var(--muted)); }
.conf__parts { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.conf__part {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  border: 0; border-radius: 10px; background: var(--surface, #fff); color: var(--ink, inherit);
  font: 500 0.84rem/1.2 var(--font-body, inherit); text-align: left;
}
.conf__part .icon { width: 16px; height: 16px; color: var(--c-icon); flex: none; }
.conf__part span:nth-child(2) { flex: 1; }
.conf__tag { font-size: 0.7rem; font-weight: 700; color: var(--muted); }
.conf .conf__snap {
  justify-self: start; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px;
  border: 0; border-radius: 11px; background: var(--surface, #fff); color: var(--c-text);
  font: 700 0.78rem/1 var(--font-body, inherit);
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 10px -6px color-mix(in srgb, var(--c-text) 40%, transparent);
}
.conf .conf__snap .icon { width: 16px; height: 16px; }
.conf-badge--close { color: var(--sky-text); }
.conf--guess { --c-soft: var(--tang-soft); --c-text: var(--tang-text); --c-icon: var(--tang); }
.conf--close { --c-soft: var(--sky-soft); --c-text: var(--sky-text); --c-icon: var(--sky); }
.conf--wait  { --c-soft: var(--grape-soft); --c-text: var(--grape-text); --c-icon: var(--grape); }
.conf--label { --c-soft: color-mix(in srgb, var(--accent) 9%, var(--surface, #fff)); --c-text: var(--accent-text); --c-icon: var(--accent); }
.part__name .conf-badge { white-space: nowrap; }

.conf-pick { display: grid; justify-items: center; gap: 4px; padding: 9px 4px; }
.conf-pick .icon { width: 20px; height: 20px; }
.conf-pick--label.is-active { --pick: var(--accent); }
.conf-pick--close.is-active { --pick: var(--sky); }
.conf-pick--guess.is-active { --pick: var(--tang); }
.conf-pick.is-active { background: color-mix(in srgb, var(--pick) 14%, var(--surface, #fff)); color: var(--pick); box-shadow: inset 0 0 0 1.5px var(--pick); }

/* ---------- Staples (v24): level meters, the weekly check, Almost out tag ---------- */

.level {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}
.level i {
  width: 5px;
  height: 100%;
  border-radius: 2px;
  background: var(--track);
}
.level--ok i.on { background: var(--accent); }
.level--low i.on { background: var(--heads-up); }
.level--out i.on { background: var(--danger); }
.level--sliver i.on { height: 40%; }

.staples .food-group__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.staples__tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.staple-row__level {
  display: grid;
  justify-items: end;
  gap: 3px;
  flex: none;
}
.staple-row__word {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
}
.staple-row__word.is-low { color: var(--tang-text); }

.staple-due {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
  color: inherit;
  font: inherit;
}

.level-pick {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  margin-top: 6px;
}
.level-pick .meals__opt {
  padding: 7px 0 5px;
}
.level-pick .meals__opt.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-text);
}
.level-pick .meals__opt.is-active .level i:not(.on) { background: color-mix(in srgb, var(--accent) 20%, transparent); }

.day-pick {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin-top: 6px;
}
.day-pick .meals__opt { padding: 8px 0; }
.day-pick .meals__opt.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.staple-check {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.staple-check__item {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  box-shadow: var(--elev-1);
  padding: 10px 12px;
}
.staple-check__head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.qty--compact { margin-top: 8px; }

.k-tag {
  display: inline-block;
  vertical-align: 1px;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.k-tag--urgent {
  background: var(--tang-soft);
  color: var(--tang-text);
}

/* Staples sheet and rows (v24.1) */
.staple-row {
  border-radius: 16px;
  box-shadow: var(--elev-1);
  color: inherit;
  font: inherit;
}
.staple-row:active { background: var(--surface-2); }

.staple-sheet {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.staple-sheet__card {
  gap: 10px;
  padding: 12px;
  border-color: var(--hairline);
  box-shadow: var(--elev-1);
}
.staple-sheet__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grape-text);
}
.staple-sheet__title .icon {
  width: 16px;
  height: 16px;
}
.staple-sheet__title .chip__count { margin-left: auto; }
.staple-sheet .day-pick { margin-top: 0; }
.staple-sheet .hint { margin: 0; }

.staple-sheet__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.staple-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: var(--surface-2);
  color: inherit;
  font: inherit;
  text-align: left;
  transition: background-color 0.15s ease;
}
.staple-item:active { background: var(--accent-soft); }
.staple-item__edit {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--muted);
}
.staple-item__edit .icon {
  width: 16px;
  height: 16px;
}

.staple-sheet__add .search { margin: 0; }
.staple-sheet__add .food-list { margin: 0; }
.staple-sheet__add .pick-row { background: var(--surface-2); border-color: var(--hairline); }
.staple-sheet__add .pick-row__protein { display: none; }
.staple-sheet__add .link-row { margin: 0; }

/* ---------- Toasts v2 (10/18): full-width card above the dock ---------- */
.toast {
  left: 12px;
  right: 12px;
  transform: none;
  max-width: 520px;
  margin-inline: auto;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 22px);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 10px;
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--hairline);
  box-shadow: var(--elev-2);
  font-weight: 500;
  font-size: 0.92rem;
  overflow: hidden;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  cursor: default;
  --t-ic: var(--accent);
  --t-ic-soft: var(--accent-soft);
}
.toast[data-kind="delete"] { --t-ic: var(--danger); --t-ic-soft: color-mix(in srgb, var(--danger) 14%, var(--surface)); }
.toast[data-kind="warn"] { --t-ic: var(--tang-text); --t-ic-soft: var(--tang-soft); }
.toast.is-in { animation: toast-in 0.26s var(--ease) both; }
.toast.is-out { animation: toast-out 0.18s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px); } }

.toast__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--t-ic-soft);
  color: var(--t-ic);
}
.toast__icon .icon { width: 19px; height: 19px; stroke-width: 2.4; }
.toast__body {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 1px;
}
.toast__text {
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.toast__sub {
  font-size: 0.8rem;
  line-height: 1.3;
  color: var(--muted);
}
.toast__action {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  line-height: 1;
}
.toast__action .icon { width: 16px; height: 16px; }
.toast__action:active { transform: scale(0.97); }
.toast__bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: var(--t-ic);
  opacity: 0.55;
  transform-origin: left center;
  display: none;
}
.toast.has-undo .toast__bar { display: block; }
.toast.has-undo.is-in .toast__bar { animation: toast-bar var(--toast-ms, 6000ms) linear both; }
@keyframes toast-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.toast { position: fixed; }

/* The add button steps aside while a toast is up, so nothing overlaps. */
.app:has(~ .toast:not([hidden])) .fab,
body:has(.toast:not([hidden])) .fab { opacity: 0; pointer-events: none; transition: opacity 0.15s ease; }

@media (prefers-reduced-motion: reduce) {
  .toast.is-in, .toast.is-out { animation: none; }
  .toast.has-undo.is-in .toast__bar { animation: none; display: none; }
}
/* toast surface: lifted in dark so it never melts into the cards */
:root { --toast-bg: #ffffff; --toast-edge: rgba(22, 36, 29, 0.08); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --toast-bg: #29443a; --toast-edge: rgba(234, 246, 239, 0.14); }
}
:root[data-theme="dark"] { --toast-bg: #29443a; --toast-edge: rgba(234, 246, 239, 0.14); }
.toast {
  background: var(--toast-bg);
  border-color: var(--toast-edge);
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 10px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08), 0 18px 40px -12px rgba(0, 0, 0, 0.45);
}

/* ---------- Profile: username, photo actions, crop (10/18) ---------- */
.me-handle {
  margin: 0;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--grape-text);
}
.me-photo-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.mini-btn--quiet { color: var(--muted); }
.handle-field {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
}
.handle-field__at {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-weight: 700;
  pointer-events: none;
}
.handle-field__input { padding-left: 28px; width: 100%; }
.hint.is-error { color: var(--tang-text); }

.crop {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 4px 0 8px;
}
.crop__stage {
  position: relative;
  width: min(300px, 78vw);
  aspect-ratio: 1;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface-2);
  touch-action: none;
  cursor: grab;
  user-select: none;
}
.crop__stage:active { cursor: grabbing; }
.crop__canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.crop__mask {
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* dim everything outside the circle, then a thin ring on the circle itself */
  background: radial-gradient(circle closest-side at center, transparent 0 calc(100% - 0.5px), rgba(17, 28, 23, 0.6) 100%);
  box-shadow: inset 0 0 0 1px var(--hairline);
}
.crop__mask::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85);
}
.crop__zoom {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(300px, 78vw);
  color: var(--muted);
}
.crop__zoom input { flex: 1; accent-color: var(--accent); }
.crop__zoom-icon { display: grid; place-items: center; }
.crop__zoom-icon .icon { width: 14px; height: 14px; }
.crop__zoom-icon--big .icon { width: 20px; height: 20px; }

/* Meal totals on Today: no chip background, so they stand apart from the line items (Taylor, 10/18) */
.meal-group__protein .hichip {
  background: none;
  padding: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--m-text);
}
.meal-group__protein .hichip .icon { width: 16px; height: 16px; }

/* ---------- Goal hit: gold + real sparkles (10/18) ---------- */
.ring { position: relative; }
.ring.is-goal .ring__fill {
  stroke: url(#ring-gold);
  filter: drop-shadow(0 0 10px rgba(247, 207, 69, 0.55)) drop-shadow(0 4px 8px rgba(226, 165, 15, 0.35));
}
.ring.is-goal .ring__value { color: #b8860b; }
.ring__sparkles { position: absolute; inset: 0; pointer-events: none; display: none; }
.ring.is-goal .ring__sparkles { display: block; }
.ring__sparkles span {
  position: absolute;
  transform: translate(-50%, -50%) scale(0);
  animation: twinkle 2.4s ease-in-out infinite;
}
.sparkle { width: 100%; height: 100%; display: block; fill: #f7cf45; filter: drop-shadow(0 0 4px rgba(255, 226, 122, 0.9)); }
@keyframes twinkle {
  0%, 100% { transform: translate(-50%, -50%) scale(0) rotate(0deg); opacity: 0; }
  20% { opacity: 1; }
  45% { transform: translate(-50%, -50%) scale(1) rotate(20deg); opacity: 1; }
  70% { transform: translate(-50%, -50%) scale(0.35) rotate(35deg); opacity: 0.6; }
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ring.is-goal .ring__value { color: #ffe27a; } }
:root[data-theme="dark"] .ring.is-goal .ring__value { color: #ffe27a; }

/* Any other goal you've hit: its card turns gold with a little sparkle in the corner */
.mstrip__cell.is-hit {
  position: relative;
  --m: #e2a50f;
  --m-text: #8a6a00;
  background: linear-gradient(160deg, #fff6d1, #ffe9a8);
  box-shadow: inset 0 0 0 1.5px #f7cf45, 0 4px 14px -6px rgba(226, 165, 15, 0.55);
}
.mstrip__cell.is-hit .mstrip__note { color: #8a6a00; opacity: 1; font-weight: 800; }
.mstrip__cell.is-hit::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 6px;
  width: 12px;
  height: 12px;
  background: #e2a50f;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z'/%3E%3C/svg%3E") center / contain no-repeat;
  animation: twinkle-small 2.6s ease-in-out infinite;
}
@keyframes twinkle-small { 0%, 100% { transform: scale(0.6); opacity: 0.6; } 50% { transform: scale(1.1) rotate(18deg); opacity: 1; } }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mstrip__cell.is-hit { background: linear-gradient(160deg, #3d3416, #4a3d12); --m-text: #ffe27a; box-shadow: inset 0 0 0 1.5px rgba(247, 207, 69, 0.7), 0 4px 14px -6px rgba(226, 165, 15, 0.5); }
  :root:not([data-theme="light"]) .mstrip__cell.is-hit .mstrip__note { color: #ffe27a; }
}
:root[data-theme="dark"] .mstrip__cell.is-hit { background: linear-gradient(160deg, #3d3416, #4a3d12); --m-text: #ffe27a; }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 60; }
@media (prefers-reduced-motion: reduce) {
  .ring__sparkles span { animation: none; transform: translate(-50%, -50%) scale(0.8); opacity: 1; }
  .mstrip__cell.is-hit::after { animation: none; }
}

/* Profile card: name + username together, compact */
.profile-form { display: grid; gap: 8px; }
.profile-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.profile-row__label { font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.profile-row .field__input { padding-block: 9px; }
.profile-form__foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 2px;
}
.profile-form__foot .hint { flex: 1; margin: 0; font-size: 0.78rem; }

/* Avatar actions sheet */
.avatar-actions { display: grid; gap: 8px; margin-top: 10px; }
.avatar-action {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-align: left;
}
.avatar-action__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  color: var(--accent-text);
}
.avatar-action__icon .icon { width: 18px; height: 18px; }
.avatar-action--danger { color: var(--danger); }
.avatar-action--danger .avatar-action__icon { background: color-mix(in srgb, var(--danger) 14%, var(--surface)); color: var(--danger); }
.me-head__avatar { cursor: pointer; }

/* ---------- Last 7 days strip (Today) ---------- */
.week-strip {
  margin: 0 0 12px;
  padding: 6px 4px 0;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  box-shadow: var(--elev-1);
}
.week-strip__day {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 4px 0 5px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font: inherit;
}
.week-strip__day.is-sel { background: var(--accent-soft); }
.week-strip__dow { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.04em; color: var(--muted); text-transform: uppercase; }
.week-strip__day.is-today .week-strip__dow { color: var(--accent-text); }
.mring { position: relative; display: grid; place-items: center; width: 38px; height: 38px; }
.mring__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.mring__track { fill: none; stroke: var(--track); stroke-width: 3.4; }
.mring__fill { fill: none; stroke-width: 3.4; stroke-linecap: round; }
.mring__num { position: relative; font-weight: 700; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.week-strip__day.is-none .mring__num { color: var(--muted); opacity: 0.6; }
.week-strip__day.is-hit .mring__num { color: #b8860b; }
.week-strip__day.is-hit .mring__svg { filter: drop-shadow(0 0 4px rgba(247, 207, 69, 0.6)); }
/* the sparkle sits ON the ring, at about 1:30 */
.mring__spark { position: absolute; width: 13px; height: 13px; top: -1px; right: -1px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .week-strip__day.is-hit .mring__num { color: #ffe27a; } }
:root[data-theme="dark"] .week-strip__day.is-hit .mring__num { color: #ffe27a; }

/* ---------- Month tiles (Reports) ---------- */
.month-card__head { display: flex; align-items: center; justify-content: space-between; }
.month-card__nav { display: flex; gap: 6px; }
.month-card__nav .icon-btn { width: 32px; height: 32px; }
.month-card__nav .icon-btn:disabled { opacity: 0.35; }
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}
.month-grid--dow span { text-align: center; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.06em; color: var(--muted); }
.mtile {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}
.mtile.is-blank { visibility: hidden; }
.mtile.is-future { opacity: 0.35; }
.mtile.is-none { box-shadow: inset 0 0 0 1px var(--hairline); }
.mtile.is-logged { background: var(--surface-2); color: var(--ink); }
.mtile.is-low { background: var(--grape-soft); color: var(--grape-text); }
.mtile.is-half { background: var(--accent-soft); color: var(--accent-text); }
/* gold: a real gold tile, dark text, glow, and the sparkle sitting on its top-right corner */
.mtile.is-hit {
  background: linear-gradient(150deg, #ffeb9e 0%, #f7cf45 55%, #e8b020 100%);
  color: #4a3a00;
  box-shadow: 0 0 0 1.5px #e2a50f inset, 0 4px 12px -4px rgba(226, 165, 15, 0.7);
}
.mtile__spark {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 15px;
  height: 15px;
  fill: #fff6d1;
  filter: drop-shadow(0 0 2px #e2a50f) drop-shadow(0 0 4px rgba(247, 207, 69, 0.9));
}
.mtile.is-today::after { content: ""; position: absolute; bottom: 3px; width: 12px; height: 2px; border-radius: 2px; background: currentColor; opacity: 0.7; }
.month-card__foot { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.month-key { display: inline-flex; align-items: center; gap: 5px; font-size: 0.72rem; font-weight: 600; color: var(--muted); }
.month-key i { width: 10px; height: 10px; border-radius: 3px; }
.month-key i.is-low { background: var(--grape); }
.month-key i.is-half { background: var(--accent); }
.month-key i.is-hit { background: linear-gradient(150deg, #ffeb9e, #e8b020); }
.month-card .hint { margin: 0; text-align: center; }

/* ---------- Profile hints ---------- */
.profile-row__hint { margin: -2px 0 2px 88px; font-size: 0.74rem; color: var(--muted); line-height: 1.3; }
.profile-row__hint.is-error { color: var(--tang-text); }
.profile-form__foot { justify-content: flex-end; }

.week-strip__row,
.week-strip__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}
.week-strip__grid { row-gap: 2px; }
.week-strip__grid--dow span { text-align: center; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.06em; color: var(--muted); padding-bottom: 2px; }
.week-strip__grid .week-strip__day { padding: 2px 0; }
.week-strip__blank { visibility: hidden; }
.week-strip__future { display: grid; place-items: center; height: 42px; font-size: 0.82rem; font-weight: 700; color: var(--muted); opacity: 0.35; }
.week-strip__month { padding: 4px 6px 0; }
.week-strip.is-animating .week-strip__month { animation: strip-open 0.22s var(--ease) both; }
.week-strip__mhead { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 6px; }
.week-strip__title { margin: 0; font: 800 1rem var(--font-display); letter-spacing: -0.02em; }
@keyframes strip-open { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.week-strip__grab {
  display: grid;
  place-items: center;
  width: 100%;
  height: 18px;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.week-strip__grab span { width: 34px; height: 4px; border-radius: 3px; background: var(--line); }
.week-strip.is-open .week-strip__grab span { background: var(--muted); opacity: 0.5; }
@media (prefers-reduced-motion: reduce) { .week-strip__month { animation: none; } }

/* ---------- "At most" goals (10/18) ---------- */
.ring.is-near .ring__fill { stroke: url(#ring-near); }
.ring__overflow { fill: none; stroke: var(--danger); stroke-linecap: round; opacity: 0.95; }
.goal-badge { margin: 0; display: flex; justify-content: center; }
.goal-badge[hidden] { display: none; }
.goal-badge__inner { display: inline-flex; align-items: center; gap: 6px; border-radius: 9px; padding: 5px 10px; font-size: 0.78rem; font-weight: 700; }
.goal-badge__inner.is-near { background: var(--tang-soft); color: var(--tang-text); }
.goal-badge__inner.is-gold { background: linear-gradient(150deg, #fff6d1, #ffe9a8); color: #8a6a00; box-shadow: inset 0 0 0 1px #f7cf45; }
.summary__status small { display: block; font-weight: 500; font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.close-out { justify-self: center; align-self: center; }
.close-out[hidden] { display: none; }
.mstrip__cell.is-near { --m-text: var(--tang-text); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--tang) 55%, transparent); }
.mstrip__cell.is-overgoal .mstrip__note { color: var(--danger); opacity: 1; font-weight: 800; }
.yesterday-win {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(150deg, #fff6d1, #ffe9a8);
  border: 1px solid #f7cf45;
  box-shadow: 0 6px 18px -10px rgba(226, 165, 15, 0.7);
}
.yesterday-win[hidden] { display: none; }
.yesterday-win__text b { display: block; color: #6b5200; font-size: 0.9rem; }
.yesterday-win__text span { color: #8a6a00; font-size: 0.78rem; }
.mring--sm { flex: none; width: 34px; height: 34px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .goal-badge__inner.is-gold,
  :root:not([data-theme="light"]) .yesterday-win { background: linear-gradient(150deg, #3d3416, #4a3d12); border-color: rgba(247, 207, 69, 0.55); color: #ffe27a; }
  :root:not([data-theme="light"]) .yesterday-win__text b { color: #ffe27a; }
  :root:not([data-theme="light"]) .yesterday-win__text span { color: #e8d9a0; }
}
:root[data-theme="dark"] .goal-badge__inner.is-gold,
:root[data-theme="dark"] .yesterday-win { background: linear-gradient(150deg, #3d3416, #4a3d12); border-color: rgba(247, 207, 69, 0.55); color: #ffe27a; }
:root[data-theme="dark"] .yesterday-win__text b { color: #ffe27a; }
:root[data-theme="dark"] .yesterday-win__text span { color: #e8d9a0; }

/* Chart: no focus box or tap flash when you press a bar; the highlighted bar and the tip show where you are */
.chart__svg,
.chart__svg:focus,
.chart__svg:focus-visible {
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.chart { -webkit-tap-highlight-color: transparent; }

/* ---------- Spot picker: icon strip, label only on the selected one (10/18) ---------- */
.loc-strip {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px;
}
.loc-strip::-webkit-scrollbar { display: none; }
.loc-strip__opt {
  flex: 1 0 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: var(--elev-1);
  transition: flex-grow 0.22s var(--ease), background-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.loc-strip__opt .icon { width: 20px; height: 20px; flex: none; }
.loc-strip__word { display: none; }
.loc-strip__opt.is-active {
  flex: 2.4 0 auto;
  background: linear-gradient(180deg, #a07ad8, #7647b8);
  border-color: transparent;
  color: #fff;
}
.loc-strip__opt.is-active .loc-strip__word { display: inline; }
@media (prefers-reduced-motion: reduce) { .loc-strip__opt { transition: none; } }

/* Spots editor: an icon per spot, tap it to pick from the set */
.spots__row--icon { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.spots__icon {
  display: grid; place-items: center; width: 42px; height: 42px; flex: none;
  border: 1px solid var(--hairline); border-radius: 12px;
  background: var(--grape-soft); color: var(--grape-text);
}
.spots__icon .icon { width: 20px; height: 20px; }
.spots__icon.is-open { box-shadow: 0 0 0 2px var(--grape); }
.icon-pick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 6px;
  padding: 8px;
  margin: 2px 0 8px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
}
.icon-pick__opt {
  display: grid; place-items: center; aspect-ratio: 1;
  border: 0; border-radius: 10px; background: transparent; color: var(--muted);
}
.icon-pick__opt .icon { width: 21px; height: 21px; }
.icon-pick__opt.is-active { background: linear-gradient(180deg, #a07ad8, #7647b8); color: #fff; }
.chip--loc { display: inline-flex; align-items: center; gap: 5px; }
.chip--loc .icon { width: 15px; height: 15px; }
.loc-title { display: inline-flex; align-items: center; gap: 6px; }
.loc-title .icon { width: 14px; height: 14px; }

/* Icon gallery (spots) */
.icon-pick { display: grid; gap: 8px; grid-template-columns: none; padding: 10px; }
.icon-pick__tabs { display: flex; gap: 4px; background: var(--surface); border-radius: 12px; padding: 4px; border: 1px solid var(--hairline); }
.icon-pick__tab { flex: 1; display: grid; place-items: center; height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); }
.icon-pick__tab .icon { width: 19px; height: 19px; }
.icon-pick__tab.is-active { background: linear-gradient(180deg, #a07ad8, #7647b8); color: #fff; }
.icon-pick__caption { margin: -2px 0 0; text-align: center; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--grape-text); }
.icon-pick__search { margin: 0; }
.icon-pick__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 4px; max-height: 236px; overflow-y: auto; }
.icon-pick__none { grid-column: 1 / -1; text-align: center; margin: 8px 0; }

/* Kitchen spots bar: All stays pinned on the left, the other spots slide under it */
.loc-bar { display: flex; align-items: center; gap: 6px; margin-right: -16px; }
.loc-bar__all { flex: none; position: relative; z-index: 1; }
.loc-bar__scroll { position: relative; flex: 1; min-width: 0; margin-inline: 0; padding: 2px 16px 4px 10px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 16px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 16px), transparent); }
.loc-bar__all::after { content: ""; position: absolute; right: -4px; top: 6px; bottom: 6px; width: 1px; background: var(--hairline); }

/* ---------- v40: staples fold, "You're out", don't-rebuy (10/19) ---------- */
.staples-fold {
  margin: 4px 0 14px; border-radius: 16px;
  background: var(--surface, #fff); box-shadow: var(--elev-1);
}
.staples-fold > summary {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  list-style: none; cursor: pointer;
}
.staples-fold > summary::-webkit-details-marker { display: none; }
.staples-fold > summary .icon { width: 20px; height: 20px; color: var(--accent); flex: none; }
.staples-fold > summary .icon:last-child { width: 18px; height: 18px; color: var(--muted); transition: transform 0.2s var(--ease); }
.staples-fold[open] > summary .icon:last-child { transform: rotate(180deg); }
.staples-fold__main { flex: 1; display: grid; gap: 1px; }
.staples-fold__main b { font-weight: 700; }
.staples-fold__body { display: grid; gap: 8px; padding: 0 10px 12px; }
.staples-fold__body .staples__tools { justify-content: flex-end; padding: 0 4px 2px; }

.k-tag--out {
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  color: var(--danger);
}
.from--why { color: var(--ink, inherit); opacity: 0.78; }
.staple-row.is-norebuy .k-row__name { color: var(--muted); }
.staple-rebuy { margin: 6px 0 2px; }
.staple-rebuy .toggle__text { display: grid; gap: 2px; }

/* ---------- v41: staples row, toss choice, waste nudge, keep-days (10/19) ---------- */
.staples-row {
  display: flex; align-items: center; gap: 10px;
  margin: 4px 0 14px; padding: 10px 12px; border-radius: 16px;
  background: var(--surface, #fff); box-shadow: var(--elev-1);
}
.staples-row.is-due { box-shadow: var(--elev-1), inset 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent); }
.staples-row__icon { display: inline-flex; color: var(--accent); flex: none; }
.staples-row__icon .icon { width: 22px; height: 22px; }
.staples-row .k-row__main { flex: 1; min-width: 0; }

.toss-pick { display: grid; gap: 10px; margin: 4px 0 8px; }
.toss-pick__opt {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px;
  border: 0; border-radius: 16px; background: var(--surface-2, #f4f4f4); color: inherit;
  font: inherit; text-align: left; cursor: pointer;
}
.toss-pick__opt .icon { width: 22px; height: 22px; flex: none; color: var(--muted); }
.toss-pick__opt--waste { background: color-mix(in srgb, var(--danger) 10%, var(--surface, #fff)); }
.toss-pick__opt--waste .icon { color: var(--danger); }
.toss-pick__opt:active { transform: scale(0.99); }

.today-plan--waste .plan-chip { align-items: flex-start; }

.field-row--three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.staple-check__head .chip--icon { flex: none; margin-left: auto; }

/* ---------- v42: photo manager + square crop (10/19) ---------- */
.pm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 4px 0 10px; }
.pm-item {
  position: relative; margin: 0; border-radius: 14px; overflow: hidden;
  background: var(--surface-2, #f4f4f4); box-shadow: var(--elev-1);
}
.pm-item img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.pm-item.is-main { box-shadow: var(--elev-1), 0 0 0 2px var(--accent); }
.pm-badge {
  position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: 8px;
  background: var(--accent); color: #fff; font-size: 0.72rem; font-weight: 700;
}
.pm-tools { display: flex; justify-content: space-between; gap: 4px; padding: 6px; }
.pm-btn {
  display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 8px;
  border: 0; border-radius: 10px; background: var(--surface, #fff); color: var(--ink, inherit); cursor: pointer;
  font: 700 0.75rem/1 var(--font-body, inherit);
}
.pm-btn .icon { width: 18px; height: 18px; }
.pm-btn:disabled { opacity: 0.35; cursor: default; }
.pm-btn--del { color: var(--danger); }
.pm-btn--del.is-armed { background: var(--danger); color: #fff; }
.pm-add {
  display: grid; place-content: center; justify-items: center; gap: 6px; min-height: 150px;
  border: 2px dashed var(--hairline, #ccc); border-radius: 14px; background: transparent; color: var(--muted);
  font: 700 0.85rem/1 var(--font-body, inherit); cursor: pointer;
}
.pm-add .icon { width: 26px; height: 26px; }
.crop--square .crop__mask { background: none; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.85); }
.crop--square .crop__mask::after { display: none; }
.link-row .link-btn .icon { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }

/* ---------- v43: recipe form + credit line (10/19) ---------- */
.rf .parts__title { margin-top: 14px; }
.rf-rows, .rf-steps { display: grid; gap: 10px; }
.rf-row { display: grid; gap: 6px; padding: 10px; border-radius: 14px; background: var(--surface-2, #f4f4f4); }
.rf-row__top, .rf-row__link { display: flex; align-items: center; gap: 6px; }
.rf-row__top .field__input { flex: 1; min-width: 0; }
.rf-row__dot { color: var(--accent); font-weight: 800; }
.rf-row__food { flex: 1; min-width: 0; }
.rf-row__qty { width: 76px; flex: none; }
.rf-row__unit { margin: 0 0 0 4px; }
.rf-step { display: flex; align-items: flex-start; gap: 8px; }
.rf-step__n {
  flex: none; width: 26px; height: 26px; margin-top: 8px; border-radius: 8px;
  display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 800; font-size: 0.8rem;
}
.rf-step textarea { flex: 1; min-width: 0; resize: none; }
.rf-step__tools { display: grid; gap: 4px; flex: none; }
.rf-add { margin-top: 8px; }
.recipe-card__credit { display: flex; align-items: center; gap: 6px; margin: 2px 0 10px; color: var(--muted); font-size: 0.85rem; }
.recipe-card__credit .icon { width: 15px; height: 15px; flex: none; }
.recipe-card__credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- v44: staples filter, badge, spot-by-spot check (10/19) ---------- */
.staple-badge { display: inline-flex; vertical-align: -2px; margin-left: 6px; color: var(--accent); }
.staple-badge .icon { width: 14px; height: 14px; }
.segmented--two { grid-template-columns: repeat(2, 1fr); }
.staple-check__spots { margin: 2px 0 10px; }
.staple-check__sort { margin-bottom: 6px; }
.chip__count--done { display: inline-flex; background: var(--accent); color: #fff; }
.chip__count--done .icon { width: 12px; height: 12px; }
.staple-check__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.qty__input--static { display: inline-grid; place-items: center; min-width: 34px; font-weight: 700; }
.staple-row--done { opacity: 0.85; }
.food-group__title .link-btn { margin-left: auto; font-size: 0.8rem; }
