/* Meal planner web app. Mobile first, installed on a Home Screen, light and dark. */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #f0eee8;
  --text: #17201b;
  --muted: #68736c;
  --line: rgba(23, 32, 27, .10);
  --accent: #1d8a5a;
  --accent-2: #14663f;
  --accent-text: #ffffff;
  --accent-soft: #e0f1e8;
  --warm: #c25a1d;
  --warm-soft: #fdebdf;
  --bad: #b3261e;
  --bad-soft: #fbe9e7;
  --warn: #8a5a00;
  --warn-soft: #fff3d6;
  --me: linear-gradient(135deg, #22a06b, #1a7d52);
  --me-text: #ffffff;
  --bot: #ffffff;
  --shadow: 0 1px 2px rgba(20, 30, 25, .05), 0 10px 28px rgba(20, 30, 25, .07);
  --shadow-sm: 0 1px 2px rgba(20, 30, 25, .06), 0 3px 10px rgba(20, 30, 25, .05);
  --radius: 20px;
  --tabs: 64px;
  --glass: rgba(255, 255, 255, .78);
  --ease: cubic-bezier(.2, .8, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d110f;
    --surface: #171d1a;
    --surface-2: #1f2723;
    --text: #eef2ef;
    --muted: #96a39b;
    --line: rgba(238, 242, 239, .10);
    --accent: #4fcf92;
    --accent-2: #7fe0b2;
    --accent-text: #06140d;
    --accent-soft: #19332a;
    --warm: #ff9a62;
    --warm-soft: #3a2518;
    --bad: #f2998f;
    --bad-soft: #3a1f1c;
    --warn: #f0c36a;
    --warn-soft: #3a2f14;
    --me: linear-gradient(135deg, #2aa774, #1b7f54);
    --bot: #1b221f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .35);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 3px 10px rgba(0, 0, 0, .25);
    --glass: rgba(23, 29, 26, .78);
  }
}
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .16s; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  letter-spacing: -.011em;
  background: var(--bg);
  color: var(--text);
  padding-top: env(safe-area-inset-top);
  padding-bottom: calc(var(--tabs) + env(safe-area-inset-bottom));
  min-height: 100vh;
}
body.bare { padding-bottom: env(safe-area-inset-bottom); }
a { color: var(--accent); }
h1 { font-size: 1.5rem; margin: 0 0 .6rem; letter-spacing: -.025em; }
h2 { font-size: .8rem; margin: 1.7rem 0 .55rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
p { margin: .5rem 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
main { max-width: 640px; margin: 0 auto; padding: 1rem 1rem 2rem; }
.page-title { font-size: 2.1rem; font-weight: 800; letter-spacing: -.035em; line-height: 1.1; margin: .6rem 0 .2rem; }
.page-sub { color: var(--muted); margin: 0 0 1rem; }

/* tab bar: frosted, with the current tab lifted */
nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(var(--tabs) + env(safe-area-inset-bottom));
  padding: 6px 8px env(safe-area-inset-bottom);
  display: flex; gap: 2px;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px);
  border-top: 1px solid var(--line);
  view-transition-name: tabs;
}
nav.tabs a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; text-decoration: none; color: var(--muted); font-size: .68rem; font-weight: 600;
  border-radius: 14px; transition: color .15s;
}
nav.tabs a svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s var(--ease); }
nav.tabs a[aria-current="page"] { color: var(--accent); }
nav.tabs a[aria-current="page"] svg { transform: translateY(-1px) scale(1.08); }
nav.tabs a:active svg { transform: scale(.9); }

/* cards, forms, buttons */
.where label { display: block; margin-bottom: .3rem; }
.totals { margin: .8rem 0 .2rem; }
.totals > div { display: flex; justify-content: space-between; padding: .15rem 0; }
.totals dt, .totals dd { margin: 0; }
.totals .total { border-top: 1px solid var(--line); margin-top: .3rem; padding-top: .45rem; font-weight: 700; }
.warn-line { color: var(--warn); font-weight: 600; margin: .6rem 0 0; }
h2.aisle { font-size: 1rem; margin: 1.1rem 0 .1rem; }
.grocery { padding: .3rem 1.05rem; }
.grocery form.tick label { display: flex; gap: .7rem; align-items: center; min-height: 48px; margin: 0; }
.grocery form.tick + form.tick { border-top: 1px solid var(--line); }
.grocery form.tick input:checked ~ .grow { text-decoration: line-through; opacity: .6; }
.store-head { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.store details { margin-top: .6rem; }
.store summary { cursor: pointer; padding: .4rem 0; min-height: 44px; display: flex; align-items: center; }
.store .pair { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.store fieldset.modes { border: 0; padding: 0; margin: .4rem 0; }
.store label.check { display: flex; gap: .5rem; align-items: center; min-height: 44px; }
.store label.check input { width: 24px; height: 24px; accent-color: var(--accent); flex: none; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.05rem; margin: .8rem 0; box-shadow: var(--shadow-sm); }
label { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); margin: .8rem 0 .3rem; }
input[type=text], input[type=password], input[type=search], textarea, select {
  width: 100%; font: inherit; color: var(--text); background: var(--surface-2);
  border: 1px solid transparent; border-radius: 12px; padding: .7rem .8rem;
}
input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
button, .button {
  font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; text-align: center;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .72rem 1.15rem; border-radius: 14px;
  border: 1px solid transparent; background: var(--accent); color: var(--accent-text);
  transition: transform .12s var(--ease), opacity .15s, background .15s;
}
button:active, .button:active { transform: scale(.97); }
button.secondary, .button.secondary { background: var(--accent-soft); color: var(--accent-2); }
button.ghost, .button.ghost { background: transparent; color: var(--muted); border-color: var(--line); }
button.danger { background: var(--bad-soft); color: var(--bad); }
button.small { padding: .4rem .8rem; font-size: .85rem; border-radius: 11px; }
button.wide, .button.wide { width: 100%; margin-top: .6rem; }
button[disabled] { opacity: .55; cursor: default; }
.row { display: flex; gap: .5rem; align-items: center; }
.row > .grow { flex: 1; }
.flash { padding: .7rem .9rem; border-radius: 14px; margin: .6rem 0; font-size: .95rem; }
.flash.ok { background: var(--accent-soft); }
.flash.err { background: var(--bad-soft); color: var(--bad); }
.flash.warn { background: var(--warn-soft); color: var(--warn); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .45rem .2rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.pill { display: inline-block; padding: .08rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--accent-soft); color: var(--accent-2); }
.pill.warm { background: var(--warm-soft); color: var(--warm); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.htmx-request { opacity: .6; }
[hidden] { display: none !important; }
.field-error { color: var(--bad); font-size: .85rem; margin-top: .2rem; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.notice-title { font-size: 1.3rem; margin: 0 0 .3rem; letter-spacing: -.02em; }

/* chat */
body.chat-page { overflow: hidden; }
.chat {
  display: flex; flex-direction: column;
  height: calc(100dvh - var(--tabs) - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  max-width: 640px; margin: 0 auto;
}
.chat-head { position: relative; z-index: 6; display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .85rem 1.1rem .6rem; }
.head-actions { display: flex; gap: .5rem; flex: none; }
button.tap { min-height: 44px; min-width: 44px; padding: .55rem 1rem; font-size: .95rem; border-radius: 14px; touch-action: manipulation; }
.history { position: relative; z-index: 6; margin: 0 1rem .4rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: .6rem .8rem; max-height: 45vh; overflow-y: auto; }
.history ul { list-style: none; margin: 0; padding: 0; }
.history li button { display: block; width: 100%; text-align: left; background: transparent; color: var(--text); border: 0; border-radius: 10px; padding: .6rem .5rem; min-height: 44px; font-weight: 600; }
.history li button:active, .history li button[aria-current="true"] { background: var(--accent-soft); }
.history li .when { display: block; font-weight: 400; font-size: .8rem; color: var(--muted); }
.chat-head .page-title { margin: 0; font-size: 1.9rem; }
.log { flex: 1; overflow-y: auto; padding: .6rem 1rem; display: flex; flex-direction: column; gap: .45rem; overscroll-behavior: contain; }
.bubble { max-width: 86%; padding: .62rem .9rem; border-radius: 20px; white-space: pre-wrap; word-wrap: break-word; animation: rise .22s var(--ease); box-shadow: var(--shadow-sm); }
.bubble.me { align-self: flex-end; background: var(--me); color: var(--me-text); border-bottom-right-radius: 6px; }
.bubble.bot { align-self: flex-start; background: var(--bot); border-bottom-left-radius: 6px; }
.bubble.err { background: var(--bad-soft); color: var(--bad); }
.divider { align-self: center; font-size: .75rem; color: var(--muted); margin: .6rem 0; font-weight: 600; letter-spacing: .04em; }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.thinking { display: inline-flex; gap: 4px; align-items: center; padding: .15rem 0; }
.thinking i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: .4; animation: blink 1.2s infinite; }
.thinking i:nth-child(2) { animation-delay: .2s; }
.thinking i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .thinking i { animation: none; opacity: .7; } .bubble, .quick button { animation: none; } }
.quick { display: flex; gap: .45rem; overflow-x: auto; padding: .1rem 1rem .5rem; scrollbar-width: none; }
.quick::-webkit-scrollbar { display: none; }
.quick button { flex: none; background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow-sm); padding: .5rem .95rem; border-radius: 999px; font-weight: 600; font-size: .95rem; animation: rise .22s var(--ease); }
.quick button:active { background: var(--accent-soft); }
.composer { display: flex; gap: .5rem; align-items: center; margin: 0 .8rem .6rem; padding: .35rem .35rem .35rem 1rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.composer input { flex: 1; background: transparent; border: 0; padding: .4rem 0; min-width: 0; }
.composer input:focus-visible { outline: none; }
.composer:focus-within { border-color: var(--accent); }
.composer button { width: 42px; height: 42px; padding: 0; border-radius: 50%; flex: none; }
.composer button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.empty { color: var(--muted); text-align: center; margin: auto; padding: 2rem; }
.empty strong { display: block; font-size: 1.35rem; color: var(--text); letter-spacing: -.02em; margin-bottom: .25rem; }

/* meals: tile colours come from classes because the page allows no inline styles */
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dish-photo { width: 100%; max-height: 16rem; object-fit: cover; border-radius: 20px; display: block; }
.receipt-line form { margin-top: .6rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.receipt-line select { flex: 1 1 10rem; min-height: 44px; }
.receipt-line button { min-height: 44px; }
.snap { margin: .8rem 0; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.snap p { flex-basis: 100%; margin: 0; font-weight: 600; }
.photo-credit a { color: inherit; }
.tile { overflow: hidden; width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 1.9rem; flex: none; }
.hue-0 { background: #fde8d7; } .hue-1 { background: #e3f1da; } .hue-2 { background: #fbe3e1; } .hue-3 { background: #e0ebf8; }
.hue-4 { background: #f4e7c8; } .hue-5 { background: #eadff5; } .hue-6 { background: #d9f0ed; } .hue-7 { background: #f7dfe9; }
@media (prefers-color-scheme: dark) {
  .hue-0 { background: #4a2f1e; } .hue-1 { background: #2b4023; } .hue-2 { background: #4a2624; } .hue-3 { background: #23374d; }
  .hue-4 { background: #4a3f1e; } .hue-5 { background: #38284a; } .hue-6 { background: #1f4440; } .hue-7 { background: #4a2538; }
}
.meal { display: flex; gap: .85rem; align-items: center; padding: .8rem; margin: .55rem 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--line); text-decoration: none; color: inherit; }
.meal .body { flex: 1; min-width: 0; }
.meal .day { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.meal .name { font-weight: 700; font-size: 1.05rem; letter-spacing: -.02em; line-height: 1.25; }
.meal .meta { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .3rem; }
.meal.today { border-color: var(--accent); }
.meal .acts { display: flex; flex-direction: column; gap: .3rem; }
.icon-btn { width: 38px; height: 38px; padding: 0; border-radius: 12px; background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chips { display: flex; gap: .45rem; flex-wrap: wrap; margin: .5rem 0; }
.chip { padding: .45rem .9rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: .92rem; text-decoration: none; box-shadow: var(--shadow-sm); }
.chip[aria-current="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.hero { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-text); border-radius: 26px; padding: 1.2rem; margin: .8rem 0; box-shadow: var(--shadow); }
.hero .name { font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; margin: .2rem 0 .6rem; }
.hero .button, .hero button { background: rgba(255, 255, 255, .22); color: inherit; }
.empty-state { text-align: center; padding: 2.2rem 1rem; color: var(--muted); }
.empty-state .big { font-size: 2.6rem; }
.empty-state h2 { margin: .5rem 0 .2rem; color: var(--text); text-transform: none; letter-spacing: -.02em; font-size: 1.25rem; }

/* recipe and cook mode */
.ingredients { list-style: none; margin: 0; padding: 0; }
.ingredients li { display: flex; gap: .7rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.ingredients input[type=checkbox], .grocery input[type=checkbox] { width: 24px; height: 24px; accent-color: var(--accent); flex: none; }
.ingredients li.done span, .grocery li.done span { text-decoration: line-through; color: var(--muted); }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: step; display: flex; gap: .8rem; padding: .7rem 0; }
.steps li::before { content: counter(step); flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-2); font-weight: 800; display: grid; place-items: center; font-size: .85rem; }
body.cook { padding-bottom: env(safe-area-inset-bottom); }
.cook-wrap { display: flex; flex-direction: column; min-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; padding: 1rem; }
.cook-bar { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.cook-bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s var(--ease); }
.cook-step { flex: 1; display: flex; flex-direction: column; justify-content: center; font-size: 1.7rem; line-height: 1.35; font-weight: 600; letter-spacing: -.02em; padding: 1.2rem 0; }
.cook-step small { font-size: .85rem; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; font-weight: 800; margin-bottom: .6rem; }
.cook-nav { display: flex; gap: .6rem; }
.cook-nav button, .cook-nav .button { flex: 1; padding: 1rem; font-size: 1.05rem; }
.timer { font-variant-numeric: tabular-nums; font-size: 2.4rem; font-weight: 800; letter-spacing: -.03em; text-align: center; }

/* grocery list and delivery */
.grocery { list-style: none; margin: 0; padding: 0; }
.grocery li { display: flex; gap: .7rem; align-items: center; padding: .65rem 0; border-bottom: 1px solid var(--line); }
.grocery li span { flex: 1; }
.grocery .qty { color: var(--muted); font-size: .9rem; flex: none; }
.segmented { display: flex; background: var(--surface-2); border-radius: 14px; padding: 3px; gap: 2px; }
.segmented button, .segmented a { flex: 1; background: transparent; color: var(--muted); padding: .55rem .4rem; border-radius: 11px; font-size: .92rem; font-weight: 650; text-align: center; text-decoration: none; }
.segmented [aria-pressed="true"], .segmented [aria-current="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.stat { display: flex; justify-content: space-between; padding: .35rem 0; }
.stat strong { font-variant-numeric: tabular-nums; }

/* meal cards in the chat, and the recipe screen */
.cards { align-self: flex-start; display: flex; flex-direction: column; gap: .4rem; width: min(88%, 360px); animation: rise .22s var(--ease); }
.cards .meal { margin: 0; }
.saved-note { display: block; background: var(--accent-soft); color: var(--text); border: 1px solid var(--line); border-radius: 14px; padding: .55rem .8rem; font-size: .92rem; font-weight: 600; text-decoration: none; }
.tries { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; margin-top: 1rem; }
.tries.starters { margin-top: 1.2rem; }
.tries.starters button:first-child { background: var(--accent); color: var(--accent-text); border-color: transparent; font-size: 1.05rem; padding: .7rem 1.2rem; width: 100%; max-width: 22rem; }
.tries button { background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow-sm); padding: .45rem .85rem; border-radius: 999px; font-weight: 600; font-size: .9rem; }
.hint { margin: .25rem 0 .9rem; }
.hint .example { display: block; margin-top: .1rem; }
details.remove { margin: 1.5rem 0 .5rem; }
details.remove summary { cursor: pointer; padding: .4rem 0; }
.meal .name { display: block; color: inherit; text-decoration: none; }
.meal .meta { display: flex; }
a.meal .day { display: block; }
.tile.big { width: 88px; height: 88px; font-size: 3rem; border-radius: 26px; }
.recipe-head { display: flex; flex-direction: column; gap: .5rem; }
.recipe-head .page-title { margin: .2rem 0 0; }
.recipe-head .meta { display: flex; gap: .35rem; flex-wrap: wrap; }
.actions { margin: 1rem 0 .3rem; }
.actions .button { width: 100%; padding: 1rem; font-size: 1.05rem; }
.put label { margin-top: 0; }
.put select { flex: 1; }
.cook-step .ingredients li label { margin: 0; font-size: 1.15rem; font-weight: 500; color: var(--text); }
.cook-step .timer { margin: .8rem 0 .4rem; }
.cook-screen[hidden] { display: none; }

/* run-now buttons: heading, what it does, the button and its progress, all in one block */
.task-head { display: flex; gap: .8rem; align-items: center; justify-content: space-between; }
.task-head strong { min-width: 0; }
.task-what { margin: .25rem 0 0; }
.task-button { flex: none; min-width: 6.5rem; }
.task-status { margin: .55rem 0 0; }
.task-status p { margin: .3rem 0 0; }
.task-status.bad { color: var(--bad); }
.spinner { display: none; width: .9em; height: .9em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.task-button[aria-busy="true"] .spinner, .htmx-request .spinner { display: inline-block; }
progress { width: 100%; height: .45rem; appearance: none; border: 0; border-radius: 999px; overflow: hidden; background: var(--surface-2); display: block; }
progress::-webkit-progress-bar { background: var(--surface-2); }
progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; transition: width .4s var(--ease); }
progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

/* the photo on a recipe page, with a quiet menu in its corner */
.hero-photo { position: relative; }
.hero-photo .tile.big { width: 100%; height: 11rem; border-radius: 20px; font-size: 4.5rem; }
.photo-menu { position: absolute; top: .6rem; right: .6rem; z-index: 2; }
.photo-edit { list-style: none; cursor: pointer; width: 2.1rem; height: 2.1rem; display: grid; place-items: center; border-radius: 50%; background: rgba(20, 20, 20, .42); color: #fff; opacity: .78; transition: opacity .15s, background .15s; -webkit-tap-highlight-color: transparent; }
.photo-edit::-webkit-details-marker { display: none; }
.photo-edit:hover, .photo-menu[open] .photo-edit, .photo-edit:focus-visible { opacity: 1; background: rgba(20, 20, 20, .62); }
.photo-edit svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.photo-menu-list { position: absolute; top: 2.6rem; right: 0; min-width: 12rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); padding: .3rem; display: flex; flex-direction: column; }
.photo-choice { display: block; width: 100%; text-align: left; background: transparent; color: var(--text); border: 0; border-radius: 10px; padding: .6rem .7rem; min-height: 44px; font: inherit; font-weight: 600; cursor: pointer; margin: 0; }
.photo-choice:hover, .photo-choice:focus-visible { background: var(--accent-soft); }
.photo-busy { position: absolute; left: .6rem; bottom: .6rem; display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .75rem; border-radius: 999px; background: rgba(20, 20, 20, .62); color: #fff; font-size: .85rem; }
.photo-busy.working .spinner { display: inline-block; }

.flash.warning { display: flex; gap: .7rem; align-items: center; justify-content: space-between; }
.flash.warning a { font-weight: 600; white-space: nowrap; color: inherit; }

a.flash { display: block; color: inherit; text-decoration: none; }

/* a long address or code never pushes the page wider than the phone */
main, .card { min-width: 0; }
code { overflow-wrap: anywhere; word-break: break-word; }
textarea { resize: vertical; }

/* cards that hold several things: one even rhythm, set by the card and not by each child */
.stack > :where(*) { margin: 0; }
.stack > * + * { margin-top: .9rem; }
.stack > .task { padding-top: .9rem; border-top: 1px solid var(--line); }
.stack > .task:first-child { padding-top: 0; border-top: 0; }
.stack > button, .stack > .button, .stack > form > button:only-child { display: flex; width: 100%; min-height: 46px; }
.stack button.wide { margin-top: .9rem; }
.stack .list + button, .stack .list + .button { margin-top: .9rem; }
.card-title { display: block; font-size: 1.05rem; letter-spacing: -.015em; }

/* buttons that sit side by side: same height, share the width, wrap before they squash */
.btns { display: flex; flex-wrap: wrap; gap: .6rem; align-items: stretch; }
.btns > button, .btns > .button { flex: 1 1 9rem; min-height: 46px; }
.btns > .fit { flex: 0 0 auto; }
.btns.even > button { flex: 1 1 0; min-width: 8rem; }
button.small { min-height: 38px; }

/* the sign-in steps: a plain numbered list, not the recipe steps */
.signin { padding: .9rem; border: 1px dashed var(--line); border-radius: 14px; }
.signin ol { padding-left: 1.3rem; margin: .5rem 0; }
.signin li { margin: .45rem 0; padding-left: .2rem; }
.signin form > * + * { margin-top: .7rem; }

/* jump links at the top of Settings */
.jump { display: flex; gap: .45rem; overflow-x: auto; margin: 0 -1rem .4rem; padding: .2rem 1rem .5rem; scrollbar-width: none; position: sticky; top: env(safe-area-inset-top); z-index: 5; background: var(--bg); }
.jump::-webkit-scrollbar { display: none; }
.jump .chip { flex: none; }
h2[id] { scroll-margin-top: 3.4rem; }

/* where the groceries are bought: one row per purchase, the items under it */
.buy { border-top: 1px solid var(--line); padding-top: .7rem; }
.buy:first-of-type { border-top: 0; padding-top: 0; }
.buy summary { list-style: none; cursor: pointer; display: flex; gap: .8rem; align-items: center; justify-content: space-between; min-height: 44px; }
.buy summary::-webkit-details-marker { display: none; }
.buy-main { display: flex; flex-direction: column; min-width: 0; }
.buy-store { font-weight: 700; font-size: 1.05rem; letter-spacing: -.015em; }
.buy-total { font-weight: 700; font-variant-numeric: tabular-nums; flex: none; }
.buy p { margin: .4rem 0 0; }
