/* Carnet de recettes : thème « livre de cuisine ». Jetons en tête, clair et sombre. */
:root {
  --paper: #faf6ef;
  --card: #fffdf9;
  --sunk: #f3ede3;
  --ink: #2b2420;
  --ink-soft: #4a3f38;
  --muted: #7d7066;
  --line: #e7ddcf;
  --accent: #b9532f;
  --accent-ink: #fff8f3;
  --accent-soft: #f6e4da;
  --sage: #5f7552;
  --sage-soft: #e5ebdd;
  --gold: #a87a22;
  --gold-soft: #f5ead2;
  --danger: #a8332a;
  --ai: #6a52b8;
  --ai-soft: #efeafb;
  --shadow: 0 1px 2px rgb(60 40 20 / 6%), 0 6px 20px rgb(60 40 20 / 7%);
  --radius: 18px;
  --serif: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --tabbar-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1b1714;
    --card: #25201c;
    --sunk: #2d2722;
    --ink: #f2eae0;
    --ink-soft: #d9cdbf;
    --muted: #a7998b;
    --line: #3a322c;
    --accent: #e27b52;
    --accent-ink: #1b1714;
    --accent-soft: #3b2920;
    --sage: #9fb58f;
    --sage-soft: #2b3326;
    --gold: #d6a84a;
    --gold-soft: #372e1c;
    --danger: #ef7d72;
    --ai: #b9a7f2;
    --ai-soft: #2b2540;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px calc(var(--tabbar-h) + var(--safe-b) + 28px);
  outline: none;
}
main.bare { padding-bottom: 32px; }

/* ---------- barre d'onglets ---------- */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 20;
  display: grid; grid-template-columns: repeat(3, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 500;
}
.tabbar a[aria-current="page"] { color: var(--accent); }
.tab-plus {
  position: relative; display: grid; place-items: center; width: 44px; height: 44px; margin-top: -14px;
  border-radius: 50%; background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 16px rgb(185 83 47 / 35%);
}
.tab-plus svg { width: 24px; height: 24px; stroke-width: 2.2; }
.tab-badge {
  position: absolute; top: -3px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: var(--gold); color: #fff; font-size: 11px; line-height: 19px; text-align: center; border: 2px solid var(--paper);
}

/* ---------- éléments communs ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 8px 0 18px; }
.page-head h1 { font-size: clamp(30px, 8vw, 44px); }
.page-head h1 em { color: var(--accent); font-style: italic; font-weight: 500; }
.kicker { font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); font-weight: 600; margin-bottom: 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font-weight: 600; cursor: pointer; text-decoration: none;
  transition: transform 0.12s, background 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 20px; height: 20px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-danger { color: var(--danger); }
.btn-small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn[disabled] { opacity: 0.55; pointer-events: none; }
.icon-btn {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); cursor: pointer; color: var(--ink); text-decoration: none;
}
.icon-btn.on { color: var(--accent); }
.icon-btn.on svg { fill: currentColor; }

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.input, textarea.input {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--card); outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
textarea.input { resize: vertical; line-height: 1.6; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); font-size: 14px; white-space: nowrap; cursor: pointer; color: var(--ink-soft);
}
.chip svg { width: 16px; height: 16px; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--sage-soft); color: var(--sage); font-size: 13px; font-weight: 500; }

.notice {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px;
  background: var(--gold-soft); color: var(--ink-soft); font-size: 14.5px; margin: 16px 0;
}
.notice svg { color: var(--gold); margin-top: 1px; }
.notice ul { margin: 6px 0 0; padding-left: 18px; }
.notice.danger { background: color-mix(in srgb, var(--danger) 12%, var(--card)); }
.notice.danger svg { color: var(--danger); }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty h2 { color: var(--ink); font-size: 24px; margin-bottom: 8px; }
.empty .btn { margin-top: 18px; }
.empty-illu { width: 84px; height: 84px; margin: 0 auto 14px; color: var(--accent); opacity: 0.85; }
.empty-illu svg { width: 100%; height: 100%; stroke-width: 1.2; }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--accent); animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- carnet (liste) ---------- */
.search { position: relative; margin-bottom: 12px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .input { padding-left: 44px; border-radius: 999px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 10px; margin: 0 -16px 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.count { color: var(--muted); font-size: 14px; margin: 4px 0 12px; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.page-head.home { align-items: center; }

/* Cartes « magazine » : photo pleine, titre posé sur un dégradé */
.card {
  position: relative; display: block; text-decoration: none; min-width: 0; isolation: isolate;
  background: var(--sunk); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  aspect-ratio: 3 / 4; transition: transform 0.15s;
}
.card:active { transform: scale(0.98); }
.card-img { position: absolute; inset: 0; z-index: -1; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
@media (hover: hover) { .card:hover .card-img img { transform: scale(1.04); } }
.card::after { content: ''; position: absolute; inset: 35% 0 0; z-index: -1; background: linear-gradient(transparent, rgb(20 12 6 / 55%) 40%, rgb(20 12 6 / 88%)); }
.card-body { position: absolute; inset: auto 0 0; padding: 12px 13px 13px; color: #fff; }
.card-kicker { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.13em; font-weight: 700; color: rgb(255 228 205 / 92%); margin-bottom: 3px; }
.card h3 { font-size: 17px; font-weight: 600; line-height: 1.18; text-shadow: 0 1px 8px rgb(0 0 0 / 30%); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; color: rgb(255 255 255 / 82%); font-size: 12.5px; margin-top: 6px; }
.card-meta span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.card-meta svg { width: 14px; height: 14px; }
.card-fav { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: rgb(255 255 255 / 90%); color: #b9532f; }
.card-fav svg { width: 17px; height: 17px; fill: currentColor; }
.card-flag { position: absolute; top: 10px; left: 10px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: rgb(255 248 236 / 94%); color: #8a5f12; }
.card.featured { grid-column: 1 / -1; aspect-ratio: 16 / 11; border-radius: 24px; }
.card.featured .card-body { padding: 18px 20px 20px; }
.card.featured h3 { font-size: clamp(22px, 6vw, 32px); -webkit-line-clamp: 2; }
.card.featured .card-kicker { font-size: 11.5px; }
.card .placeholder { place-items: start center; padding-top: 8%; }
.card .placeholder span { transform: none; font-size: 56px; line-height: 1; }
.card.featured .placeholder { place-items: start end; padding: 18px 26px; }
@media (min-width: 640px) { .card.featured { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; } }

/* Image de remplacement : initiale sur fond chaud */
.placeholder { width: 100%; height: 100%; display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, var(--gold-soft), transparent 60%), linear-gradient(145deg, var(--accent-soft), var(--sunk)); }
.placeholder span { font-family: var(--serif); font-style: italic; font-size: 64px; color: var(--accent); opacity: 0.6; transform: translateY(-18%); }

/* ---------- fiche recette ---------- */
.recipe { max-width: 760px; margin: 0 auto; }
.hero { position: relative; margin: calc(-1 * max(16px, env(safe-area-inset-top))) -16px 0; }
.hero-img { aspect-ratio: 4 / 4.2; max-height: 62vh; width: 100%; overflow: hidden; background: var(--sunk); }
.hero-img img { width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ''; position: absolute; inset: auto 0 0; height: 90px; background: linear-gradient(transparent, var(--paper)); pointer-events: none; }
.hero.no-img .hero-img { aspect-ratio: auto; height: calc(150px + env(safe-area-inset-top)); }
.hero.no-img .placeholder span { display: none; }
.hero-bar { position: absolute; top: max(14px, env(safe-area-inset-top)); left: 16px; right: 16px; display: flex; justify-content: space-between; z-index: 2; }
.hero-bar .icon-btn { background: rgb(255 253 249 / 90%); border: none; color: #2b2420; backdrop-filter: blur(6px); }
.hero-bar .icon-btn.on { color: #b9532f; }
.hero-bar .group { display: flex; gap: 10px; }
@media (min-width: 800px) { .hero { margin: 0 0 0; border-radius: 24px; overflow: hidden; } .hero::after { display: none; } }

.recipe-head { position: relative; z-index: 1; margin-top: -26px; }
.recipe-head h1 { font-size: clamp(30px, 8.4vw, 46px); margin: 6px 0 10px; }
.byline { color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.byline a { color: var(--accent); text-decoration: none; font-weight: 600; }
.summary { font-family: var(--serif); font-style: italic; font-size: 18.5px; color: var(--ink-soft); margin: 14px 0 0; line-height: 1.5; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; margin: 22px 0; }
.fact { padding: 12px 6px; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.fact b { display: block; font-family: var(--serif); font-size: 19px; font-weight: 600; }
.fact span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }

.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 30px 0 14px; }
.section-title h2 { font-size: 26px; }
.section-title h2::after { content: ''; display: block; width: 36px; height: 3px; border-radius: 2px; background: var(--accent); margin-top: 8px; }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.stepper button { width: 40px; height: 40px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; color: var(--accent); }
.stepper button svg { width: 18px; height: 18px; stroke-width: 2.3; }
.stepper output { min-width: 74px; text-align: center; font-weight: 600; font-size: 14.5px; }

.group-title { font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--accent); margin: 18px 0 6px; }
.ingredients { list-style: none; margin: 0; padding: 0; }
.ingredients li { border-bottom: 1px dashed var(--line); }
.ingredients label { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 11px 2px; cursor: pointer; }
.ingredients input { appearance: none; width: 20px; height: 20px; border: 1.8px solid var(--line); border-radius: 6px; margin: 0; position: relative; top: 4px; display: grid; place-items: center; background: var(--card); }
.ingredients input:checked { background: var(--sage); border-color: var(--sage); }
.ingredients input:checked::after { content: ''; width: 9px; height: 5px; border: solid #fff; border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px, -1px); }
.ingredients input:checked ~ .ing { opacity: 0.45; text-decoration: line-through; }
.ing b { font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.ing .note { color: var(--muted); font-size: 14px; }
.ing .orig { display: block; color: var(--muted); font-size: 12px; font-style: italic; }

/* Quantités suggérées par l'IA : toujours distinguées des quantités de la recette */
.ing b.sugg { color: var(--ai); font-weight: 600; border-bottom: 1.5px dashed color-mix(in srgb, var(--ai) 55%, transparent); }
.ai-badge { display: inline-block; vertical-align: 1px; padding: 1px 7px; border-radius: 999px; background: var(--ai-soft); color: var(--ai); font-size: 11px; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; }
.ai-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin: 4px 0 10px; border-radius: 14px; background: var(--ai-soft); color: var(--ink-soft); font-size: 14px; }
.ai-note p { margin: 0; }
.ai-note svg { color: var(--ai); width: 20px; height: 20px; margin-top: 1px; }
.serv-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -4px 0 12px; }
.serv-presets .chip { height: 30px; font-size: 13px; padding: 0 12px; }
.serv-note { color: var(--muted); font-size: 12.5px; font-style: italic; }
.notice details { margin-top: 4px; }
.notice summary { cursor: pointer; color: var(--muted); font-size: 13.5px; }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { position: relative; padding: 4px 0 22px 52px; counter-increment: step; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--serif); font-weight: 600; font-size: 17px;
  background: var(--accent-soft); color: var(--accent);
}
.steps li:not(:last-child)::after { content: ''; position: absolute; left: 17.5px; top: 42px; bottom: 6px; width: 1px; background: var(--line); }
.steps .step-section { font-family: var(--serif); font-style: italic; color: var(--accent); font-size: 17px; margin: 0 0 4px; }
.steps p { margin: 0; font-size: 16.5px; }
.timer-btn { display: inline-flex; align-items: center; gap: 6px; margin: 8px 8px 0 0; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 13.5px; font-weight: 600; color: var(--sage); cursor: pointer; }
.timer-btn svg { width: 16px; height: 16px; }

.tips { background: var(--sage-soft); border-radius: var(--radius); padding: 18px 20px; margin-top: 10px; }
.tips h3 { font-size: 19px; color: var(--sage); margin-bottom: 8px; }
.tips ul { margin: 0; padding-left: 20px; }
.tips li + li { margin-top: 6px; }

.notes-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; white-space: pre-wrap; }
details.source { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 14px; color: var(--muted); font-size: 14px; }
details.source summary { cursor: pointer; font-weight: 600; color: var(--ink-soft); }
details.source pre { white-space: pre-wrap; font: 14px/1.55 var(--sans); background: var(--sunk); padding: 12px 14px; border-radius: 12px; color: var(--ink-soft); }
details.source h4 { margin: 14px 0 6px; color: var(--ink-soft); }

.action-bar {
  position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px); z-index: 5; margin-top: 28px;
  display: flex; gap: 10px; padding: 10px; border-radius: 999px; background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(10px); box-shadow: var(--shadow); border: 1px solid var(--line);
}
.action-bar { gap: 8px; padding: 8px; }
.action-bar .btn-primary { flex: 1; }
.action-bar .btn:not(.btn-primary) { padding: 0 13px; font-size: 14.5px; gap: 6px; }
.action-bar .btn svg { width: 18px; height: 18px; }

/* ---------- export Yazio ---------- */
.sub-head { display: flex; align-items: center; gap: 14px; margin: 6px 0 18px; }
.sub-head h1 { font-size: clamp(22px, 6vw, 30px); }
.sub-head .kicker { margin-bottom: 2px; }
.yz-how { margin: 0 0 16px; padding: 14px 16px 14px 34px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; color: var(--ink-soft); font-size: 14.5px; }
.yz-how li + li { margin-top: 4px; }
.yz-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.yz-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 16px; }
.yz-row + .yz-row { border-top: 1px solid var(--line); }
.yz-row .grow { flex: 1; min-width: 0; }
.yz-row b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yz-label { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.muted { color: var(--muted); font-size: 13px; }
.yz-progress { font-weight: 700; color: var(--sage); font-variant-numeric: tabular-nums; }
.yz-list { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.yz-list li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 4px; padding-right: 10px; border-bottom: 1px solid var(--line); transition: opacity 0.2s; }
.yz-list li:last-child { border-bottom: 0; }
.yz-list li.done { opacity: 0.5; }
.yz-list li.done .yz-name b { text-decoration: line-through; }
.yz-check { display: grid; place-items: center; height: 100%; min-height: 56px; cursor: pointer; }
.yz-check input { appearance: none; width: 22px; height: 22px; border: 1.8px solid var(--line); border-radius: 7px; margin: 0; display: grid; place-items: center; background: var(--card); cursor: pointer; }
.yz-check input:checked { background: var(--sage); border-color: var(--sage); }
.yz-check input:checked::after { content: ''; width: 10px; height: 5px; border: solid #fff; border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px, -1px); }
.yz-name { min-width: 0; text-align: left; border: 0; background: none; padding: 10px 4px; cursor: pointer; color: var(--ink); }
.yz-name b { display: block; font-weight: 600; }
.yz-name small { display: block; color: var(--muted); font-size: 12.5px; }
.yz-name:active b { color: var(--accent); }
.yz-amount { min-width: 74px; height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--sunk); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; cursor: pointer; color: var(--ink); display: inline-grid; place-items: center; }
.yz-amount.est { background: var(--ai-soft); border: 1.5px dashed color-mix(in srgb, var(--ai) 50%, transparent); color: var(--ai); }
.yz-amount.none { cursor: default; font-weight: 500; color: var(--muted); font-size: 13px; background: none; }
.yz-foot { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: 13px; margin: 14px 2px 0; }
.yz-foot svg { color: var(--ai); width: 18px; height: 18px; }

/* Menu « … » */
.menu { position: relative; }
.menu-list { position: absolute; right: 0; top: 50px; min-width: 210px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 6px; z-index: 10; }
.menu-list button, .menu-list a { display: flex; width: 100%; align-items: center; gap: 10px; padding: 11px 12px; border: 0; background: none; border-radius: 10px; text-align: left; cursor: pointer; text-decoration: none; color: var(--ink); font-size: 15px; }
.menu-list button:hover, .menu-list a:hover { background: var(--sunk); }
.menu-list .danger { color: var(--danger); }
.menu-list svg { width: 19px; height: 19px; color: var(--muted); }

/* ---------- mode cuisine ---------- */
.cook { position: fixed; inset: 0; z-index: 40; background: var(--paper); display: flex; flex-direction: column; padding: max(14px, env(safe-area-inset-top)) 18px calc(18px + var(--safe-b)); }
.cook-top { display: flex; align-items: center; gap: 12px; }
.cook-title { flex: 1; min-width: 0; font-family: var(--serif); font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress { height: 4px; border-radius: 2px; background: var(--line); margin: 14px 0 0; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); transition: width 0.3s; }
.cook-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; justify-content: center; padding: 18px 2px; touch-action: pan-y; }
.cook-num { font-family: var(--serif); font-style: italic; color: var(--accent); font-size: 20px; }
.cook-section { color: var(--muted); font-size: 14px; text-transform: uppercase; letter-spacing: 0.1em; margin-top: 2px; }
.cook-text { font-family: var(--serif); font-size: clamp(24px, 6.4vw, 38px); line-height: 1.35; margin: 14px 0 6px; font-weight: 450; }
.cook-text b { color: var(--accent); font-weight: 600; }
.cook-nav { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; }
.cook-nav .btn { min-height: 58px; font-size: 17px; }
.timers { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.timer {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 8px 0 14px; border-radius: 999px;
  background: var(--sage-soft); color: var(--sage); font-weight: 700; font-variant-numeric: tabular-nums;
}
.timer.done { background: var(--accent); color: var(--accent-ink); animation: pulse 1s ease-in-out infinite; }
.timer button { width: 28px; height: 28px; border: 0; border-radius: 50%; background: rgb(0 0 0 / 8%); color: inherit; cursor: pointer; display: grid; place-items: center; }
.timer button svg { width: 15px; height: 15px; }
@keyframes pulse { 50% { transform: scale(1.04); } }
.sheet { position: fixed; inset: auto 0 0; z-index: 45; max-height: 75dvh; overflow-y: auto; background: var(--card); border-radius: 24px 24px 0 0; box-shadow: 0 -10px 40px rgb(0 0 0 / 20%); padding: 10px 20px calc(24px + var(--safe-b)); }
.sheet-grip { width: 42px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.cook-end { text-align: center; }
.cook-end h2 { font-size: 40px; font-style: italic; color: var(--accent); }

#timer-dock { position: fixed; z-index: 55; top: max(10px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: max-content; max-width: calc(100% - 24px); }
body:has(.cook) #timer-dock { top: calc(max(14px, env(safe-area-inset-top)) + 66px); }
#timer-dock .timer { box-shadow: var(--shadow); background: var(--card); border: 1px solid var(--line); }
#timer-dock .timer.done { background: var(--accent); border-color: var(--accent); }

/* ---------- import ---------- */
.paste-card { background: var(--card); border-radius: 24px; padding: 20px; box-shadow: var(--shadow); }
.paste-card h2 { font-size: 22px; margin-bottom: 4px; }
.paste-card p { color: var(--muted); margin: 0 0 14px; font-size: 14.5px; }
.paste-row { display: flex; gap: 10px; flex-wrap: wrap; }
.paste-row .btn-primary { flex: 1; }
.jobs { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; }
.job { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; }
.job-head { display: flex; align-items: center; gap: 12px; }
.job-head .grow { flex: 1; min-width: 0; }
.job-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 12px; }
.job-steps span { height: 4px; border-radius: 2px; background: var(--line); }
.job-steps span.on { background: var(--accent); }
.job-steps span.now { background: linear-gradient(90deg, var(--accent) 0 40%, var(--line) 40%); background-size: 250% 100%; animation: flow 1.2s linear infinite; }
@keyframes flow { from { background-position: 100% 0; } to { background-position: -150% 0; } }
.job-notes { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.job-error { color: var(--danger); font-size: 14px; margin-top: 8px; }
.job-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.state-dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.state-dot.ok { background: var(--sage-soft); color: var(--sage); }
.state-dot.err { background: color-mix(in srgb, var(--danger) 14%, var(--card)); color: var(--danger); }
.state-dot.run { background: var(--accent-soft); }
.state-dot svg { width: 18px; height: 18px; }

/* ---------- courses ---------- */
.add-row { display: flex; gap: 10px; margin-bottom: 8px; }
.add-row .input { flex: 1; min-width: 0; border-radius: 999px; }
.aisle { margin-top: 22px; }
.aisle h2 { font-size: 15px; font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 650; margin-bottom: 6px; }
.shop { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.shop li { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); }
.shop li:last-child { border-bottom: 0; }
.shop label { flex: 1; min-width: 0; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 13px 0 13px 16px; cursor: pointer; }
.shop .ing small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop .remove { width: 44px; height: 44px; border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.shop .remove svg { width: 18px; height: 18px; }
.shop-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

/* ---------- modale (ajout aux courses) ---------- */
.backdrop { position: fixed; inset: 0; z-index: 44; background: rgb(20 14 10 / 45%); animation: fade 0.15s; }
@keyframes fade { from { opacity: 0; } }

/* ---------- connexion ---------- */
.login { min-height: 80dvh; display: grid; place-items: center; }
.login-card { width: min(380px, 100%); text-align: center; }
.login-card h1 { font-size: 40px; margin: 10px 0 6px; }
.login-card h1 em { color: var(--accent); }
.login-card p { color: var(--muted); margin: 0 0 24px; }
.login-card .btn { width: 100%; margin-top: 4px; }
.login-mark { width: 74px; height: 74px; margin: 0 auto; }

/* ---------- édition ---------- */
.edit h1 { font-size: 30px; margin: 8px 0 20px; }
.edit textarea.mono { font: 14.5px/1.7 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; }
.edit-actions { display: flex; gap: 10px; position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px); padding: 10px 0; }
.edit-actions .btn-primary { flex: 1; }

/* ---------- notifications ---------- */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px); z-index: 60; display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); }
.toast { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 16px; border-radius: 14px; background: var(--ink); color: var(--paper); box-shadow: var(--shadow); font-size: 14.5px; animation: rise 0.2s ease-out; }
.toast span { flex: 1; }
.toast a, .toast button { color: var(--gold); font-weight: 700; background: none; border: 0; cursor: pointer; text-decoration: none; padding: 4px; }
.toast.error { background: var(--danger); color: #fff; }
.toast.error a, .toast.error button { color: #fff; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

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