/* ==========================================================================
   RecipeBook design system
   Warm tomato + sage palette, soft rounded cards, Nunito font.
   ========================================================================== */

:root {
    --rb-primary: #e8743b;
    --rb-primary-dark: #c95d27;
    --rb-primary-soft: #fde9dd;
    --rb-sage: #5b8c5a;
    --rb-sage-soft: #e5f0e3;
    --rb-cream: #fffaf5;
    --rb-ink: #2f2a26;
    --rb-muted: #7a716a;
    --rb-border: #efe5dc;
    --rb-card: #ffffff;
    --rb-radius: 16px;
    --rb-radius-sm: 10px;
    --rb-shadow: 0 2px 10px rgba(80, 50, 20, .06), 0 1px 2px rgba(80, 50, 20, .05);
    --rb-shadow-hover: 0 10px 24px rgba(80, 50, 20, .12);
    --rb-sidebar-width: 250px;

    --meal-breakfast: #f2a541;
    --meal-lunch: #5b8c5a;
    --meal-dinner: #6b5ca5;
    --meal-snack: #d9576b;

    --bs-body-font-family: 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --bs-body-bg: var(--rb-cream);
    --bs-body-color: var(--rb-ink);
    --bs-primary: var(--rb-primary);
    --bs-primary-rgb: 232, 116, 59;
    --bs-link-color: var(--rb-primary-dark);
    --bs-link-color-rgb: 201, 93, 39;
    --bs-link-hover-color: #a54a1c;
    --bs-border-radius: var(--rb-radius-sm);
    --bs-border-color: var(--rb-border);
}

html, body {
    font-family: var(--bs-body-font-family);
    background: var(--rb-cream);
    color: var(--rb-ink);
}

h1, h2, h3, h4, h5 { font-weight: 800; letter-spacing: -.01em; }
h1:focus { outline: none; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Buttons & forms ---------- */
.btn { border-radius: 999px; font-weight: 700; padding-left: 1.1rem; padding-right: 1.1rem; }
.btn-sm { padding-left: .75rem; padding-right: .75rem; }
.btn-icon { border-radius: 50%; width: 2.2rem; height: 2.2rem; padding: 0; display: inline-flex; align-items: center; justify-content: center; }

.btn-primary {
    --bs-btn-bg: var(--rb-primary); --bs-btn-border-color: var(--rb-primary);
    --bs-btn-hover-bg: var(--rb-primary-dark); --bs-btn-hover-border-color: var(--rb-primary-dark);
    --bs-btn-active-bg: #b0521f; --bs-btn-active-border-color: #b0521f;
    --bs-btn-disabled-bg: #f0a47f; --bs-btn-disabled-border-color: #f0a47f;
}
.btn-outline-primary {
    --bs-btn-color: var(--rb-primary-dark); --bs-btn-border-color: var(--rb-primary);
    --bs-btn-hover-bg: var(--rb-primary); --bs-btn-hover-border-color: var(--rb-primary);
    --bs-btn-active-bg: var(--rb-primary-dark); --bs-btn-active-border-color: var(--rb-primary-dark);
}
.btn-sage {
    --bs-btn-color: #fff; --bs-btn-bg: var(--rb-sage); --bs-btn-border-color: var(--rb-sage);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #4a7549; --bs-btn-hover-border-color: #4a7549;
    --bs-btn-active-color: #fff; --bs-btn-active-bg: #3f653e;
}
.btn-soft {
    --bs-btn-color: var(--rb-ink); --bs-btn-bg: #fff; --bs-btn-border-color: var(--rb-border);
    --bs-btn-hover-bg: var(--rb-primary-soft); --bs-btn-hover-border-color: var(--rb-primary-soft); --bs-btn-hover-color: var(--rb-primary-dark);
    --bs-btn-active-bg: var(--rb-primary-soft);
}

.form-control, .form-select { border-radius: var(--rb-radius-sm); border-color: #e6d9cd; }
.form-control:focus, .form-select:focus, .form-check-input:focus, .btn:focus-visible {
    border-color: var(--rb-primary);
    box-shadow: 0 0 0 .2rem rgba(232, 116, 59, .2);
}
.form-check-input:checked { background-color: var(--rb-primary); border-color: var(--rb-primary); }
.form-label { font-weight: 700; font-size: .9rem; }
.darker-border-checkbox.form-check-input { border-color: #929292; }

.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid #e50000; }
.validation-message { color: #c62828; font-size: .875rem; }

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder { color: var(--bs-secondary-color); text-align: end; }
.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder { text-align: start; }

/* ---------- App shell ---------- */
.app-shell { min-height: 100vh; }
.app-main { padding: 1.5rem 1.25rem 2rem; max-width: 1280px; margin: 0 auto; }
.nav-toggle-input { position: absolute; opacity: 0; pointer-events: none; }

.topbar {
    position: sticky; top: 0; z-index: 1020;
    display: flex; align-items: center; gap: .75rem;
    padding: .65rem 1rem; background: rgba(255, 250, 245, .92);
    backdrop-filter: blur(8px); border-bottom: 1px solid var(--rb-border);
}
.nav-toggle-btn { font-size: 1.6rem; line-height: 1; cursor: pointer; margin: 0; color: var(--rb-ink); }

.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.25rem; color: var(--rb-ink); }
.brand:hover { text-decoration: none; color: var(--rb-ink); }
.brand-icon {
    width: 2.2rem; height: 2.2rem; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #f59e5b, var(--rb-primary)); color: #fff; font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(232, 116, 59, .35);
}

.sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 1040; width: var(--rb-sidebar-width);
    background: #fff; border-right: 1px solid var(--rb-border); padding: 1.25rem .9rem;
    overflow-y: auto; transform: translateX(-100%); transition: transform .25s ease;
}
.nav-backdrop { position: fixed; inset: 0; z-index: 1030; background: rgba(30, 20, 10, .35); display: none; margin: 0; }
.nav-toggle-input:checked ~ .sidebar { transform: translateX(0); }
.nav-toggle-input:checked ~ .nav-backdrop { display: block; }

.side-nav { display: flex; flex-direction: column; gap: .15rem; margin-top: 1.25rem; }
.side-section { text-transform: uppercase; font-size: .72rem; font-weight: 800; letter-spacing: .08em; color: var(--rb-muted); margin: 1rem .75rem .35rem; }
.side-link {
    display: flex; align-items: center; gap: .7rem; padding: .55rem .75rem; border-radius: 12px;
    color: var(--rb-ink); font-weight: 600; cursor: pointer;
}
.side-link i { font-size: 1.1rem; color: var(--rb-muted); }
.side-link:hover { background: var(--rb-primary-soft); text-decoration: none; color: var(--rb-primary-dark); }
.side-link.active { background: var(--rb-primary); color: #fff; box-shadow: 0 4px 12px rgba(232, 116, 59, .3); }
.side-link.active i { color: #fff; }
.side-user { font-size: .8rem; color: var(--rb-muted); margin: .75rem; word-break: break-all; }

@media (min-width: 992px) {
    .topbar, .nav-backdrop { display: none !important; }
    .sidebar { transform: none; }
    .app-main { margin-left: var(--rb-sidebar-width); padding: 2rem 2.5rem 2.5rem; max-width: none; }
}

.app-footer { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--rb-border); color: var(--rb-muted); font-size: .85rem; }
.app-footer a { color: inherit; }

/* Admin go-live checklist */
.launch-card > summary { list-style: none; cursor: pointer; }
.launch-card > summary::-webkit-details-marker { display: none; }
.launch-section { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--rb-muted); margin: 1.25rem 0 .35rem; }
.launch-item { display: flex; align-items: center; gap: .85rem; padding: .65rem 0; border-top: 1px solid var(--rb-border); }
.launch-icon { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: .95rem; }
.launch-icon.done { background: var(--rb-sage-soft); color: #3f653e; }
.launch-icon.todo { background: var(--rb-primary-soft); color: var(--rb-primary-dark); }
.launch-icon.recommended { background: #fff3cd; color: #7a5a00; }
.launch-icon.optional { background: #f1f1f1; color: #888; }
.min-w-0 { min-width: 0; }

.sms-consent { background: var(--rb-bg-soft, #fff7f1); border: 1px solid var(--rb-border); border-radius: 12px; padding: .75rem 1rem; }

/* Privacy policy and terms: comfortable reading width */
.legal { max-width: 760px; padding: 2rem 2.25rem; line-height: 1.65; }
.legal h1 { font-size: 1.85rem; margin-bottom: .25rem; }
.card-soft.legal h2 { font-size: 1.2rem; margin-top: 1.75rem; }
.legal ul { padding-left: 1.25rem; }
.legal li { margin-bottom: .35rem; }
@media (max-width: 575.98px) { .legal { padding: 1.25rem 1rem; } }

/* ---------- Building blocks ---------- */
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.85rem; margin-bottom: .2rem; }
.page-header .actions { display: flex; flex-wrap: wrap; gap: .5rem; }

.card-soft { background: var(--rb-card); border: 1px solid var(--rb-border); border-radius: var(--rb-radius); box-shadow: var(--rb-shadow); }
.card-soft h2, .card-soft h3 { font-size: 1.15rem; }
.section-title { font-size: 1.15rem; font-weight: 800; display: flex; align-items: center; gap: .5rem; margin-bottom: .9rem; }
.section-title i { color: var(--rb-primary); }

.chip {
    display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .7rem; border-radius: 999px;
    background: #f6efe8; color: var(--rb-ink); font-size: .82rem; font-weight: 700; white-space: nowrap;
}
.chip-primary { background: var(--rb-primary-soft); color: var(--rb-primary-dark); }
.chip-sage { background: var(--rb-sage-soft); color: #3f653e; }
.chip-warning { background: #fff3cd; color: #7a5a00; }
.chip-danger { background: #fde2e2; color: #a33; }
.log-entry summary { cursor: pointer; list-style: none; }
.log-entry summary::-webkit-details-marker { display: none; }
.btn-soft.active { background: var(--rb-primary-soft); color: var(--rb-primary-dark); border-color: var(--rb-primary); }
.chip-toggle { cursor: pointer; border: 2px solid transparent; user-select: none; }
/* The input stays in the page (hidden visually) so keyboards and screen readers can use it; :has() shows the
   choice straight away on static pages too, where nothing re-renders the "on" class. */
.chip-toggle { position: relative; }
.chip-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.chip-toggle.on, .chip-toggle:has(input:checked) { background: var(--rb-primary-soft); border-color: var(--rb-primary); color: var(--rb-primary-dark); }
.chip-toggle:has(input:focus-visible) { outline: 2px solid var(--rb-primary); outline-offset: 2px; }

.stat-card { padding: 1.1rem 1.25rem; display: flex; align-items: center; gap: 1rem; }
.stat-icon { width: 3rem; height: 3rem; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; background: var(--rb-primary-soft); color: var(--rb-primary-dark); flex-shrink: 0; }
.stat-icon.sage { background: var(--rb-sage-soft); color: var(--rb-sage); }
.stat-icon.purple { background: #ece8f7; color: var(--meal-dinner); }
.stat-icon.pink { background: #fbe4e8; color: var(--meal-snack); }
.stat-value { font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.stat-label { color: var(--rb-muted); font-size: .85rem; font-weight: 600; }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--rb-muted); }
.empty-state > i { font-size: 3rem; color: #f0b896; display: block; margin-bottom: .75rem; }
.empty-state h2, .empty-state h3 { color: var(--rb-ink); font-size: 1.35rem; }

.loading { display: flex; align-items: center; justify-content: center; gap: .75rem; padding: 3rem; color: var(--rb-muted); }
.spinner-border { color: var(--rb-primary); }

/* ---------- Hero (landing) ---------- */
.hero {
    border-radius: 24px; padding: 3rem 2rem; color: #fff; position: relative; overflow: hidden;
    background: radial-gradient(circle at 85% 20%, rgba(255,255,255,.18), transparent 40%), linear-gradient(135deg, #f59e5b 0%, #e8743b 55%, #d0582a 100%);
    box-shadow: 0 16px 40px rgba(232, 116, 59, .35);
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
.hero p { font-size: 1.15rem; opacity: .95; max-width: 40rem; }
.hero .btn-light { color: var(--rb-primary-dark); }
.hero-emoji { position: absolute; right: 2rem; bottom: 1rem; font-size: 7rem; opacity: .25; }
.feature { padding: 1.4rem; height: 100%; }
.feature .stat-icon { margin-bottom: .75rem; }

/* ---------- Recipe cards ---------- */
.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.25rem; }
.recipe-card {
    display: flex; flex-direction: column; overflow: hidden; height: 100%; color: inherit;
    transition: transform .15s ease, box-shadow .15s ease;
}
.recipe-card:hover { transform: translateY(-3px); box-shadow: var(--rb-shadow-hover); text-decoration: none; color: inherit; }
.recipe-thumb { aspect-ratio: 4 / 3; background: linear-gradient(135deg, #fde9dd, #fbd6bf); display: flex; align-items: center; justify-content: center; position: relative; }
.recipe-thumb img { width: 100%; height: 100%; object-fit: cover; }
.recipe-thumb .placeholder-icon { font-size: 3rem; color: #eaa27c; }
.recipe-thumb .fav { position: absolute; top: .6rem; right: .6rem; background: #fff; border-radius: 50%; width: 2rem; height: 2rem; display: flex; align-items: center; justify-content: center; color: #e0435b; box-shadow: var(--rb-shadow); }
.recipe-card .body { padding: .9rem 1rem 1rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.recipe-card .title { font-weight: 800; font-size: 1.05rem; line-height: 1.25; }
.recipe-card .meta { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: auto; }

/* ---------- Recipe details ---------- */
.recipe-hero { border-radius: var(--rb-radius); overflow: hidden; aspect-ratio: 16 / 10; background: linear-gradient(135deg, #fde9dd, #fbd6bf); display: flex; align-items: center; justify-content: center; }
.recipe-hero img { width: 100%; height: 100%; object-fit: cover; }
.recipe-hero .placeholder-icon { font-size: 5rem; color: #eaa27c; }
.thumb-strip { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .6rem; }
.thumb-strip button { padding: 0; border: 3px solid transparent; border-radius: 10px; overflow: hidden; width: 4.5rem; height: 3.5rem; background: none; }
.thumb-strip button.active { border-color: var(--rb-primary); }
.thumb-strip img { width: 100%; height: 100%; object-fit: cover; }

.servings-control { display: inline-flex; align-items: center; gap: .5rem; background: var(--rb-primary-soft); padding: .35rem; border-radius: 999px; }
.servings-control .value { min-width: 4.5rem; text-align: center; font-weight: 800; color: var(--rb-primary-dark); }
.servings-control .btn { background: #fff; color: var(--rb-primary-dark); border: none; }
.servings-control .btn:hover { background: var(--rb-primary); color: #fff; }

.ingredient-list { list-style: none; padding: 0; margin: 0; }
.ingredient-list li { display: flex; gap: .75rem; align-items: baseline; padding: .55rem 0; border-bottom: 1px dashed var(--rb-border); cursor: pointer; }
.ingredient-list li:last-child { border-bottom: none; }
.ingredient-list .qty { font-weight: 800; color: var(--rb-primary-dark); min-width: 5.5rem; }
.ingredient-list li.done { color: #b5aaa1; text-decoration: line-through; }
.ingredient-list li.done .qty { color: #c9bfb6; }
.ingredient-list .saved-swap { display: block; font-size: .85rem; color: #557a57; text-decoration: none; }
.swap-btn { align-self: center; border: 1px solid var(--rb-border); background: transparent; color: #a99d92; border-radius: 999px; width: 2rem; height: 2rem; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.swap-btn.has-swaps { color: var(--rb-primary); border-color: var(--rb-primary-soft); }
.swap-btn:hover, .swap-btn:focus-visible { background: var(--rb-primary-soft); color: var(--rb-primary-dark); }
.swap-option { display: flex; gap: .75rem; align-items: center; border: 1px solid var(--rb-border); border-radius: .6rem; padding: .6rem .75rem; margin-bottom: .5rem; }
.spell-hint { font-size: .85rem; color: #8a5a00; background: #fff6df; border-radius: .4rem; padding: .2rem .5rem; margin-top: .25rem; }
.spell-hint .btn-link { font-size: inherit; }
.swap-option.saved { border-color: #8aa98b; background: #f4f8f3; }

.step-list { list-style: none; padding: 0; counter-reset: step; }
.step-list li { position: relative; padding: 0 0 1.25rem 3.25rem; counter-increment: step; }
.step-list li::before {
    content: counter(step); position: absolute; left: 0; top: -.1rem; width: 2.2rem; height: 2.2rem; border-radius: 50%;
    background: var(--rb-sage); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.nutrition-table td { padding: .35rem 0; border-bottom: 1px solid var(--rb-border); }
.nutrition-table td:last-child { text-align: right; font-weight: 700; }

/* ---------- Recipe editor ---------- */
.editor-row { display: grid; grid-template-columns: 6rem 8rem 1fr auto; gap: .5rem; align-items: start; margin-bottom: .5rem; }
.editor-row .notes { grid-column: 3 / 4; }
@media (max-width: 575px) {
    .editor-row { grid-template-columns: 1fr 1fr; }
    .editor-row > :nth-child(3) { grid-column: 1 / 3; }
    .editor-row .row-actions { grid-column: 1 / 3; justify-content: flex-end; }
}
.row-actions { display: flex; gap: .25rem; }
.step-row { display: grid; grid-template-columns: 2.2rem 1fr auto; gap: .5rem; align-items: start; margin-bottom: .6rem; }
.step-num { width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--rb-sage); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.image-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; }
.image-tile { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; border: 3px solid transparent; background: #f6efe8; }
.image-tile.primary { border-color: var(--rb-primary); }
.image-tile img { width: 100%; height: 100%; object-fit: cover; }
.image-tile .tile-actions { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; padding: .35rem; background: linear-gradient(transparent, rgba(0,0,0,.55)); }
.upload-drop { border: 2px dashed #eaa27c; border-radius: 12px; padding: 1.25rem; text-align: center; background: #fffaf6; color: var(--rb-muted); position: relative; }
.upload-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- Meal plans ---------- */
.meal-dot { width: .65rem; height: .65rem; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.meal-breakfast { --meal-color: var(--meal-breakfast); }
.meal-lunch { --meal-color: var(--meal-lunch); }
.meal-dinner { --meal-color: var(--meal-dinner); }
.meal-snack { --meal-color: var(--meal-snack); }
.meal-dot { background: var(--meal-color); }
.meal-label { color: var(--meal-color); font-weight: 800; }

.view-switch .btn { border-radius: 999px; }
.plan-nav { display: flex; align-items: center; gap: .5rem; }
.plan-nav .current { font-weight: 800; min-width: 12rem; text-align: center; }

.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .6rem; }
@media (max-width: 991px) { .week-grid { grid-template-columns: 1fr; } }
.day-col { background: #fff; border: 1px solid var(--rb-border); border-radius: var(--rb-radius); padding: .6rem; min-height: 10rem; display: flex; flex-direction: column; gap: .45rem; }
.day-col.today { border-color: var(--rb-primary); box-shadow: 0 0 0 2px var(--rb-primary-soft); }
.day-col.outside { opacity: .45; background: transparent; }
.day-head { display: flex; flex-wrap: wrap; column-gap: .35rem; justify-content: space-between; align-items: baseline; font-weight: 800; }
.day-head .date { color: var(--rb-muted); font-weight: 600; font-size: .85rem; }

.meal-pill {
    display: flex; gap: .45rem; align-items: flex-start; text-align: left; width: 100%;
    background: #fff; border: 1px solid var(--rb-border); border-left: 4px solid var(--meal-color);
    border-radius: 10px; padding: .4rem .55rem; font-size: .85rem; cursor: pointer;
}
.meal-pill:hover { background: #fffaf6; box-shadow: var(--rb-shadow); }
.meal-pill .name { font-weight: 700; line-height: 1.2; }
.meal-pill .sub { color: var(--rb-muted); font-size: .75rem; }
.add-meal { border: 1px dashed #e3cbb8; background: transparent; color: var(--rb-muted); border-radius: 10px; padding: .3rem; font-size: .8rem; width: 100%; }
.add-meal:hover { border-color: var(--rb-primary); color: var(--rb-primary-dark); background: var(--rb-primary-soft); }

.day-meal-section { border-left: 4px solid var(--meal-color); padding-left: 1rem; margin-bottom: 1.5rem; }
.day-meal-card { display: flex; gap: 1rem; align-items: center; padding: .75rem; border-radius: 12px; background: #fff; border: 1px solid var(--rb-border); margin-bottom: .5rem; }
.day-meal-card .thumb { width: 4.5rem; height: 3.5rem; border-radius: 10px; overflow: hidden; background: var(--rb-primary-soft); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #eaa27c; }
.day-meal-card .thumb img { width: 100%; height: 100%; object-fit: cover; }

.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .35rem; }
.month-grid .dow { text-align: center; font-weight: 800; color: var(--rb-muted); font-size: .8rem; padding: .25rem 0; }
.month-cell { background: #fff; border: 1px solid var(--rb-border); border-radius: 10px; min-height: 6.5rem; padding: .35rem; font-size: .75rem; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: .15rem; overflow: hidden; }
.month-cell:hover { border-color: var(--rb-primary); }
.month-cell.outside { background: transparent; border-style: dashed; opacity: .5; cursor: default; }
.month-cell.today { border-color: var(--rb-primary); box-shadow: 0 0 0 2px var(--rb-primary-soft); }
.month-cell .num { font-weight: 800; font-size: .85rem; }
.month-cell .mini { display: flex; gap: .3rem; align-items: center; white-space: nowrap; overflow: hidden; min-width: 0; }
.month-cell .mini span:last-child { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 767px) { .month-cell { min-height: 3.5rem; } .month-cell .mini span:last-child { display: none; } }

.nutrition-bar { height: .5rem; border-radius: 999px; background: #f1e7de; overflow: hidden; }
.nutrition-bar > div { height: 100%; background: var(--rb-sage); }
.nutrition-bar > div.over { background: var(--meal-snack); }

/* ---------- Shopping list ---------- */
.shop-item { display: flex; align-items: center; gap: .75rem; padding: .7rem .25rem; border-bottom: 1px solid var(--rb-border); }
.shop-item:last-child { border-bottom: none; }
.shop-item .form-check-input { width: 1.4rem; height: 1.4rem; margin: 0; flex-shrink: 0; cursor: pointer; }
.shop-item .qty { font-weight: 800; color: var(--rb-primary-dark); min-width: 5rem; }
.shop-item.checked .name, .shop-item.checked .qty { text-decoration: line-through; color: #b5aaa1; }
.shop-item .used-in { font-size: .75rem; color: var(--rb-muted); }
/* Store section headings (Admin → Store sections) */
.shop-section { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--rb-sage);
    background: var(--rb-sage-soft); border-radius: 8px; padding: .3rem .6rem; margin: 1rem 0 .25rem; }
.shop-section:first-of-type { margin-top: 0; }
.shop-item .qty-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; min-width: 5rem;
    text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; }

/* ---------- First visit: "What do you want to do first?" ---------- */
.first-step { border: 2px solid var(--rb-primary-soft); }
.first-step-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
@media (min-width: 1300px) { .first-step-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 420px) { .first-step-grid { grid-template-columns: 1fr; } }
.first-step-choice { display: block; text-align: left; background: var(--rb-cream); border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius-sm); padding: 1rem; color: var(--rb-ink); transition: border-color .15s, box-shadow .15s; }
.first-step-choice:hover, .first-step-choice:focus-visible { border-color: var(--rb-primary); box-shadow: var(--rb-shadow-hover); }
.first-step-choice > .bi { font-size: 1.6rem; color: var(--rb-primary); display: block; margin-bottom: .35rem; }

/* ---------- Modal (pure Blazor) ---------- */
.rb-modal-backdrop { position: fixed; inset: 0; background: rgba(30, 20, 10, .45); z-index: 1050; display: flex; align-items: flex-start; justify-content: center; padding: 4vh 1rem; overflow-y: auto; }
.rb-modal { background: #fff; border-radius: 20px; width: 100%; max-width: 560px; box-shadow: 0 20px 60px rgba(0,0,0,.25); animation: rb-pop .15s ease-out; }
.rb-modal.wide { max-width: 760px; }
.rb-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--rb-border); }
.rb-modal-header h2 { font-size: 1.2rem; margin: 0; }
.rb-modal-body { padding: 1.25rem 1.4rem; }
.rb-modal-footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .5rem; padding: 1rem 1.4rem; border-top: 1px solid var(--rb-border); }
@keyframes rb-pop { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Auth pages ---------- */
.auth-card { max-width: 440px; margin: 2rem auto; background: #fff; border: 1px solid var(--rb-border); border-radius: 24px; padding: 2.25rem 2rem; box-shadow: var(--rb-shadow); }
.auth-icon { width: 3.5rem; height: 3.5rem; border-radius: 18px; margin: 0 auto; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; color: #fff; background: linear-gradient(135deg, #f59e5b, var(--rb-primary)); box-shadow: 0 6px 16px rgba(232,116,59,.35); }
.manage-nav .nav-link { color: var(--rb-ink); border-radius: 10px; font-weight: 600; }
.manage-nav .nav-link.active { background: var(--rb-primary); color: #fff; }

/* ---------- Admin ---------- */
.admin-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.5rem; }
.admin-tabs a { padding: .45rem 1rem; border-radius: 999px; background: #fff; border: 1px solid var(--rb-border); color: var(--rb-ink); font-weight: 700; font-size: .9rem; }
.admin-tabs a:hover { text-decoration: none; background: var(--rb-primary-soft); }
.admin-tabs a.active { background: var(--rb-ink); color: #fff; border-color: var(--rb-ink); }
.table-soft { --bs-table-bg: transparent; margin: 0; }
.table-soft th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--rb-muted); font-weight: 800; border-bottom-width: 1px; }
.table-soft td { vertical-align: middle; }

/* ---------- Errors / reconnect ---------- */
#blazor-error-ui {
    color-scheme: light only; background: lightyellow; bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box; display: none; left: 0; padding: 0.6rem 1.25rem 0.7rem 1.25rem; position: fixed; width: 100%; z-index: 1100;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
.blazor-error-boundary { background: #b32121; padding: 1rem 1rem 1rem 1.25rem; color: white; border-radius: 12px; }
.blazor-error-boundary::after { content: "Something went wrong on this part of the page." }

/* ---------- Print ---------- */
.print-only { display: none; }
@media print {
    @page { margin: 1.2cm; }
    body { background: #fff !important; font-size: 11pt; }
    .no-print, .sidebar, .topbar, .nav-backdrop, .app-footer, #blazor-error-ui, #components-reconnect-modal { display: none !important; }
    .print-only { display: block; }
    .app-main { margin: 0 !important; padding: 0 !important; max-width: none !important; }
    .card-soft { box-shadow: none !important; border-color: #ccc; break-inside: avoid; }
    a { color: inherit !important; text-decoration: none !important; }
    .print-table { width: 100%; border-collapse: collapse; }
    .print-table th, .print-table td { border: 1px solid #bbb; padding: 6px 8px; vertical-align: top; font-size: 10pt; }
    .print-table th { background: #f3f3f3 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .print-break { break-before: page; }
}
.print-page { background: #fff; padding: 1.5rem; border-radius: var(--rb-radius); border: 1px solid var(--rb-border); }
.print-table { width: 100%; border-collapse: collapse; }
.print-table th, .print-table td { border: 1px solid #e3d8cd; padding: .5rem .6rem; vertical-align: top; font-size: .9rem; }
.print-table th { background: #faf3ec; }
.print-checkbox { display: inline-block; width: .9rem; height: .9rem; border: 1.5px solid #555; border-radius: 3px; margin-right: .5rem; vertical-align: -2px; }

/* Admin → Home page editor */
.home-card-editor.is-hidden { opacity: .6; border-style: dashed; }
.home-card-editor .stat-icon { width: 2.5rem; height: 2.5rem; font-size: 1.1rem; }
.home-preview { border: 2px dashed var(--rb-primary-soft, #f6d3bf); border-radius: 1.25rem; padding: 1rem; }
.home-preview .hero span.btn { cursor: default; }
@media (min-width: 992px) { .home-editor-actions .w-100 { width: auto !important; } }

/* ---------- Occasions ---------- */
.min-w-0 { min-width: 0; }
.print-options { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-start; }
.occasion-course { margin-bottom: 1.1rem; }
.occasion-course:last-child { margin-bottom: 0; }
.course-name { font-weight: 800; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--rb-primary); margin-bottom: .25rem; }
.occasion-row { display: flex; gap: .75rem; align-items: flex-start; padding: .55rem 0; border-bottom: 1px solid var(--rb-border); }
.occasion-row:last-child { border-bottom: 0; }
.occasion-row.done .task-text { text-decoration: line-through; opacity: .55; }
.diet-mark { display: inline-block; font-size: .68rem; font-weight: 800; line-height: 1.4; border: 1px solid #8aa98b; color: #557a57; border-radius: 4px; padding: 0 .3rem; margin-left: .35rem; vertical-align: middle; }
.guest-badge { width: 2rem; height: 2rem; flex-shrink: 0; border-radius: 50%; background: var(--rb-primary-soft); color: var(--rb-primary); font-weight: 800; display: flex; align-items: center; justify-content: center; }

/* Menu cards: sized in real units so the screen preview matches the printout. */
.menu-sheet-list, .place-sheet-list { overflow-x: auto; padding-bottom: 1rem; }
.menu-sheet { display: flex; background: #fff; margin: 0 auto 1.5rem; box-shadow: 0 4px 18px rgba(0,0,0,.12); color: #2d2a26;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.menu-sheet-list.letter.full .menu-sheet { width: 7.7in; height: 10.2in; }
.menu-sheet-list.letter.half .menu-sheet { width: 10.2in; height: 7.7in; }
.menu-sheet-list.a4.full .menu-sheet { width: 190mm; height: 277mm; }
.menu-sheet-list.a4.half .menu-sheet { width: 277mm; height: 190mm; }
.menu-card { flex: 1 1 0; min-width: 0; padding: .3in; display: flex; }
.menu-sheet-list.half .menu-card + .menu-card { border-left: 1px dashed #bbb; }
.menu-frame { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; padding: .45in .35in .3in; background: #fff; overflow: hidden; }
.menu-ornament { font-size: 1.3rem; min-height: 1.3rem; margin-bottom: .4rem; }
.menu-for { font-size: .78rem; text-transform: uppercase; letter-spacing: .18em; color: #777; margin-bottom: .2rem; }
.menu-for span { font-size: 1.05rem; letter-spacing: .05em; text-transform: none; color: #2d2a26; font-weight: 600; }
.menu-title { font-size: 2.3rem; margin: .1rem 0 .3rem; line-height: 1.15; }
.menu-date { font-style: italic; color: #777; margin-bottom: .6rem; }
.menu-course { margin-top: 1.1rem; width: 100%; }
.menu-course h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .2em; margin: 0 0 .35rem; }
.menu-dish { font-size: 1.15rem; line-height: 1.55; }
.menu-mark { font-size: .62rem; font-weight: 700; border: 1px solid currentColor; border-radius: 3px; padding: 0 .25rem; margin-left: .3rem; vertical-align: middle; opacity: .75; font-family: Nunito, sans-serif; }
.menu-mark.suits { border-color: #557a57; color: #557a57; opacity: 1; }
.menu-message { margin-top: auto; padding-top: 1rem; font-style: italic; font-size: 1.05rem; }
.menu-legend { margin-top: .6rem; font-size: .68rem; color: #888; font-family: Nunito, sans-serif; }
.menu-message + .menu-legend { margin-top: .4rem; }
.menu-frame > .menu-legend:last-child:not(.menu-message + .menu-legend) { margin-top: auto; }
.menu-sheet-list.half .menu-title { font-size: 1.75rem; }
.menu-sheet-list.half .menu-dish { font-size: 1rem; line-height: 1.45; }
.menu-sheet-list.half .menu-course { margin-top: .75rem; }
.menu-sheet-list.half .menu-frame { padding: .3in .25in .25in; }

.style-classic { font-family: 'Playfair Display', Georgia, serif; }
.style-classic .menu-frame { border: 4px double #b08d57; }
.style-classic .menu-ornament, .style-classic .menu-course h2 { color: #b08d57; }
.style-festive { font-family: Lora, Georgia, serif; }
.style-festive .menu-frame { border: 3px solid #2d6a4f; box-shadow: inset 0 0 0 5px #fff, inset 0 0 0 7px #a4161a; }
.style-festive .menu-title, .style-festive .place-name { font-family: 'Great Vibes', cursive; color: #a4161a; font-weight: 400; }
.style-festive .menu-title { font-size: 3rem; }
.style-festive .menu-ornament, .style-festive .menu-course h2 { color: #2d6a4f; }
.style-birthday { font-family: Fredoka, 'Nunito', sans-serif;
    background-color: #fff;
    background-image: radial-gradient(#f7c948 22%, transparent 26%), radial-gradient(#7aa5d2 22%, transparent 26%), radial-gradient(#e86a92 22%, transparent 26%);
    background-size: 46px 46px, 58px 58px, 70px 70px; background-position: 0 0, 20px 30px, 40px 10px; }
.style-birthday .menu-frame { border: 3px dashed #e8743b; border-radius: 18px; }
.style-birthday .menu-title { color: #e8743b; }
.style-birthday .menu-course h2 { color: #7a5cc2; }
.style-simple { font-family: Nunito, sans-serif; }
.style-simple .menu-frame { border: 1px solid #ddd; }
.style-simple .menu-title { font-weight: 800; }
.style-simple .menu-course h2 { color: var(--rb-primary); }

/* Place cards: 4 tent cards per sheet. Top half prints upside down so it reads the right way once folded. */
.place-sheet { display: grid; grid-template-columns: repeat(2, var(--card-w)); grid-auto-rows: var(--card-h); background: #fff; margin: 0 auto 1.5rem;
    width: calc(var(--card-w) * 2); box-shadow: 0 4px 18px rgba(0,0,0,.12); color: #2d2a26; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.place-sheet-list.letter { --card-w: 4in; --card-h: 5in; --side-h: 2.25in; --flap-h: .5in; }
.place-sheet-list.a4 { --card-w: 99mm; --card-h: 140mm; --side-h: 63mm; --flap-h: 14mm; }
.place-card { display: grid; grid-template-rows: var(--side-h) var(--side-h) var(--flap-h); outline: 1px dotted #999; outline-offset: -1px; overflow: hidden; }
.place-card.style-birthday .place-side { background: rgba(255,255,255,.82); margin: 0 10px; }
.place-side { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: .15in .25in; text-align: center; border-bottom: 1px dashed #999; }
.place-side.back { transform: rotate(180deg); border-bottom: 0; border-top: 1px dashed #999; }
.place-side.front { border-top: 0; }
.place-card .place-side.back { order: 0; }
.place-ornament { font-size: 1rem; min-height: 1rem; }
.style-classic .place-ornament { color: #b08d57; }
.style-festive .place-ornament { color: #2d6a4f; }
.place-name { font-size: 2rem; line-height: 1.15; margin: .15rem 0; word-break: break-word; }
.style-festive .place-name { font-size: 2.8rem; }
.place-name.blank { width: 75%; height: 2.4rem; border-bottom: 1px solid #999; }
.place-occasion { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: #888; margin-top: .25rem; font-family: Nunito, sans-serif; }
.place-flap { display: flex; align-items: center; justify-content: center; padding: 0 .2in; font-size: 7.5pt; color: #555; text-align: center; font-family: Nunito, sans-serif; background: #fff; }

@media print {
    .menu-sheet, .place-sheet { box-shadow: none !important; margin: 0 !important; break-after: page; }
    .menu-sheet:last-child, .place-sheet:last-child { break-after: auto; }
    .menu-sheet-list, .place-sheet-list { overflow: visible; padding: 0; }
}

/* Home: Coming up */
.coming-up { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .75rem; }
.coming-up-item { display: flex; align-items: center; gap: .65rem; padding: .7rem .8rem; border: 1px solid var(--rb-border); border-radius: 14px; text-decoration: none; transition: background .15s; }
.coming-up-item:hover { background: var(--rb-primary-soft); }

/* Guest invitation page */
.invite-page { max-width: 1000px; }
.invite-hero h1 { font-size: 2.2rem; }
.invite-note { white-space: pre-line; background: rgba(255,255,255,.15); border-radius: 12px; padding: .75rem 1rem; }
.rsvp-choice { font-size: 1rem; padding: .45rem .9rem; }
.rsvp-badge { font-size: .72rem; }

/* ---------- Print shop PDFs: one card per page, bleed and crop marks ---------- */
.shop-page-list { overflow-x: auto; padding-bottom: 1rem; }
.shop-page { position: relative; background: #fff; margin: 0 auto 1.25rem; box-shadow: 0 4px 18px rgba(0,0,0,.12); overflow: hidden;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.shop-bleed { position: absolute; overflow: hidden; background-color: #fff; }
.shop-trim { position: absolute; display: flex; flex-direction: column; }
.crop-v, .crop-h { position: absolute; display: block; background: #000; }
.crop-v { width: .3pt; }
.crop-h { height: .3pt; }
.crop-h.fold { background: repeating-linear-gradient(90deg, #000 0 2pt, transparent 2pt 4pt); }
.shop-help { background: var(--rb-primary-soft); border-radius: 12px; padding: .75rem 1rem; color: var(--rb-text, #333); }
.shop-help ul { padding-left: 1.2rem; }

/* Place cards: each half is a container, so names scale with the card size. */
.shop-place { flex: 1; display: flex; flex-direction: column; }
.shop-place.folded .shop-side { height: 50%; }
.shop-place.flat .shop-side { height: 100%; }
.shop-side { container-type: size; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    padding: var(--safe); box-sizing: border-box; }
.shop-side.back { transform: rotate(180deg); }
.shop-side .place-name { font-size: min(30cqh, 13cqw); margin: 0; }
.style-festive .shop-side .place-name { font-size: min(40cqh, 16cqw); }
.shop-side .place-ornament { font-size: 10cqh; min-height: 0; }
.shop-side .place-occasion { font-size: max(6pt, 7cqh); margin-top: 2cqh; }
.shop-side .place-name.blank { height: 20cqh; width: 70%; }
.shop-note { font-size: 8pt; color: #444; font-family: Nunito, sans-serif; }
.shop-bleed.style-birthday .shop-side { background: rgba(255,255,255,.85); background-clip: content-box; }

/* Menus: sized from the card's width. */
.shop-menu { container-type: inline-size; flex: 1; display: flex; padding: var(--safe); }
.shop-menu .menu-frame { padding: 8cqw 6cqw 5cqw; }
.shop-menu .menu-title { font-size: 9cqw; }
.style-festive .shop-menu .menu-title { font-size: 12cqw; }
.shop-menu .menu-date { font-size: 3.6cqw; }
.shop-menu .menu-for { font-size: 3cqw; }
.shop-menu .menu-for span { font-size: 4cqw; }
.shop-menu .menu-course { margin-top: 4.5cqw; }
.shop-menu .menu-course h2 { font-size: 3.3cqw; }
.shop-menu .menu-dish { font-size: 4.6cqw; }
.shop-menu .menu-message { font-size: 4cqw; }
.shop-menu .menu-legend { font-size: max(6pt, 2.6cqw); }
.shop-menu .menu-ornament { font-size: 5cqw; }

@media print {
    .shop-page { box-shadow: none !important; margin: 0 !important; break-after: page; }
    .shop-page:last-child { break-after: auto; }
    .shop-page-list { overflow: visible; padding: 0; }
}

/* ---------- Kitchen app (offline, WebAssembly) ---------- */
.kitchen { min-height: 100vh; background: var(--rb-cream); }
.kitchen-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: .5rem; padding: .5rem 1rem; background: #fff; border-bottom: 1px solid var(--rb-border); flex-wrap: wrap; }
.kitchen-brand { font-weight: 800; color: var(--rb-primary-dark); margin-right: auto; white-space: nowrap; }
.kitchen-status { font-size: .8rem; padding: .2rem .6rem; border-radius: 999px; background: var(--rb-primary-soft); color: var(--rb-primary-dark); white-space: nowrap; }
.kitchen-status.ok { background: var(--rb-sage-soft); color: var(--rb-sage); }
.kitchen-status.off { background: #f1ece7; color: var(--rb-muted); }
.kitchen-tabs { display: flex; background: #fff; border-bottom: 1px solid var(--rb-border); position: sticky; top: 3rem; z-index: 4; }
.kitchen-tabs button { flex: 1; border: none; background: none; padding: .7rem .5rem; font-weight: 700; color: var(--rb-muted); border-bottom: 3px solid transparent; }
.kitchen-tabs button.on { color: var(--rb-primary-dark); border-bottom-color: var(--rb-primary); }
.kitchen-main { max-width: 760px; margin: 0 auto; padding: 1rem; }
.kitchen-day { margin-bottom: 1.25rem; }
.kitchen-day-name { font-weight: 800; margin-bottom: .4rem; }
.kitchen-meal { display: flex; gap: .75rem; align-items: center; background: #fff; border: 1px solid var(--rb-border); border-radius: var(--rb-radius-sm); padding: .6rem .8rem; margin-bottom: .4rem; }
.kitchen-meal-time { width: 5rem; flex-shrink: 0; }
.kitchen-recipe { display: flex; align-items: center; gap: .5rem; width: 100%; background: #fff; border: 1px solid var(--rb-border); border-radius: var(--rb-radius-sm); padding: .7rem .9rem; margin-bottom: .4rem; color: inherit; }
.kitchen-recipe:hover { border-color: var(--rb-primary); }
@media (max-width: 560px) {
    .kitchen-bar { padding: .4rem .6rem; flex-wrap: nowrap; }
    .kitchen-brand-name { display: none; }
    .kitchen-status { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
    .kitchen-tabs { top: 2.9rem; }
}

/* ---------- Cook mode (full screen, for a tablet on the counter) ---------- */
.cook-view { position: fixed; inset: 0; display: grid; grid-template-areas: "bar" "tabs" "body" "nav"; grid-template-rows: auto auto minmax(0, 1fr) auto; background: var(--rb-cream); color: var(--rb-ink); font-size: 1.05rem; outline: none; }
.cook-view.size-0 { font-size: .95rem; }
.cook-view.size-2 { font-size: 1.3rem; }
.cook-view.size-3 { font-size: 1.6rem; }
.cook-bar { grid-area: bar; }
.cook-tabs { grid-area: tabs; display: none; }
.cook-body { grid-area: body; }
.cook-nav { grid-area: nav; }
.cook-bar { display: flex; align-items: center; gap: .75rem; padding: .5rem 1rem; background: #fff; border-bottom: 1px solid var(--rb-border); flex-wrap: wrap; }
.cook-title { font-size: 1.15em; font-weight: 800; margin: 0; flex: 1 1 10rem; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cook-tools { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.cook-tools .servings-control .value { min-width: 2.5rem; }
.cook-awake { font-size: .85rem; color: var(--rb-sage); white-space: nowrap; }
.cook-awake.off { color: var(--rb-muted); }
.cook-body { display: grid; grid-template-columns: minmax(16rem, 2fr) 3fr; min-height: 0; }
.cook-ingredients, .cook-steps { overflow-y: auto; padding: 1rem 1.25rem; min-height: 0; overscroll-behavior: contain; }
.cook-ingredients { border-right: 1px solid var(--rb-border); background: #fff; }
.cook-heading { font-weight: 800; font-size: 1.05em; margin-bottom: .5rem; display: flex; gap: .5rem; align-items: baseline; }
.cook-heading span { font-weight: 400; font-size: .75em; color: var(--rb-muted); }
.cook-ingredients ul { list-style: none; padding: 0; margin: 0; }
.cook-ingredients li { display: flex; gap: .6rem; align-items: baseline; padding: .45rem 0; border-bottom: 1px dashed var(--rb-border); cursor: pointer; break-inside: avoid; }
.cook-ingredients li:last-child { border-bottom: none; }
.cook-ingredients .qty { font-weight: 800; color: var(--rb-primary-dark); min-width: 4.5em; flex-shrink: 0; }
.cook-ingredients li.done { color: #b5aaa1; text-decoration: line-through; }
.cook-ingredients li.done .qty { color: #c9bfb6; }
.cook-swap { display: block; font-size: .85em; color: #557a57; }
.cook-steps ol { list-style: none; padding: 0; margin: 0; }
.cook-steps li { display: flex; gap: .85rem; padding: .75rem .85rem; margin-bottom: .5rem; border-radius: var(--rb-radius-sm); border: 2px solid transparent; cursor: pointer; scroll-margin: 1rem; }
.cook-steps li .num { flex-shrink: 0; width: 2em; height: 2em; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; background: var(--rb-primary-soft); color: var(--rb-primary-dark); }
.cook-steps li .text { white-space: pre-line; line-height: 1.5; }
.cook-steps li .note { font-size: .85em; color: var(--rb-muted); margin-top: .25rem; }
.cook-steps li.current { background: #fff; border-color: var(--rb-primary); box-shadow: var(--rb-shadow); }
.cook-steps li.current .num { background: var(--rb-primary); color: #fff; }
.cook-steps li.past { opacity: .55; }
.cook-steps li.past .num { background: var(--rb-sage-soft); color: var(--rb-sage); }
.cook-notes { margin-top: 1rem; padding: .75rem; border-radius: var(--rb-radius-sm); background: #fff; font-size: .9em; white-space: pre-line; }
.cook-nav { display: flex; align-items: center; gap: 1rem; padding: .6rem 1rem; background: #fff; border-top: 1px solid var(--rb-border); }
.cook-nav .btn { min-width: 8rem; }
.cook-progress { flex: 1; height: .4rem; border-radius: 999px; background: var(--rb-border); overflow: hidden; }
.cook-progress span { display: block; height: 100%; background: var(--rb-primary); transition: width .2s; }

/* Portrait tablets and phones: ingredients on top (two columns when there's room), directions below. */
@media (orientation: portrait), (max-width: 760px) {
    .cook-body { grid-template-columns: 1fr; grid-template-rows: minmax(0, auto) minmax(0, 1fr); }
    .cook-ingredients { border-right: none; border-bottom: 1px solid var(--rb-border); max-height: 42vh; }
    .cook-ingredients ul { columns: 2 15rem; column-gap: 2rem; }
}
/* Phones: an Ingredients | Steps switch shows one list at a time, each with the whole screen. */
@media (max-width: 560px) {
    .cook-bar { padding: .4rem .6rem; gap: .4rem; }
    .cook-bar .btn { padding: .3rem .6rem; }
    .cook-title { order: 3; flex-basis: 100%; font-size: 1.05em; }
    .cook-tools { margin-left: auto; gap: .35rem; }
    .cook-tools .servings-control { padding: .2rem; gap: .2rem; }
    .cook-tools .servings-control .value { min-width: 1.8rem; }
    .cook-tabs { display: flex; background: #fff; border-bottom: 1px solid var(--rb-border); }
    .cook-tabs button { flex: 1; border: none; background: none; padding: .6rem .5rem; font-weight: 700; color: var(--rb-muted); border-bottom: 3px solid transparent; }
    .cook-tabs button.on { color: var(--rb-primary-dark); border-bottom-color: var(--rb-primary); }
    .cook-body { grid-template-rows: minmax(0, 1fr); }
    .cook-body.show-steps .cook-ingredients, .cook-body.show-ingredients .cook-steps { display: none; }
    .cook-ingredients { max-height: none; border-bottom: none; }
    .cook-ingredients ul { columns: auto; }
    .cook-ingredients, .cook-steps { padding: .75rem .9rem; }
    .cook-heading { display: none; }
    .cook-nav { padding: .5rem .6rem; gap: .6rem; }
    .cook-nav .btn { min-width: 0; flex: 0 0 auto; }
}
/* Phones held sideways: side by side, with less padding so more fits. */
@media (orientation: landscape) and (max-height: 500px) {
    .cook-bar, .cook-nav { padding-top: .25rem; padding-bottom: .25rem; }
    .cook-nav .btn { padding-top: .3rem; padding-bottom: .3rem; font-size: 1rem; }
    .cook-ingredients, .cook-steps { padding: .5rem .9rem; }
    .cook-steps li { padding: .5rem .6rem; }
}
@media print { .cook-nav, .cook-bar .cook-tools { display: none; } }