/* Middag's styles. Design system: DESIGN.md (Maiolica).
   One set of tokens, a few shared building blocks, then each screen.
   Everything sits on the linen table; white is for inputs, sheets and the few things you pick up. */

/* ════════════════════════════════════════════════════════════════════════
   TOKENS
   ════════════════════════════════════════════════════════════════════════ */
:root {
  --linen:       #F6F1E7;   /* the table: every page */
  --plate:       #FFFFFF;   /* inputs, sheets, found recipes */
  --line:        #E3DBCB;   /* hairlines between rows */
  --line-strong: #CFC6B5;   /* input and checkbox borders */
  --ink:         #15202B;
  --ink-2:       #565C64;   /* secondary text */
  --ink-3:       #6E6A61;   /* hints; 4.5:1 on linen and white */

  --cobalt:       #1F3F9A;  /* actions, links, selection. Nothing else */
  --cobalt-press: #17317A;
  --cobalt-wash:  #E8ECF7;
  --lemon:        #F4C430;  /* tonight only */
  --lemon-line:   #C99A0E;
  --lemon-ink:    #3D2E00;
  --olive:        #55702F;  /* good news: leftovers, savings, hits, in season */
  --olive-wash:   #EEF1E2;
  --danger:       #9E2F1E;  /* warnings and errors */
  --danger-wash:  #FBEDEA;

  --busy:    var(--cobalt);
  --normal:  #8A6500;       /* ochre, dark enough to read as text */
  --relaxed: var(--olive);

  --ica:  #E3000B;          /* only on ICA buttons */
  --coop: #00AA46;          /* only on Coop buttons */
  --willys: #111111;        /* only on Willys buttons: their black, as their red is ICA's */

  --font: 'Schibsted Grotesk', system-ui, sans-serif;
  --gutter: 20px;
  --r-chip: 9px;
  --r-control: 12px;
  --r-card: 16px;
  --r-tile: 20px;
  --r-sheet: 22px;
  --sh-float: 0 16px 40px rgba(21,32,43,.16);

  /* Old names still used in a few inline styles */
  --bg: var(--linen); --surface: var(--plate); --border: var(--line);
  --ink-mid: var(--ink-2); --ink-soft: var(--ink-3);
  --accent: var(--cobalt); --green: var(--cobalt); --tint: var(--cobalt-wash);
  --saffron: var(--lemon); --olive-tint: var(--olive-wash);
  --font-body: var(--font); --font-display: var(--font);
}

/* ════════════════════════════════════════════════════════════════════════
   BASE
   ════════════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { height: -webkit-fill-available; }
body {
  font-family: var(--font); font-size: 16px; line-height: 1.4; color: var(--ink); background: var(--linen);
  min-height: 100vh; min-height: -webkit-fill-available; overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: var(--cobalt); }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; border-radius: 4px; }
.num, .day-num-lg, .stepper-val, .jar-count { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* Icons: line drawings from the sprite in index.html */
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.ic.lemon { --ic-fill: var(--lemon); --ic-leaf: #8BA35A; color: #9A7400; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } }

/* ════════════════════════════════════════════════════════════════════════
   FRAME: header, screens, bottom bar
   ════════════════════════════════════════════════════════════════════════ */
.app-header { padding-top: env(safe-area-inset-top, 0); }
.header-inner { display: flex; align-items: center; height: 52px; padding: 0 var(--gutter); }
.brand-name { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.brand-plate { flex: none; }

main { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0)); }
.screen { display: none; }
.screen.active { display: block; animation: fadeIn .2s ease; }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 200; display: flex;
  padding: 6px 4px env(safe-area-inset-bottom, 8px);
  background: rgba(246,241,231,.94); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.nav-btn { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px 4px; color: var(--ink-3); }
.nav-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-label { font-size: 11px; font-weight: 600; white-space: nowrap; }
.nav-btn.active { color: var(--cobalt); }
.nav-btn.active svg { stroke-width: 2.1; }

.offline-banner { display: none; justify-content: center; padding: 8px var(--gutter); font-size: 13px; font-weight: 600; color: var(--cobalt); background: var(--cobalt-wash); }
.offline-banner.show { display: flex; }

/* ════════════════════════════════════════════════════════════════════════
   BUILDING BLOCKS
   ════════════════════════════════════════════════════════════════════════ */

/* Screen heads: a big title, actions on the right */
.screen-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px var(--gutter) 0; }
.screen-title { font-size: 34px; font-weight: 750; letter-spacing: -0.035em; line-height: 1.05; }
.screen > .screen-title { padding: 8px var(--gutter) 0; }
.head-actions { display: flex; gap: 18px; }

/* A list heading inside a screen */
.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 32px 0 6px; }
.list-head h2, .list-title { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }

/* A row: one line of something you can act on, divided by hairlines */
.row { display: flex; align-items: center; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.row p { flex: 1; min-width: 0; }
.row strong { display: block; font-size: 15px; font-weight: 650; }
.row p span { display: block; font-size: 14px; color: var(--ink-2); margin-top: 2px; }

/* Intro lines under a title */
.favs-note, .history-note, .pantry-note, .pantry-intro, .settings-hint, .sheet-sub, .shop-hint { color: var(--ink-2); }
.favs-note, .history-note { padding: 12px var(--gutter) 4px; font-size: 15px; line-height: 1.45; }
.history-note.split { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.settings-hint { display: block; font-size: 13px; line-height: 1.4; margin-top: 6px; }

/* Sub-tabs: words with a cobalt underline */
.subtabs { display: flex; gap: 18px; margin: 14px var(--gutter) 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs button { position: relative; padding: 10px 0 11px; font-size: 14px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.subtabs button.active { color: var(--ink); }
.subtabs button.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--cobalt); }

/* Buttons: one primary per view, the rest are links or quiet outlines */
.primary-btn, .ghost-btn, .add-btn, .cook-tonight-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px;
  border-radius: var(--r-control); font-size: 15px; font-weight: 650; white-space: nowrap; text-decoration: none;
}
.primary-btn, .add-btn, .cook-tonight-btn { background: var(--cobalt); color: #fff; }
.primary-btn:active, .add-btn:active, .cook-tonight-btn:active { background: var(--cobalt-press); }
.ghost-btn { background: var(--plate); color: var(--ink); border: 1px solid var(--line-strong); }
.ghost-btn:active { background: var(--linen); }
.primary-btn.small, .ghost-btn.small { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.primary-btn.big, .ghost-btn.big { width: 100%; height: 52px; font-size: 16px; border-radius: 14px; margin-top: 18px; }
.primary-btn.loading, .ghost-btn.loading { opacity: .6; }
.link-btn { display: inline-block; padding: 8px 0; margin: -8px 0; font-size: 15px; font-weight: 600; color: var(--cobalt); text-align: left; }
.link-btn.strong { font-weight: 700; }
.link-btn.danger { color: var(--danger); }
.icon-btn { position: relative; display: grid; place-items: center; width: 44px; height: 44px; margin-right: -10px; border-radius: 50%; color: var(--ink); }
.icon-btn svg { width: 22px; height: 22px; fill: currentColor; }
.icon-btn .ic { fill: none; }
.icon-btn.small { width: 36px; height: 36px; margin: -8px -8px -8px 0; color: var(--ink-3); }
.icon-btn.small .ic { width: 18px; height: 18px; }
.icon-btn:active { background: var(--line); }

/* Pills inside an open dinner */
.qa-btn, .fb-btn {
  position: relative; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: var(--plate); font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap;
}
.qa-btn::after, .fb-btn::after { content: ''; position: absolute; inset: -5px 0; }
.qa-btn .ic { width: 17px; height: 17px; }
.qa-btn.for-btn { border-color: transparent; background: var(--olive-wash); color: var(--olive); }
.qa-btn.star-btn.on { border-color: transparent; background: var(--olive-wash); color: var(--olive); --ic-fill: var(--olive); }
.fb-btn.up.active { border-color: var(--olive); background: var(--olive-wash); color: var(--olive); }
.fb-btn.ok.active { border-color: var(--ink-2); background: var(--line); color: var(--ink); }
.fb-btn.down.active { border-color: var(--danger); background: var(--danger-wash); color: var(--danger); }

/* Spinners */
.spinner, .mini-spin { display: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--cobalt); animation: spin .7s linear infinite; }
.primary-btn.loading .spinner, #plan-btn.loading .spinner, .qa-btn.loading .mini-spin, .find-recipe-btn.loading .mini-spin { display: block; }
.primary-btn.loading .btn-text, #plan-btn.loading .btn-text, .swap-btn.loading .swap-text { display: none; }
.big-spin, .cook-spin { width: 30px; height: 30px; margin: 0 auto 14px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--cobalt); animation: spin .7s linear infinite; }

/* Stepper: − 4 + */
.stepper { display: inline-flex; align-items: center; flex: none; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--plate); }
.stepper button { position: relative; width: 36px; height: 36px; font-size: 18px; color: var(--ink-2); }
.stepper button::after { content: ''; position: absolute; inset: -4px; }
.stepper button:active { color: var(--cobalt); }
.stepper-val { min-width: 24px; text-align: center; font-size: 15px; font-weight: 650; white-space: nowrap; }

/* Segmented choice */
.seg { display: flex; gap: 2px; padding: 3px; border-radius: var(--r-control); background: var(--line); }
.seg button { position: relative; flex: 1; min-width: 0; height: 36px; padding: 0 6px; border-radius: 9px; font-size: 14px; font-weight: 550; color: var(--ink-2); white-space: nowrap; }
.seg button.on { background: var(--plate); color: var(--ink); font-weight: 650; box-shadow: 0 1px 2px rgba(21,32,43,.1); }

/* Switch */
.toggle-switch { position: relative; flex: none; width: 48px; height: 28px; border-radius: 999px; background: var(--line-strong); transition: background .2s; }
.toggle-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(21,32,43,.25); transition: left .2s; }
.toggle-switch.on { background: var(--cobalt); }
.toggle-switch.on::after { left: 23px; }

/* Text fields */
.pantry-input, .settings-text, .quick-add-input, .quick-add-day-select, .plan-dish, .ica-setup-row input {
  width: 100%; min-width: 0; height: 46px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--r-control);
  background: var(--plate); font-size: 16px; color: var(--ink); outline: none;
}
.settings-text { height: auto; padding: 12px 14px; line-height: 1.45; resize: none; }
.pantry-input:focus, .settings-text:focus, .quick-add-input:focus, .quick-add-day-select:focus, .plan-dish:focus, .ica-setup-row input:focus { border-color: var(--cobalt); }
::placeholder { color: var(--ink-3); opacity: 1; }
.custom-row { display: flex; gap: 8px; }
.custom-row .add-btn { flex: none; }

/* Chips you tick on or off */
.chip-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.pantry-chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 13px; border-radius: var(--r-chip); border: 1px solid var(--line-strong); background: var(--plate); font-size: 14px; color: var(--ink); cursor: pointer; }
.pantry-chip.on { border-color: transparent; background: var(--cobalt-wash); color: var(--cobalt); font-weight: 600; }

/* Menu, toast */
.week-actions { position: relative; }
.menu { position: absolute; right: -6px; top: 46px; z-index: 300; min-width: 240px; padding: 6px; border-radius: 16px; background: var(--plate); box-shadow: var(--sh-float); }
.menu button, .menu a { display: flex; align-items: center; gap: 8px; width: 100%; padding: 12px; border-radius: 10px; font-size: 15px; font-weight: 500; color: var(--ink); text-align: left; text-decoration: none; }
.menu button:hover, .menu a:hover, .menu button:focus-visible, .menu a:focus-visible { background: var(--linen); }
.toast-el {
  position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom, 0)); z-index: 999;
  width: max-content; max-width: calc(100vw - 32px); padding: 11px 18px; border-radius: 14px;
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 500; line-height: 1.35; text-align: center;
  opacity: 0; transform: translate(-50%, 8px); transition: opacity .2s, transform .2s; pointer-events: none; box-shadow: var(--sh-float);
}
.toast-el.show { opacity: 1; transform: translate(-50%, 0); }

/* Empty and loading */
.empty-wrap { padding: 48px var(--gutter); max-width: 32rem; }
.empty-icon { display: none; }
.empty-title { font-size: 26px; font-weight: 750; letter-spacing: -0.03em; line-height: 1.15; }
.empty-body { margin: 10px 0 20px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.load-wrap { padding: 56px var(--gutter); text-align: center; }
.load-msg { font-size: 16px; font-weight: 600; color: var(--ink-2); }

/* Cuisine dots on saved dinners */
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); text-transform: capitalize; }
.tag::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.tag-italian::before { background: var(--olive); }
.tag-nordic::before { background: var(--cobalt); }
.tag-mediterranean::before { background: var(--normal); }
.tag-asian::before { background: #B5523B; }
.tag-time { text-transform: none; }
.tag-time::before { display: none; }
.cost-badge { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.cost-badge.cheap { color: var(--olive); }
.cost-badge.pricey { color: var(--danger); }

/* ════════════════════════════════════════════════════════════════════════
   THIS WEEK
   ════════════════════════════════════════════════════════════════════════ */
.week-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 6px var(--gutter) 0; font-size: 15px; color: var(--ink-2); }
.week-switch button { font-size: 15px; font-weight: 650; color: var(--cobalt); padding: 8px 0; margin: -8px 0; }
.week-switch button.on { display: none; }

.quick-add-bar { display: none; padding: 16px var(--gutter) 0; }
.quick-add-bar.visible { display: block; }
.quick-add-inner { display: flex; flex-direction: column; gap: 10px; }
.quick-add-row { display: flex; align-items: center; gap: 8px; }
.quick-add-label { font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.quick-add-day-select { flex: 1; width: auto; }
.quick-add-submit { flex: none; height: 46px; padding: 0 16px; border-radius: var(--r-control); background: var(--cobalt); color: #fff; font-size: 15px; font-weight: 650; }
.quick-add-hint { font-size: 13px; color: var(--ink-3); }
.select-bar { display: none !important; }

/* Tonight: the one bold thing. Flat lemon with a painted cobalt rim, like the edge of a maiolica plate */
#tonight-slot { padding: 22px var(--gutter) 0; }
#tonight-slot:empty { display: none; }
.tonight { position: relative; overflow: hidden; padding: 34px 22px 20px; border-radius: var(--r-tile); background: var(--lemon); color: var(--lemon-ink); }
.tonight-rim { position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 18px; }
.tonight-rim pattern * { fill: var(--cobalt); }
.tonight-when { font-size: 14px; font-weight: 600; line-height: 1.35; }
.tonight-meal { margin: 6px 0 10px; font-size: 32px; font-weight: 750; letter-spacing: -0.035em; line-height: 1.02; text-wrap: balance; }
.tonight-desc { max-width: 34ch; font-size: 15px; line-height: 1.45; opacity: .85; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tonight-actions { display: flex; align-items: center; gap: 20px; margin-top: 18px; }
.tonight-cook { height: 48px; padding: 0 22px; border-radius: 14px; background: var(--cobalt); color: #fff; font-size: 16px; font-weight: 650; }
.tonight-cook:active { background: var(--cobalt-press); }
.tonight-more { padding: 12px 0; font-size: 16px; font-weight: 650; color: var(--lemon-ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }

/* Rows under tonight: the planning prompt, the lemon count */
.next-nudge { margin: 8px var(--gutter) 0; }
.next-nudge-actions { display: flex; gap: 18px; flex: none; }
.days-wrap { padding: 0 var(--gutter) 24px; }
.lemon-row { cursor: pointer; }
.lemon-row.next { cursor: default; }
.lemon-plates { display: flex; gap: 4px; flex: none; }
.mini-plate { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--line-strong); }
.mini-plate.full { border-color: var(--lemon-line); background: var(--lemon); }
.lemon-text { flex: 1; min-width: 0; font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.lemon-text strong { display: block; font-size: 15px; font-weight: 650; color: var(--ink); }
.lemon-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 2px; }
.lemon-text > span + span::before { content: ' · '; }
.lemon-row .chev { width: 18px; height: 18px; color: var(--ink-3); }

.season-line { display: flex; align-items: flex-start; gap: 8px; margin: 2px 0 6px; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.season-line .ic { width: 17px; height: 17px; margin-top: 2px; color: var(--olive); }
.week-tips { margin: 0 0 6px; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.week-tips p + p { margin-top: 4px; }
.add-lunches { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.add-lunches span { flex: 1; }

/* A dinner: date, name, the evening and its numbers, who cooks */
.day-card { border-bottom: 1px solid var(--line); scroll-margin-top: 16px; }
.card-trigger { display: flex; align-items: center; gap: 14px; padding: 15px 0; cursor: pointer; user-select: none; }
.day-label { flex: none; width: 40px; text-align: center; }
.day-name-sm { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.day-num-lg { display: grid; place-items: center; width: 36px; height: 36px; margin: 1px auto 0; border-radius: 50%; font-size: 19px; font-weight: 650; letter-spacing: -0.02em; }
.day-card.today .day-name-sm { color: var(--lemon-ink); }
.day-card.today .day-num-lg { background: var(--lemon); color: var(--lemon-ink); }
.card-body { flex: 1; min-width: 0; }
.card-meal { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; line-height: 1.25; }

/* Meta lines: dots between items, and a dot never starts a line (the first one is clipped off) */
.card-meta, .card-tags { overflow: hidden; margin-top: 3px; font-size: 14px; color: var(--ink-2); }
.card-tags { margin-top: 2px; font-size: 13px; color: var(--ink-3); }
.meta-line { display: flex; flex-wrap: wrap; margin-left: -15px; }
.meta-line > span { white-space: nowrap; }
.meta-line > span::before { content: ''; display: inline-block; width: 3px; height: 3px; margin: 0 6px; border-radius: 50%; background: currentColor; opacity: .55; vertical-align: middle; }
.meta-line > .meta-long { white-space: normal; }
.mode-word { font-weight: 600; }
.mode-word-busy { color: var(--busy); }
.mode-word-normal { color: var(--normal); }
.mode-word-relaxed { color: var(--relaxed); }
.meta-long { color: var(--danger); font-weight: 600; }
.meta-new { color: var(--cobalt); font-weight: 600; }
.meta-season { color: var(--olive); }
.card-lunch { margin-top: 4px; font-size: 13px; color: var(--ink-2); line-height: 1.35; }
.card-lunch span { margin-right: 6px; font-weight: 650; color: var(--olive); }
.card-right { display: flex; align-items: center; flex: none; }

/* Who cooks: an initial in a small plate */
.cook-pill { position: relative; flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--plate); font-size: 13px; font-weight: 650; color: var(--ink-2); }
button.cook-pill::after { content: ''; position: absolute; inset: -6px; }
.cook-pill.nobody { border-style: dashed; background: transparent; color: var(--ink-3); }

/* An open dinner: everything lines up with the dinner's name */
.card-detail { display: none; }
.day-card.open .card-detail { display: block; animation: fadeIn .2s ease; }
.detail-inner { display: flex; flex-direction: column; gap: 14px; padding: 0 0 20px 54px; }
.detail-desc { font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.kids-note { font-size: 14px; line-height: 1.45; }
.detail-heading { margin-bottom: 8px; font-size: 13px; font-weight: 650; color: var(--ink-2); }
.ing-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.ing-chip { padding: 5px 10px; border-radius: var(--r-chip); border: 1px solid var(--line); background: var(--plate); font-size: 14px; }
.ing-chip b { font-weight: 650; }
.ing-chip.pantry-item { background: transparent; color: var(--ink-3); text-decoration: line-through; }
.best-recipe { padding: 14px 16px; border-radius: 14px; background: var(--plate); border: 1px solid var(--line); }
.best-recipe .detail-heading { margin-bottom: 2px; }
.best-title { display: block; font-size: 16px; font-weight: 650; color: var(--cobalt); text-decoration: none; }
.best-meta { margin-top: 2px; font-size: 13px; color: var(--ink-2); }
.best-why { margin-top: 8px; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.best-others { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.best-others a { font-size: 13px; color: var(--ink); text-decoration: none; }
.best-others a span { color: var(--ink-3); }
.find-recipe-btn { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; padding: 6px 0; margin: -6px 0; font-size: 15px; font-weight: 650; color: var(--cobalt); }
.find-recipe-btn:disabled { cursor: default; opacity: .8; }
.recipe-search { font-size: 13px; line-height: 1.9; color: var(--ink-3); }
.recipe-search a { padding: 6px 0; font-weight: 600; text-decoration: none; }
.cook-tonight-btn { width: 100%; height: 48px; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.move-days { display: none; gap: 6px; }
.day-card.show-move .move-days { display: flex; }
.move-day { position: relative; flex: 1; height: 38px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--plate); font-size: 13px; font-weight: 600; }
.move-day::after { content: ''; position: absolute; inset: -4px 0; }
.move-day:disabled { border-style: dashed; background: transparent; color: var(--ink-3); cursor: default; }
.my-meal-panel { padding: 12px 14px; border-radius: 14px; background: var(--olive-wash); }
.my-meal-label { font-size: 12px; font-weight: 700; color: var(--olive); }
.my-meal-name { margin: 2px 0 4px; font-size: 16px; font-weight: 650; }
.my-meal-desc, .my-meal-extra { font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.my-meal-extra { margin-top: 6px; }
.lunch-box { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 14px; background: var(--olive-wash); }
.lunch-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.lunch-head .detail-heading { margin: 0; color: var(--olive); }
.lunch-meta { font-size: 12px; color: var(--ink-2); }
.lunch-box strong { font-size: 16px; }
.lunch-box p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.lunch-box .ing-chip { border-color: transparent; background: rgba(255,255,255,.75); }
.lunch-box .link-btn { align-self: flex-start; font-size: 14px; color: var(--olive); }
.after-dinner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.after-dinner > span { margin-right: 2px; font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }

/* Before the first plan */
.week-empty { margin: 0 auto; padding: 40px var(--gutter) 56px; max-width: 30rem; text-align: center; }
.empty-plate { display: block; margin: 0 auto 20px; }
.week-empty .empty-title { font-size: 30px; }
.week-empty .empty-body { margin: 10px auto 24px; max-width: 32ch; }
.week-strip { list-style: none; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 24px; }
.strip-day { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.strip-day span { font-size: 13px; font-weight: 600; }
.strip-day i, .strip-key i { display: block; width: 18px; height: 4px; border-radius: 2px; background: var(--line-strong); }
.mode-busy i { background: var(--busy); }
.mode-normal i { background: var(--normal); }
.mode-relaxed i { background: var(--relaxed); }
.strip-key { display: flex; justify-content: center; gap: 16px; margin: -10px 0 24px; font-size: 13px; color: var(--ink-2); }
.strip-key span { display: inline-flex; align-items: center; gap: 6px; }
.week-empty .primary-btn.big { margin-top: 0; }

.leftover-banner { display: flex; align-items: center; gap: 12px; margin: 12px var(--gutter) 0; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 1.4; }
.leftover-banner p { flex: 1; }
.leftover-actions { display: flex; gap: 6px; flex: none; }
.leftover-actions .primary-btn, .leftover-actions .ghost-btn { height: 38px; padding: 0 14px; }

/* ════════════════════════════════════════════════════════════════════════
   SHOPPING
   ════════════════════════════════════════════════════════════════════════ */
.shop-body { padding: 16px var(--gutter) 24px; }
.shop-week { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: -6px 0 14px; font-size: 15px; color: var(--ink-2); }
.shop-week strong { color: var(--ink); font-weight: 650; }
.shop-ordered { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; padding: 12px 14px; border-radius: 14px; background: var(--olive-wash); }
.shop-ordered .ic { width: 20px; height: 20px; margin-top: 1px; color: var(--olive); stroke-width: 2.2; }
.shop-ordered p { flex: 1; min-width: 0; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.shop-ordered strong { display: block; font-size: 15px; color: var(--olive); }
.shop-ordered .link-btn { flex: none; font-size: 14px; }
.day-chips { display: flex; gap: 6px; margin-bottom: 14px; }
.day-chip { position: relative; flex: 1; height: 38px; border-radius: 10px; border: 1px dashed var(--line-strong); font-size: 13px; font-weight: 500; color: var(--ink-3); text-decoration: line-through; text-decoration-color: rgba(110,106,97,.6); }
.day-chip::after { content: ''; position: absolute; inset: -4px 0; }
.day-chip.on { border: 1px solid transparent; background: var(--cobalt-wash); color: var(--cobalt); font-weight: 650; text-decoration: none; }
.day-chip.wide { flex: none; padding: 0 12px; white-space: nowrap; text-decoration: none; }
.shop-modes { display: flex; gap: 2px; padding: 3px; margin-bottom: 14px; border-radius: var(--r-control); background: var(--line); }
.shop-mode { flex: 1; height: 38px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.shop-mode.active { background: var(--plate); color: var(--ink); box-shadow: 0 1px 2px rgba(21,32,43,.1); }
.shop-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 8px; font-size: 13px; color: var(--ink-2); }
.shop-meta .link-btn { font-size: 14px; }
.basket-progress { height: 4px; margin-bottom: 8px; border-radius: 2px; background: var(--line); overflow: hidden; }
.basket-progress i { display: block; width: 0; height: 100%; border-radius: 2px; background: var(--olive); transition: width .35s ease; }
.ica-fill { margin: 8px 0 6px; }
.ica-fill .primary-btn.big { margin-top: 8px; background: var(--ica); }
.ica-fill .primary-btn.big:first-child { margin-top: 0; }
.ica-fill .primary-btn.coop { background: var(--coop); }
.ica-fill .primary-btn.willys { background: var(--willys); }
.ica-fill .ghost-btn.big { margin-top: 8px; }
.shop-hint { padding-top: 10px; font-size: 13px; line-height: 1.45; }
.shop-hint a, .ica-fill a { font-weight: 600; }
.ica-setup { padding: 16px; border-radius: var(--r-card); background: var(--plate); border: 1px solid var(--line); }
.ica-setup-title { margin-bottom: 8px; font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.ica-setup ol { margin-bottom: 12px; padding-left: 18px; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.ica-setup-row { display: flex; gap: 8px; }
.ica-setup-row .primary-btn { flex: none; }
.shop-cat { margin-top: 22px; }
.cat-heading { display: flex; align-items: baseline; gap: 8px; padding-bottom: 4px; font-size: 15px; font-weight: 700; }
.cat-count { font-size: 13px; font-weight: 500; color: var(--ink-3); }
.aisle-move { margin-left: auto; display: inline-flex; gap: 4px; }
.aisle-move button { width: 32px; height: 28px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--plate); font-size: 13px; }
.aisle-move button:disabled { opacity: .35; cursor: default; }
.shop-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.check-box { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; border: 1.5px solid var(--line-strong); background: var(--plate); transition: background .15s, border-color .15s; }
.check-mark { display: none; }
.check-mark svg { display: block; width: 12px; height: 12px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.shop-row.done .check-box { border-color: var(--olive); background: var(--olive); }
.shop-row.done .check-mark { display: block; }
.row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-label { font-size: 16px; }
.row-label b { font-weight: 650; }
.row-sub { font-size: 13px; color: var(--ink-3); }
.shop-row.done .row-label { color: var(--ink-3); text-decoration: line-through; }
.ica-btn { flex: none; height: 32px; display: inline-flex; align-items: center; padding: 0 11px; border-radius: 9px; border: 1px solid rgba(227,0,11,.45); color: #B5000A; font-size: 13px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.shop-row.done .ica-btn { border-color: var(--line-strong); color: var(--ink-3); }
.pantry-note { margin-top: 18px; font-size: 13px; line-height: 1.5; }
.recent-item { white-space: nowrap; }
.recent-when { color: var(--ink-3); }
.recent-note .link-btn { font-size: 13px; padding: 4px 0; margin: -4px 0; }
.cost-summary { margin: 24px var(--gutter) 0; }
.cost-summary-title { margin-bottom: 4px; font-size: 15px; font-weight: 700; }
.cost-row { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.cost-row:last-child { border-bottom: 0; }
.cost-amount { font-size: 16px; font-weight: 700; }
.cost-amount.total { font-size: 20px; }

/* ════════════════════════════════════════════════════════════════════════
   COOKBOOK
   ════════════════════════════════════════════════════════════════════════ */
.favs-wrap, .history-wrap, .weeks-wrap, .stickers-wrap { padding: 4px var(--gutter) 32px; }
.fav-card, .history-card { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.fav-info, .history-info { flex: 1; min-width: 0; }
.fav-title, .history-meal { font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
.fav-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; }
.history-meta { margin-top: 2px; font-size: 13px; color: var(--ink-3); text-transform: capitalize; }
.fav-del, .history-del { position: relative; flex: none; display: grid; place-items: center; width: 36px; height: 36px; margin-right: -8px; border-radius: 50%; font-size: 22px; line-height: 1; color: var(--ink-3); }
.history-del .ic { width: 18px; height: 18px; }
.fav-del:active, .history-del:active { background: var(--line); }
.history-vote { flex: none; display: grid; place-items: center; width: 28px; height: 28px; }
.history-vote .ic { width: 22px; height: 22px; }
.history-vote.up { color: var(--olive); --ic-fill: var(--olive-wash); }
.history-vote.ok { color: var(--ink-2); }
.history-vote.down { color: var(--ink-3); }
.clear-all { margin-top: 22px; }
.scores { margin: 8px 0 18px; }
.scores .list-title { margin-bottom: 8px; }
.score { padding: 8px 0; }
.score-top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: 14px; }
.score-name { font-weight: 600; text-transform: capitalize; }
.score-nums { color: var(--ink-2); font-size: 13px; }
.score-bar { display: flex; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.score-bar i { display: block; height: 100%; background: var(--olive); }
.score-bar i.ok { background: var(--ink-3); opacity: .5; }
.past-week .list-head { margin-top: 24px; }
.past-week:first-child .list-head { margin-top: 12px; }
.past-week .list-head h2 { font-size: 17px; }
.past-row { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.past-day { flex: none; width: 34px; font-size: 13px; font-weight: 600; color: var(--ink-3); padding-top: 1px; }
.past-note { padding-top: 8px; font-size: 13px; color: var(--olive); }

/* Lemons and stickers */
.jar-card { display: flex; align-items: center; gap: 16px; margin: 8px 0 22px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.jar-count { display: inline-flex; align-items: center; gap: 6px; font-size: 30px; font-weight: 750; letter-spacing: -0.03em; white-space: nowrap; }
.jar-count .ic { width: 30px; height: 30px; }
.jar-card strong { display: block; font-size: 16px; }
.jar-card > div:not(.jar-count) > span { display: block; font-size: 13px; line-height: 1.4; color: var(--ink-2); }
.cook-scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0 20px; margin: -14px 0 22px; }
.cook-score { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cook-score strong { flex: 1; min-width: 0; font-size: 15px; overflow: hidden; text-overflow: ellipsis; }
.cook-score > span:last-child { display: inline-flex; align-items: center; gap: 4px; font-size: 15px; font-weight: 700; }
.cook-score .ic { width: 18px; height: 18px; }
.stickers-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.stickers-head strong { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.stickers-head span { font-size: 13px; color: var(--ink-2); }
.sticker-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 10px; }
.sticker { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.sticker strong { margin-top: 6px; font-size: 13px; line-height: 1.2; }
.sticker span { font-size: 12px; line-height: 1.35; color: var(--ink-2); }
/* A small maiolica tile: cobalt rim, dotted inner ring, a cobalt drawing */
.sticker-tile { position: relative; display: grid; place-items: center; width: 60px; height: 60px; border-radius: 16px; background: var(--plate); color: var(--cobalt); box-shadow: 0 0 0 2.5px var(--cobalt); }
.sticker-tile::before { content: ''; position: absolute; inset: 5px; border-radius: 11px; border: 1.5px dotted rgba(31,63,154,.45); }
.sticker-tile .ic { width: 28px; height: 28px; --ic-fill: var(--cobalt-wash); --ic-leaf: var(--cobalt-wash); }
.sticker:not(.on) .sticker-tile { background: transparent; color: var(--ink-3); box-shadow: 0 0 0 1.5px var(--line-strong); opacity: .7; }
.sticker:not(.on) .sticker-tile::before { border-color: var(--line-strong); }
.sticker:not(.on) .sticker-tile .ic { --ic-fill: none; --ic-leaf: none; }
.sticker:not(.on) strong { color: var(--ink-2); }
.sticker-tile.big { width: 64px; height: 64px; flex: none; }
.sticker-pop { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0)); z-index: 950; transform: translateX(-50%);
  width: min(360px, calc(100vw - 32px)); display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 20px;
  background: var(--plate); box-shadow: var(--sh-float); animation: popIn .45s cubic-bezier(.2,1.4,.4,1) both; }
.sticker-pop.leaving { animation: popOut .4s ease both; }
.sticker-pop-text { flex: 1; min-width: 0; }
.sticker-pop-text small { display: block; font-size: 12px; font-weight: 700; color: var(--olive); }
.sticker-pop-text strong { display: block; font-size: 17px; }
.sticker-pop-text span { display: block; font-size: 13px; line-height: 1.35; color: var(--ink-2); }
.sticker-pop .link-btn { flex: none; font-size: 14px; }
.burst { position: absolute; left: 48px; top: 48px; width: 0; height: 0; pointer-events: none; }
.burst span { position: absolute; transform: translate(-50%, -50%); animation: lemonFly .9s cubic-bezier(.2,.8,.3,1) both; }
.burst .ic { width: 18px; height: 18px; }
@keyframes lemonFly {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--a)) translateY(0) scale(.4); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--a)) translateY(calc(-1 * var(--d))) rotate(180deg) scale(1); }
}
@keyframes popIn { from { opacity: 0; transform: translate(-50%, 24px) scale(.92); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes popOut { to { opacity: 0; transform: translate(-50%, 16px); } }

/* ════════════════════════════════════════════════════════════════════════
   KITCHEN
   ════════════════════════════════════════════════════════════════════════ */
.pantry-body { padding: 0 var(--gutter) 40px; }
.pantry-sec-label { margin: 32px 0 8px; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.pantry-body > .pantry-sec-label:first-child { margin-top: 20px; }
.pantry-intro { margin-bottom: 12px; font-size: 14px; line-height: 1.45; }
.pantry-body .chip-grid + .custom-row, .pantry-body .regulars + .chip-grid { margin-top: 10px; }
#regulars-suggest { margin-bottom: 10px; }

/* Settings rows: a label (and a hint) on the left, a control on the right */
.settings-row, .budget-bar, .settings-toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%;
  padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; font-size: 15px; font-weight: 500; }
.settings-row > span:first-child, .budget-label { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 15px; font-weight: 500; }
.settings-row .settings-hint, .budget-label .settings-hint { margin-top: 0; font-weight: 400; }
.settings-row > span[aria-hidden] { font-size: 20px; color: var(--ink-3); }
.budget-toggle-wrap { display: flex; align-items: center; gap: 10px; }
.budget-toggle-label { font-size: 13px; color: var(--ink-2); }
.calendar-box .settings-hint { margin: 0 0 10px; }
.calendar-status { margin-top: 8px; font-size: 13px; }
.calendar-status:empty { display: none; }
.calendar-help { margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.calendar-help summary { cursor: pointer; color: var(--cobalt); font-weight: 600; }
.calendar-help p { margin-top: 6px; line-height: 1.45; }

.family-card { border-top: 1px solid var(--line); }
#family-settings { margin-top: 20px; }
.family-title { padding: 12px 0 2px; font-size: 15px; font-weight: 700; }
.family-row, .cook-row, .diet-row, .regular-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; overflow-wrap: anywhere; }
.family-row.waiting { color: var(--ink-2); }
.family-row .link-btn, .family-row-actions { flex: none; white-space: nowrap; font-size: 14px; }
.family-row-actions { display: inline-flex; gap: 16px; }
.family-row .settings-hint { display: inline; margin: 0; }
.cook-row { justify-content: flex-start; cursor: default; }
.cook-name { flex: 1; min-width: 0; height: 38px; padding: 0 9px; border: 1px solid transparent; border-radius: 9px; background: transparent; font-size: 15px; font-weight: 500; }
.cook-name:hover, .cook-name:focus { border-color: var(--line-strong); background: var(--plate); outline: none; }
.cook-toggle { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: 14px; color: var(--ink-2); }
.cook-toggle input { width: 18px; height: 18px; accent-color: var(--cobalt); }
.diet-row { display: block; }
.diet-row summary { display: flex; align-items: baseline; gap: 10px; list-style: none; cursor: pointer; }
.diet-row summary::-webkit-details-marker { display: none; }
.diet-row summary strong { font-size: 15px; font-weight: 650; }
.diet-row summary span { flex: 1; font-size: 13px; color: var(--ink-2); }
.diet-row summary::after { content: 'Edit'; font-size: 14px; font-weight: 600; color: var(--cobalt); }
.diet-row[open] summary::after { content: 'Done'; }
.diet-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 10px; }
.regulars { border-top: 1px solid var(--line); }
.regular-name { min-width: 0; font-size: 15px; font-weight: 500; }
.regular-name span { font-size: 13px; font-weight: 400; color: var(--ink-3); }
.stepper.small button { width: 32px; height: 32px; }

/* How it works */
.how { max-width: 640px; margin: 0 auto; padding: 8px var(--gutter) 48px; }
.how-hero { padding: 20px 0 4px; text-align: center; }
.how-hero h2 { margin: 14px 0 8px; font-size: 26px; font-weight: 750; letter-spacing: -0.03em; line-height: 1.15; }
.how-hero p { max-width: 34ch; margin: 0 auto; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.how-sec { margin-top: 32px; }
.how-sec h3 { margin-bottom: 4px; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.how-steps { list-style: none; counter-reset: how; }
.how-steps li { position: relative; counter-increment: how; padding: 14px 0 14px 40px; border-bottom: 1px solid var(--line); }
.how-steps li::before { content: counter(how); position: absolute; left: 0; top: 13px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--cobalt); color: #fff; font-size: 13px; font-weight: 700; }
.how-steps strong, .how-list dt { display: block; font-size: 16px; font-weight: 650; }
.how-steps span { display: block; margin-top: 4px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.how-list dt { padding-top: 14px; }
.how-list dd { padding: 4px 0 14px; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.how em { font-style: normal; font-weight: 600; color: var(--ink); }
.how-note { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--olive-wash); font-size: 14px; color: var(--olive); }

/* ════════════════════════════════════════════════════════════════════════
   SHEETS: plan the week, our dinners, send to partner
   ════════════════════════════════════════════════════════════════════════ */
.sheet-overlay, .husband-overlay { position: fixed; inset: 0; z-index: 600; display: flex; align-items: flex-end; background: rgba(21,32,43,.45); opacity: 0; pointer-events: none; transition: opacity .2s; }
.sheet-overlay.open, .husband-overlay.open { opacity: 1; pointer-events: all; }
.sheet, .husband-sheet { width: 100%; max-height: 90vh; overflow-y: auto; padding: 12px var(--gutter) calc(24px + env(safe-area-inset-bottom, 0));
  border-radius: var(--r-sheet) var(--r-sheet) 0 0; background: var(--plate); transform: translateY(24px); transition: transform .25s cubic-bezier(.2,.7,.2,1); }
.sheet-overlay.open .sheet, .husband-overlay.open .husband-sheet { transform: none; }
.sheet-handle, .husband-sheet-handle { width: 36px; height: 4px; margin: 0 auto 16px; border-radius: 2px; background: var(--line-strong); }
.sheet h2, .husband-sheet h2 { font-size: 24px; font-weight: 750; letter-spacing: -0.03em; }
.sheet-sub, .husband-sheet .sub { margin: 4px 0 14px; font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.sheet .pantry-sec-label { margin-top: 22px; }
.sheet .pantry-input, .sheet .plan-dish, .sheet .settings-text { background: var(--linen); border-color: var(--line); }
.husband-close { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--linen); color: var(--ink-2); }

.plan-day { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.plan-day-name { flex: none; width: 40px; font-size: 14px; font-weight: 650; line-height: 1.2; }
.plan-day-name span { display: block; font-size: 13px; font-weight: 500; color: var(--ink-3); }
.plan-day-main { flex: 1; min-width: 0; }
.plan-day .cook-pill { width: 34px; height: 34px; font-size: 14px; }
.plan-day .seg { background: var(--linen); }
.plan-day .seg button { flex: 1 1 auto; padding: 0 6px; font-size: 13px; }
.plan-day .seg button.on { box-shadow: none; }
.seg button[data-mode="busy"].on { background: var(--cobalt-wash); color: var(--busy); }
.seg button[data-mode="normal"].on { background: #F8EED4; color: var(--normal); }
.seg button[data-mode="relaxed"].on { background: var(--olive-wash); color: var(--relaxed); }
.plan-day-note { margin: 5px 2px 0; font-size: 12px; color: var(--ink-2); }
.plan-dish { height: 40px; margin-top: 6px; font-size: 15px; }
.plan-setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.plan-setting-title { font-size: 15px; font-weight: 650; }
.plan-setting .settings-hint { margin-top: 2px; }
.plan-hint { margin-top: 14px; padding: 14px; border-radius: 12px; background: var(--linen); font-size: 14px; }
.plan-hint p { margin-bottom: 10px; }

.husband-day { padding: 14px 0; border-bottom: 1px solid var(--line); }
.husband-day-name { margin-bottom: 2px; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.husband-meal-name { margin-bottom: 4px; font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.husband-desc { margin-bottom: 8px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.husband-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; }

/* ════════════════════════════════════════════════════════════════════════
   COOK MODE: a dark, glanceable kitchen view. Lemon is the colour of now
   ════════════════════════════════════════════════════════════════════════ */
.cook-overlay { position: fixed; inset: 0; z-index: 500; display: flex; flex-direction: column; overflow: hidden; background: var(--ink); color: #fff;
  transform: translateY(100%); transition: transform .35s cubic-bezier(.4,0,.2,1); }
.cook-overlay.open { transform: none; }
.cook-header { flex: none; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: calc(16px + env(safe-area-inset-top, 0)) var(--gutter) 12px; }
.cook-title { flex: 1; font-size: 24px; font-weight: 750; letter-spacing: -0.03em; line-height: 1.15; }
.cook-close { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.1); font-size: 16px; color: #fff; }
.cook-tabs { flex: none; display: flex; gap: 4px; margin: 0 var(--gutter); padding: 4px; border-radius: 14px; background: rgba(255,255,255,.07); }
.cook-tab { flex: 1; height: 42px; border-radius: 11px; font-size: 15px; font-weight: 650; color: rgba(255,255,255,.6); }
.cook-tab.active { background: var(--lemon); color: var(--lemon-ink); }
.cook-body { flex: 1; overflow-y: auto; padding: 16px var(--gutter) 40px; }
.cook-section { display: none; }
.cook-section.active { display: block; }
.cook-ing-list { display: flex; flex-direction: column; margin-bottom: 20px; }
.cook-ing-row { display: flex; align-items: center; gap: 14px; padding: 14px 2px; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 17px; cursor: pointer; }
.cook-ing-row.done { opacity: .45; }
.cook-ing-check { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; border: 1.5px solid rgba(255,255,255,.3); }
.cook-ing-check-mark { display: none; color: var(--lemon-ink); }
.cook-ing-check-mark .ic { width: 16px; height: 16px; stroke-width: 2.4; }
.cook-ing-row.done .cook-ing-check { border-color: var(--lemon); background: var(--lemon); }
.cook-ing-row.done .cook-ing-check-mark { display: grid; }
.cook-ing-row.done .cook-ing-name { text-decoration: line-through; }
.cook-start { width: 100%; height: 52px; border-radius: 14px; background: var(--lemon); color: var(--lemon-ink); font-size: 16px; font-weight: 700; }
.cook-steps { display: flex; flex-direction: column; gap: 12px; }
.cook-step { padding: 16px 18px; border-radius: var(--r-card); border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.04); transition: opacity .2s; }
.cook-step.active-step { border-color: rgba(244,196,48,.6); background: rgba(255,255,255,.07); }
.cook-step.done-step { opacity: .45; }
.step-num { margin-bottom: 6px; font-size: 13px; font-weight: 650; color: var(--lemon); }
.step-text { font-size: 17px; line-height: 1.55; color: rgba(255,255,255,.92); }
.step-timer { margin-top: 12px; }
.timer-btn { display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 20px 0 16px; border-radius: 14px; background: var(--lemon); color: var(--lemon-ink); }
.timer-icon { display: grid; place-items: center; }
.timer-icon .ic { width: 18px; height: 18px; }
.timer-display { font-size: 24px; font-weight: 750; letter-spacing: -0.02em; }
.timer-btn.running { background: #fff; color: var(--ink); }
.timer-display.urgent { color: var(--danger); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.step-done-btn { width: 100%; height: 46px; margin-top: 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.07); font-size: 15px; font-weight: 600; color: rgba(255,255,255,.75); }
.cook-step.done-step .step-done-btn { color: var(--lemon); }
.cook-loading { padding: 40px 0; text-align: center; font-size: 16px; font-weight: 600; color: rgba(255,255,255,.6); }
.cook-source { margin: 0 0 14px; font-size: 14px; line-height: 1.45; color: rgba(255,255,255,.65); }
.cook-with { margin-bottom: 16px; background: rgba(255,255,255,.07); }
.cook-with button { height: 40px; font-size: 15px; color: rgba(255,255,255,.6); }
.cook-with button.on { background: rgba(255,255,255,.16); color: #fff; box-shadow: none; }
.cook-note { margin: -6px 0 14px; padding: 10px 14px; border-radius: 12px; background: rgba(244,196,48,.12); font-size: 15px; line-height: 1.45; color: rgba(255,255,255,.88); }
.cook-source a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.cook-spin { border-color: rgba(255,255,255,.15); border-top-color: var(--lemon); }

/* ════════════════════════════════════════════════════════════════════════
   LOG IN
   ════════════════════════════════════════════════════════════════════════ */
.family-gate { position: fixed; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center; padding: 24px var(--gutter); background: var(--linen); }
.gate-card { width: 100%; max-width: 380px; }
.gate-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 36px; font-size: 22px; font-weight: 750; letter-spacing: -0.02em; }
.gate-brand img { flex: none; }
.gate-body h1 { margin-bottom: 8px; font-size: 30px; font-weight: 750; letter-spacing: -0.035em; line-height: 1.1; }
.gate-body p { margin-bottom: 18px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.gate-body input { width: 100%; height: 52px; margin-bottom: 10px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--plate); font-size: 17px; font-weight: 500; }
.gate-body input:focus { outline: none; border-color: var(--cobalt); }
#gate-code { letter-spacing: .3em; font-size: 22px; text-align: center; }
#gate-code::placeholder { letter-spacing: 0; font-size: 17px; }
.gate-body .primary-btn.big { margin-top: 4px; }
.gate-msg { min-height: 1.4em; margin-top: 10px; color: var(--danger) !important; font-size: 14px !important; }
.gate-body .link-btn { display: block; margin: 12px auto 0; font-size: 15px; }
.handoff-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: max(12px, env(safe-area-inset-top)) var(--gutter) 12px; background: var(--cobalt-wash); font-size: 14px; }
.handoff-bar span { flex: 1 1 100%; font-weight: 500; }
.handoff-bar .primary-btn { height: 38px; padding: 0 14px; font-size: 14px; }
.handoff-bar .link-btn { font-size: 14px; color: var(--ink-2); }

/* ════════════════════════════════════════════════════════════════════════
   DESKTOP: the bottom bar becomes a sidebar with the plate; content sits in a readable column
   ════════════════════════════════════════════════════════════════════════ */
@media (min-width: 960px) {
  :root { --side: 248px; --col: 720px; --gutter: 28px; }
  body { padding-left: var(--side); }
  .app-header { display: none; }
  main { max-width: var(--col); margin: 0 auto; padding: 28px 0 48px; }
  .bottom-nav { top: 0; right: auto; width: var(--side); flex-direction: column; justify-content: flex-start; gap: 4px; padding: 28px 16px;
    border-top: 0; border-right: 1px solid var(--line); -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--linen); }
  .bottom-nav::before { content: 'Middag'; display: flex; align-items: center; min-height: 56px; margin-bottom: 24px; padding-left: 70px;
    background: url(/icon.svg) 6px 50% / 52px 52px no-repeat; font: 750 22px/1 var(--font); letter-spacing: -0.02em; color: var(--ink); }
  .nav-btn { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--ink-2); }
  .nav-btn:hover { background: var(--line); }
  .nav-btn.active { background: var(--plate); color: var(--cobalt); }
  .nav-btn svg { width: 22px; height: 22px; }
  .nav-label { font-size: 15px; }
  .screen-title { font-size: 40px; }
  .toast-el, .sticker-pop { left: calc(50% + var(--side) / 2); bottom: 32px; }
  .sticker-grid { grid-template-columns: repeat(5, 1fr); }

  .sheet-overlay, .husband-overlay { align-items: center; justify-content: center; padding-left: var(--side); }
  .sheet, .husband-sheet { width: min(560px, 92vw); max-height: 86vh; border-radius: var(--r-sheet); padding-top: 24px; }
  .sheet-handle, .husband-sheet-handle { display: none; }

  /* Cooking on a computer: ingredients and steps side by side */
  .cook-header { width: 100%; max-width: 1120px; margin: 0 auto; padding: 28px 40px 18px; }
  .cook-title { font-size: 32px; }
  .cook-tabs { display: none; }
  .cook-body { width: 100%; max-width: 1120px; margin: 0 auto; padding: 16px 40px 48px; display: grid; grid-template-columns: 320px 1fr; gap: 40px; align-items: start; }
  .cook-section { display: block; }
  #csec-ingredients { position: sticky; top: 0; padding: 20px; border-radius: 18px; background: rgba(255,255,255,.05); }
  #csec-ingredients::before { content: 'Ingredients'; display: block; margin-bottom: 6px; font-size: 15px; font-weight: 650; color: var(--lemon); }
  #csec-ingredients .cook-start { display: none; }
  #csec-steps .step-text { font-size: 19px; }
  #csec-steps .cook-step { padding: 20px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Plan sheet: what's at home to use up */
.plan-useup { padding: 16px 0; border-bottom: 1px solid var(--line); }
.plan-useup .settings-hint { margin-top: 2px; }
.plan-useup .chip-grid:not(:empty) { margin-top: 10px; }
.plan-useup .custom-row { margin-top: 10px; }
