:root {
  --bg: #FBF7F2;
  --card: #FFFFFF;
  --ink: #2B2420;
  --muted: #7A6F66;
  --line: #EADFD3;
  --accent: #B8472F;
  --line-strong: #948474;
  --accent-ink: #FFFFFF;
  --accent-soft: #F6E3DC;
  --ok: #4F7A4A;
  --star: #B87A12;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 6px 20px rgba(60, 40, 20, .07);
  --radius: 18px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --gutter: max(16px, var(--safe-l), var(--safe-r));
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1B1714;
    --card: #26201C;
    --ink: #F3ECE4;
    --muted: #A89C91;
    --line: #3A312B;
    --accent: #E0765C;
    --line-strong: #82766B;
    --accent-ink: #1B1714;
    --accent-soft: #3D2A23;
    --ok: #8DBF86;
    --star: #E9A23B;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
  min-height: 100dvh;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
a { color: var(--accent); }
img { display: block; max-width: 100%; }
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
/* Contour visible au clavier (iPad avec clavier), jamais au toucher. */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }
.icon { width: 24px; height: 24px; flex: none; }

.page { max-width: 1100px; margin: 0 auto; padding: calc(var(--safe-t) + 12px) var(--gutter) calc(var(--safe-b) + 32px); }

/* --- Barre du haut ---------------------------------------------------- */
.topbar { display: flex; align-items: center; gap: 12px; margin: 8px 0 16px; }
.topbar h1 { font-size: 2rem; font-weight: 800; flex: 1; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: var(--card); color: var(--ink); box-shadow: var(--shadow); text-decoration: none;
}
.icon-btn:active { transform: scale(.94); }
.icon-btn.ghost { background: transparent; box-shadow: none; }
.icon-btn.on { background: var(--accent); color: var(--accent-ink); }

/* --- Recherche et grille ------------------------------------------------ */
.search { position: relative; margin-bottom: 18px; }
.search input {
  width: 100%; height: 48px; padding: 0 16px 0 44px; border-radius: 14px; border: 1px solid var(--line-strong);
  background: var(--card); font-size: 17px; outline: none; -webkit-appearance: none; appearance: none;
}
.search input:focus { border-color: var(--accent); }
.search input:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft); }
.search .icon { position: absolute; left: 14px; top: 12px; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; } }
.card {
  display: flex; flex-direction: column; background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); text-decoration: none; color: inherit; min-width: 0;
}
.card:active { transform: scale(.98); }
.thumb { aspect-ratio: 4 / 3; background: var(--accent-soft); position: relative; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--accent); opacity: .55; }
.thumb .ph .icon { width: 40px; height: 40px; }
.card-body { padding: 10px 12px 12px; }
.card-title { font-weight: 650; font-size: 1rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { color: var(--muted); font-size: .85rem; margin-top: 4px; display: flex; gap: 6px; align-items: center; }
.card-meta .icon { width: 15px; height: 15px; }

.more { display: block; margin: 22px auto 0; }
.empty, .notice { text-align: center; color: var(--muted); padding: 48px 16px; }
.notice h2 { color: var(--ink); font-size: 1.3rem; margin-bottom: 8px; }
.notice p { max-width: 460px; margin: 8px auto 18px; }
.spinner { width: 34px; height: 34px; margin: 64px auto; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }

/* --- Boutons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border-radius: 14px; border: 1px solid var(--line); background: var(--card); font-weight: 600; text-decoration: none; color: var(--ink);
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.big { min-height: 60px; font-size: 1.15rem; border-radius: 18px; width: 100%; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: .9rem; border-radius: 10px; }
.btn:disabled { opacity: .4; }

/* --- Fiche recette ------------------------------------------------------ */
.hero { position: relative; margin: calc(-1 * (var(--safe-t) + 12px)) calc(-1 * var(--gutter)) 0; min-height: 200px; background: var(--accent-soft); overflow: hidden; }
.hero img { width: 100%; height: clamp(220px, 42vw, 420px); object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,.35), transparent 30%); pointer-events: none; }
.hero .icon-btn { position: absolute; top: calc(var(--safe-t) + 12px); left: var(--gutter); z-index: 1; }
.hero.noimg { min-height: calc(var(--safe-t) + 72px); background: transparent; }
.hero.noimg::after { display: none; }

.recipe-head { padding: 20px 0 4px; }
.recipe-head h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); font-weight: 800; }
.recipe-head p { color: var(--muted); margin: 10px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: .9rem; }
.chip .icon { width: 16px; height: 16px; color: var(--accent); }
.chip b { font-weight: 650; }
.chip.link { color: inherit; text-decoration: none; min-height: 44px; border-color: var(--line-strong); }
.chip.link b { font-weight: 500; color: var(--muted); }
.chip.link:active { opacity: .7; }

.layout { display: grid; gap: 22px; margin-top: 18px; }
@media (min-width: 820px) { .layout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } .layout .side { position: sticky; top: calc(var(--safe-t) + 16px); } }

.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.panel-head h2 { font-size: 1.25rem; }
.panel-head small { color: var(--muted); }

.servings { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--bg); border-radius: 999px; padding: 4px; }
.stepper button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--card); box-shadow: var(--shadow); display: grid; place-items: center; }
.stepper button:disabled { opacity: .35; }
.stepper output { min-width: 3.2em; text-align: center; font-weight: 750; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.servings-label { font-weight: 600; }
.servings-label small { display: block; color: var(--muted); font-weight: 400; font-size: .85rem; }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist .section { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 14px 0 4px; }
.checklist label { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-top: 1px solid var(--line); cursor: pointer; }
.checklist li:first-child label, .checklist .section + li label { border-top: 0; }
.checklist input { position: absolute; opacity: 0; pointer-events: none; }
.box { flex: none; width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line-strong); display: grid; place-items: center; margin-top: -1px; transition: .15s; }
.box .icon { width: 18px; height: 18px; color: var(--accent-ink); opacity: 0; }
.checklist input:checked + .box { background: var(--ok); border-color: var(--ok); }
.checklist input:checked + .box .icon { opacity: 1; }
.checklist input:checked ~ .txt { color: var(--muted); text-decoration: line-through; }
.checklist input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 2px; }
.qty { font-weight: 750; color: var(--accent); }

.steps-preview { margin: 0; padding-left: 1.4em; }
.steps-preview li { margin: 0 0 12px; padding-left: 4px; }
.steps-preview li::marker { color: var(--accent); font-weight: 700; }
.steps-preview .sec { list-style: none; margin-left: -1.4em; font-weight: 700; padding-top: 6px; }

.cta-bar { display: grid; gap: 10px; }
@media (max-width: 819px) {
  .cta-bar { position: sticky; bottom: 0; z-index: 5; margin: 0 calc(-1 * var(--gutter)) calc(-1 * (var(--safe-b) + 32px)); padding: 12px var(--gutter) calc(var(--safe-b) + 12px); background: linear-gradient(to top, var(--bg) 75%, transparent); }
  body.recipe-page #timers { bottom: calc(var(--safe-b) + 92px); }
  body.recipe-page.resume #timers { bottom: calc(var(--safe-b) + 150px); }
}
body.has-timers .page { padding-bottom: calc(var(--safe-b) + 110px); }

/* --- Mode cuisine ------------------------------------------------------- */
body.cooking { overflow: hidden; overscroll-behavior: none; }
.cook { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.cook-bar { display: flex; align-items: center; gap: 10px; padding: calc(var(--safe-t) + 10px) var(--gutter) 10px; }
.cook-title { flex: 1; min-width: 0; text-align: center; }
.cook-title h1 { margin: 0; font-weight: 700; display: block; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cook-title span { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.progress { height: 4px; background: var(--line); margin: 0 var(--gutter); border-radius: 4px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); transition: width .3s; }

.cook-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 18px var(--gutter) 24px; display: grid; gap: 20px; align-content: start; }
@media (min-width: 760px) and (orientation: landscape), (min-width: 1000px) {
  .cook-body { grid-template-columns: minmax(260px, 36%) 1fr; gap: 32px; align-items: start; padding-top: 28px; }
  .cook-body .step-ings { position: sticky; top: 0; }
}
.step-section { color: var(--accent); font-weight: 750; text-transform: uppercase; letter-spacing: .06em; font-size: .85rem; margin-bottom: 8px; }
.step-num { display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 10px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 1.3rem; margin-bottom: 14px; }
.step-text { font-size: clamp(1.35rem, 1.2vw + 1.1rem, 2.05rem); line-height: 1.42; font-weight: 450; }
.step-text p { margin: 0 0 .7em; }
.step-text ul { margin: 0 0 .7em; padding-left: 1.2em; }
.step-summary { font-weight: 700; margin-bottom: .4em; }

.step-ings { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px 6px; }
.step-ings h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2px 8px; margin-bottom: 4px; }
.step-ings h2 small { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: .8rem; margin-left: auto; }
.ing-list { list-style: none; margin: 0; padding: 0; }
.ing-list button {
  display: flex; width: 100%; gap: 12px; align-items: baseline; text-align: left; padding: 12px 0; border: 0;
  border-top: 1px solid var(--line); background: none; font-size: clamp(1.1rem, .6vw + 1rem, 1.4rem);
}
.ing-list li:first-child button { border-top: 0; }
.ing-list .q { font-weight: 800; color: var(--accent); white-space: nowrap; min-width: 4.2em; }
.ing-list .n { flex: 1; }
.ing-list .done { opacity: .45; }
.ing-list .done .n { text-decoration: line-through; }
.ing-none { color: var(--muted); padding: 6px 0 12px; margin: 0; }

.timer-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.timer-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 18px; border-radius: 999px; border: 2px solid var(--accent); background: var(--accent-soft); color: var(--ink); font-weight: 700; font-size: 1.05rem; }
.timer-btn .icon { color: var(--accent); }

.cook-nav { display: grid; grid-template-columns: 1fr 1.6fr; gap: 12px; padding: 0 var(--gutter) calc(var(--safe-b) + 12px); background: var(--bg); }
.cook-nav .btn { min-height: 64px; font-size: 1.15rem; border-radius: 18px; }

.finish { text-align: center; padding: 40px 16px; display: grid; gap: 14px; justify-items: center; }
.finish .big-emoji { font-size: 4rem; }
.finish h2 { font-size: 2rem; }
.made-card { width: 100%; max-width: 420px; display: grid; gap: 10px; text-align: left; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.made-card label { font-weight: 650; }
.made-card label small, .made-card > small { color: var(--muted); font-weight: 400; }
.made-card textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--bg); padding: 10px 12px; font: inherit; resize: vertical; }
.made-card.done p { margin: 0; display: flex; gap: 8px; align-items: center; color: var(--ok); }
.made-card.done p .icon { color: var(--ok); }

/* --- Commande vocale --------------------------------------------------- */
.icon-btn.listening { animation: listen 1.6s ease-in-out infinite; }
@keyframes listen { 0%, 100% { box-shadow: 0 0 0 0 rgba(200, 85, 61, .45); } 50% { box-shadow: 0 0 0 8px rgba(200, 85, 61, 0); } }
.voice-hint { margin: 8px var(--gutter) 0; padding: 8px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--ink); font-size: .95rem; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voice-hint.strong { background: var(--accent); color: var(--accent-ink); font-weight: 700; }

/* --- Étape suivante ------------------------------------------------------ */
.next-card {
  display: grid; gap: 4px; margin: 0 var(--gutter) 10px; padding: 10px 14px; text-align: left;
  border: 2px dashed var(--line-strong); border-radius: 14px; background: var(--card); color: var(--ink); min-height: 44px;
}
.next-card:active { transform: scale(.99); }
.next-card.last { border-style: solid; }
.next-label { font-size: .75rem; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.next-text { color: var(--muted); font-size: 1rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.next-ings { list-style: none; margin: 2px 0 0; padding: 0; display: flex; gap: 6px; overflow: hidden; flex-wrap: nowrap; mask-image: linear-gradient(to right, #000 85%, transparent); -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); }
.next-ings li { flex: none; font-size: .85rem; padding: 3px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
.next-ings b { color: var(--accent); }
@media (min-width: 760px) and (orientation: landscape), (min-width: 1000px) {
  .next-card { margin-left: calc(var(--gutter) + 36% + 16px); }
  .next-text { -webkit-line-clamp: 3; font-size: 1.05rem; }
}

/* --- Minuteurs ---------------------------------------------------------- */
#timers { position: fixed; z-index: 20; left: 0; right: 0; bottom: calc(var(--safe-b) + 12px); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 var(--gutter); }
/* En mode cuisine : dans la page, entre l'étape et « Ensuite », sans rien recouvrir. */
.cook-timers #timers { position: static; flex-direction: row; flex-wrap: wrap; justify-content: center; pointer-events: auto; padding: 0 var(--gutter); }
.cook-timers #timers:not(:empty) { padding-bottom: 10px; }
.cook-timers .timer { box-shadow: none; padding: 5px 5px 5px 14px; gap: 8px; }
.cook-timers .timer .t { font-size: 1.15rem; }
.cook-timers .timer .l { max-width: 30vw; }
@media (min-width: 760px) and (orientation: landscape), (min-width: 1000px) {
  .cook-timers { margin-left: calc(36% + 16px); }
  .cook-timers #timers { justify-content: flex-start; }
}
.timer {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; background: var(--ink); color: var(--bg);
  border-radius: 999px; padding: 8px 8px 8px 18px; box-shadow: 0 8px 30px rgba(0,0,0,.25); max-width: 100%;
}
.timer .t { font-weight: 800; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.timer .l { opacity: .75; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.timer button { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: inherit; display: grid; place-items: center; }
.timer.paused .t { opacity: .6; }
.timer.ringing { background: var(--accent); color: var(--accent-ink); animation: ring 1s ease-in-out infinite; }
@keyframes ring { 50% { transform: scale(1.05); } }

/* --- Réglages ----------------------------------------------------------- */
.form { display: grid; gap: 14px; }
.form label { font-weight: 600; display: grid; gap: 6px; }
.form input { height: 48px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--bg); padding: 0 14px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; }
.form .hint { color: var(--muted); font-size: .9rem; font-weight: 400; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.status { padding: 12px 14px; border-radius: 12px; background: var(--bg); font-size: .95rem; }
.status.ok { color: var(--ok); }
.status.err { color: var(--accent); }
.settings { display: grid; gap: 18px; max-width: 640px; }
.settings ol { padding-left: 1.2em; margin: 6px 0 0; color: var(--muted); }

.toast { position: fixed; left: 50%; top: calc(var(--safe-t) + 14px); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; z-index: 30; font-size: .95rem; box-shadow: var(--shadow); max-width: calc(100% - 32px); }

.rating-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 12px; }
.stars { display: inline-flex; gap: 2px; }
.star { width: 44px; height: 44px; border: 0; background: none; padding: 0; display: grid; place-items: center; color: var(--line-strong); }
.star .icon { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.star.on { color: var(--star); }
.star.on .icon { fill: currentColor; stroke: none; }
.fav { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--card); color: var(--ink); font-weight: 600; font-size: .95rem; }
.fav .icon { width: 20px; height: 20px; color: var(--accent); }
.fav.on { background: var(--accent-soft); border-color: var(--accent); }
.fav.on .icon { fill: var(--accent); }
.made-rating { display: grid; gap: 2px; }
.made-rating > span { font-weight: 650; }
.made-rating .rating-row { margin-top: 0; }
.filters { display: flex; gap: 8px; margin: -6px 0 16px; }
.filter { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--card); color: var(--ink); font-weight: 600; }
.filter .icon { width: 18px; height: 18px; color: var(--accent); }
.filter.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.filter.on .icon { color: inherit; }
.filters { flex-wrap: wrap; }

/* --- Menu (planning des repas) ------------------------------------------ */
.menu-day { margin-bottom: 22px; }
.menu-day h2 { font-size: 1.05rem; margin: 0 0 10px; }
.menu-item { display: flex; align-items: center; gap: 14px; padding: 10px; margin-bottom: 10px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
.menu-item > .icon { flex: none; color: var(--muted); margin-right: 4px; }
.menu-item.note { box-shadow: none; border: 1px dashed var(--line); }
.menu-thumb { position: relative; flex: none; width: 76px; height: 76px; border-radius: 14px; overflow: hidden; background: var(--accent-soft); }
.menu-thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--accent); }
.menu-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.menu-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.menu-type { font-size: .75rem; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.menu-name { font-weight: 650; font-size: 1.08rem; line-height: 1.25; }
.menu-note { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: .9rem; }
.menu-note .icon { width: 15px; height: 15px; }
@media (min-width: 820px) { .menu-day { max-width: 720px; } }
.badge-fav, .badge-stars { position: absolute; top: 8px; display: inline-flex; align-items: center; gap: 3px; padding: 4px 7px; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; font-size: .8rem; font-weight: 700; }
.badge-fav { right: 8px; }
.badge-stars { left: 8px; }
.badge-fav .icon, .badge-stars .icon { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.badge-stars .icon { color: #F2C14E; }
.version { margin-top: 28px; text-align: center; font-size: .85rem; display: grid; gap: 10px; justify-items: center; }
.version a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; }

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

/* --- Mode cuisine sur iPhone : tout doit tenir sur un petit écran --------- */
@media (max-width: 759px) {
  body.cooking .toast { top: calc(var(--safe-t) + 84px); }
  .cook-bar { padding-bottom: 6px; }
  .cook-body { padding: 12px var(--gutter) 14px; gap: 14px; }
  /* Ingrédients de l'étape : pastilles compactes au lieu d'une grande liste. */
  .cook .step-ings { padding: 10px 12px; }
  .cook .step-ings h2 { font-size: .75rem; margin-bottom: 8px; }
  .cook .ing-list { display: flex; flex-wrap: wrap; gap: 6px; }
  .cook .ing-list button { width: auto; gap: 6px; min-height: 44px; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--bg); font-size: 1rem; }
  .cook .ing-list li:first-child button { border-top: 1px solid var(--line-strong); }
  .cook .ing-list .q { min-width: 0; }
  .cook .ing-none { padding: 0; font-size: .95rem; }
  .cook .step-num { min-width: 36px; height: 36px; border-radius: 11px; font-size: 1.1rem; margin-bottom: 10px; }
  .cook .step-text { font-size: 1.22rem; line-height: 1.4; }
  .cook .timer-btn { min-height: 46px; font-size: 1rem; }
  /* « Ensuite » sur une ligne. */
  .next-card { grid-template-columns: auto 1fr; align-items: baseline; gap: 8px; padding: 8px 12px; margin-bottom: 8px; }
  .next-text { -webkit-line-clamp: 1; font-size: .92rem; }
  .next-ings { display: none; }
  .cook-nav { gap: 10px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
  .cook-nav .btn { padding-left: 8px; padding-right: 8px; }
  /* Rien à ajouter : on ne garde pas un cadre vide. */
  .cook .step-ings.empty { display: none; }
  .next-label { max-width: 46vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cook-nav .btn { min-height: 54px; font-size: 1.05rem; border-radius: 16px; }
}

/* Message avec action (« Rétablir ») */
.toast { width: max-content; }
.toast.with-action, body.cooking .toast.with-action { display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 16px; top: auto; bottom: calc(var(--safe-b) + 150px); white-space: nowrap; }
.toast.with-action button { min-height: 44px; padding: 0 14px; border: 0; border-radius: 10px; background: rgba(255,255,255,.18); color: inherit; font-weight: 700; }

/* --- Mode Thermomix ------------------------------------------------------- */
.mode-switch { margin: 14px 0 0; }
.tm-warning { margin-top: 12px; border: 1px solid var(--line-strong); }
.tm-panel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; }
.tm-cell { display: grid; gap: 2px; justify-items: center; padding: 10px 4px; border-radius: 14px; background: var(--ink); color: var(--bg); }
.tm-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; opacity: .75; white-space: nowrap; }
.tm-val { font-size: clamp(1.6rem, 2vw + 1.1rem, 2.4rem); font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tm-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 12px; }
.cook .tm-warning { margin: 0 0 12px; }
@media (max-width: 759px) {
  /* Sur iPhone, les réglages du robot passent avant la liste des ingrédients. */
  .cook-body.tm .step-ings { order: 2; }
  .tm-label { font-size: .62rem; letter-spacing: .02em; }
  .tm-cell { padding: 8px 2px; }
}
