/* Cuisine — feuille de style unique, mobile d'abord.
   Identité : assiettes illustrées sur fond porcelaine, encre aubergine,
   accent qui change avec la saison. */

@font-face {
  font-family: 'Fraunces';
  src: url('/fonts/fraunces.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Figtree';
  src: url('/fonts/figtree.woff2') format('woff2');
  font-weight: 300 900;
  font-display: swap;
}

:root {
  --bg: #eef0ea;
  --surface: #fbfbf8;
  --surface-2: #e3e6dd;
  --ink: #2a2230;
  --ink-2: #625b69;
  --ink-3: #8f8996;
  --line: rgba(42, 34, 48, 0.12);
  --plate: #fdfcf8;
  --plate-rim: rgba(42, 34, 48, 0.08);
  --plate-shadow: rgba(42, 34, 48, 0.10);
  --danger: #b3261e;
  --ok: #3d7a3a;
  --shadow: 0 1px 2px rgba(42, 34, 48, 0.06), 0 8px 24px -12px rgba(42, 34, 48, 0.25);

  --accent: #a8641a;
  --accent-ink: #fff;
  --accent-soft: #f1e2c9;
  --cloth: #ead6b5;

  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --gutter: 16px;
  --tabs-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

/* Accent de saison (clair) */
[data-season="autumn"] { --accent: #a8641a; --accent-soft: #f1e2c9; --cloth: #e9d3ad; }
[data-season="winter"] { --accent: #3d5f86; --accent-soft: #dce5ef; --cloth: #cfdae6; }
[data-season="spring"] { --accent: #47803a; --accent-soft: #dcebd3; --cloth: #cfe2c3; }
[data-season="summer"] { --accent: #bd4029; --accent-soft: #f6dcd3; --cloth: #f0cbbd; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16141a; --surface: #201d25; --surface-2: #2b2731; --ink: #f1ede6; --ink-2: #b3acb8; --ink-3: #847e8a;
    --line: rgba(241, 237, 230, 0.12); --plate: #2d2933; --plate-rim: rgba(255, 255, 255, 0.07); --plate-shadow: rgba(0, 0, 0, 0.35);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6); --danger: #f2a49d; color-scheme: dark;
  }
  :root:not([data-theme="light"])[data-season="autumn"] { --accent: #e3a04a; --accent-ink: #231a10; --accent-soft: #3a2c1c; --cloth: #3b2d1f; }
  :root:not([data-theme="light"])[data-season="winter"] { --accent: #8fb1d8; --accent-ink: #13202f; --accent-soft: #223142; --cloth: #223040; }
  :root:not([data-theme="light"])[data-season="spring"] { --accent: #93c97f; --accent-ink: #15240f; --accent-soft: #233322; --cloth: #22331f; }
  :root:not([data-theme="light"])[data-season="summer"] { --accent: #f08a72; --accent-ink: #2b130d; --accent-soft: #3d231e; --cloth: #3e241e; }
}
:root[data-theme="dark"] {
  --bg: #16141a; --surface: #201d25; --surface-2: #2b2731; --ink: #f1ede6; --ink-2: #b3acb8; --ink-3: #847e8a;
  --line: rgba(241, 237, 230, 0.12); --plate: #2d2933; --plate-rim: rgba(255, 255, 255, 0.07); --plate-shadow: rgba(0, 0, 0, 0.35);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6); --danger: #f2a49d; color-scheme: dark;
}
:root[data-theme="dark"][data-season="autumn"] { --accent: #e3a04a; --accent-ink: #231a10; --accent-soft: #3a2c1c; --cloth: #3b2d1f; }
:root[data-theme="dark"][data-season="winter"] { --accent: #8fb1d8; --accent-ink: #13202f; --accent-soft: #223142; --cloth: #223040; }
:root[data-theme="dark"][data-season="spring"] { --accent: #93c97f; --accent-ink: #15240f; --accent-soft: #233322; --cloth: #22331f; }
:root[data-theme="dark"][data-season="summer"] { --accent: #f08a72; --accent-ink: #2b130d; --accent-soft: #3d231e; --cloth: #3e241e; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 560; line-height: 1.15; margin: 0; letter-spacing: -0.01em; font-variation-settings: 'SOFT' 100, 'WONK' 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }
.center { text-align: center; }
[hidden] { display: none !important; }
.ic { flex: none; }

#view { outline: none; }
.page {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) var(--gutter) calc(var(--tabs-h) + var(--safe-b) + 32px);
}
body.bare .page { padding-bottom: calc(var(--safe-b) + 40px); }
.boot { min-height: 100dvh; }

/* ───── Boutons ───── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 999px;
  border: 1.5px solid transparent; background: var(--surface-2); font-weight: 600; font-size: 16px;
  transition: transform .15s var(--ease), background-color .2s;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger-text { color: var(--danger); }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 15px; }
.btn.big { min-height: 56px; font-size: 18px; padding: 0 24px; }
.btn.huge { min-height: 68px; font-size: 20px; border-radius: 22px; }
.btn:disabled { opacity: .45; }
.icon-btn {
  display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  border: 0; background: var(--surface); box-shadow: var(--shadow); flex: none;
}
.icon-btn.small { width: 40px; height: 40px; box-shadow: none; background: transparent; }
.icon-btn.accent { background: var(--accent); color: var(--accent-ink); }
.icon-btn:disabled { opacity: .3; }
.icon-btn:active { transform: scale(.94); }

/* ───── Barre d'onglets ───── */
.tabs {
  position: fixed; inset: auto 0 0 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabs-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-top: 1px solid var(--line);
  view-transition-name: tabs;
}
.tabs a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-3);
}
.tabs a[aria-current="page"] { color: var(--ink); }
.tabs a[aria-current="page"] .ic { color: var(--accent); }

/* ───── Couvertures (photo ou assiette) ───── */
.cover { position: relative; overflow: hidden; background: var(--cloth); }
.cover .plate { position: absolute; display: block; }
.cover.photo img { width: 100%; height: 100%; object-fit: cover; }
.cover.hero { aspect-ratio: 16 / 10; }
.cover.hero .plate { width: 92%; aspect-ratio: 1; left: 22%; top: -14%; }
.cover.thumb { width: 72px; height: 72px; border-radius: 18px; flex: none; }
.cover.thumb .plate, .cover.square .plate, .cover.mini .plate { inset: 6%; width: 88%; height: 88%; }
.cover.square { aspect-ratio: 1; border-radius: 20px; }
.cover.mini { width: 44px; height: 44px; border-radius: 12px; flex: none; }

/* ───── Accueil ───── */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 16px; }
.topbar-text { display: flex; flex-direction: column; gap: 6px; }
.date { font-size: 15px; color: var(--ink-2); }
.date::first-letter { text-transform: uppercase; }
.season-chip {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--serif); font-size: 15px; font-weight: 600; color: var(--accent);
}
.season-chip::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.notice {
  background: var(--accent-soft); border-radius: 20px; padding: 16px; margin-bottom: 16px;
  display: grid; gap: 12px; animation: rise .4s var(--ease) both;
}
.notice-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

.today {
  display: block; border-radius: 28px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow);
  transition: transform .2s var(--ease);
}
.today:active { transform: scale(.985); }
.today .cover.hero { aspect-ratio: 16 / 11; }
.today-body { padding: 16px 20px 20px; display: grid; gap: 8px; }
.today-label { color: var(--accent); font-weight: 700; font-size: 15px; }
.today-name { font-size: clamp(26px, 7.4vw, 34px); font-weight: 600; text-wrap: balance; font-variation-settings: 'SOFT' 100, 'WONK' 1, 'opsz' 72; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--ink-2); font-size: 15px; }
.meta-time { display: inline-flex; align-items: center; gap: 5px; }
.macros { display: flex; gap: 8px; flex-wrap: wrap; }
.macro { padding: 5px 12px; border-radius: 999px; background: var(--surface-2); font-size: 14.5px; }
.macro b { font-weight: 700; }
.macro.protein { background: var(--accent-soft); }

.low-energy {
  display: block; margin: 10px auto 0; padding: 10px 14px; border: 0; background: none;
  color: var(--ink-2); font-size: 15px; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line);
}
.easy-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.easy-item {
  width: 100%; display: flex; align-items: center; gap: 14px; padding: 10px; border: 0; border-radius: 18px;
  background: var(--bg); text-align: left; min-height: 72px; transition: transform .15s var(--ease);
}
.easy-item:active { transform: scale(.98); }
.easy-item .cover.mini { width: 52px; height: 52px; border-radius: 14px; }
.easy-item span { display: grid; gap: 2px; }
.easy-item b { font-family: var(--serif); font-weight: 520; font-size: 16.5px; line-height: 1.2; }
.easy-item small { color: var(--ink-2); font-size: 13.5px; }
.section-title { font-size: 22px; margin: 32px 0 12px; }
.day-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.day-row {
  display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 10px;
  background: var(--surface); border-radius: 22px; min-height: 92px;
  transition: transform .15s var(--ease);
}
.day-row:active { transform: scale(.985); }
.day-row.is-today { box-shadow: inset 0 0 0 2px var(--accent); }
.day-row.missing { justify-content: space-between; padding: 20px; border: 1.5px dashed var(--line); background: transparent; }
.day-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.day-name { font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.day-name em { font-style: normal; color: var(--accent); font-weight: 700; }
.day-recipe { font-family: var(--serif); font-size: 17.5px; font-weight: 520; line-height: 1.22; text-wrap: pretty; }
.day-meta { display: flex; gap: 12px; color: var(--ink-3); font-size: 13.5px; }
.day-meta .ic { width: 14px; height: 14px; }
.day-side { display: grid; justify-items: end; gap: 2px; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.day-side small { font-weight: 500; color: var(--ink-3); font-size: 12px; }
.day-side .prot { color: var(--accent); }

.season-dots { display: inline-flex; gap: 3px; margin-top: 4px; }
.season-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.season-dots i.on { background: var(--ink-3); }
.season-dots i.on.now { background: var(--accent); }

.week-foot { margin-top: 28px; display: grid; gap: 14px; justify-items: start; }

/* ───── Feuilles (dialogues) ───── */
dialog.sheet {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px;
  background: var(--surface); color: var(--ink); border-radius: 28px 28px 0 0;
  max-height: 88dvh; box-shadow: 0 -10px 40px rgba(0, 0, 0, .2);
}
dialog.sheet[open] { animation: sheet-up .32s var(--ease) both; }
dialog.sheet::backdrop { background: rgba(20, 16, 24, .45); animation: fade .25s both; }
.sheet-body { padding: 24px var(--gutter) calc(20px + var(--safe-b)); display: grid; gap: 16px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head .icon-btn { box-shadow: none; background: var(--surface-2); }
.sheet-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.sheet-actions .btn { flex: 1 1 auto; }
.mini-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.mini-list li { display: flex; gap: 12px; align-items: center; }
.mini-list .fav-mark { margin-left: auto; flex: none; }
.mini-list span { display: grid; font-family: var(--serif); font-size: 16.5px; line-height: 1.2; }
.mini-list small { font-family: var(--sans); font-size: 13px; color: var(--ink-3); font-weight: 600; }

/* ───── Toast & minuteurs ───── */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabs-h) + var(--safe-b) + 14px); z-index: 50;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 14px; width: max-content; max-width: calc(100vw - 32px);
  padding: 12px 16px 12px 18px; border-radius: 18px; background: var(--ink); color: var(--bg);
  font-size: 15px; transition: opacity .2s, transform .25s var(--ease);
}
body.bare #toast { bottom: calc(var(--safe-b) + 100px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast button { border: 0; background: none; color: var(--accent-soft); font-weight: 700; padding: 6px 4px; }
#timers {
  position: fixed; top: calc(env(safe-area-inset-top, 0px) + 10px); right: 10px; z-index: 40;
  display: grid; gap: 6px; justify-items: end;
}
.timer-pill {
  display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-size: 14px; box-shadow: var(--shadow);
}
.timer-pill.done { background: var(--accent); color: var(--accent-ink); animation: pulse 1s ease-in-out infinite alternate; }
.timer-time { font-weight: 800; font-variant-numeric: tabular-nums; }
.timer-label { opacity: .75; }
.timer-pill button { border: 0; background: rgba(255, 255, 255, .14); color: inherit; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; }

/* ───── Fiche recette ───── */
.recipe.page { padding-top: 0; }
.recipe-hero { position: relative; margin: 0 calc(var(--gutter) * -1); }
.recipe-hero .cover.hero { aspect-ratio: 5 / 4; max-height: 56dvh; width: 100%; }
.recipe-hero .cover.hero .plate { width: 96%; left: 14%; top: -6%; }
.hero-bar {
  position: absolute; inset: calc(env(safe-area-inset-top, 0px) + 10px) var(--gutter) auto;
  display: flex; justify-content: space-between;
}
.fav.on { color: #d1435b; }
.fav .ic { transition: transform .25s var(--ease); }
.fav.on .ic { animation: pop .35s var(--ease); }

.recipe-head { padding: 20px 0 4px; display: grid; gap: 8px; }
.recipe-day { color: var(--accent); font-weight: 700; }
.recipe-head h1 { font-size: clamp(28px, 8vw, 38px); font-weight: 600; text-wrap: balance; font-variation-settings: 'SOFT' 100, 'WONK' 1, 'opsz' 96; }
.recipe-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; color: var(--ink-2); font-size: 14.5px; }
.recipe-tags .season-dots { margin: 0; }
.cost { font-weight: 700; letter-spacing: .05em; }
.cost-off { opacity: .25; }
.tag { padding: 2px 10px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 600; }

.cta-row { display: flex; gap: 10px; margin: 18px 0; }
.cta-row .btn.primary { flex: 1; }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-radius: 20px; overflow: hidden; }
.facts div { background: var(--surface); padding: 14px 12px; display: grid; gap: 4px; }
.facts span { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink-2); }
.facts b { font-size: 19px; font-weight: 700; }

.nutrition { margin-top: 12px; padding: 18px; background: var(--surface); border-radius: 20px; display: grid; gap: 10px; }
.nutri-main { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.nutri-main div { display: grid; }
.nutri-main b { font-family: var(--serif); font-size: 36px; font-weight: 600; line-height: 1.05; font-variant-numeric: lining-nums; }
.nutri-main .protein b { color: var(--accent); }
.nutri-main span { font-size: 14px; color: var(--ink-2); }
.nutri-sub { font-size: 15px; }
.nutri-note { font-size: 13px; color: var(--ink-3); }

.method { margin: 18px 0 0; display: grid; gap: 6px; font-size: 15.5px; }
.method b { display: block; font-size: 13px; color: var(--ink-3); font-weight: 700; }

.block { margin-top: 28px; }
.block > h2, .block-head h2 { font-size: 22px; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.block-head small { font-family: var(--sans); font-size: 14px; color: var(--ink-3); font-weight: 500; }
.note-block { background: var(--surface); padding: 18px; border-radius: 20px; display: grid; gap: 8px; }
.note-block > h2 { font-size: 19px; }
.tips { margin: 0; padding-left: 18px; display: grid; gap: 6px; }

/* Listes à cocher */
.checklist { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 4px; }
.checklist li { position: relative; display: flex; align-items: center; border-radius: 16px; background: var(--surface); transition: opacity .2s; }
.check { flex: 1; display: flex; align-items: center; gap: 14px; padding: 12px 14px; min-height: 56px; cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box {
  flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px;
  border: 2px solid var(--line); color: transparent; font-weight: 700; font-size: 14px;
  transition: background-color .18s, border-color .18s, color .18s, transform .18s var(--ease);
}
.steps .check .box { color: var(--ink-2); border-radius: 50%; }
.check input:checked + .box { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.check input:focus-visible + .box { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.check input:checked + .box { transform: scale(1.06); }
.check-text { flex: 1; display: grid; gap: 2px; }
.check-text small { color: var(--ink-3); font-size: 13.5px; }
.check-text .qty { font-weight: 700; }
li.done .check-text { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1.5px; text-decoration-color: color-mix(in srgb, var(--ink-3) 60%, transparent); }
li.done .check-text small { text-decoration: none; }
.steps .check { align-items: flex-start; }
.steps .check-text { font-size: 16.5px; line-height: 1.45; padding-top: 2px; }
.step-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin-top: 2px; }
.sit { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 600; }
.steps li.wait { background: color-mix(in srgb, var(--surface) 70%, var(--accent-soft)); }
.timer-btn { align-self: flex-start; margin: 10px 10px 0 0; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line); background: transparent; display: grid; place-items: center; color: var(--ink-2); }
.timer-btn:active { background: var(--accent-soft); }

.recipe-actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 8px; padding-top: 20px; border-top: 1px solid var(--line); }
.recipe-actions .btn { flex: 1 1 auto; }
.recipe-actions + .muted { margin-top: 18px; }

/* ───── Mode cuisine ───── */
.cook { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.cook-bar { display: flex; align-items: center; gap: 12px; padding: calc(env(safe-area-inset-top, 0px) + 10px) var(--gutter) 6px; }
.cook-bar .icon-btn { box-shadow: none; background: var(--surface); }
.cook-progress { flex: 1; display: flex; gap: 4px; }
.cook-progress i { flex: 1; height: 5px; border-radius: 3px; background: var(--line); transition: background-color .3s; }
.cook-progress i.on { background: var(--accent); }
.text-size { font-family: var(--serif); font-weight: 700; font-size: 15px; }
.text-size span { font-size: 21px; }
.cook-track { flex: 1; position: relative; overflow: hidden; }
.cook-slide {
  position: absolute; inset: 0; overflow-y: auto; padding: 20px var(--gutter) 24px;
  display: flex; flex-direction: column; gap: 22px; max-width: 680px; margin: 0 auto;
  opacity: 0; visibility: hidden; transform: translateX(24px);
  transition: opacity .25s, transform .3s var(--ease), visibility 0s .3s;
}
.cook-slide:not([data-slide="0"]) { justify-content: safe center; padding-bottom: 12dvh; }
.cook-slide.active { opacity: 1; visibility: visible; transform: none; transition: opacity .25s, transform .3s var(--ease); }
.cook-kicker { color: var(--accent); font-weight: 700; font-size: 17px; }
.cook h1 { font-size: 34px; }
.cook-step { font-family: var(--serif); font-size: 29px; line-height: 1.3; font-weight: 450; text-wrap: pretty; }
.cook-step.small { font-size: 21px; font-family: var(--sans); }
.cook.size-xl .cook-step { font-size: 36px; }
.cook.size-xl .cook-ingredients { font-size: 23px; }
.cook-sit { display: flex; gap: 10px; align-items: center; font-size: 19px; color: var(--accent); font-weight: 600; }
.timer-big { align-self: flex-start; background: var(--accent-soft); }
.cook-ingredients { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 19px; }
.cook-ingredients label { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 16px; background: var(--surface); min-height: 60px; }
.cook-ingredients input { position: absolute; opacity: 0; }
.cook-ingredients .box { flex: none; width: 34px; height: 34px; border-radius: 11px; border: 2px solid var(--line); display: grid; place-items: center; color: transparent; transition: background-color .18s; }
.cook-ingredients input:checked + .box { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.cook-ingredients input:checked ~ span:last-child { color: var(--ink-3); text-decoration: line-through; }
.cook-ingredients input:focus-visible + .box { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.cook-note { display: block; font-size: .78em; color: var(--ink-3); }
.cook-utensils { display: flex; gap: 10px; align-items: center; color: var(--ink-2); font-size: 17px; }
.cook-slide.end { justify-content: center; text-align: center; align-items: center; }
.cook-nav { display: grid; grid-template-columns: 88px 1fr; gap: 10px; padding: 10px var(--gutter) calc(var(--safe-b) + 14px); }
.cook-nav .btn.ghost { background: var(--surface); }

/* ───── Courses ───── */
.page-head { padding: 8px 0 18px; display: grid; gap: 6px; }
.page-head h1 { font-size: 34px; font-weight: 600; font-variation-settings: 'SOFT' 100, 'WONK' 1, 'opsz' 96; }
.page-head.with-back { display: flex; align-items: center; gap: 12px; }
.page-head.with-back > div { flex: 1; display: grid; gap: 4px; }
.page-head.with-back h1 { font-size: 28px; flex: 1; }
.page-head.with-back .icon-btn { box-shadow: none; background: var(--surface); }
.library .page-head { display: flex; align-items: flex-start; gap: 12px; }
.library .page-head > div { flex: 1; display: grid; gap: 4px; }

.segmented { display: flex; padding: 4px; border-radius: 999px; background: var(--surface-2); margin-bottom: 18px; }
.segmented button { flex: 1; min-height: 42px; border: 0; border-radius: 999px; background: transparent; font-weight: 600; font-size: 15px; color: var(--ink-2); transition: background-color .2s, color .2s; }
.segmented button[aria-selected="true"], .segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08), inset 0 0 0 1.5px var(--line); }

.day-picker { display: grid; gap: 10px; margin-bottom: 20px; }
.day-dots { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day-dot {
  aspect-ratio: 1; max-width: 48px; width: 100%; justify-self: center; border-radius: 50%;
  border: 1.5px solid var(--line); background: transparent; color: var(--ink-2);
  font-family: var(--serif); font-size: 17px; font-weight: 600;
  transition: background-color .18s, color .18s, transform .15s var(--ease);
}
.day-dot.today { border-color: var(--accent); }
.day-dot[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.day-dot:active { transform: scale(.92); }
.day-shortcuts { display: flex; flex-wrap: wrap; gap: 8px; }
.chip.small { min-height: 34px; padding: 0 12px; font-size: 14px; }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: transparent; color: var(--ink); }
.shopping.from-right .segmented ~ * { animation: vt-in-forward .22s var(--ease) both; }
.shopping.from-left .segmented ~ * { animation: vt-in-back .22s var(--ease) both; }
.shop-progress { display: grid; gap: 6px; margin-bottom: 8px; font-size: 14px; color: var(--ink-2); }
.bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .35s var(--ease); }
.shop-group { margin-top: 22px; }
.shop-group h2 { font-size: 19px; margin-bottom: 8px; }
.shop-group.pantry summary { list-style: none; cursor: pointer; display: grid; gap: 2px; padding: 14px 16px; border-radius: 16px; background: var(--surface); }
.shop-group.pantry summary::-webkit-details-marker { display: none; }
.shop-group.pantry summary h2 { margin: 0; font-size: 17px; }
.shop-group.pantry[open] summary { margin-bottom: 6px; }
.qty-right { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
li.done .qty-right { color: var(--ink-3); }
.check-text small.pack { color: var(--ink-3); opacity: .85; }
.shop-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.shop-actions .btn { flex: 1 1 auto; }
.by-recipe h2 { display: grid; gap: 2px; }
.by-recipe h2 small { font-family: var(--sans); font-size: 13px; color: var(--accent); font-weight: 700; }
.plain-list { list-style: none; margin: 0; padding: 4px 16px; background: var(--surface); border-radius: 16px; }
.plain-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15.5px; }
.plain-list li:last-child { border-bottom: 0; }
.plain-list b { white-space: nowrap; }

/* ───── Bibliothèque ───── */
.search { position: relative; display: flex; align-items: center; margin-bottom: 12px; }
.search .ic { position: absolute; left: 14px; color: var(--ink-3); pointer-events: none; }
.search input { width: 100%; min-height: 50px; padding: 0 16px 0 44px; border-radius: 16px; border: 1.5px solid transparent; background: var(--surface); font-size: 16px; }
.search input:focus { border-color: var(--accent); outline: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 2px var(--gutter) 6px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1.5px solid var(--line); background: transparent; font-weight: 600; font-size: 15px; color: var(--ink-2);
}
.chip[aria-selected="true"], .chip:has(input:checked) { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip:has(input:focus-visible) { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.grid { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { display: grid; gap: 6px; width: 100%; padding: 0; border: 0; background: none; text-align: left; transition: transform .15s var(--ease); }
.card:active { transform: scale(.97); }
.card.current .cover { box-shadow: inset 0 0 0 3px var(--accent); }
.card-name { font-family: var(--serif); font-size: 16px; font-weight: 520; line-height: 1.22; text-wrap: pretty; }
.card-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 13px; color: var(--ink-2); }
.card-meta .prot { color: var(--accent); font-weight: 700; }
.card-foot { display: flex; align-items: center; gap: 8px; min-height: 18px; }
.card-foot .season-dots { margin: 0; }
.fav-mark { color: #d1435b; }
.empty, .empty-page { text-align: center; padding: 40px 16px; display: grid; gap: 14px; justify-items: center; color: var(--ink-2); }

/* ───── Petit-déj et collations ───── */
.extra-section { margin-top: 8px; margin-bottom: 34px; display: grid; gap: 12px; justify-items: start; }
.extra-section > h2 { font-size: 24px; }
.extra-section .grid { margin-top: 2px; width: 100%; }
.extra-current {
  width: 100%; display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 10px;
  background: var(--surface); border-radius: 22px; box-shadow: inset 0 0 0 2px var(--accent);
}
.extra-current .day-name { color: var(--accent); }
.extra-none { padding: 4px 0; }
.extra-option { display: grid; gap: 4px; align-content: start; }
.extra-option .card { position: relative; }
.chosen-badge {
  position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: var(--accent-ink);
  animation: pop .3s var(--ease);
}
.see-link { font-size: 13.5px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); padding: 4px 0; justify-self: start; }

/* ───── Éditeur ───── */
.editor { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field legend { font-size: 14px; font-weight: 700; color: var(--ink-2); padding: 0; margin-bottom: 6px; }
.field h2 { font-size: 22px; margin-bottom: 4px; }
.field input:not([type=checkbox]), .field textarea, .field select, .rows input:not([type=checkbox]), .rows textarea, .rows select {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--surface); font-size: 16px;
}
.field textarea, .rows textarea { min-height: 72px; resize: vertical; line-height: 1.4; }
.field input:focus, .field textarea:focus, .field select:focus, .rows input:focus, .rows textarea:focus, .rows select:focus { border-color: var(--accent); outline: none; }
.field-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.field-row .field > span { font-size: 13px; min-height: 2.6em; display: flex; align-items: flex-end; }
.rows { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 10px; }
.row { display: grid; gap: 8px; padding: 12px; border-radius: 18px; background: var(--surface-2); }
.row-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-line .ing-qty { flex: 0 0 96px; }
.row-line .ing-note { flex: 1 1 120px; }
.row-line .unit { font-size: 14px; color: var(--ink-2); min-width: 54px; }
.row-line select { flex: 0 0 auto; width: auto !important; }
.row-line.custom { font-size: 14px; }
.mini { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); }
.mini input[type=number] { width: 84px !important; min-height: 40px !important; }
.mini input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--accent); }
.row-tools { margin-left: auto; display: inline-flex; }
.row-tools .ic.up { transform: rotate(90deg); }
.row-tools .ic.down { transform: rotate(90deg); }
.editor-bar {
  position: sticky; bottom: 0; z-index: 5; margin: 0 calc(var(--gutter) * -1);
  display: flex; align-items: center; gap: 12px; padding: 12px var(--gutter) calc(12px + var(--safe-b));
  background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.preview { flex: 1; font-size: 14px; color: var(--ink-2); }
.preview b { color: var(--ink); }

/* ───── Réglages ───── */
.settings .block { display: grid; gap: 12px; }
.settings .block > h2 { font-size: 20px; }
.switch-row { display: flex; gap: 16px; align-items: center; padding: 16px; background: var(--surface); border-radius: 18px; }
.switch-row span { display: grid; gap: 4px; flex: 1; }
.switch-row small { color: var(--ink-2); font-size: 14px; }
.switch-row input { appearance: none; flex: none; width: 52px; height: 32px; border-radius: 999px; background: var(--surface-2); position: relative; transition: background-color .2s; border: 1.5px solid var(--line); }
.switch-row input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 25px; height: 25px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s var(--ease); }
.switch-row input:checked { background: var(--accent); border-color: var(--accent); }
.switch-row input:checked::after { transform: translateX(20px); }
.settings > .btn { margin-top: 28px; }

/* ───── Connexion ───── */
.login { min-height: 100dvh; max-width: 420px; margin: 0 auto; padding: 48px 24px calc(32px + var(--safe-b)); display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.login-plate { width: 168px; height: 168px; margin-bottom: 18px; border-radius: 40px; background: var(--cloth); position: relative; overflow: hidden; }
.login-plate .plate { position: absolute; inset: 8%; width: 84%; animation: spin-in 1.1s var(--ease) both; }
.login h1 { font-size: 46px; font-weight: 600; font-variation-settings: 'SOFT' 100, 'WONK' 1, 'opsz' 144; }
.login-form { margin-top: 28px; display: grid; gap: 14px; }
.login .error { color: var(--danger); min-height: 1.4em; font-size: 15px; }

/* ───── Animations ───── */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } }
@keyframes pop { 50% { transform: scale(1.3); } }
@keyframes pulse { to { opacity: .75; } }
@keyframes spin-in { from { transform: rotate(-70deg) scale(.85); opacity: 0; } }

/* Transitions de page (View Transitions API) : discrètes et courtes. */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; animation-timing-function: var(--ease); }
[data-nav="forward"]::view-transition-new(root) { animation-name: vt-in-forward; }
[data-nav="forward"]::view-transition-old(root) { animation-name: vt-out; }
[data-nav="back"]::view-transition-new(root) { animation-name: vt-in-back; }
[data-nav="back"]::view-transition-old(root) { animation-name: vt-out; }
::view-transition-group(*) { animation-duration: .32s; animation-timing-function: var(--ease); }
@keyframes vt-in-forward { from { opacity: 0; transform: translateX(18px); } }
@keyframes vt-in-back { from { opacity: 0; transform: translateX(-18px); } }
@keyframes vt-out { to { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* Écrans larges : la page reste une colonne lisible. */
@media (min-width: 720px) {
  .today .cover.hero { aspect-ratio: 16 / 8; }
  .today .cover.hero .plate { width: 60%; left: 40%; top: -20%; }
  .recipe-hero { margin: 16px 0 0; border-radius: 28px; overflow: hidden; }
}
