/* ==========================================================================
   Menu & spéciaux — « Carnet de cuisine »
   Un magazine de cuisine : pages ivoire, encre chaude, tomate, safran, olive.
   Fraunces (titres ; l'italique est la voix du magazine) + Schibsted Grotesk (interface).
   ========================================================================== */

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(fonts/fraunces-roman.woff2) format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url(fonts/fraunces-italic.woff2) format('woff2');
}
@font-face {
  font-family: 'Schibsted Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/schibsted-grotesk.woff2) format('woff2');
}

/* ---------- Jetons : édition du jour (clair) ---------- */
:root {
  /* Palette */
  --paper: #f5eee1;      /* page ivoire */
  --page: #fffaf2;       /* feuillet */
  --paper-2: #ece2cf;    /* kraft pâle */
  --ink: #2a1e17;        /* encre espresso */
  --tomato: #b3391e;     /* tomate / paprika */
  --tomato-soft: #f6dccf;
  --saffron: #e0a22a;    /* safran */
  --saffron-soft: #f8e6b6;
  --saffron-ink: #7d4b00;
  --olive: #56602a;
  --olive-soft: #e5e4c8;
  --plum: #6b2f4c;       /* aubergine */
  --plum-soft: #f0e0e7;

  /* Rôles (noms historiques utilisés partout) */
  --bg: var(--paper);
  --surface: var(--page);
  --surface-2: var(--paper-2);
  --text: var(--ink);
  --ink-2: #5a4a3e;
  --muted: #7a6a5c;
  --border: #e2d4bd;
  --border-strong: #cdbb9f;
  --accent: var(--tomato);
  --accent-soft: var(--tomato-soft);
  --accent-text: #fffaf2;
  --hot: var(--saffron-ink);
  --hot-soft: var(--saffron-soft);
  --hot-fill: var(--saffron);
  --ok: var(--olive);
  --ok-soft: var(--olive-soft);
  --warn: #9a6500;
  --danger: #a8261b;
  --fridge: var(--plum);
  --fridge-soft: var(--plum-soft);
  --photo-ink: #fffaf2;

  /* Valeur nutritive */
  --mp: #56602a; --mc: #d0921d; --mf: #8a4a6b;

  /* Typo */
  --serif: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --sans: 'Schibsted Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --fs-xs: .75rem;
  --fs-sm: .875rem;
  --fs-md: 1rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.6rem;
  --fs-2xl: 2.1rem;

  /* Espace (base 4 px) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;

  /* Formes */
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --radius: var(--r-md);
  --shadow: 0 1px 0 rgb(90 60 30 / 5%), 0 12px 28px -18px rgb(90 50 20 / 35%);
  --shadow-lift: 0 2px 0 rgb(90 60 30 / 4%), 0 24px 48px -24px rgb(70 40 15 / 45%);

  --tabs-h: 66px;
  --gutter: 16px;
  --col: 760px;
  --wide: 1180px;
  color-scheme: light;
}

/* ---------- Jetons : édition du soir (sombre, espresso et vin) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1412; --surface: #271c19; --surface-2: #34251f; --text: #f3e8d7; --ink-2: #d7c6b0; --muted: #b5a18c;
    --border: #45332a; --border-strong: #5e4638; --accent: #ec6f4f; --accent-soft: #4b2419; --accent-text: #1c1412;
    --hot: #f2c15a; --hot-soft: #3e2d12; --hot-fill: #e9ae36; --ok: #b7c07a; --ok-soft: #2e3119; --danger: #f07a6a;
    --fridge: #dba6c0; --fridge-soft: #3c2230; --mp: #b7c07a; --mc: #f2c15a; --mf: #d9a1bd;
    --shadow: 0 1px 0 rgb(0 0 0 / 20%), 0 14px 30px -18px rgb(0 0 0 / 70%);
    --shadow-lift: 0 24px 48px -24px rgb(0 0 0 / 80%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1c1412; --surface: #271c19; --surface-2: #34251f; --text: #f3e8d7; --ink-2: #d7c6b0; --muted: #b5a18c;
  --border: #45332a; --border-strong: #5e4638; --accent: #ec6f4f; --accent-soft: #4b2419; --accent-text: #1c1412;
  --hot: #f2c15a; --hot-soft: #3e2d12; --hot-fill: #e9ae36; --ok: #b7c07a; --ok-soft: #2e3119; --danger: #f07a6a;
  --fridge: #dba6c0; --fridge-soft: #3c2230; --mp: #b7c07a; --mc: #f2c15a; --mf: #d9a1bd;
  --shadow: 0 1px 0 rgb(0 0 0 / 20%), 0 14px 30px -18px rgb(0 0 0 / 70%);
  --shadow-lift: 0 24px 48px -24px rgb(0 0 0 / 80%);
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  padding-top: var(--hdr-full, 150px);
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 24px);
  overflow-x: clip;
}
h1, h2 { font-family: var(--serif); font-weight: 500; letter-spacing: -.01em; }
h2 { font-size: var(--fs-lg); font-style: italic; line-height: 1.2; margin: 0 0 var(--s1); }
h3 { font: italic 500 1.05rem/1.3 var(--serif); color: var(--text); margin: var(--s5) 0 var(--s2); }
a { color: var(--accent); text-underline-offset: 3px; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.center { text-align: center; }
[hidden] { display: none !important; }
::selection { background: var(--hot-soft); color: var(--text); }

/* ---------- Mise en page ---------- */
main { padding: 0 var(--gutter); }
.view > :not(.band) { max-width: var(--col); margin-inline: auto; }
.row { display: flex; gap: var(--s2); align-items: center; margin-bottom: 10px; }
.row.wrap { flex-wrap: wrap; }
.row:last-child { margin-bottom: 0; }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }
.block { width: 100%; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); margin-top: var(--s2); }
.list { display: flex; flex-direction: column; gap: var(--s3); }

/* ---------- En-tête : le cartouche posé sur la photo ---------- */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 25; display: block;
  padding: calc(10px + env(safe-area-inset-top)) var(--s4) var(--s3);
  color: var(--photo-ink); background: transparent;
  transition: background-color .3s, color .3s, box-shadow .3s, padding .2s;
}
.top::before {
  content: ''; position: absolute; inset: 0 0 -36px; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgb(24 14 9 / 62%) 0%, rgb(24 14 9 / 28%) 60%, transparent 100%);
  transition: opacity .3s;
}
.top.compact {
  padding-top: calc(8px + env(safe-area-inset-top)); padding-bottom: var(--s2);
  color: var(--text);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 1px 0 var(--border);
}
.top.compact::before { opacity: 0; }
.masthead {
  display: flex; align-items: center; gap: var(--s3); max-width: var(--wide); margin: 0 auto 4px;
  font: italic 400 1rem/1 var(--serif); letter-spacing: .01em; white-space: nowrap;
}
.masthead::before, .masthead::after { content: ''; flex: 1; height: 1px; background: currentColor; opacity: .4; }
.masthead i { font-weight: 300; }
.top.compact .masthead { display: none; }

.top-row { display: flex; align-items: center; gap: var(--s2); max-width: var(--wide); margin: 0 auto; }
.week-card { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s1); height: 56px; transition: height .2s; }
.wk-btn {
  flex: none; width: 36px; height: 36px; border-radius: 50%; padding: 0; cursor: pointer; display: grid; place-items: center;
  border: 1px solid color-mix(in srgb, currentColor 38%, transparent); background: transparent; color: inherit;
}
.wk-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wk-btn:not(:disabled):hover { background: color-mix(in srgb, currentColor 12%, transparent); }
.wk-btn:disabled { opacity: .25; cursor: default; }
.wk-btn.soft { opacity: .5; }
.wk-center { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 3px; }
.wk-center h1 {
  margin: 0; font: italic 500 1.6rem/1.05 var(--serif); letter-spacing: -.015em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.top:not(.compact) .wk-center h1 { text-shadow: 0 1px 12px rgb(0 0 0 / 30%); }
.wk-sub { font-size: .7rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; opacity: .88; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.wk-sub .wk-next { background: var(--saffron); color: #2a1e17; padding: 1px 8px; border-radius: 99px; font-weight: 700; }
.top.compact .week-card { height: 40px; }
.top.compact .wk-center h1 { font-size: 1.2rem; }
.top.compact .wk-sub { display: none; }
.top.compact .wk-btn { width: 32px; height: 32px; }

.round-btn {
  flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; padding: 0;
  color: inherit; font-size: 1.1rem;
  border: 1px solid color-mix(in srgb, currentColor 38%, transparent);
  background: rgb(255 250 242 / 10%);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.top.compact .round-btn { background: transparent; width: 38px; height: 38px; }
.round-btn:active { transform: scale(.95); }
.icon-btn { background: transparent; border: 0; color: inherit; font-size: 1.15rem; padding: 6px 10px; border-radius: 10px; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }

/* Épiceries choisies */
.storebar {
  display: flex; gap: var(--s2); overflow-x: auto; scrollbar-width: none; max-width: var(--wide); margin: var(--s3) auto 0; padding: 2px 0;
  max-height: 60px; transition: max-height .25s, opacity .2s, margin .25s; cursor: pointer;
}
.storebar::-webkit-scrollbar { display: none; }
.sb-pill {
  flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px 4px 4px; border-radius: 999px; position: relative;
  font-size: .8rem; font-weight: 600; white-space: nowrap;
  background: rgb(28 18 12 / 30%); border: 1px solid rgb(255 250 242 / 28%); color: var(--photo-ink);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.sb-pill img, .sb-pill .ph { width: 28px; height: 28px; border-radius: 50%; background: #fff; object-fit: contain; padding: 2px; }
.sb-pill .ph { display: grid; place-items: center; color: var(--tomato); font-size: .8rem; font-weight: 800; padding: 0; }
.sb-pill.loc { padding-left: 12px; }
.sb-pill.edit { padding-left: 14px; padding-right: 14px; background: #fffaf2; color: #2a1e17; border-color: #fffaf2; }
.sb-pill.cta { padding: 10px 18px; background: var(--tomato); border-color: var(--tomato); color: #fffaf2; font-size: .9rem; }
.sb-state { width: 8px; height: 8px; border-radius: 50%; background: rgb(255 255 255 / 45%); margin-left: 2px; }
.sb-state.ok { background: #c5d08a; }
.sb-state.err { background: #ff9a85; }
.sb-state.loading { background: none; border: 2px solid rgb(255 255 255 / 40%); border-top-color: #fff; width: 10px; height: 10px; animation: spin .8s linear infinite; }
.top.compact .storebar { max-height: 0; opacity: 0; margin-top: 0; pointer-events: none; }

.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: transparent; overflow: hidden; }
.progress div { height: 100%; width: 0; background: var(--saffron); transition: width .3s; }

/* ---------- Bandeaux photo (ouverture de rubrique) ---------- */
.band {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  margin: calc(-1 * var(--hdr-full, 150px)) calc(50% - 50vw) var(--s6);
  min-height: calc(var(--hdr-full, 150px) + 210px);
  color: var(--photo-ink); background: #2a1e17;
}
.band-hero { min-height: max(calc(var(--hdr-full, 150px) + 320px), 66vh); min-height: max(calc(var(--hdr-full, 150px) + 320px), 66svh); }
.band-media, .interlude-media, .rv-hero { overflow: hidden; }
.band-media { position: absolute; inset: 0; z-index: -1; }
.band-media img, .interlude-media img {
  position: absolute; left: 0; top: -20%; width: 100%; height: 140%; object-fit: cover; display: block;
  will-change: transform;
}
.band-media::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgb(24 14 9 / 40%) 0%, rgb(24 14 9 / 0%) 34%, rgb(24 14 9 / 8%) 50%, rgb(24 14 9 / 82%) 100%);
}
.band-text { width: 100%; max-width: calc(var(--col) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter) 30px; }
.kicker {
  display: flex; align-items: center; gap: 10px; margin: 0 0 var(--s3);
  font: 700 .7rem/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: #f4c96b;
}
.kicker::before { content: ''; width: 26px; height: 1px; background: currentColor; }
.band-title {
  margin: 0; max-width: 15ch; text-wrap: balance;
  font: italic 400 clamp(2.05rem, 9vw, 3.9rem)/1.02 var(--serif); letter-spacing: -.02em;
  text-shadow: 0 2px 24px rgb(0 0 0 / 25%);
}
.band-dek { margin: var(--s3) 0 0; max-width: 36ch; font-size: 1rem; line-height: 1.45; opacity: .92; }
.band-credit { position: absolute; right: 14px; bottom: 10px; margin: 0; font-size: .62rem; letter-spacing: .04em; opacity: .62; }
.band:not(.band-hero) .band-title { font-size: clamp(1.9rem, 8vw, 3.1rem); }
.band:not(.band-hero) .band-text { padding-bottom: 26px; }

/* Intermède photo entre deux sections (semaine → épicerie) */
.interlude {
  position: relative; isolation: isolate; overflow: hidden; height: 230px; color: var(--photo-ink); background: #2a1e17;
  margin: var(--s6) calc(50% - 50vw);
}
.interlude-media { position: absolute; inset: 0; z-index: -1; }
.interlude-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgb(24 14 9 / 72%), rgb(24 14 9 / 10%) 75%); }
.interlude figcaption {
  position: absolute; left: 0; right: 0; bottom: 26px; max-width: calc(var(--col) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter);
  font: italic 400 2rem/1.05 var(--serif); letter-spacing: -.015em;
}
.interlude figcaption span { display: block; margin-bottom: 10px; font: 700 .7rem/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: #f4c96b; }
#weekList:has(> .empty) + .interlude { display: none; }

/* ---------- Formulaires ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 18px; margin-bottom: var(--s4); box-shadow: var(--shadow);
}
.panel h2 { font-size: 1.35rem; margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.field > span { font-size: .8rem; color: var(--muted); font-weight: 600; }
input, select, textarea {
  font: inherit; font-size: 1rem; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-sm); padding: 10px 14px; min-height: 46px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: color-mix(in srgb, var(--muted) 85%, transparent); }
input:focus, select:focus, textarea:focus { border-color: var(--text); }
select { width: auto; }
input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex: none; margin: 0; padding: 0; cursor: pointer;
  width: 22px; height: 22px; min-height: 0; border-radius: 6px; border: 1.5px solid var(--border-strong); background: var(--surface);
  display: inline-grid; place-items: center;
}
input[type="checkbox"]:checked {
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fffaf2' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/15px no-repeat;
  border-color: var(--accent);
}
input[type="range"] { padding: 0; accent-color: var(--accent); background: transparent; border: 0; min-height: 30px; }
input[type="number"] { max-width: 120px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
dialog:focus-visible { outline: none; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.check { display: flex; gap: 12px; align-items: center; padding: 8px 0; cursor: pointer; }
select option { background-color: var(--surface); color: var(--text); font-weight: 600; }

/* ---------- Boutons ---------- */
.btn {
  font: 600 .93rem/1.2 var(--sans); letter-spacing: .005em; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  padding: 11px 20px; min-height: 46px; border-radius: 999px;
  transition: background-color .15s, border-color .15s, transform .1s, box-shadow .15s;
}
.btn:hover { border-color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--accent); color: var(--accent-text); border-color: var(--accent);
  box-shadow: 0 10px 22px -14px color-mix(in srgb, var(--accent) 90%, transparent);
}
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn.danger { color: var(--danger); }
.btn.danger-fill { background: var(--danger); color: #fff; border-color: transparent; }
.btn:disabled, .btn.primary:disabled { background: var(--surface-2); color: var(--muted); border-color: var(--border); box-shadow: none; cursor: default; }
.btn.block { white-space: normal; }
.btn.big { padding: 16px 20px; font-size: 1.02rem; margin-top: var(--s1); }
.actions { margin: var(--s5) 0; }
.actions .btn.primary { grid-column: 1 / -1; }
.more { margin: var(--s4) auto; display: block; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Pastilles, segments ---------- */
.chip {
  font: 500 .86rem/1.2 var(--sans); cursor: pointer; white-space: nowrap;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  padding: 8px 14px; border-radius: 999px; transition: background-color .15s, border-color .15s;
}
.chip:hover { border-color: var(--text); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip.filter-chip { font-weight: 700; border-style: dashed; }
.chip.filter-chip.on { border-style: solid; }
.chip.active-chip { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 600; }
.chips-scroll { display: flex; gap: var(--s2); overflow-x: auto; padding: 2px 0 var(--s2); scrollbar-width: none; }
.chips-scroll::-webkit-scrollbar { display: none; }
.chips-wrap { display: flex; gap: var(--s2); flex-wrap: wrap; }
.badge { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-text); font-size: .7rem; font-weight: 700; line-height: 18px; text-align: center; }

.seg { display: flex; gap: 2px; margin-top: var(--s2); padding: 3px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); }
.seg button {
  flex: 1; border: 0; background: transparent; color: var(--muted); font: 600 .86rem/1.2 var(--sans); cursor: pointer;
  padding: 9px 8px; border-radius: 999px; transition: background-color .15s, color .15s;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--text); color: var(--bg); }
.small-seg { margin: 0 0 var(--s2); }
.seg-label { margin: var(--s4) 0 0; font-size: .92rem; line-height: 1.4; }
.week-seg { margin: 0 0 var(--s5); }

/* ---------- Outils des recettes ---------- */
.rtools {
  display: flex; flex-direction: column; gap: var(--s3); margin: var(--s5) auto var(--s2);
  padding: var(--s4) 0 var(--s3); border-top: 2px solid var(--text); border-bottom: 1px solid var(--border);
}
.rsearch {
  display: flex; align-items: center; gap: 10px; padding: 0 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border-strong);
}
.rsearch:focus-within { border-color: var(--text); }
.rsearch .ico { display: grid; color: var(--muted); }
.rsearch .ico svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.rsearch input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 12px 0; min-height: 0; outline: none; box-shadow: none; }
.rtools .chips-scroll { margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
.rtools-row { display: flex; align-items: center; gap: 6px; }
.rtools-row .spacer { display: block; flex: 1; }
.tool-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 99px; cursor: pointer; white-space: nowrap; flex: none;
  border: 1px solid var(--border-strong); background: var(--surface); color: inherit; font: 600 .84rem var(--sans);
}
.tool-btn:hover { border-color: var(--text); }
.tool-btn.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.tool-btn.icon-only { width: 38px; padding: 0; justify-content: center; font-size: .95rem; }
.rtools-row .sort-pill.tool-btn { padding-right: 8px; flex: 0 1 auto; max-width: 100%; min-width: 0; }
.sort-pill select {
  border: 0; background: transparent; color: var(--text); font: 600 .84rem var(--sans); padding: 0 2px; height: 34px; min-height: 0;
  outline: none; cursor: pointer; border-radius: 0; width: auto; flex: 0 1 auto; min-width: 0; text-overflow: ellipsis;
}
.manage-btn.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.import { display: flex; gap: var(--s2); margin-bottom: 10px; }
.import input { flex: 1; min-width: 0; }
.rimport { margin: 0; }
.rcount { font-size: .8rem; letter-spacing: .02em; color: var(--muted); margin: var(--s2) auto var(--s4); }

/* ---------- Cartes recette (l'image d'abord) ---------- */
#recipeList { gap: var(--s6) var(--s5); }
.rcard {
  position: relative; display: flex; flex-direction: column; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow);
  transition: box-shadow .2s;
}
@media (hover: hover) {
  .rcard:hover { box-shadow: var(--shadow-lift); }
  .rcard:hover > img { transform: scale(1.03); }
}
.rcard > img, .rcard > .noimg { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; background-color: var(--surface-2); transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.rcard .body { padding: 16px 18px 18px; min-width: 0; }
.rcard .title { font: 500 1.35rem/1.16 var(--serif); letter-spacing: -.012em; text-wrap: balance; }
.rcard .meta { font-size: .8rem; color: var(--muted); margin-top: 6px; }
.rcard.in-week { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.rcard.in-week::after {
  content: 'Au menu'; position: absolute; top: 14px; left: 14px; padding: 6px 11px; border-radius: 99px;
  background: var(--accent); color: var(--accent-text); font: 700 .66rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase;
}
.rcard.picking.in-week::after { display: none; }
.rcard .add, .rcard .eye {
  position: absolute; right: 12px; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; padding: 0; cursor: pointer;
  background: rgb(255 250 242 / 92%); color: #2a1e17; border: 0; box-shadow: 0 4px 14px -4px rgb(0 0 0 / 35%);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.rcard .add { top: 12px; font: 400 1.55rem/1 var(--sans); color: var(--tomato); }
.rcard .eye { top: 62px; color: #6b5a4c; opacity: 1; }
.rcard .eye:hover { color: #2a1e17; }
.rcard .eye .ico-eye { width: 18px; height: 18px; }
.in-week .add, .rcard.in-week .add { background: var(--accent); color: var(--accent-text); font-size: 1.1rem; font-weight: 700; }
.rcard .pick {
  position: absolute; top: 12px; left: 12px; z-index: 2; width: 28px; height: 28px; border-radius: 8px; border: 2px solid #fff;
  background: rgb(0 0 0 / 35%); color: #fff; display: grid; place-items: center; font-weight: 800; box-shadow: 0 1px 4px rgb(0 0 0 / 40%);
}
.rcard.picked { outline: 2.5px solid var(--accent); outline-offset: -2px; }
.rcard.picked .pick { background: var(--accent); border-color: var(--accent); }
.rcard.leaving { opacity: 0; transform: scale(.97); transition: opacity .18s, transform .18s; }
.noimg { background: var(--surface-2) url(img/epices.webp) center / cover no-repeat; }

.macros { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.macro { font: 600 .74rem/1.2 var(--sans); background: var(--surface-2); color: var(--ink-2); padding: 4px 10px; border-radius: 999px; }
.macro.p { background: var(--ok-soft); color: var(--ok); }
.rtags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rtag { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 600; color: var(--muted); border: 1px solid var(--border); padding: 2px 9px 2px 6px; border-radius: 99px; line-height: 1.5; }
.rtag span { font-size: .8rem; }
.dealbar { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border-strong); font-size: .8rem; line-height: 1.4; }
.dealbar b { color: var(--hot); }
.dealbar .bar { height: 4px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.dealbar .bar div { height: 100%; background: var(--hot-fill); border-radius: 99px; }
.fridge-badge { margin-top: 8px; font-size: .78rem; font-weight: 700; color: var(--fridge); background: var(--fridge-soft); padding: 3px 10px; border-radius: 99px; display: inline-block; }

/* Masquées / gérer */
.hidden-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-radius: var(--r-md); background: var(--surface-2); margin-bottom: var(--s3); font-size: .9rem; }
.recipe-manage { display: flex; flex-wrap: wrap; gap: var(--s2); padding-top: 6px; }
.view > .manage-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabs-h) + 8px + env(safe-area-inset-bottom));
  width: min(560px, calc(100% - 24px)); max-width: none; margin: 0; z-index: 30;
  background: var(--surface); border: 1px solid var(--accent); border-radius: var(--r-lg); padding: 14px 16px; box-shadow: var(--shadow-lift);
}
.manage-bar .mb-top { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); font-size: .92rem; }
.manage-bar .mb-actions { display: flex; gap: var(--s2); margin-top: 10px; }
.manage-bar .mb-actions .btn { flex: 1; }
.manage-bar .btn[disabled] { opacity: .45; }
.manage-bar p { margin: 8px 0 0; }
section[data-view="recipes"]:has(.manage-bar:not([hidden])) #recipeList { padding-bottom: 150px; }
.ico-eye { width: 1.05em; height: 1.05em; vertical-align: -0.17em; flex: none; }
.linkish .ico-eye { margin-right: 2px; }

/* ---------- Mon frigo (encadré illustré) ---------- */
.fridge { position: relative; overflow: hidden; padding-right: 128px; }
.fridge::after {
  content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 112px;
  background: url(img/frigo.webp) center / cover no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 30%); mask-image: linear-gradient(90deg, transparent, #000 30%);
}
.fridge:has(#fridgePicker:not([hidden])), .fridge.has-items { padding-right: 18px; }
.fridge:has(#fridgePicker:not([hidden]))::after, .fridge.has-items::after { display: none; }
.fridge h2 { margin: 0; }
.fridge > p { margin: 6px 0 0; line-height: 1.45; }
.fridge .chips-wrap:not(:empty) { margin-top: var(--s3); }
.fridge .import { margin: 10px 0 0; }
.fridge-toggle { margin-top: 14px; }
.fridge-picker { margin-top: var(--s3); }
.fridge-picker input { width: 100%; }
.fridge-group h3 { margin: var(--s4) 0 var(--s2); font-size: .98rem; }
.fridge-item { background: var(--fridge-soft); color: var(--fridge); }
.chip.fridge-chip.on, .chip.fridge-pick.on { background: var(--fridge); color: var(--surface); border-color: var(--fridge); }
.deal-tag.fridge-tag { background: var(--fridge-soft); color: var(--fridge); }

/* ---------- Ma semaine ---------- */
.week-row {
  display: grid; grid-template-columns: 92px 1fr auto; gap: 16px; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.week-row:first-child { border-top: 2px solid var(--text); }
.week-row img, .week-row .noimg { width: 92px; height: 92px; border-radius: var(--r-xs); object-fit: cover; background-color: var(--surface-2); }
.week-row .title { font: 500 1.18rem/1.2 var(--serif); letter-spacing: -.01em; cursor: pointer; margin-bottom: 2px; }
.week-row .title:hover { color: var(--accent); }
.week-row .add {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border-strong); background: transparent; color: var(--muted);
  font-size: .95rem; cursor: pointer; display: grid; place-items: center; padding: 0;
}
.week-row .add:hover { color: var(--danger); border-color: var(--danger); }
.week-row .chev { align-self: center; }
.stepper { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border-strong); border-radius: 999px; padding: 2px; background: var(--surface); }
.stepper button { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--text); font-size: 1.05rem; cursor: pointer; }
.stepper button:hover { background: var(--text); color: var(--bg); }
.stepper span { min-width: 72px; text-align: center; font-size: .84rem; font-weight: 600; }
.small-step button { width: 28px; height: 28px; }
.small-step span { min-width: 22px; }
#weekCurrent > .panel { margin-top: var(--s5); }
#weekCurrent > p.small { margin-top: var(--s4); line-height: 1.45; }
.new-week { margin-top: 10px; }

/* Historique */
.hist-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.hist-stats .stat b { display: block; font: 500 1.6rem/1.1 var(--serif); }
.hist-stats .stat span { font-size: .76rem; color: var(--muted); }
.hist-top { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); cursor: pointer; font-size: .92rem; }
.hist-top:last-child { border-bottom: 0; }
.hist-card {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px; margin-bottom: 10px; box-shadow: var(--shadow);
}
.hist-card .grow { min-width: 0; }
.hist-card b { font: 500 1.05rem var(--serif); }
.hist-card small { display: block; font-size: .78rem; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-card .saved { color: var(--ok); font-weight: 600; }
.hist-imgs { display: flex; flex: none; }
.hist-imgs img, .hist-imgs .noimg { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; border: 2px solid var(--surface); background-color: var(--surface-2); display: grid; place-items: center; }
.hist-imgs > * + * { margin-left: -14px; }
.chev { color: var(--muted); font-size: 1.3rem; }
.hist-head { display: flex; gap: 12px; align-items: center; padding: calc(16px + env(safe-area-inset-top)) 16px 6px; }
.hist-head h1 { font: italic 500 1.6rem/1.15 var(--serif); margin: 0; }
.hline { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: .92rem; }
.hline small { display: block; color: var(--muted); font-size: .76rem; }

/* Semaine des circulaires (anciens sélecteurs, conservés) */
.week-switch { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px; margin: 10px 0; }
.wk-row { display: flex; flex-direction: column; gap: 8px; }
.wk-lbl { font-size: .78rem; font-weight: 700; color: var(--muted); }
.wk-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; }
.wk-seg button { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 6px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: inherit; cursor: pointer; }
.wk-seg button.on { background: var(--text); color: var(--bg); }
.wk-ask { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: .9rem; }
.week-nav, .week-head { display: none; }
.week-ask { padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
.week-ask h2 { margin: 0; font-size: var(--fs-xl); }
.week-ask p { margin: 0 0 6px; line-height: 1.45; }
.week-ask .btn small { display: block; font-weight: 500; opacity: .8; font-size: .78rem; }

/* ---------- Épicerie ---------- */
#grocerySummary { font: italic 500 1.45rem/1.2 var(--serif); letter-spacing: -.01em; }
.staples h2 { margin: 0; }
.staples .import { margin: 10px 0 0; }
.staples > .btn.block { margin-top: var(--s3); }
.staple-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--ok-soft); color: var(--ok); border: 0; font: 600 .86rem var(--sans); padding: 7px 10px 7px 14px; border-radius: 999px; cursor: pointer; }
.staple-chip span { opacity: .7; font-size: .8rem; }
.tag-essentiel { display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .04em; background: var(--ok-soft); color: var(--ok); border-radius: 999px; padding: 1px 8px; margin-left: 6px; vertical-align: 2px; }
.suggest-title { font-weight: 700; margin: 16px 0 8px; font-size: .92rem; }
.suggest-row { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.sugg { flex: none; width: 150px; display: flex; flex-direction: column; gap: 4px; background: var(--surface-2); border-radius: var(--r-md); padding: 10px; }
.sugg small { color: var(--muted); font-size: .74rem; }
.sale-banner {
  display: flex; align-items: center; gap: 12px; width: 100%; margin: var(--s3) 0; padding: 14px 16px; cursor: pointer; text-align: left;
  border-radius: var(--r-md); border: 1px solid color-mix(in srgb, var(--hot-fill) 45%, transparent); background: var(--hot-soft); color: var(--text); font: inherit;
}
.sale-banner .big { font-size: 1.5rem; }
.sale-banner b { display: block; }
.sale-banner small { color: var(--muted); font-size: .8rem; }
.sale-banner .chev { font-size: 1.4rem; color: var(--hot); }

#groceryList { margin-top: var(--s6); }
.store-block {
  margin-bottom: var(--s5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 4px 18px 8px; box-shadow: var(--shadow);
}
.store-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 0; padding: 16px 0 10px; }
.store-head b { font: italic 500 1.35rem/1.2 var(--serif); letter-spacing: -.01em; }
details.store-block > summary { cursor: pointer; list-style: none; }
details.store-block > summary::-webkit-details-marker { display: none; }
.aisle-head {
  font: 700 .7rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
  padding: 18px 0 8px; border-top: 1px solid var(--border); margin-top: 4px;
}
.store-block .store-head + .aisle-head { border-top: 2px solid var(--text); margin-top: 0; }
.gline {
  display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; align-items: start; cursor: pointer;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.gline:last-child { border-bottom: 0; }
.gline input { margin-top: 1px; }
.gline.done { opacity: .5; }
.gline.done .gname { text-decoration: line-through; text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; }
.gname { font-weight: 600; line-height: 1.35; }
.gname .buy { font-weight: 700; color: var(--accent); white-space: nowrap; }
.gname .buy small, .gname .need { font-weight: 500; color: var(--muted); font-size: .76rem; }
.gsub { font-size: .78rem; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.gprice { text-align: right; font-size: .84rem; white-space: nowrap; line-height: 1.45; }
.gprice b { display: block; font: 600 1.05rem var(--serif); }
.gprice s.was { font-size: .78rem; }
.gline .st { display: inline-block; margin-top: 5px; font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.gline .st.sale { background: var(--hot-soft); color: var(--hot); }
.gline .st.reg { background: var(--surface-2); color: var(--muted); }
.st.soon { background: var(--accent-soft); color: var(--accent); margin-left: 4px; }
.elsewhere { margin-top: 6px; font-size: .78rem; color: var(--hot); background: var(--hot-soft); border-radius: 8px; padding: 5px 10px; display: inline-block; line-height: 1.4; }
.home-ico { width: 22px; height: 22px; border-radius: 50%; background: var(--fridge); color: var(--surface); display: grid; place-items: center; font-size: .78rem; margin-top: 2px; }

/* Anciennes vues de plan (conservées) */
.coverage { list-style: none; padding: 0; margin: 8px 0 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.coverage li { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; font-size: .88rem; }
.coverage li.ok { background: var(--ok-soft); }
.cart-group { margin-bottom: 12px; }
.cart-row { display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; margin-bottom: 6px; }
.cart-row img { width: 44px; height: 44px; object-fit: contain; background: #fff; border-radius: 8px; }
.cart-row .grow { font-size: .88rem; line-height: 1.25; }
.preview pre { white-space: pre-wrap; font-size: .78rem; background: var(--surface-2); padding: 10px; border-radius: 10px; max-height: 320px; overflow: auto; }
.preview summary { cursor: pointer; margin-top: 12px; color: var(--muted); }
.merchant { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; overflow: hidden; }
.merchant-head { display: flex; gap: 10px; align-items: center; padding: 10px 12px; font-weight: 600; }
.merchant-head img { width: 32px; height: 32px; object-fit: contain; border-radius: 8px; background: #fff; flex: none; }
.flyer { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--border); cursor: pointer; }
.flyer .meta { flex: 1; min-width: 0; }
.status { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.status.ok { color: var(--ok); }
.status.err { color: var(--danger); }
.toolbar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 8px 0 10px; }
.sticky-cta { position: sticky; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 8px); padding-top: 8px; }

/* ---------- Spéciaux ---------- */
.sticky-search {
  position: sticky; top: var(--hdr-h, 110px); z-index: 10; background: var(--bg);
  padding: 12px 0 8px; margin-bottom: var(--s3);
  box-shadow: 0 0 0 100vmax var(--bg); clip-path: inset(0 -100vmax -1px);
  border-bottom: 1px solid var(--border);
}
.sticky-search .row.small { flex-wrap: wrap; gap: 6px 8px; margin-top: 4px; }
.sticky-search select { min-height: 38px; padding: 6px 12px; border-radius: 999px; font-size: .86rem; font-weight: 600; }
.sticky-search #q { border-radius: 999px; }
#recipeCount { flex: 1 1 100%; }
.group-title { font: 700 .7rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 26px 2px 10px; }

.deal {
  display: grid; grid-template-columns: 84px 1fr auto; gap: 14px; align-items: start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px; box-shadow: var(--shadow);
}
.deal.in-cart { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.deal img { width: 84px; height: 84px; object-fit: contain; background: #fff; border-radius: var(--r-sm); padding: 4px; }
.deal .name { font: 600 .98rem/1.3 var(--sans); }
.deal .desc { font-size: .8rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 3px; }
.deal .prices { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-top: 6px; }
.price { font: 600 1.35rem/1 var(--serif); letter-spacing: -.01em; }
.price small { font: 500 .78rem var(--sans); color: var(--muted); }
.was { text-decoration: line-through; color: var(--muted); font-size: .82rem; }
s.was { font-weight: 500; opacity: .85; }
.deal-tag s.was, .cdeal s.was { color: inherit; opacity: .6; font-size: .9em; }
.unit { font-size: .8rem; color: var(--muted); }
.pct { background: var(--hot-fill); color: #2a1e17; font-weight: 800; font-size: .76rem; padding: 3px 9px; border-radius: 999px; letter-spacing: .01em; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; font-size: .74rem; }
.tag { background: var(--surface-2); color: var(--muted); padding: 2px 9px; border-radius: 999px; }
.tag.store { color: var(--text); font-weight: 600; }
.flipp-link { font-size: .74rem; font-weight: 600; color: var(--accent); text-decoration: none; white-space: nowrap; }
.flipp-link:hover { text-decoration: underline; }
.tags .flipp-link { margin-left: auto; align-self: center; }
a.deal-tag { text-decoration: none; }
.add { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 1.2rem; cursor: pointer; line-height: 1; padding: 0; }
.add:hover { border-color: var(--text); }
.in-cart .add { background: var(--accent); color: var(--accent-text); border-color: transparent; }

.cmp { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: var(--s2); overflow: hidden; }
.cmp summary { list-style: none; display: flex; gap: 10px; align-items: center; padding: 14px 16px; cursor: pointer; }
.cmp summary::-webkit-details-marker { display: none; }
.cmp summary .grow b { display: block; font: 500 1.05rem var(--serif); }
.cmp summary .best { text-align: right; font-size: .85rem; }
.cmp summary .best b { font: 600 1.1rem var(--serif); color: var(--accent); }
.cmp-row { display: flex; gap: 10px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--border); font-size: .88rem; }
.cmp-row .grow { line-height: 1.35; }
.cmp-row.in-cart { background: var(--accent-soft); }

/* ---------- États vides illustrés ---------- */
.empty { text-align: center; color: var(--muted); padding: 44px 16px; line-height: 1.5; }
#recipeList > .empty:not(:has(.spinner)),
#weekList > .empty,
#groceryList > .empty:not(:has(.spinner)) {
  padding: 0 0 var(--s6); color: var(--text); font: italic 400 1.25rem/1.4 var(--serif); text-wrap: balance;
}
#recipeList > .empty:not(:has(.spinner))::before,
#weekList > .empty::before,
#groceryList > .empty:not(:has(.spinner))::before {
  content: ''; display: block; aspect-ratio: 3 / 2; margin: 0 0 var(--s5); border-radius: var(--r-md);
  background: var(--surface-2) url(img/carnet.webp) center / cover no-repeat; box-shadow: var(--shadow);
}
#groceryList > .empty:not(:has(.spinner))::before { background-image: url(img/panier.webp); }
.empty b { font-style: normal; font-weight: 600; font-family: var(--sans); font-size: .92em; color: var(--accent); }
#recipeList > .empty, #recipeList > .hidden-banner { grid-column: 1 / -1; }

/* ---------- Feuilles (dialogues) ---------- */
.sheet {
  border: 0; padding: 0; width: 100%; max-width: 580px; max-height: 90vh; margin: auto auto 0;
  border-radius: var(--r-lg) var(--r-lg) 0 0; background: var(--bg); color: var(--text); box-shadow: var(--shadow-lift);
}
.sheet::backdrop { background: rgb(28 18 12 / 55%); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.sheet form { padding: 0 20px 18px; }
.sheet-head {
  position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--bg); padding: 20px 0 12px; margin-bottom: var(--s2); border-bottom: 1px solid var(--border);
}
.sheet-head h2 { margin: 0; font-size: 1.7rem; line-height: 1.1; }
.sheet-head p { margin: 4px 0 0; }
.sheet-foot {
  position: sticky; bottom: 0; display: flex; gap: var(--s2); justify-content: space-between; align-items: center;
  background: var(--bg); padding: 14px 0 calc(4px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); margin-top: var(--s4);
}
@media (min-width: 700px) { .sheet { border-radius: var(--r-lg); margin: auto; } }
@media (prefers-reduced-motion: no-preference) {
  .sheet[open] { animation: sheet-up .34s cubic-bezier(.2, .8, .2, 1); }
  .sheet[open]::backdrop { animation: fade .3s ease; }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.excl { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--border); }
.excl .grow div { font-size: .78rem; color: var(--muted); }
.excl button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1rem; }

/* Mes épiceries */
.where { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 8px 0 4px; }
.where-field { display: flex; flex-direction: row; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 999px; padding: 4px 18px; }
.where-field span { white-space: nowrap; font-size: .82rem; font-weight: 600; color: var(--muted); }
.where-field input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0; min-height: 40px; text-align: right; font: 600 1.15rem var(--serif); letter-spacing: .08em; text-transform: uppercase; }
.where-field input:focus-visible { outline: none; }
.where-field:focus-within { border-color: var(--text); }
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s2); margin: var(--s4) 0; }
.store-tile {
  position: relative; display: flex; flex-direction: row; align-items: center; gap: 12px; text-align: left; cursor: pointer;
  min-height: 70px; padding: 10px 14px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font: inherit; transition: border-color .15s, background-color .15s, transform .1s;
}
.store-tile:hover { border-color: var(--border-strong); }
.store-tile:active { transform: scale(.98); }
.store-tile img, .store-tile .ph { width: 42px; height: 42px; flex: none; border-radius: 50%; object-fit: contain; background: #fff; border: 1px solid var(--border); padding: 3px; }
.store-tile .ph { display: grid; place-items: center; font-weight: 800; color: var(--accent); padding: 0; }
.store-tile .st-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.store-tile .st-text b, .store-tile .st-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.store-tile b { font-size: .96rem; line-height: 1.2; }
.store-tile small { font-size: .74rem; color: var(--muted); line-height: 1.3; }
.store-tile .tick {
  flex: none; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--border-strong);
  display: grid; place-items: center; font-size: .78rem; color: transparent; background: var(--surface);
}
.store-tile.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
.store-tile.on .tick { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.store-tile.none { opacity: .55; }
.small-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.small-grid .store-tile { min-height: 56px; }
.small-grid .store-tile img, .small-grid .store-tile .ph { width: 32px; height: 32px; }
.others { margin-top: 4px; }
.others summary { list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: var(--surface-2); border-radius: var(--r-md); cursor: pointer; font-weight: 600; }
.others summary::-webkit-details-marker { display: none; }
.others summary::after { content: '▾'; color: var(--muted); margin-left: 8px; }
.others[open] summary::after { content: '▴'; }
.others summary b { margin-left: auto; font-size: .8rem; color: var(--muted); }
.others input { margin-top: 10px; }
.chain { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.chain img { width: 34px; height: 34px; object-fit: contain; background: #fff; border-radius: 8px; }
.chain .grow div { font-size: .78rem; color: var(--muted); }

/* Filtres des recettes */
.rf-sec { border-top: 1px solid var(--border); padding: 4px 0 18px; }
.rf-sec:first-of-type { border-top: 0; }
.rf-sec h3 { margin: 16px 0 10px; }
#recipeFiltersDlg .chips-wrap { gap: 8px; }
#recipeFiltersDlg .chips-wrap .chip { padding: 9px 15px; font-size: .9rem; }
#recipeFiltersDlg .seg { margin-top: 0; }
#recipeFiltersDlg .seg button { font-size: .82rem; padding: 9px 4px; }
.ftile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.ftile-grid.three { grid-template-columns: repeat(3, 1fr); }
.ftile {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; position: relative; cursor: pointer; text-align: center;
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); color: inherit; font: inherit;
}
.ftile b { font-size: .88rem; }
.ftile small { color: var(--muted); font-size: .74rem; display: flex; align-items: center; gap: 4px; }
.ftile.on { border-color: var(--accent); background: var(--accent-soft); }
.ftile.on::after { content: '✓'; position: absolute; top: 6px; right: 9px; color: var(--accent); font-weight: 800; font-size: .85rem; }
.src-badge { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: .82rem; letter-spacing: .02em; }
.src-badge.all { background: var(--accent); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); font-size: .92rem; }
.switch-row:first-of-type { border-top: 0; }
.switch-row input, .switch-row input:checked {
  appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: 99px; background: var(--border-strong); border: 0;
  position: relative; flex: none; cursor: pointer; transition: background-color .15s; background-image: none;
}
.switch-row input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fffaf2; transition: left .15s; box-shadow: 0 1px 3px rgb(0 0 0 / 30%); }
.switch-row input:checked { background: var(--accent); }
.switch-row input:checked::after { left: 21px; }

/* Exclusions */
.excl-active { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 10px; }
.excl-chip { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.excl-chip > span:first-child { font-size: 1.3rem; }
.excl-chip b { display: block; font-size: .9rem; }
.excl-chip small { color: var(--muted); font-size: .75rem; }
.excl-chip .x { color: var(--muted); font-size: 1rem; padding: 0 2px; }
.excl-picker { margin-top: 10px; }
.excl-picker input { width: 100%; }
.chip.excl-pick.on { background: var(--danger); color: #fff; border-color: var(--danger); }
.excl-custom { margin-top: 12px; }

/* Profils */
.profile-btn { font-size: 1.15rem; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 12px 0; }
.profile-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 10px 14px; cursor: pointer; text-align: center;
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface);
}
button.profile-tile { font: inherit; color: inherit; }
.profile-tile.on { border-color: var(--accent); background: var(--accent-soft); }
.profile-tile .pemo { font-size: 2rem; }
.profile-tile b { font: 500 1.05rem var(--serif); }
.profile-tile small { color: var(--muted); font-size: .74rem; }
.profile-tile .icon-btn { position: absolute; top: 4px; right: 4px; font-size: .95rem; color: var(--muted); }
.emo-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.emo-pick { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); font-size: 1.3rem; cursor: pointer; padding: 0; }
.emo-pick.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.me-card { border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-md); padding: 16px; margin: 8px 0 16px; box-shadow: var(--shadow); }
.me-card b { font: 500 1.2rem var(--serif); }
.me-card .pemo { font-size: 2rem; margin-right: 10px; }
.me-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.me-actions .btn { font-size: .85rem; padding: 10px 8px; white-space: normal; }
.pin-form { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.pin-label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; }
.pin-label input { width: 100%; }
.pin-input { font-size: 1.6rem; letter-spacing: .5em; text-align: center; padding: 10px; }
.form-error { color: var(--danger); font-weight: 600; margin: 0; }
#profileBody .btn.block { width: 100%; margin-top: 4px; }
#profilesDlg > form { padding-bottom: 0; }
#profileBody { padding: 0 20px calc(18px + env(safe-area-inset-bottom)); }
#profileBody form.pin-form { padding: 0; }
.admin-badge { font-size: .72rem; font-weight: 700; background: var(--hot-soft); color: var(--hot); padding: 2px 8px; border-radius: 99px; }
.admin-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.admin-row { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.admin-row .pemo { font-size: 1.5rem; }
.profile-btn.on { font-size: 1.2rem; }
.step-kicker { margin: 0; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.icon-btn.danger { color: var(--danger); }

/* Catalogue des essentiels (plein écran) */
.catalog { max-width: var(--col); margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }
.catalog-head { position: sticky; top: 0; z-index: 2; background: var(--bg); padding: calc(16px + env(safe-area-inset-top)) 16px 6px; border-bottom: 1px solid var(--border); }
.catalog-head h2 { margin: 0; font-size: 1.7rem; }
.catalog-head .seg { margin: 12px 0 10px; }
#catalogList { flex: 1; padding: 0 16px 16px; }
.aisle { scroll-margin-top: 200px; }
.aisle h3 { margin: 22px 0 10px; }
.cat-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); cursor: pointer; }
.cat-row .emo { font-size: 1.5rem; width: 32px; text-align: center; flex: none; }
.cat-row .grow { min-width: 0; }
.cat-row b { display: block; font-size: .95rem; }
.cat-row small { display: block; font-size: .76rem; line-height: 1.3; }
.cat-row small.cdeal { color: var(--hot); font-weight: 700; }
.cat-row small.prod { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-row.on { border-color: var(--accent); background: var(--accent-soft); }
.cat-row .toggle { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 1.1rem; cursor: pointer; }
.cat-row .toggle.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.catalog-foot { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--bg); border-top: 1px solid var(--border); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }

/* ---------- Fiche recette (plein écran) ---------- */
.fullscreen { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; border: 0; padding: 0; margin: 0; width: 100%; max-width: 100%; height: 100%; max-height: 100%; background: var(--bg); color: var(--text); overscroll-behavior: contain; }
.fullscreen::backdrop { background: var(--bg); }
.rv { max-width: var(--col); margin: 0 auto; padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
.rv-hero { position: relative; }
.rv-hero:has(img) { height: min(58vh, 520px); background: #2a1e17; }
.rv-hero img { position: absolute; left: 0; top: -20%; width: 100%; height: 140%; max-height: none; object-fit: cover; display: block; background: var(--surface-2); will-change: transform; }
.rv-close {
  position: absolute; z-index: 2; top: calc(12px + env(safe-area-inset-top)); left: 12px; width: 42px; height: 42px; border-radius: 50%; cursor: pointer;
  border: 0; background: rgb(255 250 242 / 90%); color: #2a1e17; font-size: 1rem; box-shadow: 0 4px 14px -4px rgb(0 0 0 / 40%);
}
.rv-close.static { position: static; flex: none; background: var(--surface-2); color: var(--text); box-shadow: none; }
.rv-head { position: relative; padding: 24px 20px 4px; background: var(--bg); }
.rv-hero:has(img) + .rv-head { margin: -44px 12px 0; border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 26px 18px 4px; }
.rv-head h1 { font: 500 clamp(1.9rem, 7.4vw, 2.7rem)/1.06 var(--serif); letter-spacing: -.02em; margin: 0 0 10px; text-wrap: balance; }
.rv-head a { color: var(--accent); }
.rv-head .macros { margin-top: 14px; }
.rv-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 16px 0 6px; padding: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.rv section { padding: 0 20px; }
.rv h2 { margin: 34px 0 12px; font-size: 1.75rem; padding-bottom: 10px; border-bottom: 2px solid var(--text); }
.ing { display: grid; grid-template-columns: 112px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: .95rem; line-height: 1.4; }
.ing .amt { font: 600 1rem/1.3 var(--serif); }
.ing .amt small { display: block; font: 500 .76rem var(--sans); color: var(--muted); }
.ing .deal-tag { display: inline-block; margin-top: 4px; font-size: .74rem; background: var(--hot-soft); color: var(--hot); padding: 2px 9px; border-radius: 999px; font-weight: 600; }
.ing.pantry { color: var(--muted); }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 14px 0 14px 48px; border-bottom: 1px solid var(--border); line-height: 1.6; cursor: pointer; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 10px; width: 34px; text-align: center;
  font: italic 400 1.9rem/1 var(--serif); color: var(--accent);
}
.steps li.done { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1.5px; text-decoration-color: var(--muted); }
.steps li.done .q { background: transparent; color: var(--muted); }
.steps li.done::before { content: '✓'; color: var(--ok); font-style: normal; font-size: 1.3rem; top: 15px; }
.q { background: var(--accent-soft); color: var(--accent); font-weight: 700; padding: 1px 7px; border-radius: 6px; white-space: nowrap; }
.rv-foot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; gap: 8px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid var(--border); padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}
.rv-foot .btn { flex: 1; }
/* Grand écran : boutons centrés à leur taille, pas sur toute la largeur */
@media (min-width: 768px) {
  .rv-foot { justify-content: center; }
  .rv-foot .btn { flex: 0 1 auto; min-width: 240px; padding-inline: 32px; }
}
.mf { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px; font-size: .86rem; line-height: 1.55; }

/* Valeur nutritive */
.nut-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px; box-shadow: var(--shadow); }
.nut-seg { margin: 0 0 14px; }
.nut-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.nut-kcal { font: 500 2.4rem/1 var(--serif); letter-spacing: -.02em; }
.nut-kcal span { font: 600 .9rem var(--sans); color: var(--muted); margin-left: 4px; }
.nut-scale { display: block; margin-top: 4px; line-height: 1.35; }
.nut-badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.nut-badges span { font-size: .75rem; font-weight: 600; background: var(--surface-2); padding: 3px 10px; border-radius: 999px; }
.nut-split { display: flex; height: 10px; border-radius: 99px; overflow: hidden; margin: 16px 0 8px; background: var(--surface-2); gap: 2px; }
.nut-split .sp { height: 100%; }
.sp.p, .dot.p { background: var(--mp); }
.sp.c, .dot.c { background: var(--mc); }
.sp.f, .dot.f { background: var(--mf); }
.dot.na { background: var(--muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; flex: none; }
.nut-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: .76rem; color: var(--muted); }
.nut-legend span { display: inline-flex; align-items: center; }
.nut-rows { margin-top: 10px; }
.nut-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 10px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.nut-row:last-child { border-bottom: 0; }
.nut-label { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; }
.nut-label b { font-size: .95rem; }
.nut-label small { color: var(--muted); font-size: .78rem; width: 100%; padding-left: 16px; }
.nut-val { font: 600 1.15rem var(--serif); }
.nut-goal { grid-column: 1 / -1; padding-left: 16px; }
.nut-goal .bar { height: 5px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.nut-goal .bar div { height: 100%; background: var(--mp); }
.nut-goal small { display: block; margin-top: 4px; font-size: .76rem; color: var(--muted); }
.nut-src { margin-top: 14px; background: var(--surface-2); border-radius: var(--r-sm); padding: 12px 14px; font-size: .88rem; }
.nut-src ul { list-style: none; margin: 6px 0 0; padding: 0; }
.nut-src li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.nut-src li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nut-src li b { flex: none; white-space: nowrap; }
.nut-note { margin: 12px 0 0; font-size: .76rem; color: var(--muted); line-height: 1.45; }

/* ---------- Barre d'onglets ---------- */
.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabs-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--bg) 92%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  border-top: 1px solid var(--border);
}
.tabs button {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer;
  background: none; border: 0; color: var(--muted); font: 500 .74rem var(--sans); letter-spacing: .02em;
}
.tabs button span { display: grid; }
.tabs button svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--accent); font-weight: 700; }
.tabs button.active svg { stroke-width: 1.9; }
.tabs button.active::before { content: ''; position: absolute; top: -1px; left: 50%; width: 28px; margin-left: -14px; height: 2px; background: var(--accent); border-radius: 0 0 2px 2px; }
.tabs .badge { position: absolute; top: 8px; left: calc(50% + 8px); }

/* ---------- Toast, chargement ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 16px); transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 11px 20px; border-radius: 999px; font-size: .9rem; font-weight: 500;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 40; max-width: calc(100% - 32px); text-align: center; box-shadow: var(--shadow-lift);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.spinner { display: inline-block; width: 13px; height: 13px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Grand écran : une mise en page de magazine ---------- */
@media (min-width: 700px) {
  :root { --gutter: 24px; }
  .band-text { padding-bottom: 44px; }
  .top-row { padding-left: 92px; }
  .week-card { flex: 0 1 460px; margin-inline: auto; }
  .band:not(.band-hero) { min-height: calc(var(--hdr-full, 150px) + 260px); }
  .band-dek { font-size: 1.1rem; }
  .interlude { height: 320px; }
  .interlude figcaption { font-size: 2.6rem; }
  .rtools { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .rtools .rsearch { flex: 1 1 320px; }
  .rtools .chips-scroll, .rtools-row, .rtools .rimport { flex: 1 1 100%; }
  #recipeList { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: var(--wide); }
  .fridge { padding-right: 200px; }
  .fridge::after { width: 180px; }
}
@media (min-width: 1024px) {
  .band-hero { min-height: max(calc(var(--hdr-full, 150px) + 380px), 76vh); }
  .band-hero .band-text { max-width: calc(var(--wide) + 2 * var(--gutter)); }
  [data-view="recipes"] > :not(.band) { max-width: var(--wide); }
  .fridge { padding-right: 300px; }
  .fridge::after { width: 280px; }
  .band-hero .band-title { max-width: 13ch; }
  #recipeList { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* La première recette fait la une : image large, titre en grand */
  #recipeList > .rcard:first-child { grid-column: 1 / -1; flex-direction: row; }
  #recipeList > .rcard:first-child > img, #recipeList > .rcard:first-child > .noimg { width: 58%; aspect-ratio: auto; height: 340px; }
  #recipeList > .rcard:first-child .body { flex: 1; padding: 28px 36px; display: flex; flex-direction: column; justify-content: center; }
  #recipeList > .rcard:first-child .title { font-size: 2.2rem; font-style: italic; font-weight: 400; line-height: 1.06; }
  #recipeList > .rcard:first-child .add, #recipeList > .rcard:first-child .eye { right: calc(42% + 12px); }
  .tabs {
    left: 50%; right: auto; bottom: 16px; width: 480px; margin-left: -240px; height: 64px; padding: 0 6px;
    border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow-lift);
  }
  .tabs button.active::before { display: none; }
  body { padding-bottom: 110px; }
  #toast { bottom: 96px; }
  .view > .manage-bar { bottom: 92px; }
  .rv-hero:has(img) { height: min(62vh, 560px); }
  .rv { max-width: 860px; }
}

/* ---------- Mouvement réduit : tout reste immobile ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  [data-parallax], .rv-hero img, [data-parallax-text] { transform: none !important; opacity: 1 !important; }
  .band-media img, .interlude-media img, .rv-hero img { top: 0; height: 100%; }
}

/* Traduction sur l'appareil */
.tr-mark { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tr-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-top: 10px; padding: 8px 12px; border: 1px dashed var(--border); border-radius: var(--r-md, 12px); font-size: .82rem; color: var(--muted); }
.tr-bar .spinner { vertical-align: -2px; }
.steps.tr-pending { opacity: .55; transition: opacity .3s; }
