/* Family Kitchen — calm, warm and readable. No external fonts or images. */

:root {
    --bg: #f7f1ea;
    --surface: #fffdfa;
    --surface-2: #f1e8dd;
    --text: #2a241f;
    --muted: #6a5e53;
    --border: #e2d5c6;
    --primary: #a8481f;
    --primary-strong: #8a3a17;
    --primary-soft: #f6e1d3;
    --on-primary: #ffffff;
    --accent: #4f6e4a;
    --accent-soft: #e2ecdf;
    --warn: #8a5a00;
    --warn-soft: #fbefd2;
    --danger: #a52a2a;
    --danger-soft: #f9dfdc;
    --focus: #1f5fbf;
    --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 4px 14px rgba(60, 40, 20, .06);
    --radius: 14px;
    --radius-sm: 10px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
    --font-head: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    --tap: 44px;
    --nav-h: 64px;
    color-scheme: light;
}

:root[data-theme="dark"] {
    --bg: #1d1a17;
    --surface: #26221e;
    --surface-2: #302a25;
    --text: #f3ece4;
    --muted: #c0b3a5;
    --border: #463d35;
    --primary: #f0956a;
    --primary-strong: #ffb08c;
    --primary-soft: #4a2f22;
    --on-primary: #1d1a17;
    --accent: #9cc293;
    --accent-soft: #2c3a2a;
    --warn: #f2c66d;
    --warn-soft: #3d3220;
    --danger: #ff9b8f;
    --danger-soft: #4a2622;
    --focus: #8ab4ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 17px/1.55 var(--font);
    padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 16px);
}

@media (min-width: 900px) {
    body { padding-bottom: 32px; }
}

h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.3rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .8em; }
a { color: var(--primary-strong); text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }
small, .small { font-size: .875rem; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.pre-line { white-space: pre-line; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sprite { display: none; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

.skip-link { position: absolute; left: 8px; top: -60px; background: var(--surface); padding: 10px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { top: 8px; }

.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.25em; }
.icon.star { color: #c98a00; }

/* ───────── Layout ───────── */

.container { max-width: 1120px; margin: 0 auto; padding: 16px 16px 24px; }
.container.narrow { max-width: 720px; }
.container.wide { max-width: 1320px; }
main:focus { outline: none; }

.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1320px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 8px 16px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-family: var(--font-head); font-size: 1.2rem; font-weight: 600; }
.top-nav { display: none; gap: 4px; margin-left: 16px; }
.top-nav a { padding: 8px 12px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 500; }
.top-nav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary-strong); }
.top-nav a:hover { color: var(--text); }
.topbar-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; }

@media (min-width: 900px) {
    .top-nav { display: flex; }
}

.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    display: grid; grid-template-columns: repeat(4, 1fr);
    background: var(--surface); border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--nav-h); text-decoration: none; color: var(--muted); font-size: .8rem; font-weight: 600; }
.bottom-nav .icon { width: 26px; height: 26px; }
.bottom-nav a[aria-current="page"] { color: var(--primary-strong); }
@media (min-width: 900px) { .bottom-nav { display: none; } }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; justify-content: space-between; margin: 8px 0 20px; }
.page-head h1 { margin: 0; }
.page-head .lead { margin: 4px 0 0; color: var(--muted); }

.stack > * + * { margin-top: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.row.tight { gap: 6px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: 1fr; }
.grid.three { grid-template-columns: 1fr; }
@media (min-width: 720px) {
    .grid.two { grid-template-columns: 1fr 1fr; }
    .grid.three { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) { .grid.three { grid-template-columns: repeat(3, 1fr); } }
.split { display: grid; gap: 24px; }
@media (min-width: 960px) { .split { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: start; } }

/* ───────── Surfaces ───────── */

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-head h2, .card-head h3 { margin: 0; }
.section { margin-top: 28px; }

.empty { text-align: center; padding: 28px 18px; color: var(--muted); border: 2px dashed var(--border); border-radius: var(--radius); background: var(--surface); }
.empty h2, .empty h3 { color: var(--text); }
.empty .btn { margin-top: 8px; }

.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid; }
.flash > span, .flash > div { flex: 1; }
.flash-success { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.flash-info { background: var(--surface-2); border-color: var(--border); }
.flash-error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.flash-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.notice { background: var(--warn-soft); border-radius: var(--radius-sm); padding: 12px 14px; }
.validation-summary ul { margin: 4px 0 0; padding-left: 1.2em; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.ok { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.chip { font-size: .8rem; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
a.chip { text-decoration: none; }

/* ───────── Buttons ───────── */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: var(--tap); padding: 8px 16px; border-radius: 999px;
    border: 1px solid var(--border); background: var(--surface); color: var(--text);
    font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.2;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--on-primary); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.small { min-height: 36px; padding: 4px 12px; font-size: .9rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; min-width: var(--tap); min-height: var(--tap); border-radius: 999px; border: 0; background: transparent; color: var(--text); cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.small { min-width: 34px; min-height: 34px; }
.inline-form { display: inline; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ───────── Forms ───────── */

label, .label { display: block; font-weight: 600; margin-bottom: 4px; }
.hint { display: block; font-size: .875rem; color: var(--muted); font-weight: 400; margin-top: 2px; }
.field { margin-bottom: 14px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=date], input[type=search], input:not([type]), select, textarea {
    width: 100%; min-height: var(--tap); padding: 9px 12px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); }
input[type=checkbox], input[type=radio] { width: 22px; height: 22px; accent-color: var(--primary); vertical-align: middle; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; min-height: var(--tap); padding: 8px 0; cursor: pointer; }
.check input { margin-top: 2px; flex: none; }
.input-validation-error { border-color: var(--danger) !important; background: var(--danger-soft) !important; }
.field-validation-error { color: var(--danger); font-size: .9rem; display: block; margin-top: 4px; }
.form-grid { display: grid; gap: 0 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) {
    .form-grid.two { grid-template-columns: 1fr 1fr; }
    .form-grid.three { grid-template-columns: repeat(3, 1fr); }
    .form-grid.four { grid-template-columns: repeat(4, 1fr); }
}
.span-all { grid-column: 1 / -1; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px 6px; margin: 0 0 18px; }
legend { font-family: var(--font-head); font-weight: 600; font-size: 1.15rem; padding: 0 6px; }
.search-bar { display: flex; gap: 8px; }
.search-bar input { flex: 1; }
.sticky-actions { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); background: color-mix(in srgb, var(--bg) 94%, transparent); padding: 12px 0; border-top: 1px solid var(--border); z-index: 10; }
@media (min-width: 900px) { .sticky-actions { bottom: 0; } }

details.disclosure { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
details.disclosure > summary { cursor: pointer; padding: 12px 14px; font-weight: 600; min-height: var(--tap); list-style: none; display: flex; align-items: center; gap: 8px; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
details.disclosure[open] > summary::before { transform: rotate(90deg); }
details.disclosure > .disclosure-body { padding: 0 14px 14px; }

/* ───────── Tables & lists ───────── */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .85rem; color: var(--muted); font-weight: 600; }
.list { list-style: none; padding: 0; margin: 0; }
.list > li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.list > li:last-child { border-bottom: 0; }
.link-list a { display: flex; align-items: center; gap: 12px; padding: 14px 4px; text-decoration: none; color: var(--text); font-weight: 600; min-height: 52px; }
.link-list a .icon { color: var(--primary); width: 24px; height: 24px; }
.link-list a small { display: block; font-weight: 400; color: var(--muted); }

/* ───────── Recipes ───────── */

.recipe-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.recipe-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.recipe-card-link { display: block; color: inherit; text-decoration: none; height: 100%; }
.recipe-card-link:hover h3 { text-decoration: underline; }
.recipe-card-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface-2); }
.recipe-card-img.placeholder { display: grid; place-items: center; background: linear-gradient(135deg, var(--primary-soft), var(--accent-soft)); }
.recipe-card-img.placeholder span { font-family: var(--font-head); font-size: 3rem; color: var(--primary-strong); opacity: .6; }
.recipe-card-body { padding: 12px 14px 14px; }
.recipe-card-body h3 { margin: 0 0 4px; font-size: 1.08rem; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: .9rem; margin: 0; align-items: center; }
.meta span { display: inline-flex; align-items: center; gap: 4px; }
.fav { color: var(--primary); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.filters > * { flex: 1 1 150px; }
.filters .check { flex: 0 0 auto; }

.recipe-hero { display: grid; gap: 18px; margin-bottom: 20px; }
@media (min-width: 860px) { .recipe-hero.has-photo { grid-template-columns: 1fr 1fr; align-items: center; } }
.recipe-hero img { border-radius: var(--radius); width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.fact { background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 12px; min-width: 96px; }
.fact strong { display: block; font-size: 1.05rem; }
.fact span { font-size: .8rem; color: var(--muted); }
.servings { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 2px; }
.servings input { width: 64px; text-align: center; border: 0; min-height: 40px; padding: 4px; background: transparent; font-weight: 700; }
.servings .icon-btn { min-width: 40px; min-height: 40px; font-size: 1.3rem; font-weight: 700; }
.ingredients { list-style: none; padding: 0; margin: 0; }
.ingredients li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.ingredients .amount { flex: 0 0 6.5em; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.ingredients .optional { color: var(--muted); font-size: .85rem; }
.ingredients-group { font-family: var(--font-head); margin: 14px 0 2px; font-size: 1.05rem; }
.steps { padding: 0; margin: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 4px 0 16px 44px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 2px; width: 30px; height: 30px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-strong); display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
.steps li.section-title { counter-increment: none; font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; padding: 6px 0 10px; }
.steps li.section-title::before { content: none; }
.steps .timer-chip { display: inline-flex; align-items: center; gap: 4px; font-size: .85rem; background: var(--accent-soft); color: var(--accent); padding: 2px 10px; border-radius: 999px; margin-top: 4px; }
.stars { display: inline-flex; gap: 2px; }
.stars button { border: 0; background: transparent; color: var(--border); cursor: pointer; min-width: 40px; min-height: 40px; display: grid; place-items: center; border-radius: 8px; }
.stars button.on { color: #c98a00; }
.stars button .icon { width: 26px; height: 26px; }
.photo-strip { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.photo-strip figure { margin: 0; }
.photo-strip img { border-radius: var(--radius-sm); aspect-ratio: 1; object-fit: cover; width: 100%; }
.photo-strip figcaption { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.comment { padding: 10px 0; border-bottom: 1px solid var(--border); }
.comment .who { font-weight: 600; }

/* recipe form rows */
.rows { display: grid; gap: 10px; }
.ing-row { display: grid; gap: 8px; grid-template-columns: 5.5rem 6.5rem 1fr; align-items: start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; }
.ing-row .ing-prep, .ing-row .ing-extra { grid-column: 1 / -1; }
.ing-row .ing-extra { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; }
.ing-row.review { border-color: var(--warn); background: var(--warn-soft); }
.ing-row .review-note { grid-column: 1 / -1; font-size: .85rem; color: var(--warn); font-weight: 600; }
.ing-row label, .step-row label { font-size: .8rem; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
@media (min-width: 820px) {
    .ing-row { grid-template-columns: 6rem 7rem minmax(0, 1.4fr) minmax(0, 1.2fr) minmax(0, .8fr); }
    .ing-row .ing-prep { grid-column: auto; }
    .ing-row .ing-extra { grid-column: 1 / -1; }
}
.step-row { display: grid; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; grid-template-columns: 1fr 1fr; }
.step-row .step-text { grid-column: 1 / -1; }
.row-tools { display: flex; gap: 2px; }

/* ───────── Planner ───────── */

.week-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.week { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 1100px) { .week { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; } }
.day { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; scroll-margin-top: 80px; }
.day.today { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.day.past { opacity: .85; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; margin-bottom: 6px; }
.day-head h2 { font-size: 1.05rem; margin: 0; }
.slot { margin-top: 8px; min-height: 30px; border-radius: var(--radius-sm); }
.slot.drop-target { outline: 2px dashed var(--primary); outline-offset: 2px; }
.slot-title { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.slot-title a { text-transform: none; letter-spacing: 0; font-weight: 600; font-size: .85rem; text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; padding: 0 6px; }
.meal { background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 10px; margin-top: 6px; }
.meal[draggable="true"] { cursor: grab; }
.meal.cooked { background: var(--accent-soft); }
.meal-title { font-weight: 600; display: block; color: var(--text); text-decoration: none; }
.meal .meta { font-size: .82rem; }
.meal details summary { font-size: .85rem; color: var(--primary-strong); cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.meal .meal-actions { display: grid; gap: 8px; padding-top: 8px; }
.meal .meal-actions form { display: grid; gap: 6px; }

/* ───────── Shopping ───────── */

.sync-status { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); }
.sync-status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.sync-status[data-state="live"]::before { background: #3b9b4a; }
.sync-status[data-state="error"] { color: var(--danger); }
.sync-status[data-state="error"]::before { background: var(--danger); }
.progress { width: 100%; height: 10px; accent-color: var(--accent); }
.aisle { margin-top: 18px; }
.aisle h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-family: var(--font); margin-bottom: 6px; }
.shop-items { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.shop-item { border-bottom: 1px solid var(--border); scroll-margin-top: 90px; }
.shop-item:last-child { border-bottom: 0; }
.shop-line { display: flex; align-items: center; gap: 4px; }
.check-form { flex: 1; min-width: 0; }
.check-btn { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 10px 12px 12px; min-height: 60px; border: 0; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; border-radius: var(--radius); }
.check-btn:hover { background: var(--surface-2); }
.check-box { flex: none; width: 30px; height: 30px; border-radius: 9px; border: 2px solid var(--muted); display: grid; place-items: center; color: transparent; background: var(--surface); }
.check-btn[aria-pressed="true"] .check-box { background: var(--accent); border-color: var(--accent); color: #fff; }
.check-btn[aria-pressed="true"] .item-name { text-decoration: line-through; color: var(--muted); }
.check-btn .icon { width: 20px; height: 20px; }
.item-text { min-width: 0; flex: 1; }
.item-name { font-weight: 600; font-size: 1.05rem; display: block; overflow-wrap: anywhere; }
.item-qty { font-weight: 700; color: var(--primary-strong); margin-right: 6px; }
.item-sub { display: block; font-size: .85rem; color: var(--muted); }
.shop-item.pending .check-btn { opacity: .6; }
.item-more { padding: 0 12px 12px 56px; }
.item-more summary { font-size: .85rem; color: var(--primary-strong); cursor: pointer; min-height: 32px; display: inline-flex; align-items: center; }
.contributions { font-size: .85rem; color: var(--muted); margin: 6px 0; padding-left: 1.1em; }
.review-flag { display: block; margin: 0 12px 10px 56px; font-size: .88rem; background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 6px 10px; }
.add-item { display: flex; gap: 8px; }
.add-item input { flex: 1; font-size: 1.05rem; }

/* ───────── Pantry ───────── */

.pantry-item { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); scroll-margin-top: 80px; }
.pantry-item:last-child { border-bottom: 0; }
.pantry-item a.name { font-weight: 600; text-decoration: none; color: var(--text); }
.expiry-list li { display: flex; justify-content: space-between; gap: 8px; }

/* ───────── Cooking mode ───────── */

body.cooking { font-size: 20px; padding-bottom: 24px; }
.cook-top { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--border); padding: 8px 0; }
.cook-top-inner { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cook-title { font-family: var(--font-head); font-size: 1.2rem; margin: 0; flex: 1; min-width: 12ch; }
.cook-layout { display: grid; gap: 22px; }
@media (min-width: 900px) { .cook-layout { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); } }
.cook-ingredients li { padding: 0; }
.cook-ingredients label { display: flex; gap: 14px; align-items: center; padding: 12px 4px; min-height: 56px; font-weight: 500; cursor: pointer; }
.cook-ingredients input { width: 28px; height: 28px; }
.cook-ingredients input:checked + span { text-decoration: line-through; color: var(--muted); }
.cook-step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.cook-step.done { opacity: .6; }
.cook-step .step-no { font-size: .85rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.cook-step p { font-size: 1.25rem; line-height: 1.6; margin: 6px 0 12px; }
.cook-step-section { font-family: var(--font-head); font-size: 1.1rem; margin: 18px 0 8px; }
body.step-mode .cook-step { display: none; }
body.step-mode .cook-step.current { display: block; }
body.step-mode .cook-step-section { display: none; }
.step-nav { display: none; gap: 10px; }
body.step-mode .step-nav { display: flex; }
.step-nav .btn { flex: 1; min-height: 56px; font-size: 1.05rem; }
.timers { position: sticky; bottom: 0; z-index: 15; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 0; background: var(--bg); }
.timers:empty { display: none; }
.timer { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 2px solid var(--accent); border-radius: 999px; padding: 6px 8px 6px 16px; font-weight: 700; }
.timer.done { border-color: var(--danger); background: var(--danger-soft); animation: pulse 1s infinite; }
.timer .time { font-variant-numeric: tabular-nums; font-size: 1.2rem; }
@keyframes pulse { 50% { transform: scale(1.03); } }
@media (prefers-reduced-motion: reduce) { .timer.done { animation: none; } }

/* ───────── Misc ───────── */

.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin: 24px 0; }
.confirm-dialog { border: 0; border-radius: var(--radius); padding: 22px; max-width: min(92vw, 440px); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.confirm-dialog::backdrop { background: rgba(20, 14, 8, .45); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom, 0px)); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; z-index: 50; max-width: 92vw; box-shadow: var(--shadow); }
@media (min-width: 900px) { .toast { bottom: 24px; } }
.dashboard { display: grid; gap: 18px; }
@media (min-width: 900px) { .dashboard { grid-template-columns: 1fr 1fr; } .dashboard .full { grid-column: 1 / -1; } }
.today-meal { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.today-meal:last-child { border-bottom: 0; }
.today-meal img, .today-meal .ph { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex: none; background: var(--surface-2); }
.big-number { font-family: var(--font-head); font-size: 2.2rem; line-height: 1; }
.login { max-width: 420px; margin: 6vh auto 0; }
.login .brand { justify-content: center; margin-bottom: 18px; font-size: 1.5rem; }
.kbd { font-family: ui-monospace, monospace; font-size: .85em; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.revision-diff { white-space: pre-wrap; font-size: .95rem; }
.print-only { display: none; }

@media print {
    :root, :root[data-theme="dark"] { --bg: #fff; --surface: #fff; --surface-2: #f3f3f3; --text: #000; --muted: #444; --border: #bbb; --primary-strong: #000; --shadow: none; color-scheme: light; }
    body { padding: 0; font-size: 12pt; }
    .no-print, .topbar, .bottom-nav, .flash, .btn, .icon-btn, form, details:not([open]) > *:not(summary), .toast, dialog { display: none !important; }
    .print-only { display: block; }
    .container { max-width: none; padding: 0; }
    .card { border: 0; padding: 0; box-shadow: none; }
    a { color: #000; text-decoration: none; }
    .recipe-hero img { max-height: 7cm; width: auto; }
    .split { display: block; }
    .steps li, .ingredients li, .shop-item { break-inside: avoid; }
    .print-list li { padding: 3pt 0; border-bottom: 1px solid #ccc; list-style: none; }
    .print-list .box { display: inline-block; width: 10pt; height: 10pt; border: 1px solid #000; margin-right: 8pt; vertical-align: -1pt; }
    h1 { font-size: 20pt; }
}
