/* Layout concept: an app shell — sidebar rail on wide screens, bottom tab bar on phones —
   around one scrolling content column. Market-fresh: herb green for actions, saffron for stars,
   meal colours as soft tints. Tokens mirror docs/design/02-design-system.md. */
:root {
  --bg: #F4F7F2;
  --surface: #FFFFFF;
  --surface-2: #EAF0E6;
  --ink: #17251C;
  --ink-2: #4E5F54;
  --line: #D9E2D4;
  --basil: #2E7A4C;
  --basil-ink: #FFFFFF;
  --basil-soft: #DDEFE2;
  --saffron: #E9A21B;
  --saffron-ink: #6B4500;
  --tomato: #C2412A;
  --tomato-soft: #FBE4DE;
  --plum: #7A4E9C;
  --plum-soft: #EFE6F6;
  --sky: #2563A6;
  --sky-soft: #E1ECF8;
  --m-breakfast: #FFF1CF;
  --m-lunch: #E2F3E6;
  --m-tea: #FBE6EC;
  --m-dinner: #E4E7F8;
  --m-breakfast-ink: #7A5200;
  --m-lunch-ink: #1E6438;
  --m-tea-ink: #8E2A4A;
  --m-dinner-ink: #33408F;
  --shadow: 0 1px 2px rgba(23, 37, 28, .06), 0 4px 14px rgba(23, 37, 28, .07);
  --shadow-lg: 0 10px 40px rgba(23, 37, 28, .18);
  --scrim: rgba(16, 26, 20, .45);
  --font-display: "Fredoka", "Noto Sans SC", ui-rounded, system-ui, sans-serif;
  --font-body: "Nunito", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --rail: 232px;
  --tabbar: 64px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101612; --surface: #18201B; --surface-2: #212B24; --ink: #E7EFE9; --ink-2: #A3B4A8; --line: #2D3931;
    --basil: #5CC287; --basil-ink: #0B1A11; --basil-soft: #1D3526; --saffron: #F2B544; --saffron-ink: #F7D58F;
    --tomato: #F07A62; --tomato-soft: #3A211B; --plum: #C29BE0; --plum-soft: #2E2338; --sky: #7DB3EE; --sky-soft: #1B2A3B;
    --m-breakfast: #3A3017; --m-lunch: #1C3324; --m-tea: #3A2029; --m-dinner: #23284A;
    --m-breakfast-ink: #F7D58F; --m-lunch-ink: #9EDDB4; --m-tea-ink: #F2A9BF; --m-dinner-ink: #B7C0F5;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.3); --shadow-lg: 0 10px 40px rgba(0,0,0,.5); --scrim: rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101612; --surface: #18201B; --surface-2: #212B24; --ink: #E7EFE9; --ink-2: #A3B4A8; --line: #2D3931;
  --basil: #5CC287; --basil-ink: #0B1A11; --basil-soft: #1D3526; --saffron: #F2B544; --saffron-ink: #F7D58F;
  --tomato: #F07A62; --tomato-soft: #3A211B; --plum: #C29BE0; --plum-soft: #2E2338; --sky: #7DB3EE; --sky-soft: #1B2A3B;
  --m-breakfast: #3A3017; --m-lunch: #1C3324; --m-tea: #3A2029; --m-dinner: #23284A;
  --m-breakfast-ink: #F7D58F; --m-lunch-ink: #9EDDB4; --m-tea-ink: #F2A9BF; --m-dinner-ink: #B7C0F5;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.3); --shadow-lg: 0 10px 40px rgba(0,0,0,.5); --scrim: rgba(0,0,0,.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; margin: 0; text-wrap: balance; letter-spacing: -.005em; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.1rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.06rem; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--basil); }
:focus-visible { outline: 3px solid var(--basil); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 16px; height: 16px; }
svg.i.lg { width: 24px; height: 24px; }

/* ───── Shell ───── */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100%; }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 20px 14px; border-right: 1px solid var(--line); background: var(--surface); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; }
.brand .logo { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--basil); color: var(--basil-ink); }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 0; background: none; text-decoration: none; color: var(--ink-2); font-weight: 700; width: 100%; text-align: left; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item[aria-current="page"] { background: var(--basil-soft); color: var(--basil); }
.nav-item .count { margin-left: auto; font-size: .78rem; background: var(--surface-2); color: var(--ink-2); padding: 1px 8px; border-radius: 99px; }
.rail .spacer { flex: 1; }
.who { display: grid; gap: 8px; padding: 12px; border-radius: var(--r-md); background: var(--surface-2); }
.who label { font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.who select { width: 100%; min-width: 0; min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); padding: 0 10px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: none; align-items: center; gap: 10px; padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .brand { padding: 0; font-size: 1.05rem; }
.topbar select { margin-left: auto; min-height: 40px; max-width: 52%; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); padding: 0 8px; font-size: .9rem; }
.view { width: 100%; max-width: 1180px; margin: 0 auto; padding-block: 28px 48px; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); display: grid; gap: 22px; align-content: start; }
.tabbar { display: none; }

.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 20px; }
.page-head .sub { color: var(--ink-2); margin-top: 4px; }
.eyebrow { font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }

/* ───── Buttons, chips, inputs ───── */
.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 800; white-space: nowrap; transition: transform .15s var(--ease), background .2s, border-color .2s, box-shadow .2s; }
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--basil); border-color: var(--basil); color: var(--basil-ink); box-shadow: 0 2px 0 rgba(0,0,0,.08); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--tomato); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: .9rem; border-radius: 10px; }
.btn.icon { padding: 0; width: 44px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; font-size: .92rem; white-space: nowrap; transition: background .2s, border-color .2s, color .2s; }
.chip:hover { border-color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip.star[aria-pressed="true"] { background: var(--saffron); border-color: var(--saffron); color: #2B1C00; }
.chip .x { opacity: .7; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: .78rem; font-weight: 700; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.tag.private { background: var(--plum-soft); color: var(--plum); }
.tag.kitchen { background: var(--basil-soft); color: var(--basil); }

.field { display: grid; gap: 6px; min-width: 0; }
.panel > * { min-width: 0; }
.field > label, .label { font-weight: 800; font-size: .92rem; }
.field .hint { font-size: .84rem; color: var(--ink-2); }
.field .err { font-size: .86rem; color: var(--tomato); font-weight: 700; display: flex; gap: 6px; align-items: center; }
.input, .select, .textarea { width: 100%; min-width: 0; min-height: 46px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 10px 14px; transition: border-color .2s, box-shadow .2s; }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--basil); box-shadow: 0 0 0 3px var(--basil-soft); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--tomato); }
.search { position: relative; flex: 1 1 280px; max-width: 460px; }
.search svg { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--ink-2); }
.search .input { padding-left: 44px; border-radius: 99px; }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.stepper button { width: 44px; height: 44px; border: 0; background: none; display: grid; place-items: center; border-radius: 12px; }
.stepper button:hover { background: var(--surface-2); }
.stepper output { min-width: 3.2ch; text-align: center; font-weight: 800; }

.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 14px; background: var(--surface-2); flex-wrap: wrap; }
.seg button { min-height: 38px; padding: 0 14px; border-radius: 10px; border: 0; background: none; font-weight: 800; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; display: grid; gap: 14px; align-content: start; }

/* ───── Recipe grid ───── */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 18px; }
.rcard { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; }
.rcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.rcard.selected { border-color: var(--basil); box-shadow: 0 0 0 3px var(--basil-soft); }
.rcard .ph { aspect-ratio: 4 / 3; background: var(--surface-2); position: relative; overflow: hidden; }
.rcard .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rcard .open { position: absolute; inset: 0; border: 0; background: none; z-index: 1; border-radius: var(--r-lg); }
.rcard .body { padding: 12px 14px 14px; display: grid; gap: 6px; }
.rcard h3 { font-size: 1rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rcard .meta { display: flex; gap: 12px; color: var(--ink-2); font-size: .84rem; align-items: center; }
.rcard .meta span { display: inline-flex; gap: 4px; align-items: center; }
.rcard .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.star-btn { position: absolute; top: 8px; right: 8px; z-index: 2; width: 44px; height: 44px; border-radius: 99px; border: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--ink-2); box-shadow: var(--shadow); transition: transform .2s var(--ease), color .2s; }
.star-btn:hover { transform: scale(1.08); }
.star-btn[aria-pressed="true"] { color: var(--saffron); }
.star-btn[aria-pressed="true"] svg { fill: var(--saffron); }
.star-btn.pop svg { animation: pop .35s var(--ease); }
@keyframes pop { 40% { transform: scale(1.35); } }
.sel-box { position: absolute; top: 10px; left: 10px; z-index: 2; width: 30px; height: 30px; border-radius: 9px; border: 2px solid #fff; background: rgba(0,0,0,.25); display: grid; place-items: center; color: #fff; pointer-events: none; }
.rcard.selected .sel-box { background: var(--basil); border-color: var(--basil); }
.badges { position: absolute; left: 10px; bottom: 10px; display: flex; gap: 6px; z-index: 1; }
.noimg { width: 100%; height: 100%; display: grid; place-items: center; color: var(--ink-2); background: repeating-linear-gradient(45deg, var(--surface-2) 0 12px, var(--bg) 12px 24px); font-family: var(--font-display); font-size: 2rem; }

.selbar { position: fixed; z-index: 30; left: calc(var(--rail) + 24px); right: 24px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); margin: 0 auto; max-width: 860px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px 12px 20px; border-radius: 18px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); transform: translateY(0); transition: transform .3s var(--ease), opacity .3s; }
.selbar[data-open="false"] { transform: translateY(140%); opacity: 0; pointer-events: none; }
.selbar .count { font-weight: 800; }
.selbar .btn { border-color: transparent; }
.selbar .btn.ghost { color: var(--bg); }
.selbar .btn.ghost:hover { background: rgba(255,255,255,.12); }
.selbar .grow { flex: 1; }

/* ───── Detail ───── */
.detail { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.detail .hero { border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 4 / 3; background: var(--surface-2); max-width: 100%; }
.detail .hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--ink-2); font-weight: 700; }
.facts span { display: inline-flex; gap: 6px; align-items: center; }
.ing-list { list-style: none; margin: 0; padding: 0; display: grid; }
.ing-list li { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); align-items: baseline; }
.ing-list .q { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.ing-list .q.none { color: var(--ink-2); font-weight: 600; font-size: .86rem; }
.ing-section { margin-top: 10px; font-weight: 800; color: var(--ink-2); font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; }
.steps li > .yt-player { grid-column: 2; }
.steps li::before { counter-increment: s; content: counter(s); width: 32px; height: 32px; border-radius: 99px; display: grid; place-items: center; background: var(--basil-soft); color: var(--basil); font-weight: 800; font-family: var(--font-display); }
.timer-chip { display: inline-flex; gap: 6px; align-items: center; margin-top: 6px; font-size: .84rem; font-weight: 800; color: var(--sky); background: var(--sky-soft); padding: 2px 10px; border-radius: 99px; }
.flag { display: inline-flex; gap: 6px; align-items: center; font-size: .78rem; font-weight: 800; color: var(--saffron-ink); background: color-mix(in srgb, var(--saffron) 22%, transparent); border-radius: 99px; padding: 1px 8px; }

/* ───── Kitchen ───── */
.kitem { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.kitem img, .kitem .noimg { width: 84px; height: 70px; border-radius: 12px; object-fit: cover; font-size: 1.2rem; }
.kitem .when { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.klist { display: grid; gap: 10px; }
.meal-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 99px; font-size: .8rem; font-weight: 800; }
.meal-pill::before { content: ""; width: 7px; height: 7px; border-radius: 99px; background: currentColor; }
.meal-breakfast { background: var(--m-breakfast); color: var(--m-breakfast-ink); }
.meal-lunch { background: var(--m-lunch); color: var(--m-lunch-ink); }
.meal-tea { background: var(--m-tea); color: var(--m-tea-ink); }
.meal-dinner { background: var(--m-dinner); color: var(--m-dinner-ink); }

/* ───── Planner ───── */
.week-scroll { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); }
.week { display: grid; grid-template-columns: 92px repeat(7, minmax(132px, 1fr)); min-width: 1010px; }
.week .dh { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: center; }
.week .dh .d { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; }
.week .dh.today .d { color: var(--basil-ink); background: var(--basil); width: 38px; height: 38px; border-radius: 99px; display: inline-grid; place-items: center; }
.week .mh { padding: 12px 10px; font-weight: 800; font-size: .86rem; border-bottom: 1px solid var(--line); display: flex; align-items: start; }
.week .cell { padding: 6px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 116px; }
.week .cell.today { background: color-mix(in srgb, var(--basil-soft) 45%, transparent); }
.mcard { width: 100%; height: 100%; text-align: left; border: 0; border-radius: 12px; padding: 8px 10px; display: grid; gap: 4px; align-content: start; font-size: .84rem; transition: transform .15s var(--ease), box-shadow .2s; }
.mcard:hover { box-shadow: var(--shadow); }
.mcard .r { font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mcard .foot { display: flex; justify-content: space-between; gap: 6px; font-size: .76rem; opacity: .85; font-weight: 700; margin-top: 2px; }
.mcard.cooked .r { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.add-cell { width: 100%; height: 100%; min-height: 100px; border: 1.5px dashed var(--line); border-radius: 12px; background: none; color: var(--ink-2); display: grid; place-items: center; transition: border-color .2s, color .2s, background .2s; }
.add-cell:hover { border-color: var(--basil); color: var(--basil); background: var(--basil-soft); }
.day-strip { display: none; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.day-strip button { flex: none; width: 56px; min-height: 64px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; padding: 6px 0; font-weight: 800; }
.day-strip button .dn { font-size: .74rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; }
.day-strip button .dd { font-family: var(--font-display); font-size: 1.25rem; }
.day-strip button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.day-strip button[aria-pressed="true"] .dn { color: inherit; opacity: .8; }
.day-strip .dot { width: 6px; height: 6px; border-radius: 99px; background: var(--basil); }
.day-list { display: none; gap: 10px; }
.day-meal { display: grid; gap: 8px; padding: 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); }
.coverage { display: flex; gap: 4px; }
.coverage i { flex: 1; height: 8px; border-radius: 99px; background: var(--surface-2); }
.coverage i.on { background: var(--basil); }

/* ───── Shopping ───── */
.shop-layout { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 22px; align-items: start; }
.progress { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--basil); border-radius: 99px; transition: width .4s var(--ease); }
.aisle { display: grid; gap: 2px; }
.aisle h3 { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 4px 6px; font-size: 1rem; }
.sitem { border-radius: 12px; }
.sitem .row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 40px; align-items: center; gap: 6px; min-height: 52px; padding: 0 4px; }
.sitem .row:hover { background: var(--surface-2); border-radius: 12px; }
.check { width: 44px; height: 44px; border: 0; background: none; display: grid; place-items: center; }
.check span { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--ink-2); display: grid; place-items: center; transition: background .2s, border-color .2s; }
.check[aria-pressed="true"] span { background: var(--basil); border-color: var(--basil); color: var(--basil-ink); }
.sitem.done .nm, .sitem.done .qty { color: var(--ink-2); text-decoration: line-through; }
.sitem .nm { font-weight: 700; min-width: 0; }
.sitem .qty { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.sitem .why { margin: 0 0 8px 50px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: .86rem; display: grid; gap: 4px; }
.sitem .why div { display: flex; justify-content: space-between; gap: 12px; }
.callout { display: flex; gap: 12px; align-items: start; padding: 14px 16px; border-radius: var(--r-md); background: var(--sky-soft); color: var(--ink); }
.callout svg { color: var(--sky); margin-top: 2px; }
.callout.warn { background: color-mix(in srgb, var(--saffron) 18%, var(--surface)); }
.callout.warn svg { color: var(--saffron-ink); }

/* ───── Today / dashboard ───── */
.cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.meal-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: start; }
.meal-row:last-child { border-bottom: 0; }
.dish { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.dish img, .dish .noimg { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; font-size: 1rem; flex: none; }
.dish .t { flex: 1; min-width: 0; font-weight: 700; }
.stat { display: grid; gap: 2px; }
.stat b { font-family: var(--font-display); font-size: 1.8rem; font-weight: 600; }

/* ───── Forms (add recipe) ───── */
.form { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.form .stack { display: grid; gap: 18px; }
.two { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.drop { border: 2px dashed var(--line); border-radius: var(--r-lg); padding: 22px; display: grid; place-items: center; gap: 8px; text-align: center; color: var(--ink-2); transition: border-color .2s, background .2s; }
.drop.over { border-color: var(--basil); background: var(--basil-soft); }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.thumb { position: relative; width: 104px; height: 84px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .cover { position: absolute; left: 6px; top: 6px; }
.thumb button { position: absolute; right: 4px; top: 4px; width: 28px; height: 28px; border-radius: 99px; border: 0; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; }
.ing-row { display: grid; grid-template-columns: 78px 100px minmax(0, 1fr) minmax(0, .8fr) 44px; gap: 8px; align-items: center; }
.step-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 44px; gap: 10px; align-items: start; }
.step-row .n { width: 32px; height: 32px; margin-top: 7px; border-radius: 99px; display: grid; place-items: center; background: var(--basil-soft); color: var(--basil); font-weight: 800; }
.radio-card { display: flex; gap: 12px; align-items: start; padding: 14px; border-radius: var(--r-md); border: 1px solid var(--line); cursor: pointer; }
.radio-card:has(input:checked) { border-color: var(--basil); background: var(--basil-soft); }
.radio-card input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--basil); }
.errsum { border: 1px solid var(--tomato); background: var(--tomato-soft); border-radius: var(--r-md); padding: 12px 16px; }
.errsum ul { margin: 6px 0 0; padding-left: 20px; }

/* ───── Family ───── */
.member { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 14px; padding: 16px; align-items: start; }
.avatar { width: 48px; height: 48px; border-radius: 99px; display: grid; place-items: center; font-weight: 800; font-family: var(--font-display); font-size: 1.1rem; }
.role-chip { min-height: 36px; font-size: .86rem; }
.role-chip[aria-pressed="true"].admin { background: var(--plum); border-color: var(--plum); color: #fff; }
.role-chip[aria-pressed="true"].chef { background: var(--basil); border-color: var(--basil); color: var(--basil-ink); }
.role-chip[aria-pressed="true"].procurement { background: var(--sky); border-color: var(--sky); color: #fff; }
.role-badge { font-size: .74rem; font-weight: 800; padding: 1px 8px; border-radius: 99px; }
.role-badge.admin { background: var(--plum-soft); color: var(--plum); }
.role-badge.chef { background: var(--basil-soft); color: var(--basil); }
.role-badge.procurement { background: var(--sky-soft); color: var(--sky); }

/* ───── Sheets / dialogs ───── */
.scrim { position: fixed; inset: 0; z-index: 50; background: var(--scrim); display: grid; place-items: center; padding: 20px; animation: fade .2s var(--ease); }
.sheet { width: min(560px, 100%); max-height: min(86vh, 760px); overflow: auto; background: var(--surface); border-radius: 24px; box-shadow: var(--shadow-lg); display: grid; gap: 18px; padding: 22px; animation: rise .28s var(--ease); }
.sheet header { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.sheet footer { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; position: sticky; bottom: -22px; background: var(--surface); padding: 12px 0 0; margin-bottom: -6px; }
.opt-list { display: grid; gap: 8px; }
.opt { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); text-align: left; width: 100%; }
.opt[aria-pressed="true"] { border-color: var(--basil); background: var(--basil-soft); }
.opt .grow { flex: 1; min-width: 0; }
.opt .tick { width: 24px; height: 24px; border-radius: 99px; border: 2px solid var(--line); display: grid; place-items: center; color: var(--basil-ink); }
.opt[aria-pressed="true"] .tick { background: var(--basil); border-color: var(--basil); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }

.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); translate: -50% 0; display: flex; gap: 14px; align-items: center; padding: 12px 14px 12px 18px; border-radius: 14px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); font-weight: 700; max-width: calc(100% - 32px); animation: rise .25s var(--ease); }
.toast button { color: var(--saffron); background: none; border: 0; font-weight: 800; min-height: 36px; padding: 0 6px; }

/* ───── Cooking mode ───── */
.cook { position: fixed; inset: 0; z-index: 70; background: var(--bg); display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.cook-top { display: flex; align-items: center; gap: 10px; padding: 12px max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px)); }
.cook-top .ttl { flex: 1; min-width: 0; }
.cook-top .ttl b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.cook-prog { display: flex; gap: 4px; padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); }
.cook-prog i { flex: 1; height: 5px; border-radius: 99px; background: var(--line); transition: background .3s; }
.cook-prog i.on { background: var(--basil); }
.cook-stage { min-height: 0; display: grid; place-items: center; padding: 16px max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px)); overflow: hidden; touch-action: pan-y; }
.flash { width: min(980px, 100%); max-height: 100%; overflow: auto; background: var(--surface); border-radius: 28px; box-shadow: var(--shadow-lg); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); animation: card-in .32s var(--ease); }
.flash.back { animation-name: card-back; }
.flash.textonly { grid-template-columns: minmax(0, 1fr); width: min(760px, 100%); }
@keyframes card-in { from { transform: translateX(40px) rotate(1deg); opacity: 0; } }
@keyframes card-back { from { transform: translateX(-40px) rotate(-1deg); opacity: 0; } }
.flash .pic { background: var(--surface-2); min-height: 260px; }
.flash .pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.flash .txt { padding: clamp(20px, 4vw, 40px); display: grid; gap: 18px; align-content: center; }
.flash .stepno { font-family: var(--font-display); font-weight: 600; color: var(--basil); font-size: 1rem; letter-spacing: .02em; }
.flash .say { font-size: var(--cook-size, 1.5rem); line-height: 1.45; font-weight: 600; }
.cook-bot { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; padding: 10px max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px)); }
.cook-bot .btn { min-height: 58px; font-size: 1.05rem; border-radius: 16px; }
.cook-bot .next { justify-self: end; min-width: 180px; }
.cook-bot .prev { justify-self: start; }
.running-timer { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; background: var(--sky-soft); color: var(--sky); font-weight: 800; font-variant-numeric: tabular-nums; border: 0; min-height: 40px; }
.running-timer.done { background: var(--tomato); color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .65; } }
.mise { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.mise li button { width: 100%; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; align-items: center; text-align: left; border: 0; background: none; min-height: 48px; padding: 4px 6px; border-radius: 12px; font-size: 1.05rem; }
.mise li button:hover { background: var(--surface-2); }
.mise li button[aria-pressed="true"] .w { text-decoration: line-through; color: var(--ink-2); }
.mise .box { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--ink-2); display: grid; place-items: center; }
.mise li button[aria-pressed="true"] .box { background: var(--basil); border-color: var(--basil); color: var(--basil-ink); }
.mise .amt { font-weight: 800; font-variant-numeric: tabular-nums; }

/* ───── Design notes ───── */
.notes { border: 1.5px dashed color-mix(in srgb, var(--plum) 55%, transparent); background: var(--plum-soft); border-radius: var(--r-lg); padding: 14px 18px; }
.notes summary { cursor: pointer; font-weight: 800; color: var(--plum); display: flex; gap: 8px; align-items: center; min-height: 32px; }
.notes ul { margin: 8px 0 2px; padding-left: 20px; display: grid; gap: 6px; font-size: .92rem; }
.empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 48px 16px; color: var(--ink-2); }
.empty h3 { color: var(--ink); }

/* ───── Responsive ───── */
@media (max-width: 1080px) {
  .detail, .cols, .shop-layout, .form { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .topbar { display: flex; }
  body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 25; background: var(--surface); }
  .view { padding-block: 18px calc(var(--tabbar) + 96px); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); gap: 18px; }
  .tabbar { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); background: var(--surface); border-top: 1px solid var(--line); }
  .tabbar .nav-item { flex-direction: column; justify-content: center; gap: 2px; min-height: 52px; padding: 0 2px; font-size: .72rem; text-align: center; }
  .tabbar .nav-item .count { display: none; }
  .selbar { left: 12px; right: 12px; bottom: calc(var(--tabbar) + 12px + env(safe-area-inset-bottom, 0px)); }
  .week-scroll { display: none; }
  .day-strip { display: flex; }
  .day-list { display: grid; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .rcard .body { padding: 10px 12px 12px; }
  .rcard .tags { display: none; }
  .flash { grid-template-columns: minmax(0, 1fr); border-radius: 22px; }
  .flash .pic { min-height: 0; aspect-ratio: 16 / 10; }
  .cook-bot .next { min-width: 0; }
  .ing-row { grid-template-columns: 70px 92px minmax(0, 1fr) 44px; }
  .ing-row .prep { display: none; }
  .two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two .field:first-child { grid-column: 1 / -1; }
  .scrim { place-items: end center; padding: 0; }
  .sheet { border-radius: 24px 24px 0 0; max-height: 88vh; padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px)); }
  .toast { bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 480px) {
  .ing-list li { grid-template-columns: 5.6rem minmax(0, 1fr); }
  .meal-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .kitem { grid-template-columns: 64px minmax(0, 1fr); }
  .kitem img, .kitem .noimg { width: 64px; height: 56px; }
  .kitem .acts { grid-column: 1 / -1; }
  .cook-bot { grid-template-columns: auto 1fr; }
  .cook-bot .mid { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ───── v2: auth, account, settings ───── */
.auth { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); background: var(--bg); }
.auth-main { display: grid; align-content: center; justify-items: center; padding-block: 40px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.auth-card { width: min(440px, 100%); display: grid; gap: 18px; }
.auth-card .brand { padding: 0 0 6px; }
.auth-art { position: relative; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 10px; padding: 10px; min-height: 100vh; position: sticky; top: 0; height: 100vh; }
.auth-art img { width: 100%; height: 100%; object-fit: cover; border-radius: 22px; }
.auth-art .quote { position: absolute; left: 34px; right: 34px; bottom: 34px; background: color-mix(in srgb, var(--surface) 92%, transparent); border-radius: 18px; padding: 16px 18px; box-shadow: var(--shadow-lg); font-weight: 700; }
.pw { position: relative; }
.pw .input { padding-right: 84px; }
.pw button { position: absolute; right: 6px; top: 50%; translate: 0 -50%; min-height: 36px; border: 0; background: none; color: var(--basil); font-weight: 800; padding: 0 10px; border-radius: 8px; }
.demo-hint { font-size: .86rem; color: var(--ink-2); background: var(--surface-2); border-radius: 12px; padding: 10px 14px; }
.account { display: grid; gap: 10px; padding: 12px; border-radius: var(--r-md); background: var(--surface-2); }
.account .me { display: flex; align-items: center; gap: 10px; min-width: 0; }
.account .me .avatar { width: 36px; height: 36px; font-size: .9rem; flex: none; }
.account .me div { min-width: 0; }
.account .me div > b, .account .me div > span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account select { width: 100%; min-width: 0; min-height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); padding: 0 8px; font-size: .9rem; }
.account label { font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.topbar .icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 0; background: none; display: grid; place-items: center; color: var(--ink); text-decoration: none; }
.topbar .icon-btn:hover { background: var(--surface-2); }
.switch { position: relative; width: 52px; height: 32px; border-radius: 99px; border: 0; background: var(--line); flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 99px; background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s var(--ease); }
.switch[aria-checked="true"] { background: var(--basil); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.srow { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.srow:last-child { border-bottom: 0; }
.srow img, .srow .noimg { width: 56px; height: 44px; border-radius: 10px; object-fit: cover; font-size: 1rem; }
.srow.off .t { color: var(--ink-2); }
.linkbox { display: flex; gap: 8px; }
.linkbox .input { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: .86rem; }
.role-badge.basic { background: var(--surface-2); color: var(--ink-2); }
.member .acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
@media (max-width: 860px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { display: none; }
}
.topbar { gap: 6px; }
.topbar .brand { min-width: 0; white-space: nowrap; overflow: hidden; }
.topbar select { flex: 0 1 46%; min-width: 0; width: 46%; max-width: none; }
.topbar .icon-btn { flex: none; }
@media (max-width: 400px) { .topbar .brand { font-size: 0; gap: 0; } .topbar .brand .logo { font-size: 1rem; } }

.topbar .grow { flex: 1; }

/* ───── v3: mobile text and date fixes ───── */
body { overflow-wrap: break-word; }
.sitem .nm, .dish .t, .kitem a, .srow .t, .mcard .r, .opt .grow, .ing-list li > span:last-child { overflow-wrap: anywhere; }
.dates { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.dates .input { width: 100%; min-width: 0; padding-inline: 10px; }
.day-strip button.is-today { box-shadow: inset 0 0 0 2px var(--basil); }
.day-strip button.is-today[aria-pressed="true"] { box-shadow: none; }
.page-head h1, .page-head h2 { min-width: 0; }
@media (max-width: 860px) {
  .day-strip { gap: 6px; overflow: visible; }
  .day-strip button { flex: 1 1 0; width: auto; min-width: 0; padding: 6px 0; }
  .sheet footer { bottom: calc(-22px - env(safe-area-inset-bottom, 0px)); margin-bottom: calc(-6px - env(safe-area-inset-bottom, 0px)); padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .sheet footer > :only-child { grid-column: 1 / -1; }
  .sheet footer .danger { grid-column: 1 / -1; margin-right: 0 !important; justify-self: start; }
  .sitem .row { grid-template-columns: 44px minmax(0, 1fr) auto 36px; }
  .sitem .qty { max-width: 9.5rem; text-align: right; overflow-wrap: anywhere; }
  .sitem .why { margin-left: 8px; }
  .sitem .why div { flex-wrap: wrap; }
  .week-nav { width: 100%; }
}
@media (max-width: 400px) {
  .dates { grid-template-columns: minmax(0, 1fr); }
  .seg button { padding: 0 11px; }
  .page-head .btn-row { width: 100%; }
}

/* ───── v4: language switch, links, video ───── */
.langseg button { min-height: 34px; padding: 0 12px; font-size: .86rem; }
.cook-top .langseg { padding: 3px; }
.cook-top .langseg button { min-height: 32px; padding: 0 10px; }
.ytlink { display: inline; font-weight: 800; color: var(--tomato); text-decoration: underline; text-underline-offset: 2px; }
.ytlink svg { fill: currentColor; display: inline-block; vertical-align: -2px; margin-right: 4px; }
.yt-player { display: grid; gap: 8px; margin: 10px 0 4px; }
.yt-frame { position: relative; aspect-ratio: 16 / 9; max-width: 100%; border-radius: 14px; overflow: hidden; background: #000; }
.yt-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-player .yt-exit { display: none; }
.yt-player.theater { position: fixed; inset: 0; z-index: 1000; margin: 0; background: #000; padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px; }
.yt-player.theater .yt-frame { width: min(100%, calc((100dvh - 96px) * 16 / 9)); border-radius: 0; }
.yt-player.theater .yt-enter { display: none; }
.yt-player.theater .yt-exit { display: inline-flex; }
.yt-player.theater .btn-row { justify-content: center; }
.yt-player.theater .btn.ghost { color: #fff; border-color: rgba(255,255,255,.4); }
body.yt-lock { overflow: hidden; }
.yt-poster { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #1d1d1d; }
.yt-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yt-play { position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; border-radius: 50%; background: var(--tomato); display: grid; place-items: center; box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.yt-play svg { fill: #fff; stroke: none; width: 28px; height: 28px; }
.say a, .steps a, .detail p a { overflow-wrap: anywhere; }

/* App loading / error screen */
.boot { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 24px; text-align: center; }
.boot .logo { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--basil); color: var(--basil-ink); }
.img-missing { visibility: hidden; }

/* ── Print the week: an on-screen preview that prints as a clean document ── */
.print-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; position: sticky; top: 0; z-index: 5; padding: 10px 0; background: var(--bg); }
.print-doc { --p-ink: #17251C; --p-muted: #5A6A5F; --p-line: #DCE4D8; --p-soft: #F2F6EF; background: #fff; color: var(--p-ink); border-radius: 18px; box-shadow: var(--shadow); padding: 40px 44px; display: grid; gap: 28px; font-size: 15px; line-height: 1.5; }
.print-doc .muted { color: var(--p-muted); }
.pd-cover { display: grid; gap: 6px; border-bottom: 2px solid var(--p-ink); padding-bottom: 18px; }
.pd-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: #2E7A4C; }
.pd-brand .logo { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: #2E7A4C; color: #fff; }
.pd-brand .logo svg { width: 18px; height: 18px; }
.pd-cover h1 { font-size: 2.2rem; margin: 6px 0 0; }
.pd-sub { font-size: 1.15rem; font-weight: 700; margin: 0; }
.pd-note { background: #FFF6DE; border-radius: 10px; padding: 10px 14px; margin: 0; color: #6B4500; }
.pd-week { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13.5px; }
.pd-week th, .pd-week td { border: 1px solid var(--p-line); padding: 8px 9px; vertical-align: top; text-align: left; }
.pd-week thead th { background: var(--p-soft); font-weight: 800; }
.pd-week tbody th { width: 92px; background: var(--p-soft); }
.pd-week tbody th b, .pd-week tbody th span { display: block; }
.pd-week tbody th span { font-weight: 600; color: var(--p-muted); }
.pd-week td.none { color: #A8B4AB; text-align: center; vertical-align: middle; }
.pd-week ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.pd-week li { display: flex; gap: 6px; font-weight: 700; line-height: 1.3; }
.pd-week .ppl { display: block; margin-top: 6px; font-size: 12px; color: var(--p-muted); }
.print-doc .no { flex: none; display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: #2E7A4C; color: #fff; font-size: 11px; font-weight: 800; }
.pd-recipe { display: grid; gap: 16px; border-top: 1px solid var(--p-line); padding-top: 28px; }
.pd-recipe > header { display: flex; gap: 14px; align-items: flex-start; }
.pd-recipe > header .no { min-width: 34px; height: 34px; font-size: 16px; margin-top: 4px; }
.pd-recipe h2 { font-size: 1.6rem; margin: 0; line-height: 1.2; }
.pd-recipe .meta { margin: 2px 0 0; color: var(--p-muted); font-weight: 700; }
.pd-recipe .when { margin: 4px 0 0; font-weight: 700; color: #2E7A4C; }
.pd-recipe .hero { width: 100%; max-height: 330px; object-fit: cover; border-radius: 14px; }
.pd-recipe .summary { margin: 0; color: var(--p-muted); }
.pd-cols { display: grid; grid-template-columns: minmax(220px, 1fr) 2fr; gap: 28px; align-items: start; }
.pd-cols h3 { margin: 0 0 4px; font-size: 1.15rem; }
.pd-cols .ings { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 0; }
.pd-cols .ings li { display: grid; grid-template-columns: 86px 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--p-line); }
.pd-cols .ings .q { font-weight: 800; text-align: right; }
.pd-cols li.sec { display: block; border: 0; padding: 12px 0 2px; font-weight: 800; color: #2E7A4C; }
.steps-p { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 14px; }
.steps-p li.step { display: grid; grid-template-columns: 30px 1fr; gap: 10px; }
.steps-p .n { width: 28px; height: 28px; border-radius: 99px; display: grid; place-items: center; background: #DDEFE2; color: #2E7A4C; font-weight: 800; }
.steps-p p { margin: 2px 0 0; }
.steps-p .timer { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 12.5px; font-weight: 700; color: #2563A6; }
.steps-p img { display: block; width: 100%; max-width: 420px; max-height: 260px; object-fit: cover; border-radius: 10px; margin-top: 8px; }
.print-doc a { color: inherit; }
@media screen and (max-width: 600px) {
  .pd-week, .pd-week tbody, .pd-week tr, .pd-week th, .pd-week td { display: block; width: auto !important; }
  .pd-week thead, .pd-week td.none { display: none; }
  .pd-week tr { border: 1px solid var(--p-line); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
  .pd-week th, .pd-week td { border: 0; }
  .pd-week tbody th { display: flex; gap: 6px; }
  .pd-week td { border-top: 1px solid var(--p-line); }
  .pd-week td::before { content: attr(data-meal); display: block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--p-muted); margin-bottom: 4px; }
}
@media screen and (max-width: 860px) {
  .print-doc { padding: 22px 16px; border-radius: 12px; }
  .pd-cols { grid-template-columns: 1fr; }
  .pd-week { font-size: 12px; }
  .pd-week tbody th { width: 64px; }
}
@media print {
  @page { size: A4; margin: 14mm 13mm; }
  html, body { background: #fff !important; }
  .rail, .topbar, .tabbar, .selbar, .print-bar, #toast-host, #layer, #cook-host { display: none !important; }
  .shell { display: block; }
  .view { max-width: none; padding: 0 !important; }
  .print-doc { box-shadow: none; border-radius: 0; padding: 0; gap: 18px; font-size: 11.5pt; }
  .pd-cover { gap: 2px; padding-bottom: 10px; }
  .pd-cover h1 { font-size: 20pt; margin-top: 2px; }
  .pd-sub { font-size: 12pt; }
  .pd-week { font-size: 8.5pt; }
  .pd-week th, .pd-week td { padding: 4px 6px; }
  .pd-week tbody th { width: 62px; }
  .pd-week ul { gap: 2px; }
  .pd-week li { line-height: 1.2; }
  .pd-week .ppl { margin-top: 3px; font-size: 7.5pt; }
  .print-doc .no { min-width: 15px; height: 15px; font-size: 7pt; padding: 0 3px; }
  .pd-week tr { break-inside: avoid; }
  .pd-recipe { break-before: page; border-top: 0; padding-top: 0; }
  .pd-cols { grid-template-columns: 34% 1fr; }
  .pd-recipe .hero { max-height: 70mm; }
  .steps-p li.step, .pd-cols .ings li, .pd-recipe > header { break-inside: avoid; }
  .steps-p img { max-width: 70mm; max-height: 48mm; }
  .print-doc * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
