/* Food Mood styles
   One token set drives every color, size and radius. Light values live on :root;
   dark values only redefine the same tokens. Components never use raw colors. */

:root {
  color-scheme: light;

  /* Color */
  --bg: #f4f0fa;
  --surface: #fffcff;
  --surface-2: #ebe4f5;
  --surface-3: #dfd5ee;
  --ink: #29203e;
  --muted: #62597a;
  --line: #ddd3ea;
  --field-line: #8d82a6;
  --accent: #6440cf;
  --accent-hover: #5331b7;
  --accent-ink: #4b2ca8;
  --accent-soft: #e6dcfb;
  --on-accent: #ffffff;
  --inverse: #29203e;
  --on-inverse: #f4f0fa;
  --toast-action: #d9f59a;
  --mark-bg: #29203e;
  --mark-fg: #d9f59a;
  --mood-sweet: #f8d5e6;
  --mood-savory: #ded0fc;
  --mood-spicy: #d9edac;
  --mood-any: #e1dff5;
  --backdrop: rgb(33 21 51 / 0.5);
  --tile-glow: rgb(255 255 255 / 0.45);
  --warn-bg: #fdecc8;
  --warn-ink: #6b3d00;
  --danger: #b3261e;
  --on-danger: #ffffff;
  --open: #1d7a3e;
  --open-ink: #145a2c;
  --shadow-sm: 0 1px 2px rgb(41 32 62 / 0.06), 0 4px 14px rgb(41 32 62 / 0.06);
  --shadow-md: 0 10px 28px rgb(41 32 62 / 0.12);
  --shadow-lg: 0 24px 64px rgb(33 18 44 / 0.22);

  /* Type */
  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --text-xs: 0.75rem;   /* 12px */
  --text-sm: 0.875rem;  /* 14px */
  --text-md: 1rem;      /* 16px */
  --text-lg: 1.25rem;   /* 20px */
  --text-xl: 1.75rem;   /* 28px */
  --text-2xl: clamp(2rem, 1.5rem + 2.2vw, 2.75rem);   /* 32–44px */
  --text-display: clamp(2.5rem, 1.6rem + 4vw, 3.5rem); /* 40–56px */

  /* Shape and layout */
  --radius-xs: 10px;
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-pill: 999px;
  --gutter: 20px;
  --page: 1040px;
  --tap: 44px;
}

/* Dark theme: follows the device unless Settings forces Light (data-theme="light")
   or Dark (data-theme="dark") on the root element. Both blocks hold the same values. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #14111b;
    --surface: #1e1828;
    --surface-2: #2a2337;
    --surface-3: #362d46;
    --ink: #f1ecfa;
    --muted: #aca3c0;
    --line: #382f48;
    --field-line: #74698c;
    --accent: #7d5cf0;
    --accent-hover: #8f72f4;
    --accent-ink: #cbbbff;
    --accent-soft: #2f2650;
    --on-accent: #ffffff;
    --inverse: #f1ecfa;
    --on-inverse: #14111b;
    --toast-action: #4b2ca8;
    --mark-bg: #d9f59a;
    --mark-fg: #29203e;
    --mood-sweet: #47283a;
    --mood-savory: #352a5c;
    --mood-spicy: #323f1e;
    --mood-any: #2b2946;
    --backdrop: rgb(0 0 0 / 0.6);
    --tile-glow: rgb(255 255 255 / 0.06);
    --warn-bg: #3d2a0a;
    --warn-ink: #f6d28b;
    --danger: #ff8a80;
  --on-danger: #2a0d0b;
    --on-danger: #2a0d0b;
  --open: #7ddc9a;
  --open-ink: #7ddc9a;
    --open: #7ddc9a;
    --open-ink: #7ddc9a;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.3);
    --shadow-md: 0 10px 28px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 24px 64px rgb(0 0 0 / 0.5);
  }
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #14111b;
  --surface: #1e1828;
  --surface-2: #2a2337;
  --surface-3: #362d46;
  --ink: #f1ecfa;
  --muted: #aca3c0;
  --line: #382f48;
  --field-line: #74698c;
  --accent: #7d5cf0;
  --accent-hover: #8f72f4;
  --accent-ink: #cbbbff;
  --accent-soft: #2f2650;
  --on-accent: #ffffff;
  --inverse: #f1ecfa;
  --on-inverse: #14111b;
  --toast-action: #4b2ca8;
  --mark-bg: #d9f59a;
  --mark-fg: #29203e;
  --mood-sweet: #47283a;
  --mood-savory: #352a5c;
  --mood-spicy: #323f1e;
  --mood-any: #2b2946;
  --backdrop: rgb(0 0 0 / 0.6);
  --tile-glow: rgb(255 255 255 / 0.06);
  --warn-bg: #3d2a0a;
  --warn-ink: #f6d28b;
  --danger: #ff8a80;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.3);
  --shadow-md: 0 10px 28px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 24px 64px rgb(0 0 0 / 0.5);
}

/* Base */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--text-md);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body:has(dialog[open]) { overflow: hidden; }

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

h1, h2, h3 {
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; opacity: 0.45; }
svg { flex-shrink: 0; }

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

[hidden] { display: none !important; }

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

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 50;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--inverse);
  color: var(--on-inverse);
}
.skip-link:focus { top: 12px; }

.no-script { padding: 32px var(--gutter); }

/* Page frame */

.site-header {
  max-width: var(--page);
  margin: 0 auto;
  min-height: 76px;
  padding: 12px var(--gutter);
  padding-top: max(12px, env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  text-decoration: none;
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.05em;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  background: var(--mark-bg);
  color: var(--mark-fg);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.5rem;
  line-height: 1;
  transform: rotate(-9deg);
}

.brand-dot { color: var(--accent); }

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--tap);
  padding: 0 12px;
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
}
.nav-link:hover { background: var(--surface-2); }

.count-badge {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  font-size: var(--text-xs);
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

main {
  max-width: var(--page);
  min-height: calc(100svh - 160px);
  margin: 0 auto;
  padding: 8px var(--gutter) 40px;
}
/* Focus moves to main after each navigation; that should not draw a ring. */
main:focus { outline: none; }

.site-footer {
  display: flex;
  justify-content: center;
  padding: 8px var(--gutter) max(24px, env(safe-area-inset-bottom));
}

/* Buttons and controls */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: var(--text-md);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, transform 0.1s;
}
.button:active:not(:disabled) { transform: scale(0.98); }

.button.primary { background: var(--accent); color: var(--on-accent); }
.button.primary:hover { background: var(--accent-hover); }

.button.secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
.button.secondary:hover { border-color: var(--accent); }

.button.small {
  min-height: var(--tap);
  padding: 0 16px;
  font-size: var(--text-sm);
}

.button.wide { width: 100%; }

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--tap);
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--accent-ink);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
}
.text-button:hover { text-decoration: underline; text-underline-offset: 3px; }

.icon-button {
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
}
.icon-button:hover { background: var(--surface-3); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s;
}
.chip:hover:not(:disabled) { border-color: var(--accent); }
.chip:disabled { opacity: 0.45; cursor: not-allowed; }
.chip[aria-pressed='true'] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.chip-select {
  position: relative;
  padding: 0;
}
.chip-select select {
  min-height: 44px;
  padding: 0 34px 0 14px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  font-weight: 600;
  appearance: none;
  cursor: pointer;
}
.chip-select::after {
  content: '';
  position: absolute;
  right: 15px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.chip-select.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip-select select option { color: var(--ink); background: var(--surface); }

.input {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--field-line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: var(--text-md);
}
.input:focus-visible { outline-offset: 0; border-color: var(--accent); }
select.input {
  padding-right: 40px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 52%, calc(100% - 15px) 52%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  margin-bottom: 8px;
  padding: 0 16px 0 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--ink);
  font-size: var(--text-md);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s;
}
.back-link:hover { background: var(--surface-3); }

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 20px;
}
.page-heading h1 { font-size: var(--text-2xl); }
.page-sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: var(--text-sm);
}

/* Welcome */

.welcome-view .site-header { justify-content: center; }
.welcome-view .header-nav { display: none; }

/* Results open straight into the food: no brand header, controls first. */
.results-view .site-header { display: none; }
.results-view main { padding-top: max(8px, env(safe-area-inset-top)); }
.results-view .page-heading { margin-bottom: 14px; }
.results-view .page-heading h1 { font-size: var(--text-xl); }
.results-view .page-sub { margin-top: 4px; }

.welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 640px;
  margin: 0 auto;
  padding: 12px 0 24px;
  text-align: center;
}

.welcome-art {
  position: relative;
  width: min(100%, 440px);
  height: 250px;
  margin-bottom: 36px;
}

.welcome-orbit {
  position: absolute;
  inset: 14px 6px 6px;
  border: 1.5px dashed var(--surface-3);
  border-radius: 50%;
  transform: rotate(-9deg);
}

.welcome-art img {
  position: absolute;
  object-fit: cover;
  border: 7px solid var(--surface);
  border-radius: 50%;
  box-shadow: var(--shadow-lg);
}

.welcome-main {
  left: 50%;
  top: 50%;
  width: 210px;
  height: 210px;
  z-index: 1;
  translate: -50% -50%;
  rotate: -8deg;
}
.welcome-left { left: 0; top: 4px; width: 128px; height: 128px; rotate: -15deg; }
.welcome-right { right: 0; bottom: 10px; width: 122px; height: 122px; rotate: 12deg; }

.welcome-spark {
  position: absolute;
  top: 0;
  right: 12%;
  color: var(--accent);
  font-size: 2.25rem;
  line-height: 1;
  rotate: 15deg;
}

.welcome h1 { font-size: var(--text-display); line-height: 1.04; }
.welcome h1 em, .home h1 em { color: var(--accent); font-style: normal; }
.welcome-cta { margin-top: 32px; min-width: min(100%, 300px); }

/* Account: email and emailed code */

.account { display: flex; justify-content: center; padding: 8px 0 32px; }
.account-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 420px;
  padding: 28px 22px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.account-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); }
.account-step { color: var(--muted); font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.account-card h1 { font-size: var(--text-xl); }
.account-sub { max-width: 34ch; color: var(--muted); font-size: var(--text-md); }
.account-sub strong { color: var(--ink); overflow-wrap: anywhere; }
.account-form { display: grid; gap: 10px; width: 100%; margin-top: 6px; text-align: left; }
.account-form .field-label { margin: 0; }
.account-form .input { min-height: 52px; font-size: var(--text-lg); }
.account-form .input[aria-invalid='true'] { border-color: var(--danger); }
.form-error { color: var(--danger); font-size: var(--text-sm); font-weight: 600; }
.account-fine { color: var(--muted); font-size: var(--text-xs); line-height: 1.5; }
.account-tips { display: grid; gap: 6px; width: 100%; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); font-size: var(--text-sm); text-align: left; list-style: disc; padding-left: 34px; }
.account-card h1:focus, main h1[tabindex='-1']:focus { outline: none; }
.account-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; }
.text-button:disabled { color: var(--muted); text-decoration: none; cursor: default; opacity: 1; }
.preview-note { width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--warn-bg); color: var(--warn-ink); font-size: var(--text-sm); text-align: left; }
.preview-code { font-size: var(--text-lg); letter-spacing: 0.12em; font-variant-numeric: tabular-nums; }

/* One real input (so paste and one-time-code autofill work) drawn as six boxes. */
.code-entry { position: relative; }
.code-entry input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  font-size: 16px;
  opacity: 0.01;
}
.code-boxes { display: grid; grid-template-columns: repeat(var(--code-length, 6), minmax(0, 1fr)); gap: clamp(4px, 1.6vw, 8px); }
.code-box {
  display: grid;
  place-items: center;
  height: 56px;
  border: 1px solid var(--field-line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: var(--text-xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.code-box.filled { border-color: var(--surface-3); background: var(--surface); }
.code-entry:focus-within .code-box.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.code-entry input[aria-invalid='true'] + .code-boxes .code-box { border-color: var(--danger); }

/* Home */

.home {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 640px;
  margin: 0 auto;
  padding-top: 8px;
}

.home-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.home-heading h1 { font-size: var(--text-display); line-height: 1.02; }
.home-heading .chip { margin-top: 6px; }

.segmented {
  display: grid;
  /* One equal column per option (Cook and Order), so no empty slot is left. */
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
}
.segmented button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 60px;
  padding: 6px 4px;
  border: 0;
  border-radius: calc(var(--radius-md) - 4px);
  background: transparent;
  font-size: var(--text-sm);
  font-weight: 600;
  transition: background-color 0.15s;
}
.segmented button:hover { background: var(--surface-3); }
.segmented button[aria-pressed='true'] { background: var(--inverse); color: var(--on-inverse); }
.segmented .emoji { font-size: 1.25rem; line-height: 1.2; }

/* Three cravings: full-width rows on phones, three tiles side by side on wider screens. */
.moods {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.mood {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 16px;
  row-gap: 2px;
  min-height: 84px;
  padding: 14px 18px;
  border: 0;
  border-radius: var(--radius-md);
  text-align: left;
  transition: transform 0.15s, box-shadow 0.15s;
}
.mood:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.mood:active { transform: scale(0.98); }
.mood[data-mood='sweet'] { background: var(--mood-sweet); }
.mood[data-mood='savory'] { background: var(--mood-savory); }
.mood[data-mood='spicy'] { background: var(--mood-spicy); }

.mood-emoji { grid-row: 1 / 3; font-size: 2.25rem; line-height: 1.1; }
.mood-name { align-self: end; font-size: var(--text-lg); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.mood-hint { align-self: start; color: var(--muted); font-size: var(--text-sm); line-height: 1.35; }
.mood-arrow { grid-column: 3; grid-row: 1 / 3; opacity: 0.7; }

@media (min-width: 560px) {
  .moods { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .mood { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 164px; padding: 20px; }
  .mood-emoji { margin-bottom: auto; }
  .mood-name, .mood-hint { align-self: auto; }
  .mood-arrow { position: absolute; top: 20px; right: 20px; }
}

/* Loader: "finding the best…" after a craving and during place searches */
.craving-loader {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  background: var(--bg);
  text-align: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.craving-loader.on { opacity: 1; }
.loader-art { position: relative; width: 220px; height: 220px; margin-bottom: 14px; }
.loader-ring { position: absolute; inset: 6px; border: 1.5px dashed var(--surface-3); border-radius: 50%; animation: loader-spin 14s linear infinite; }
.loader-plate {
  position: absolute;
  inset: 50px;
  display: grid;
  place-items: center;
  border: 7px solid var(--surface);
  border-radius: 50%;
  background: var(--accent-soft);
  box-shadow: var(--shadow-lg);
}
.loader-emoji { font-size: 4rem; line-height: 1; animation: loader-bob 1.2s ease-in-out infinite; }
/* Three small foods ride the dashed ring, a third of the way apart. */
.loader-orbit { position: absolute; inset: 6px; animation: loader-spin 6s linear infinite; animation-delay: calc(var(--i) * -2s); }
.loader-orbit span {
  position: absolute;
  top: -20px;
  left: 50%;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-left: -20px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 1.3rem;
  animation: loader-spin 6s linear infinite reverse;
  animation-delay: inherit;
}
.loader-title { max-width: 22ch; font-size: var(--text-xl); font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; text-wrap: balance; }
.loader-step { color: var(--muted); font-size: var(--text-sm); }
.loader-step::after { content: ''; display: inline-block; width: 1.2em; text-align: left; animation: loader-dots 1.2s steps(4) infinite; }
@keyframes loader-spin { to { transform: rotate(360deg); } }
@keyframes loader-bob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-8px) rotate(4deg); } }
@keyframes loader-dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
@media (prefers-reduced-motion: reduce) {
  .loader-ring, .loader-orbit, .loader-orbit span, .loader-emoji, .loader-step::after { animation: none; }
  .loader-orbit { transform: rotate(calc(var(--i) * 120deg)); }
  .loader-orbit span { transform: rotate(calc(var(--i) * -120deg)); }
}

/* Settings: confirm before deleting the account */
.delete-account-button { width: 100%; }
.delete-confirm { display: grid; gap: 10px; padding: 16px; }
.delete-confirm strong { color: var(--danger); font-size: var(--text-md); }
.delete-confirm p { color: var(--muted); font-size: var(--text-sm); line-height: 1.5; }
.delete-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.delete-actions .button { flex: 1 1 140px; padding-inline: 12px; white-space: nowrap; }
.button.danger { background: var(--danger); color: var(--on-danger); }
.button.danger:hover { filter: brightness(1.05); }

/* Privacy page */
.privacy { display: grid; gap: 18px; max-width: 640px; margin: 0 auto; }
.privacy h1 { font-size: var(--text-2xl); line-height: 1.1; }
.privacy-updated { margin-top: -10px; color: var(--muted); font-size: var(--text-sm); }
.privacy h2 { margin-bottom: 6px; font-size: var(--text-lg); line-height: 1.25; }
.privacy p, .privacy li { color: var(--ink); font-size: var(--text-md); line-height: 1.6; }
.privacy ul { display: grid; gap: 8px; margin: 0; padding-left: 1.2em; list-style: disc; }
.privacy li::marker { color: var(--accent); }
.privacy ul + p { margin-top: 12px; }
.privacy a:not(.button) { color: var(--accent-ink); }
.privacy-short { padding: 16px 18px; border-radius: var(--radius-md); background: var(--accent-soft); }
.privacy-short li { font-weight: 600; }
.account-fine a { color: inherit; }

/* Home: invitation to set My taste */
.taste-invite { position: relative; }
.taste-invite-main {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 52px 12px 16px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s, background-color 0.15s;
}
.taste-invite-main:hover { background: color-mix(in srgb, var(--accent-soft) 85%, var(--accent)); }
.taste-invite-main:active { transform: scale(0.99); }
.taste-invite-text { display: grid; gap: 1px; min-width: 0; }
.taste-invite-text strong { font-size: var(--text-md); line-height: 1.25; }
.taste-invite-text small { color: var(--muted); font-size: var(--text-xs); line-height: 1.3; }
.taste-invite-arrow { display: grid; place-items: center; flex: none; width: 34px; height: 34px; margin-left: auto; border-radius: 50%; background: var(--accent); color: var(--on-accent); }
.taste-invite-close { position: absolute; top: 50%; right: 4px; display: grid; place-items: center; width: 44px; height: 44px; margin-top: -22px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.taste-invite-close:hover { color: var(--ink); }
.taste-invite-close svg { width: 18px; height: 18px; }

/* Home: slim row of recently viewed foods */
.home-recent .field-label { margin-bottom: 6px; }
.recent-chips {
  display: flex;
  gap: 8px;
  padding: 2px 0;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.recent-chips::-webkit-scrollbar { display: none; }
.recent-chip {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  max-width: 190px;
  min-height: 52px;
  padding: 6px 14px 6px 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  scroll-snap-align: start;
  text-decoration: none;
}
.recent-chip:hover { background: var(--surface-3); }
.recent-photo { position: relative; flex: none; width: 40px; height: 40px; overflow: hidden; border-radius: 50%; }
.recent-photo img { position: relative; width: 100%; height: 100%; object-fit: cover; }
.recent-photo .tile-emoji { font-size: 1.2rem; }
.recent-photo[data-tone='sweet'] { background: var(--mood-sweet); }
.recent-photo[data-tone='savory'] { background: var(--mood-savory); }
.recent-photo[data-tone='spicy'] { background: var(--mood-spicy); }
.recent-photo[data-tone='any'] { background: var(--mood-any); }
.recent-name { overflow: hidden; font-size: var(--text-sm); font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }

/* Home: one-line link to the recipe browser */
.browse-link { display: inline-flex; align-items: center; gap: 6px; align-self: center; min-height: 44px; color: var(--muted); font-size: var(--text-sm); text-decoration: none; }
.browse-link strong { color: var(--accent-ink); }
.browse-link svg { width: 16px; height: 16px; color: var(--accent-ink); }

.browse-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px 12px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  text-decoration: none;
  transition: background-color 0.15s;
}
.browse-banner:hover { background: var(--surface-3); }
.browse-banner img { width: 56px; height: 56px; border-radius: var(--radius-xs); object-fit: cover; }
.browse-banner strong { display: block; font-size: var(--text-md); }
.browse-banner small { color: var(--muted); font-size: var(--text-sm); }
.browse-banner svg { margin-left: auto; }

/* Home rows: recently viewed and picks */

.home-row { display: grid; gap: 4px; }
.home-row-head { display: flex; align-items: center; justify-content: space-between; }
.home-row-head .field-label { margin: 0; }
.mini-cards {
  display: flex;
  gap: 10px;
  margin: 0 calc(-1 * var(--gutter));
  padding: 4px var(--gutter) 6px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
}
.mini-cards::-webkit-scrollbar { display: none; }
.mini-card { display: grid; flex: 0 0 116px; gap: 6px; scroll-snap-align: start; text-decoration: none; }
.mini-photo { position: relative; display: block; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius-sm); background: var(--surface-2); }
.mini-photo img { position: relative; width: 100%; height: 100%; object-fit: cover; }
.mini-photo .tile-emoji { font-size: 2.25rem; }
.mini-name { display: -webkit-box; overflow: hidden; font-size: var(--text-sm); font-weight: 600; line-height: 1.3; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mini-card:hover .mini-name { text-decoration: underline; text-underline-offset: 3px; }

/* Shopping list tools */

.custom-item { display: flex; gap: 8px; margin-bottom: 16px; }
.custom-item .input { flex: 1; min-width: 0; min-height: 44px; }
.list-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.list-tools .list-actions { margin: 0; }
.list-group-head h2 { font-size: var(--text-md); letter-spacing: -0.01em; }
.list-source { display: block; color: var(--muted); font-size: var(--text-xs); }

/* Sheets (dialogs) */

.sheet {
  width: min(560px, calc(100% - 32px));
  max-height: 86dvh;
  padding: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--bg);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}
.sheet::backdrop { background: var(--backdrop); backdrop-filter: blur(4px); }
.sheet[open] { animation: sheet-in 0.22s ease-out; }

.sheet-handle { display: none; }

.sheet-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.sheet-top h2 { flex: 1; font-size: var(--text-xl); }
.sheet-back { flex-shrink: 0; margin-left: -6px; }

.dish-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.dish-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-height: 96px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-size: var(--text-md);
  font-weight: 600;
  line-height: 1.25;
  text-align: left;
  transition: background-color 0.15s, border-color 0.15s;
}
.dish-option:hover { border-color: var(--accent); }
.dish-option:active { transform: scale(0.98); }
.dish-option[aria-pressed='true'] { background: var(--accent-soft); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.dish-option .emoji { font-size: 1.75rem; line-height: 1; }
.dish-option-text { display: grid; gap: 2px; }
.dish-option-text small { color: var(--muted); font-size: var(--text-xs); font-weight: 500; }

.sheet p { font-size: var(--text-sm); line-height: 1.65; color: var(--muted); }
.sheet .credits { font-size: var(--text-xs); }
.sheet-body { display: grid; gap: 14px; }
.sheet-body a { color: var(--accent-ink); }
.sheet-body .button { margin-top: 8px; }

/* Taste preferences */

.taste-form { display: grid; gap: 22px; }
.taste-form fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.taste-form legend { margin-bottom: 10px; padding: 0; font-size: var(--text-md); font-weight: 700; }

.taste-favorites {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.taste-favorites label { position: relative; min-width: 0; cursor: pointer; }
.taste-favorites input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.taste-favorites label > span {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.25;
}
.taste-favorites input:checked + span { background: var(--accent-soft); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.taste-favorites input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

.taste-field { display: grid; gap: 8px; font-weight: 700; }
.taste-check { display: flex; align-items: center; gap: 12px; min-height: 48px; font-weight: 500; cursor: pointer; }
.taste-check input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); }
.taste-help { color: var(--muted); font-size: var(--text-xs); line-height: 1.6; }

.taste-history { margin-top: 22px; border-top: 1px solid var(--line); }
.taste-history summary { min-height: 52px; padding: 14px 0; font-size: var(--text-sm); font-weight: 700; cursor: pointer; }
.taste-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: var(--text-sm);
}
.taste-history-row small { display: block; color: var(--muted); font-size: var(--text-xs); }
.taste-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* Results and lists */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
/* Kinds of food within a cuisine: one swipeable row, edge to edge on phones. */
.kind-filters {
  flex-wrap: nowrap;
  overflow-x: auto;
  margin: 0 calc(-1 * max(16px, env(safe-area-inset-left, 0px))) 12px;
  padding: 2px max(16px, env(safe-area-inset-left, 0px));
  scroll-padding-inline: max(16px, env(safe-area-inset-left, 0px));
  scrollbar-width: none;
}
.kind-filters::-webkit-scrollbar { display: none; }
.kind-filters .chip { flex-shrink: 0; }

/* On phones the results toolbar is one swipeable row so food shows sooner. */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 calc(-1 * var(--gutter)) 20px;
  padding: 2px var(--gutter);
  overflow-x: auto;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.toolbar::-webkit-scrollbar { display: none; }
.toolbar .filters { flex-wrap: nowrap; }
.toolbar-divider { flex-shrink: 0; width: 1px; height: 28px; background: var(--line); }
.chip-action { flex-shrink: 0; background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.toolbar .chip { min-height: 48px; padding: 0 18px; font-size: var(--text-md); }
.toolbar .chip-select { padding: 0; }
.toolbar .chip-select select { min-height: 46px; padding: 0 38px 0 18px; }

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

.food-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s, box-shadow 0.18s;
}
.food-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.food-card:has(.menu[open]) { z-index: 5; }

.food-photo {
  position: relative;
  aspect-ratio: 5 / 4;
  max-width: 100%;
  overflow: hidden;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--surface-2);
}
.food-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.food-card:hover .food-photo img { transform: scale(1.03); }

/* Drawn tile under every photo, tinted by craving. */
.food-photo[data-tone='sweet'], .detail-photo[data-tone='sweet'], .mini-photo[data-tone='sweet'] { background: var(--mood-sweet); }
.food-photo[data-tone='savory'], .detail-photo[data-tone='savory'], .mini-photo[data-tone='savory'] { background: var(--mood-savory); }
.food-photo[data-tone='spicy'], .detail-photo[data-tone='spicy'], .mini-photo[data-tone='spicy'] { background: var(--mood-spicy); }
.food-photo[data-tone='any'], .detail-photo[data-tone='any'], .mini-photo[data-tone='any'] { background: var(--mood-any); }
.tile-emoji {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 3.25rem;
  line-height: 1;
  background: radial-gradient(circle at 50% 45%, var(--tile-glow), transparent 60%);
}
.detail-photo .tile-emoji { font-size: 6rem; }
.food-photo img, .detail-photo img { position: relative; }

.mode-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.food-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  padding: 12px 14px 14px;
  text-decoration: none;
}
.food-link::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: var(--radius-md);
}
.food-link:focus-visible { outline: none; }
.food-link:focus-visible::after { outline: 3px solid var(--accent); outline-offset: 3px; }
.food-link h2 {
  display: -webkit-box;
  overflow: hidden;
  font-size: var(--text-md);
  line-height: 1.3;
  letter-spacing: -0.015em;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.food-meta { color: var(--muted); font-size: var(--text-xs); line-height: 1.4; }
/* Plain-English line under dish names an American might not know (name-notes.mjs). */
.food-link .name-note {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: var(--text-xs);
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.save-button,
.menu > summary {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.food-card .save-button { position: absolute; top: 8px; right: 8px; z-index: 2; }
.food-card.large .save-button { top: 10px; right: 10px; }
.food-card .menu { position: absolute; top: 10px; right: 58px; z-index: 2; }
.save-button[aria-pressed='true'] svg { fill: var(--accent); stroke: var(--accent); }
.share-button { position: absolute; top: 12px; right: 12px; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.share-button:hover { background: var(--surface-2); }

.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-list {
  position: absolute;
  top: 46px;
  right: 0;
  z-index: 3;
  display: grid;
  width: 200px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.menu-list button {
  min-height: var(--tap);
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-xs);
  background: none;
  font-size: var(--text-sm);
  font-weight: 500;
  text-align: left;
}
.menu-list button:hover { background: var(--surface-2); }

.list-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}
.count { color: var(--muted); font-size: var(--text-sm); }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 40px 20px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  text-align: center;
}
.empty h2 { font-size: var(--text-lg); letter-spacing: -0.02em; }
.empty p { max-width: 36ch; color: var(--muted); font-size: var(--text-sm); }
.empty .button { margin-top: 8px; }
.grid > .empty { grid-column: 1 / -1; }
.empty-icon { color: var(--accent); }

.fine-print { margin-top: 28px; color: var(--muted); font-size: var(--text-xs); text-align: center; }

/* One-at-a-time pick */

.decision { max-width: 520px; margin: 0 auto; }
.decision .food-link h2 { font-size: var(--text-xl); -webkit-line-clamp: 3; }
.decision .food-link { padding: 16px 18px 18px; }
.decision .food-meta { font-size: var(--text-sm); }
.decision-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

/* Local places */

.panel {
  margin-top: 32px;
  padding: 22px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
}
.results > .panel:first-of-type { margin-top: 0; }
/* The supermarket finder sits under the shopping list. */
.list-screen > .panel:first-of-type { margin-top: 28px; }
.panel h2 { font-size: var(--text-xl); }
.panel-intro { margin: 6px 0 18px; color: var(--muted); font-size: var(--text-sm); }
.city-entry { display: flex; gap: 10px; }
.city-entry .input { flex: 1; min-width: 0; }
.locate-button { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; min-height: 44px; }
.locate-button svg { width: 18px; height: 18px; }
.panel-status { padding: 18px 0 4px; color: var(--muted); font-size: var(--text-sm); }
.panel-error { padding: 18px 0 4px; font-size: var(--text-sm); }
.panel-error p { margin-top: 4px; color: var(--muted); }

.city-choices { display: grid; gap: 8px; padding-top: 18px; }
.city-choices h3 { font-size: var(--text-md); letter-spacing: -0.01em; }
.city-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: left;
}
.city-choice:hover { border-color: var(--accent); }

.places-heading { margin-top: 22px; }
.places-heading h3 { font-size: var(--text-lg); letter-spacing: -0.02em; }
.place-filters { margin: 12px 0 4px; }
.chip-count { opacity: 0.7; font-weight: 500; font-variant-numeric: tabular-nums; }
.places-heading p, .place-limit { margin-top: 4px; color: var(--muted); font-size: var(--text-xs); }
.place-limit { margin-bottom: 12px; }
.places-list { display: grid; gap: 10px; }
.place-card {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.place-body { min-width: 0; }
.place-photo {
  position: relative;
  flex-shrink: 0;
  width: 84px;
  height: 84px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.place-photo img { position: relative; width: 100%; height: 100%; object-fit: cover; }
.place-photo .tile-emoji { font-size: 2rem; }
.place-card h3 { font-size: var(--text-md); line-height: 1.3; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.place-card p { margin-top: 2px; color: var(--muted); font-size: var(--text-xs); }
.place-card .place-type { color: var(--ink); }
.place-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.place-badges span { padding: 2px 8px; border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--accent-ink); font-size: var(--text-xs); font-weight: 600; }
.place-hours { overflow-wrap: anywhere; font-weight: 600; }
.place-hours[data-open="true"] { color: var(--open); }
.place-hours[data-open="false"] { color: var(--muted); }
.places-more { margin-top: 16px; }
.place-delivery { display: flex; flex-wrap: wrap; align-items: center; gap: 0 16px; }
.place-delivery span { color: var(--muted); font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.place-delivery a { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent-ink); font-size: var(--text-sm); font-weight: 600; }
.filter-divider { flex: none; width: 1px; align-self: stretch; margin: 6px 2px; background: var(--line); }
.place-actions { grid-column: 1 / -1; display: grid; gap: 2px; padding-top: 4px; border-top: 1px solid var(--line); }
.place-links { display: flex; flex-wrap: wrap; gap: 0 18px; }
.place-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent-ink); font-size: var(--text-sm); font-weight: 600; }
.places-fallback { margin-top: 12px; }
.places-credit { display: block; margin-top: 16px; color: var(--muted); font-size: var(--text-xs); }
.places-credit a { color: inherit; }

/* Recipe browser */

.recipe-tools { display: grid; gap: 14px; margin-bottom: 20px; }
.search-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 220px); gap: 12px; }
.search-row label { display: grid; gap: 6px; color: var(--muted); font-size: var(--text-sm); font-weight: 600; }
.search-row .input { color: var(--ink); font-weight: 400; }

/* Food detail */

.detail-layout { display: grid; gap: 24px; }

.detail-photo {
  position: relative;
  aspect-ratio: 4 / 3;
  max-width: 100%;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--surface-2);
}
.detail-photo img { width: 100%; height: 100%; object-fit: cover; }

.detail-body { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.detail-heading { display: grid; gap: 12px; }
.detail-heading h1 { font-size: var(--text-2xl); }
.detail-title { display: grid; gap: 6px; }
.detail-title .name-note { font-size: var(--text-md); font-weight: 600; line-height: 1.35; }
.detail-desc { color: var(--muted); font-size: var(--text-md); }

.facts { display: flex; flex-wrap: wrap; gap: 8px; }
.facts li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  font-size: var(--text-sm);
  font-weight: 600;
}
.facts .muted { background: transparent; border: 1px dashed var(--line); color: var(--muted); font-weight: 500; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 8px;
}
.detail-section h2 { font-size: var(--text-lg); letter-spacing: -0.02em; }
.section-note { color: var(--muted); font-size: var(--text-xs); }

.servings {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: var(--text-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.servings span { min-width: 84px; text-align: center; }
.servings button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: var(--text-lg);
  line-height: 1;
}

.ingredients li { border-bottom: 1px solid var(--line); }
.ingredients label { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 0; cursor: pointer; }
.ingredients input { width: 20px; height: 20px; margin: 0; flex-shrink: 0; accent-color: var(--accent); }
.ingredients input:checked + span { color: var(--muted); text-decoration: line-through; }

.steps { display: grid; gap: 16px; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: var(--text-sm);
  font-weight: 700;
}

.note-box { display: grid; gap: 4px; padding: 16px 18px; border-radius: var(--radius-md); background: var(--surface-2); font-size: var(--text-sm); }
.note-box strong { font-size: var(--text-md); }

.about-recipe { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.about-recipe summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}
.about-recipe summary::-webkit-details-marker { display: none; }
.about-recipe summary svg { transition: transform 0.2s; }
.about-recipe[open] summary svg { transform: rotate(180deg); }
.about-recipe .about-body { display: grid; gap: 10px; padding-bottom: 16px; color: var(--muted); font-size: var(--text-sm); }
.about-body a { color: var(--accent-ink); font-weight: 600; }

.detail { padding-bottom: 96px; }

/* Floating bar: always reachable, and the toast sits just above it. */
.action-bar {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 20;
  display: flex;
  gap: 8px;
  width: min(calc(100% - 2 * var(--gutter)), 560px);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transform: translateX(-50%);
}
.action-bar .button { min-height: 48px; padding: 0 14px; white-space: nowrap; }
.action-bar .primary { flex: 1; min-width: 0; }
.action-bar .save-action svg { width: 20px; height: 20px; }
.action-bar .save-action[aria-pressed='true'] svg { fill: var(--accent); stroke: var(--accent); }
.action-bar .menu { position: relative; }
.action-bar .menu > summary { width: 48px; height: 48px; border: 1px solid var(--line); box-shadow: none; }
.action-bar .menu-list { top: auto; bottom: 58px; }

/* Diet, allergies and the shopping list button */

.taste-intro { margin: -8px 0 20px; color: var(--muted); font-size: var(--text-sm); }
.taste-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.taste-chips label { position: relative; cursor: pointer; }
.taste-chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.taste-chips span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: var(--text-sm);
  font-weight: 600;
}
.taste-chips input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.taste-chips input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.taste-form fieldset .taste-help { margin-top: 10px; }

.section-tools { margin: 0 0 6px; }
.list-add[aria-pressed='true'] { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }

.allergen-box {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.allergen-box h2 { font-size: var(--text-lg); letter-spacing: -0.02em; }
.allergen-box dl { display: grid; gap: 6px; margin: 0; }
.allergen-box dl div { display: flex; gap: 12px; font-size: var(--text-sm); }
.allergen-box dt { flex-shrink: 0; width: 96px; font-weight: 700; }
.allergen-box dd { margin: 0; min-width: 0; }
.allergen-warning { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--warn-bg); color: var(--warn-ink); font-size: var(--text-sm); font-weight: 600; }
.allergen-note { color: var(--muted); font-size: var(--text-xs); line-height: 1.5; }

/* Shopping list */

.list-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.list-groups { display: grid; gap: 14px; }
.list-group { padding: 4px 18px 8px; border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.list-group-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; border-bottom: 1px solid var(--line); }
.list-group-head a { font-weight: 700; text-decoration: none; }
.list-group-head a:hover { text-decoration: underline; text-underline-offset: 3px; }
.list-group-head small { display: block; color: var(--muted); font-size: var(--text-xs); }
.list-group .ingredients li:last-child { border-bottom: 0; }

/* Cook mode: full screen, one step at a time */

.cook-view .site-header,
.cook-view .site-footer { display: none; }
.cook {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 640px;
  min-height: calc(100dvh - 48px);
  margin: 0 auto;
  padding-top: max(8px, env(safe-area-inset-top));
}
.cook-top { display: flex; align-items: center; gap: 14px; }
.cook-heading { min-width: 0; }
.cook-recipe { overflow: hidden; color: var(--muted); font-size: var(--text-sm); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.cook-count { font-size: var(--text-lg); font-weight: 700; letter-spacing: -0.02em; }
.cook-progress { height: 6px; overflow: hidden; border-radius: var(--radius-pill); background: var(--surface-2); }
.cook-progress span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width 0.3s; }
.cook-ingredients { border-bottom: 1px solid var(--line); }
.cook-ingredients summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; font-weight: 700; list-style: none; cursor: pointer; }
.cook-ingredients summary::-webkit-details-marker { display: none; }
.cook-ingredients[open] summary svg { transform: rotate(180deg); }
.cook-ingredients ul { display: grid; gap: 6px; padding-bottom: 14px; font-size: var(--text-md); }
.cook-step { font-size: clamp(1.375rem, 1.1rem + 1.4vw, 1.875rem); font-weight: 500; line-height: 1.4; letter-spacing: -0.015em; }
.cook-timer-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.cook-timer-buttons:empty, .cook-timers-running:empty { display: none; }
.cook-timers-running { display: grid; gap: 8px; }
.timer-pill { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.timer-pill span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: var(--text-sm); }
.timer-pill strong { margin-left: auto; font-size: var(--text-lg); font-variant-numeric: tabular-nums; }
.timer-pill.done { border-color: var(--accent); background: var(--accent-soft); }
.icon-button.small { width: 40px; height: 40px; }
.cook-nav {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 10px;
  margin-top: auto;
  padding: 12px 0 max(12px, env(safe-area-inset-bottom));
  background: var(--bg);
}

/* Settings */

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1;
}
.avatar.large { flex-shrink: 0; width: 56px; height: 56px; font-size: var(--text-xl); }
.settings-link { padding: 0 6px; }
.greeting { margin-bottom: 6px; color: var(--muted); font-size: var(--text-md); font-weight: 600; }

.settings { max-width: 640px; margin: 0 auto; }
.settings-groups { display: grid; gap: 26px; }
.settings-group h2 { margin: 0 0 8px 4px; color: var(--muted); font-size: var(--text-sm); font-weight: 700; letter-spacing: 0; }
.settings-card { overflow: hidden; border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.settings-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 60px;
  padding: 12px 18px;
  border: 0;
  border-top: 1px solid var(--line);
  background: none;
  font-size: var(--text-md);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.settings-card > :first-child { border-top: 0; }
button.settings-row:hover:not(:disabled), label.settings-row:hover, a.settings-row:hover { background: var(--surface-2); }
div.settings-row { cursor: default; }
.settings-row:focus-visible { outline-offset: -3px; }
.settings-row:has(input[type='file']:focus-visible) { outline: 3px solid var(--accent); outline-offset: -3px; }
.settings-row > svg { margin-left: auto; color: var(--muted); }
.settings-text { display: grid; flex: 1; gap: 2px; min-width: 0; }
.settings-text strong { font-weight: 600; }
.settings-text small { color: var(--muted); font-size: var(--text-sm); line-height: 1.4; }
[data-clear-all] strong { color: var(--danger); }
.settings-note { margin: 10px 4px 0; color: var(--muted); font-size: var(--text-xs); line-height: 1.5; }

.profile-row { display: flex; align-items: center; gap: 16px; padding: 16px 18px; }
.profile-field { display: grid; flex: 1; gap: 6px; min-width: 0; color: var(--muted); font-size: var(--text-sm); font-weight: 600; }
.profile-field .input { color: var(--ink); font-weight: 400; }

.theme-choice { display: flex; flex-shrink: 0; gap: 2px; padding: 3px; border-radius: var(--radius-pill); background: var(--surface-2); }
.theme-choice button { min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--radius-pill); background: none; font-size: var(--text-sm); font-weight: 600; }
.theme-choice button[aria-pressed='true'] { background: var(--surface); box-shadow: var(--shadow-sm); }
/* On phones the choice buttons sit under the label instead of squeezing it. */
@media (max-width: 480px) {
  .settings-row.static { flex-wrap: wrap; }
  .settings-row.static > :first-child { flex: 1 1 100%; }
  .settings-row.static .theme-choice { flex: 1 1 100%; }
  .settings-row.static .theme-choice button { flex: 1; }
}

.switch {
  position: relative;
  flex-shrink: 0;
  width: 50px;
  height: 30px;
  margin: 0 0 0 auto;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  appearance: none;
  cursor: pointer;
  transition: background-color 0.2s;
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s;
}
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(20px); }

/* Toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, calc(env(safe-area-inset-bottom) + 12px));
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 4px;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background: var(--inverse);
  color: var(--on-inverse);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity 0.2s, transform 0.2s;
}
.toast.visible { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.detail-view .toast { bottom: calc(max(12px, env(safe-area-inset-bottom)) + 78px); }
.cook-view .toast { bottom: calc(max(12px, env(safe-area-inset-bottom)) + 84px); }
.toast button {
  min-height: 44px;
  margin: -8px -8px -8px 4px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-xs);
  background: none;
  color: var(--toast-action);
  font-size: var(--text-sm);
  font-weight: 700;
}

/* Motion */

.entering .screen { animation: appear 0.25s ease-out; }
/* A moving ancestor would drag the fixed action bar with it, so fade only. */
.entering .detail.screen { animation-name: fade-in; }

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

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* Larger screens */

@media (min-width: 720px) {
  :root { --gutter: 32px; }
  .site-header { min-height: 88px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  .food-link { padding: 14px 16px 16px; }
  .food-link h2 { font-size: var(--text-lg); }
  .food-meta { font-size: var(--text-sm); }
  .food-link .name-note { font-size: var(--text-sm); }
  .panel { padding: 28px; }
  .toolbar { flex-wrap: wrap; margin-inline: 0; padding-inline: 0; overflow: visible; }
  .toolbar .filters { flex-wrap: wrap; }
}

@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .detail-layout { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 48px; align-items: start; }
  .detail-photo { position: sticky; top: 24px; }
  .detail { padding-bottom: 0; }
  .action-bar { position: sticky; left: auto; bottom: 16px; width: auto; margin-top: -8px; transform: none; }
  .toast,
  .detail-view .toast { left: 24px; bottom: 24px; transform: translateY(16px); }
  .toast.visible { transform: none; }
}

/* Phones */

@media (max-width: 640px) {
  .sheet {
    width: 100%;
    max-width: 100%;
    max-height: 90dvh;
    margin: auto 0 0;
    padding: 10px 20px max(24px, env(safe-area-inset-bottom));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .sheet-handle {
    display: block;
    width: 40px;
    height: 5px;
    margin: 0 auto 16px;
    border-radius: var(--radius-pill);
    background: var(--surface-3);
  }
  .saved-text { display: none; }
  .nav-recipes { display: none; }
  .brand { font-size: var(--text-lg); }
  .nav-link { padding: 0 8px; }
  .header-nav { gap: 2px; }
  .search-row { grid-template-columns: minmax(0, 1fr); }
}

/* Phones: the whole home screen fits without scrolling. */
@media (max-width: 559px) {
  .home { gap: 16px; padding-top: 0; }
  .home-heading h1 { font-size: 2.2rem; }
  .segmented button { min-height: 52px; padding: 4px; }
  .moods { gap: 8px; }
  /* The cravings take up whatever height the phone has left over; --mood-base is the height of
     everything else on home, which depends on whether the taste card and recent row show. */
  .home { --mood-base: 460px; }
  .home:has(.taste-invite) { --mood-base: 536px; }
  .home:has(.home-recent) { --mood-base: 554px; }
  .home:has(.taste-invite):has(.home-recent) { --mood-base: 630px; }
  /* On home the About link sits just under the content, small. */
  .home-view main { min-height: 0; padding-bottom: 0; }
  .home-view .site-footer { padding: 0 var(--gutter) max(8px, env(safe-area-inset-bottom)); }
  .home-view #about-button { min-height: 32px; font-size: var(--text-xs); color: var(--muted); }
  .mood { --mood-h: clamp(62px, calc((100dvh - var(--mood-base)) / 3), 116px); min-height: var(--mood-h); padding: 10px 18px; column-gap: 16px; }
  .mood-emoji { font-size: clamp(1.85rem, calc(var(--mood-h) * 0.42), 2.9rem); }
  .mood-name { font-size: clamp(var(--text-md), calc(var(--mood-h) * 0.22), 1.45rem); }
  .mood-hint { font-size: clamp(var(--text-xs), calc(var(--mood-h) * 0.15), var(--text-sm)); }
}

@media (max-width: 420px) {
  .city-entry { flex-direction: column; }
  .welcome-art { height: 220px; }
  .welcome-main { width: 180px; height: 180px; }
  .welcome-left { width: 108px; height: 108px; }
  .welcome-right { width: 104px; height: 104px; }
}

@media (max-width: 359px) {
  :root { --gutter: 16px; }
  .brand-name { display: none; }
  .grid { gap: 10px; }
  .segmented button { font-size: var(--text-xs); }
}

/* Recipe cards: time on the photo, small colored tags under the name */
.time-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px 4px 7px;
  border-radius: var(--radius-pill);
  background: rgb(20 14 32 / 0.72);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1.2;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.time-badge svg { flex: none; }
.card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.card-tag {
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.25;
}
.card-tag.diet { background: color-mix(in srgb, var(--open) 14%, transparent); color: var(--open-ink); }
.card-tag.spend { background: var(--accent-soft); color: var(--accent-ink); }
.card-tag.plain { background: var(--surface-2); color: var(--muted); }

/* Craving cards: a real food photo on the right, fading into the craving's color. */
.mood { position: relative; isolation: isolate; overflow: hidden; }
.mood::before {
  content: '';
  position: absolute;
  inset: 0 0 0 40%;
  z-index: -2;
  background: var(--mood-photo) center / cover no-repeat;
}
.mood::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, var(--mood-bg) 46%, color-mix(in srgb, var(--mood-bg) 70%, transparent) 62%, transparent 88%);
}
.mood[data-mood='sweet'] { --mood-bg: var(--mood-sweet); --mood-photo: url('assets/pancakes.jpg'); }
.mood[data-mood='savory'] { --mood-bg: var(--mood-savory); --mood-photo: url('assets/food-photos/turkey-burger.jpg'); }
.mood[data-mood='spicy'] { --mood-bg: var(--mood-spicy); --mood-photo: url('assets/catalog/52806.jpg'); }
.mood .mood-emoji { display: none; }
.mood { grid-template-columns: minmax(0, 1fr) auto; }
.mood-name, .mood-hint { grid-column: 1; max-width: 66%; }
.mood-arrow {
  grid-column: 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  opacity: 1;
}
@media (min-width: 560px) {
  .mood::before { inset: 0 0 34% 0; }
  .mood::after { background: linear-gradient(0deg, var(--mood-bg) 38%, color-mix(in srgb, var(--mood-bg) 70%, transparent) 56%, transparent 80%); }
  .mood-name, .mood-hint { max-width: none; }
  .mood { justify-content: flex-end; }
}

/* Tab bar: phones only. The header's icon links hide so there's one main navigation. */
.tab-bar { display: none; }
@media (max-width: 767px) {
  .header-nav { display: none; }
  .tab-bar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 4px max(6px, env(safe-area-inset-right, 0px)) max(6px, env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px));
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    backdrop-filter: blur(18px) saturate(1.4);
  }
  .tab-bar a {
    position: relative;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 2px;
    min-height: 52px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: var(--text-xs);
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    transition: color 0.15s;
  }
  .tab-bar svg { width: 24px; height: 24px; }
  .tab-bar a[aria-current='page'] { color: var(--accent-ink); }
  .tab-bar a[aria-current='page'] svg { fill: color-mix(in srgb, var(--accent) 22%, transparent); }
  .tab-bar a:active { transform: scale(0.94); }
  .tab-badge {
    position: absolute;
    top: 2px;
    left: calc(50% + 5px);
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--radius-pill);
    background: var(--accent);
    color: var(--on-accent);
    font-size: var(--text-xs);
    font-weight: 700;
    line-height: 18px;
    text-align: center;
  }
  body:not(.tabbar-hidden) main { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  body:not(.tabbar-hidden) .site-footer { display: none; }
  body:not(.tabbar-hidden) .toast { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .tabbar-hidden .tab-bar { display: none; }
}

/* Touch polish (UI/UX Pro Max checklist: tap delay, press feedback, app-like touch) */
a, button, input, select, textarea, summary, label { touch-action: manipulation; }
button, .chip, .mood, .food-card, .mini-card, .recent-chip, .dish-option, .settings-row, .city-choice, .browse-link {
  -webkit-user-select: none;
  user-select: none;
}
.food-card img, .mini-card img, .recent-chip img, .place-photo img, .detail-photo img, .welcome-art img {
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}
/* Everything tappable answers the press right away. */
.chip:active:not(:disabled), .icon-button:active, .segmented button:active, .theme-choice button:active,
.city-choice:active, .recent-chip:active, .settings-row:active, .mini-card:active, .browse-link:active,
.share-button:active, .save-button:active { transform: scale(0.96); }
.food-card:active { transform: scale(0.985); }

/* Result cards arrive one after another instead of all at once. */
.grid > .food-card { animation: card-in 0.32s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.grid > .food-card:nth-child(2) { animation-delay: 30ms; }
.grid > .food-card:nth-child(3) { animation-delay: 60ms; }
.grid > .food-card:nth-child(4) { animation-delay: 90ms; }
.grid > .food-card:nth-child(5) { animation-delay: 120ms; }
.grid > .food-card:nth-child(6) { animation-delay: 150ms; }
.grid > .food-card:nth-child(n+7) { animation-delay: 180ms; }
.grid > .food-card.settled { animation: none; }
@keyframes card-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .grid > .food-card { animation: none; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .mood:hover, .food-card:hover, .food-card:hover .food-photo img { transform: none; }
}
