:root {
  --bg: #fbf8f3;
  --card: #ffffff;
  --ink: #231f1a;
  --muted: #6f675d;
  --line: #e7dfd3;
  --accent: #c9552b;
  --accent-ink: #ffffff;
  --chip: #f1e9dd;
  --ok: #2f7d4f;
  --err: #b3261e;
  --info: #3b5f8a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px -12px rgba(35,31,26,.25);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151311; --card: #1f1b18; --ink: #f3ece3; --muted: #a79d90; --line: #35302a;
    --accent: #e2693b; --chip: #2b2521; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); letter-spacing: -.01em; }
h2 { font-size: 1.25rem; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.inline { display: inline; }

/* ---- chrome ---- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem clamp(1rem, 4vw, 2rem); border-bottom: 1px solid var(--line); background: var(--card); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 800; font-size: 1.15rem; color: var(--ink); display: flex; align-items: center; gap: .4rem; }
.brand:hover { text-decoration: none; }
.topbar nav { display: flex; align-items: center; gap: 1rem; }
.topbar nav a { color: var(--ink); }
.page { max-width: 1040px; margin: 0 auto; padding: 1.25rem clamp(1rem, 4vw, 2rem) 3rem; }
.footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 2rem 1rem; }

.btn { display: inline-flex; align-items: center; gap: .35rem; background: var(--accent); color: var(--accent-ink); border: 1px solid transparent; border-radius: 999px; padding: .6rem 1.1rem; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(1.07); text-decoration: none; }
.btn-ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn-small { padding: .4rem .85rem; font-size: .9rem; }
.linklike { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.linklike.danger { color: var(--err); }
input, select, textarea, button { font: inherit; }
input[type=text], input[type=url], input[type=email], input[type=password], input[type=search], select, textarea {
  width: 100%; padding: .65rem .85rem; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: 1px; }
label { display: block; font-weight: 600; margin-bottom: .75rem; }
label input, label textarea { margin-top: .25rem; font-weight: 400; }

.flash { padding: .75rem 1rem; border-radius: 10px; margin: 0 0 1rem; background: var(--chip); border-left: 4px solid var(--info); }
.flash-ok { border-left-color: var(--ok); }
.flash-error { border-left-color: var(--err); }

/* ---- add form ---- */
.addform { display: flex; gap: .5rem; align-items: stretch; margin: 0 0 1rem; }
.addform input { flex: 1; min-width: 0; font-size: 1.05rem; }
.addform .btn-ghost { padding: .6rem .8rem; }
@media (max-width: 560px) { .addform { flex-wrap: wrap; } .addform input { flex-basis: 100%; } .addform .btn { flex: 1; justify-content: center; } }

.photoform { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin: -.5rem 0 1rem; }
.photoform label { margin: 0; cursor: pointer; }
.textform { margin: 0 0 1rem; }
.textform textarea { margin-bottom: .5rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; }
.ocr-fix { margin: 1rem 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem; }
.ocr-fix summary { cursor: pointer; font-weight: 600; }
.ocr-fix textarea { margin: .5rem 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; }

/* ---- landing ---- */
.landing .hero-copy { text-align: center; padding: 3rem 0 2rem; max-width: 720px; margin: 0 auto; }
.landing .hero-copy h1 { font-size: clamp(2rem, 6vw, 3.2rem); }
.landing .hero-copy h1 em { color: var(--accent); font-style: normal; }
.landing .hero-copy > p { font-size: 1.1rem; color: var(--muted); }
.landing .addform { margin: 1.5rem auto; max-width: 640px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-top: 2rem; }
.features div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.features b { display: block; margin-bottom: .25rem; }
.features span { color: var(--muted); font-size: .95rem; }

/* ---- auth ---- */
.authbox { max-width: 420px; margin: 2rem auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.75rem; box-shadow: var(--shadow); }
.authbox .btn { width: 100%; justify-content: center; margin-top: .25rem; }
.authbox h2 { margin-top: 1.25rem; font-size: 1.05rem; }
.inline-check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.inline-check input { width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--accent); }

/* ---- library ---- */
.library-head { margin-bottom: 1rem; }
.searchbar { display: flex; gap: .5rem; margin-bottom: .75rem; }
.searchbar input { flex: 1; min-width: 0; }
.searchbar select { width: auto; }
@media (max-width: 560px) { .searchbar { flex-wrap: wrap; } .searchbar input { flex-basis: 100%; } }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; }
.chip { display: inline-flex; align-items: center; gap: .3rem; background: var(--chip); color: var(--ink); border-radius: 999px; padding: .3rem .75rem; font-size: .9rem; border: 1px solid transparent; }
.chip.on { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.chip:hover { text-decoration: none; border-color: var(--accent); }
.chip small { color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--ink); box-shadow: var(--shadow); transition: transform .12s ease; }
.card:hover { transform: translateY(-2px); text-decoration: none; }
.card .thumb { aspect-ratio: 4 / 3; background: var(--chip); display: grid; place-items: center; font-size: 2.5rem; position: relative; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .thumb .fav { position: absolute; top: .5rem; right: .6rem; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.6); font-style: normal; }
.card-body { padding: .75rem .9rem 1rem; }
.card h3 { font-size: 1rem; margin: 0 0 .25rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card p { margin: 0; }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty h2 { color: var(--ink); }
.pager { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 1.5rem; }

/* ---- recipe ---- */
.recipe { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.recipe .hero { max-height: 380px; overflow: hidden; background: var(--chip); }
.recipe .hero img { width: 100%; height: 100%; max-height: 380px; object-fit: cover; }
.recipe-head { padding: 1.5rem clamp(1rem, 4vw, 2rem) 0; }
.recipe-head .source { margin: 0 0 .5rem; color: var(--muted); }
.recipe-head .desc { color: var(--muted); margin: .25rem 0 .75rem; }
.meta { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; padding: 0; margin: .5rem 0 .75rem; }
.meta li { font-weight: 600; }
.meta li span { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.tags { margin: 0 0 .5rem; display: flex; gap: .4rem; flex-wrap: wrap; }
.recipe-actions { display: flex; flex-wrap: wrap; gap: .5rem; padding: .75rem clamp(1rem, 4vw, 2rem); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--chip) 45%, var(--card)); }
.recipe-body { display: grid; grid-template-columns: minmax(260px, 1fr) 2fr; gap: 2rem; padding: 1.5rem clamp(1rem, 4vw, 2rem); }
@media (max-width: 760px) { .recipe-body { grid-template-columns: 1fr; gap: 1.5rem; } }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.scaler { display: inline-flex; align-items: center; gap: .35rem; background: var(--chip); border-radius: 999px; padding: .2rem; }
.scaler button:not(.linklike) { width: 2rem; height: 2rem; border-radius: 50%; border: 0; background: var(--card); color: var(--ink); font-weight: 700; cursor: pointer; }
.scaler .js-scale-label { min-width: 4.5rem; text-align: center; font-weight: 600; font-size: .9rem; padding: 0 .25rem; }
.scaler .js-scale-reset { font-size: .8rem; padding: 0 .5rem; }
.sub { font-size: .95rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 1rem 0 .25rem; }
.ing-list, .step-list { list-style: none; padding: 0; margin: 0; }
.ing { border-bottom: 1px solid var(--line); }
.ing label { display: flex; gap: .6rem; align-items: flex-start; padding: .55rem 0; margin: 0; font-weight: 400; cursor: pointer; }
.ing input { margin-top: .3rem; width: 1.1rem; height: 1.1rem; flex: none; accent-color: var(--accent); }
.ing .qty, .ing .unit { font-weight: 700; }
.ing .note { color: var(--muted); }
.ing.done .ing-text { opacity: .45; text-decoration: line-through; }
.step { display: flex; gap: .85rem; padding: .65rem 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.step .num { flex: none; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
.step p { margin: .2rem 0 0; }
.step.done { opacity: .45; }
.step.done p { text-decoration: line-through; }
.step.active { background: color-mix(in srgb, var(--accent) 8%, transparent); margin: 0 -.5rem; padding-left: .5rem; padding-right: .5rem; border-radius: 8px; }
.nutrition { margin: 0 clamp(1rem, 4vw, 2rem) 1rem; }
.nutrition summary { cursor: pointer; font-weight: 600; }
.nutrition ul { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .35rem 1rem; font-size: .9rem; }
.nutrition li span { color: var(--muted); display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; }
.notes { padding: 1rem clamp(1rem, 4vw, 2rem); border-top: 1px solid var(--line); }
.notes textarea { margin-bottom: .5rem; }
.tagline { font-weight: 600; }
.danger-zone { padding: 0 clamp(1rem, 4vw, 2rem) 1.25rem; text-align: right; }

/* cook mode: bigger, calmer, screen stays awake (see app.js) */
body.cook-mode { font-size: 1.2rem; }
body.cook-mode .topbar, body.cook-mode .footer, body.cook-mode .hero, body.cook-mode .notes, body.cook-mode .danger-zone, body.cook-mode .nutrition, body.cook-mode .desc { display: none; }
body.cook-mode .recipe-body { grid-template-columns: 1fr; }
body.cook-mode .step p { font-size: 1.25rem; line-height: 1.5; }

@media print {
  .topbar, .footer, .recipe-actions, .notes form button, .danger-zone, .scaler, .ing input, .addform, .flash { display: none !important; }
  body { background: #fff; color: #000; }
  .recipe { border: 0; box-shadow: none; }
  .recipe .hero { max-height: 220px; }
  .recipe-body { grid-template-columns: 1fr 2fr; }
}

/* ---- import ---- */
.import h1 { margin-bottom: .25rem; }
.import-how { margin: 1rem 0 1.25rem; }
.import-how details { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem; margin-bottom: .5rem; }
.import-how summary { cursor: pointer; }
.import-how ol { margin: .5rem 0 0; padding-left: 1.25rem; }
.import-how code { background: var(--chip); padding: .1rem .35rem; border-radius: 6px; }
.import-form { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.import-form input[type=file] { display: block; margin-top: .35rem; }
.import-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.import-preview, .import-progress { margin-top: 1.25rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.import-list { list-style: none; padding: 0; margin: .75rem 0; max-height: 360px; overflow: auto; border-top: 1px solid var(--line); }
.import-list li { padding: .45rem 0; border-bottom: 1px solid var(--line); display: flex; gap: .6rem; align-items: baseline; font-size: .95rem; }
.import-list .st { flex: none; width: 1.4rem; text-align: center; }
.import-list .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-list .msg { color: var(--muted); font-size: .85rem; flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-list li.failed .msg { color: var(--err); }
.import-list li.imported .st { color: var(--ok); }
progress { width: 100%; height: 12px; accent-color: var(--accent); }

/* ---- Fred Meyer / Kroger cart modal ---- */
.kr-modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: none; align-items: flex-end; justify-content: center; z-index: 50; padding: 0; }
.kr-modal.on { display: flex; }
.kr-card { background: var(--card); color: var(--ink); width: min(720px, 100%); max-height: 92vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 1rem 1.1rem 1.25rem; box-shadow: 0 -10px 40px rgba(0,0,0,.35); }
@media (min-width: 760px) { .kr-modal { align-items: center; padding: 1rem; } .kr-card { border-radius: var(--radius); } }
.kr-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; font-size: 1.1rem; }
.kr-zip { display: flex; gap: .5rem; margin: .5rem 0; }
.kr-zip input { width: 9rem; }
.kr-store { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; background: var(--chip); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; margin: .35rem 0; cursor: pointer; color: var(--ink); }
.kr-store span { color: var(--muted); font-size: .85rem; }
.kr-list { border-top: 1px solid var(--line); }
.kr-row { display: grid; grid-template-columns: auto 1fr 1.4fr auto; gap: .6rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--line); margin: 0; font-weight: 400; cursor: pointer; }
.kr-row.nomatch { opacity: .55; }
.kr-row.staple .kr-ing small { display: block; }
.kr-select { margin: .25rem 0 .5rem; }
.kr-row input[type=checkbox] { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
.kr-ing b { font-weight: 600; font-size: .95rem; }
.kr-match { min-width: 0; display: flex; flex-direction: column; gap: .25rem; }
.kr-prod { display: flex; gap: .5rem; align-items: center; min-width: 0; }
.kr-prod img, .kr-prod i { width: 40px; height: 40px; object-fit: contain; border-radius: 6px; background: #fff; flex: none; display: block; }
.kr-prod span { min-width: 0; display: flex; flex-direction: column; }
.kr-prod b { font-weight: 500; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kr-prod small { color: var(--muted); }
.kr-prod em { color: var(--ok); font-style: normal; font-weight: 600; }
.kr-alt { display: block; width: 100%; text-align: left; background: var(--chip); border: 1px solid var(--line); border-radius: 8px; padding: .35rem .5rem; cursor: pointer; color: var(--ink); }
.kr-usual { color: var(--accent); font-weight: 600; }
.kr-search { font-size: .85rem; }
.kr-qty { width: 3.6rem; padding: .3rem .4rem; }
@media (max-width: 560px) { .kr-row { grid-template-columns: auto 1fr auto; } .kr-match { grid-column: 2 / 4; } }

/* ---- toast (planner.js) ---- */
.jr-toast { position: fixed; left: 50%; bottom: 1.25rem; transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: .7rem 1rem; border-radius: 12px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: all .2s ease; z-index: 60; max-width: min(92vw, 560px); font-size: .95rem; }
.jr-toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.jr-toast a { color: var(--bg); text-decoration: underline; font-weight: 600; }
.jr-toast.error { background: var(--err); color: #fff; }

/* ---- meal plan ---- */
.plan-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem 1rem; margin-bottom: 1rem; }
.plan-head h1 { margin-bottom: 0; }
.plan-head p { margin: 0; }
.plan-nav, .plan-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .75rem; }
.plan-day { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem .85rem; }
.plan-day.today { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.plan-day h2 { font-size: 1rem; display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .5rem; }
.plan-day h2 small { color: var(--muted); font-weight: 500; }
.plan-slot { border-top: 1px solid var(--line); padding: .4rem 0; }
.plan-slot-head { display: flex; justify-content: space-between; align-items: center; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.plan-slot-head .linklike { font-size: .8rem; text-transform: none; letter-spacing: 0; font-weight: 600; }
.plan-slot.empty .plan-slot-head .linklike { opacity: .6; }
.plan-slot.empty:hover .plan-slot-head .linklike { opacity: 1; }
.plan-entry { display: flex; align-items: center; gap: .5rem; padding: .35rem 0; }
.plan-entry-main { display: flex; align-items: center; gap: .5rem; flex: 1; min-width: 0; color: var(--ink); }
.plan-entry-main:hover { text-decoration: none; color: var(--accent); }
.plan-entry-main img, .plan-entry-main i { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; flex: none; background: var(--chip); display: grid; place-items: center; font-style: normal; }
.plan-entry-main > span { min-width: 0; display: flex; flex-direction: column; font-weight: 600; font-size: .92rem; line-height: 1.25; }
.plan-entry-main > span small { color: var(--muted); font-weight: 400; }
.plan-entry-main.note > span { font-weight: 500; }
.plan-servings { display: inline-flex; align-items: center; gap: .2rem; margin: 0; font-weight: 400; font-size: .8rem; color: var(--muted); }
.plan-servings input { width: 3.4rem; padding: .2rem .35rem; font-size: .85rem; margin: 0; }
.plan-entry .js-plan-del { color: var(--muted); }
.plan-entry .js-plan-del:hover { color: var(--err); }
.plan-pop { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; width: 100%; padding: .5rem 0 0; }
.plan-pop label { margin: 0; font-size: .8rem; }
.plan-pop input, .plan-pop select { width: auto; padding: .4rem .6rem; }
.picker-results { max-height: 50vh; overflow: auto; margin: .75rem 0; border-top: 1px solid var(--line); }
.picker-item { display: flex; gap: .6rem; align-items: center; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: .5rem .25rem; cursor: pointer; color: var(--ink); }
.picker-item:hover { background: var(--chip); }
.picker-item img, .picker-item i { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--chip); display: grid; place-items: center; font-style: normal; flex: none; }
.picker-item span { display: flex; flex-direction: column; min-width: 0; }
.picker-item b { font-weight: 600; }
.picker-item small { color: var(--muted); }
.picker-note { display: flex; gap: .5rem; }
.picker-note input { flex: 1; }

/* ---- filters / cookbooks / pantry ---- */
.searchbar .btn.on { border-color: var(--accent); color: var(--accent); }
.filters { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: flex-end; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem; margin-top: .25rem; }
.filters label { margin: 0; font-size: .85rem; flex: 1 1 180px; }
.filters label input[type=text], .filters select { width: 100%; }
.filters .inline-check { flex: 0 1 auto; font-weight: 500; }
.cb-banner { background: var(--chip); border-radius: 10px; padding: .5rem .85rem; margin: 0 0 .75rem; }
.cb-chip { background: color-mix(in srgb, var(--accent) 10%, var(--chip)); }
.cb-new { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.cb-new input { flex: 1 1 200px; }
.cb-card .thumb { font-size: 3rem; }
.cb-card h3 a { color: var(--ink); }
.cb-edit { margin-top: .5rem; }
.cb-edit form { display: flex; flex-direction: column; gap: .4rem; margin-top: .5rem; }
.cookbook-form { margin-top: 1rem; }
.cookbook-checks { display: flex; flex-wrap: wrap; gap: .35rem 1rem; margin: .25rem 0 .5rem; }
.cookbook-checks .inline-check { margin: 0; }
.card .thumb .cov { position: absolute; left: .5rem; bottom: .5rem; background: rgba(0,0,0,.65); color: #fff; font-style: normal; font-size: .75rem; padding: .15rem .5rem; border-radius: 999px; }
.g-pantry { color: var(--ok); white-space: nowrap; }
.scan-result { border-color: var(--accent); }
.scan-result .scan-name { padding: .3rem .5rem; font-size: .95rem; }
.scan-result .g-main { gap: .5rem; }
.activity { list-style: none; padding: 0; margin: 0; }
.activity li { display: flex; gap: .6rem; align-items: baseline; padding: .45rem 0; border-top: 1px solid var(--line); font-size: .95rem; }
.activity .act-icon { flex: none; width: 1.5rem; text-align: center; }
.activity .act-body { flex: 1; min-width: 0; }
.activity .act-when { flex: none; }

/* ---- cook log, tidy, duplicates, auto-plan ---- */
.cooklog { padding: 1rem clamp(1rem, 4vw, 2rem) 0; border-top: 1px solid var(--line); }
.madeit { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .5rem 0; }
.madeit input[type=date] { width: auto; padding: .4rem .6rem; }
.madeit input[type=text] { flex: 1 1 200px; padding: .4rem .6rem; }
.stars { display: inline-flex; flex-direction: row-reverse; gap: .1rem; font-size: 1.5rem; line-height: 1; }
.stars input { display: none; }
.stars label { color: var(--line); cursor: pointer; }
.stars input:checked ~ label, .stars label:hover, .stars label:hover ~ label { color: #e0a800; }
.rated { color: #e0a800; font-weight: 600; }
.cooklog-list { list-style: none; padding: 0; margin: .25rem 0 .5rem; }
.cooklog-list li { display: flex; justify-content: space-between; gap: .5rem; padding: .3rem 0; border-top: 1px solid var(--line); font-size: .95rem; }
.tidy h1 { margin-bottom: .25rem; }
.tidy-changes { margin: .5rem 0 .75rem; padding-left: 1.25rem; }
.tidy-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
@media (max-width: 760px) { .tidy-cols { grid-template-columns: 1fr; } }
.tidy-after { border-color: var(--accent); }
.tidy-list { padding-left: 1.25rem; font-size: .92rem; }
.tidy-list li { margin: .15rem 0; }
.tidy h4 { margin: .75rem 0 .25rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.dupe-group h3 { display: flex; justify-content: space-between; gap: 1rem; }
.dupe-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; padding: .5rem 0; border-top: 1px solid var(--line); }
.dupe-row .inline-check { margin: 0; font-weight: 500; font-size: .9rem; }
.dupe-main { display: flex; align-items: center; gap: .6rem; flex: 1 1 300px; min-width: 0; color: var(--ink); }
.dupe-main img, .dupe-main i { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--chip); display: grid; place-items: center; font-style: normal; flex: none; }
.dupe-main span { display: flex; flex-direction: column; min-width: 0; }
.autoplan { margin-bottom: 1rem; }
.autoplan > label { flex: 1 1 220px; }

/* ---- household ---- */
.household h1 { margin-bottom: .25rem; }
.hh-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin-top: 1rem; }
.hh-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-top: 1rem; }
.hh-card h2 { margin-bottom: .25rem; }
.hh-card h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1.25rem 0 .5rem; }
.hh-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.hh-rename { display: flex; gap: .5rem; align-items: center; }
.hh-rename input { width: 16rem; padding: .4rem .6rem; }
.hh-members { list-style: none; padding: 0; margin: 0; }
.hh-members li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .5rem 0; border-top: 1px solid var(--line); }
.hh-code { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.hh-code code { font-size: 1.5rem; letter-spacing: .12em; background: var(--chip); padding: .35rem .7rem; border-radius: 10px; }
.hh-leave { margin-top: 1.5rem; display: flex; gap: .75rem; align-items: center; }

/* ---- grocery list ---- */
.g-add { display: flex; gap: .5rem; margin: 0 0 1rem; }
.g-add input { flex: 1; }
.g-group { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .9rem; margin-bottom: .75rem; }
.g-group h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: .35rem 0; }
.g-row { display: flex; align-items: center; gap: .5rem; padding: .3rem 0; border-top: 1px solid var(--line); }
.g-main { display: flex; align-items: center; gap: .6rem; flex: 1; min-width: 0; margin: 0; font-weight: 400; cursor: pointer; }
.g-main input { width: 1.2rem; height: 1.2rem; margin: 0; accent-color: var(--accent); flex: none; }
.g-text b { font-weight: 700; }
.g-row.done .g-text { opacity: .5; text-decoration: line-through; }
.g-src { max-width: 30%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-row select { width: auto; padding: .2rem .4rem; font-size: .8rem; color: var(--muted); background: transparent; border-color: transparent; }
.g-row select:hover, .g-row select:focus { border-color: var(--line); }
.g-row .js-g-del { color: var(--muted); }
.g-row .js-g-del:hover { color: var(--err); }
.g-done { opacity: .8; }
@media (max-width: 560px) { .g-src { display: none; } }

/* ---- brand mark ---- */
.brand .brand-mark { width: 26px; height: 26px; vertical-align: -7px; margin-right: .15rem; }

/* ---- courses ---- */
.course-form { display: flex; align-items: center; gap: .5rem; margin: .25rem 0 .5rem; }
.course-form select { padding: .3rem .5rem; }
.course-list { list-style: none; padding: 0; margin: .5rem 0; }
.course-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .4rem 0; border-top: 1px solid var(--line); }
.course-list li a { flex: 1 1 240px; font-weight: 600; }
.course-list select { padding: .25rem .4rem; }
.plan-preview table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.plan-preview td, .plan-preview th { padding: .4rem .5rem; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.plan-preview .muted { display: block; }
.suggest-form { display: inline; margin-left: .5rem; font-weight: 400; }
.plan-preview h3 small { display: block; font-weight: 400; font-size: .85rem; }

/* ---- download page ---- */
.download h1 { margin-bottom: .25rem; }
.dl-card { display: flex; align-items: center; gap: 1rem; }
.dl-main { flex: 1 1 auto; min-width: 0; }
.dl-card h3 { margin: 0 0 .25rem; }
.dl-card h3 small { font-weight: 400; font-size: .85rem; }
.dl-card p { margin: .2rem 0; }
.dl-link code { font-size: .8rem; word-break: break-all; }
@media (max-width: 560px) { .dl-card { flex-direction: column; align-items: stretch; } }
.range-label input[type=range] { width: 180px; vertical-align: middle; margin: 0 .4rem; }
.range-label output { font-weight: 600; min-width: 2.5em; display: inline-block; }
.range-label small { display: block; }

/* ---- plan extras ---- */
.people-form input[type=number] { width: 3.6em; padding: .2rem .3rem; }
.plan-tools { flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; margin: .25rem 0 .5rem; }
.plan-tools details { flex: 1 1 100%; }
.plan-tools details summary { cursor: pointer; font-weight: 600; }
.cook-form select { padding: .15rem .3rem; font-size: .8rem; max-width: 9em; }
h2 .people-form { display: inline; margin-left: .5rem; font-weight: 400; font-size: .85rem; }
h2 .kcal { margin-left: .5rem; font-weight: 400; font-size: .8rem; }
.plan-entry-main small { display: block; }
.nutrition { margin: .25rem 0 .5rem; }
.versions details { margin: .5rem 0 1rem; }
.versions summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.useitup { padding-top: 1rem; border-top: 1px solid var(--line); margin-top: 1rem; }

/* ---- small screens: the top bar wraps instead of forcing the whole page wide ---- */
@media (max-width: 880px) {
  .topbar { flex-wrap: wrap; gap: .4rem .75rem; padding-top: .6rem; padding-bottom: .55rem; }
  .topbar nav { flex-wrap: wrap; width: 100%; gap: .3rem .9rem; font-size: .95rem; }
  .topbar nav a, .topbar nav button { white-space: nowrap; }
}
html { overflow-x: clip; }
img, video, table { max-width: 100%; }
input, select, textarea { max-width: 100%; box-sizing: border-box; }

/* ---- landing + download overhaul ---- */
.cta-row { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; margin: 1.5rem 0 .5rem; }
.btn-big { font-size: 1.05rem; padding: .8rem 1.6rem; }
.btn-big small { display: block; font-weight: 400; font-size: .75rem; opacity: .85; }
.features-big { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.features-big div b { display: block; font-size: 1.05rem; margin-bottom: .3rem; }
.features-big div span { color: var(--muted); font-size: .95rem; line-height: 1.45; }
.pricing-tease { text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin: 2rem auto 0; max-width: 720px; color: var(--muted); }
.landing .hero-try { max-width: 720px; margin: 2.75rem auto 0; text-align: center; }
.dl-hero { text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; margin: 1rem 0 1.5rem; }
.dl-steps { text-align: left; max-width: 460px; margin: .9rem auto 0; color: var(--muted); font-size: .95rem; }

/* ---- tidy chip rows: the long tail folds away ---- */
.chips-more { margin: .5rem 0 0; }
.chips-more summary { cursor: pointer; color: var(--muted); font-size: .9rem; padding: .2rem 0; user-select: none; }
.chips-more summary:hover { color: var(--ink); }
.chips-more[open] summary { margin-bottom: .5rem; }
.chips-more .chips { margin-bottom: .5rem; }

.picker-fold .cookbook-checks { display: flex; flex-wrap: wrap; gap: .25rem .9rem; max-height: 14rem; overflow-y: auto; padding: .35rem 0; }

/* compact filter forms: toggles flow and wrap instead of one-per-line */
.filters { row-gap: .6rem; }
.filters label { flex: 1 1 150px; }
@media (max-width: 560px) { .filters { padding: .65rem .8rem; } }
