/* ═══════════════════════════════════════════════════════════════
   Les Recettes de Nathalie — feuille de styles
   Tout en haut : les design tokens (:root). Pour reskiner l'app,
   changer les variables ici plutôt que les valeurs en dur.
   ═══════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════
   DESIGN TOKENS
   ══════════════════════════════════════════════════════════ */
:root {
  --paper: #FBFAF6;
  --paper-w: #F4F0E6;
  --white: #FFFFFF;
  --ink-900: #0E0E10;
  --ink-700: #2A2A2D;
  --ink-500: #6E6E73;
  --ink-400: #86868B;
  --ink-200: #D2D2D7;
  --ink-100: #ECECEF;
  --ink-50: #F4F4F6;
  --gold: #C9A35F;
  --gold-d: #8C6A38;
  --gold-100: #F4ECD4;
  --gold-200: #ECDDB7;
  --gold-900: #5C4318;
  --err: #B53225;
  --err-bg: #F7E4E1;
  --ok: #1F8F4E;
  --warn-bg: #F4ECD4;
  --cat-e: #6FAE5A;
  --cat-p: #C9A35F;
  --cat-d: #C26B8A;
  --card-bg-e: #e8f4e0;
  --card-bg-p: #f5ecd8;
  --card-bg-d: #f2e0eb;
  --font-d: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
  --font-t: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  --r: 18px;
  --rm: 12px;
  --rs: 8px;
  --st: env(safe-area-inset-top, 0px);
  --sb: env(safe-area-inset-bottom, 0px);
  --topbar: 52px;
  --tabbar: 64px;
}

/* ══ RESET ══════════════════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-t);
  background: var(--paper);
  color: var(--ink-900);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  /* Padding pour topbar + tabbar */
  padding-top: calc(var(--st) + var(--topbar));
  padding-bottom: calc(var(--sb) + var(--tabbar) + .5rem);
}

/* ══ TOP BAR ════════════════════════════════════════════════ */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--st) + var(--topbar));
  padding-top: var(--st);
  background: rgba(251, 250, 246, .88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: .5px solid rgba(14, 14, 16, .1);
  z-index: 80;
  display: flex;
  align-items: flex-end;
}

.topbar-inner {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem .6rem;
  height: var(--topbar);
}

.topbar-title {
  font-family: var(--font-d);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--ink-900);
}

.topbar-title em {
  font-style: normal;
  color: var(--gold-d);
  font-weight: 400;
}

.topbar-actions {
  display: flex;
  gap: .5rem;
}

.topbar-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ink-50);
  border: 1px solid var(--ink-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  color: var(--ink-500);
  transition: background .15s;
}

.topbar-btn:hover {
  background: var(--ink-100);
}

.topbar-btn.active {
  background: var(--gold-100);
  border-color: var(--gold-200);
  color: var(--gold-d);
}

/* ══ FILTRES CATÉGORIE (pill bar scrollable) ════════════════ */
.catbar {
  background: transparent;
}

.catbar-inner {
  display: flex;
  gap: .3rem;
  padding: .4rem .75rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  max-width: 780px;
  margin: 0 auto;
  /* Distribue les pills uniformément si elles rentrent */
  justify-content: center;
}

.catbar-inner::-webkit-scrollbar {
  display: none;
}

.catpill {
  flex-shrink: 1;
  min-width: 0;
  scroll-snap-align: start;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1.5px solid var(--ink-200);
  background: var(--white);
  font-size: clamp(.68rem, 2.5vw, .8rem);
  font-weight: 500;
  color: var(--ink-500);
  white-space: nowrap;
  transition: all .18s;
}

/* Sur très petit écran, pills encore plus compactes */
@media (max-width: 360px) {
  .catpill {
    padding: 4px 8px;
    font-size: .66rem;
  }

  .catbar-inner {
    gap: .25rem;
    padding: .35rem .5rem;
  }
}

.catpill.on {
  border-width: 0;
  color: var(--white);
}

.catpill[data-c="Toutes"].on {
  background: var(--ink-900);
}

.catpill[data-c="Entrées"].on {
  background: var(--cat-e);
}

.catpill[data-c="Plats"].on {
  background: var(--cat-p);
}

.catpill[data-c="Desserts"].on {
  background: var(--cat-d);
}

.catpill[data-c="Favoris"].on {
  background: var(--err);
}

/* ══ BARRE DE RECHERCHE ══════════════════════════════════════ */
.searchbar {
  padding: .3rem .75rem .45rem;
  max-width: 780px;
  margin: 0 auto;
}

.search-row {
  display: flex;
  gap: .5rem;
  align-items: center;
}

.search-wrap {
  flex: 1;
  position: relative;
}

.search-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-400);
  pointer-events: none;
}

.search-wrap input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  background: var(--ink-50);
  border: none;
  border-radius: var(--rm);
  font-size: 16px;
  color: var(--ink-900);
  outline: none;
  -webkit-appearance: none;
}

.search-wrap input::placeholder {
  color: var(--ink-400);
}

.btn-tag-add {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ink-900);
  color: var(--white);
  font-size: 1.2rem;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
  flex-shrink: 0;
}

.btn-tag-add.show {
  opacity: 1;
  pointer-events: all;
}

.tags {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  padding: .3rem 0 .1rem;
}

.tags:empty {
  display: none;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--ink-900);
  color: var(--white);
  border-radius: 999px;
  padding: 3px 6px 3px 10px;
  font-size: .73rem;
  font-weight: 500;
}

.tag button {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .25);
  color: var(--white);
  font-size: .62rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ══ GRILLE ══════════════════════════════════════════════════ */
.main {
  max-width: 780px;
  margin: 0 auto;
  padding: .75rem 1rem 1rem;
}

.rcount {
  font-size: .72rem;
  color: var(--ink-400);
  margin-bottom: .6rem;
}

.rcount span {
  color: var(--ink-700);
  font-weight: 500;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .7rem;
}

@media (min-width: 600px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 900px) {
  .grid {
    grid-template-columns: repeat(4, 1fr);
    gap: .9rem;
  }
}

.no-results {
  grid-column: 1/-1;
  text-align: center;
  padding: 4rem 1rem;
  color: var(--ink-400);
}

.no-results h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink-500);
  margin: .5rem 0;
}

/* ══ TUILE RECETTE ═══════════════════════════════════════════ */
.card {
  background: var(--white);
  border: .5px solid rgba(14, 14, 16, .07);
  border-radius: var(--r);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform .18s cubic-bezier(.34, 1.4, .64, 1);
  -webkit-tap-highlight-color: transparent;
}

.card:active {
  transform: scale(.96);
}

.card.tapping {
  transform: scale(.96);
}

/* Zone photo */
.card-photo {
  aspect-ratio: 4/3;
  position: relative;
  overflow: hidden;
}

.card-photo-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

/* ──────────────────────────────────────────────────────────────
   FOND DES TUILES — 2 options, décommentez celle que vous voulez
   ────────────────────────────────────────────────────────────── */
/* Option A — Illustrations (actif) */
.card-photo-bg.e {
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 680 400'><rect width='680' height='400' fill='%23e8f4e0'/><ellipse cx='120' cy='320' rx='90' ry='40' fill='%23b8dba6' transform='rotate(-30 120 320)'/><ellipse cx='560' cy='80' rx='80' ry='35' fill='%23b8dba6' transform='rotate(20 560 80)'/><ellipse cx='580' cy='340' rx='70' ry='30' fill='%23c8e8b8' transform='rotate(-15 580 340)'/><ellipse cx='340' cy='215' rx='155' ry='155' fill='white' opacity='.92'/><ellipse cx='340' cy='215' rx='155' ry='155' fill='none' stroke='%23d0e8c8' stroke-width='1.5'/><ellipse cx='340' cy='215' rx='125' ry='125' fill='none' stroke='%23e4f0dc' stroke-width='1'/><ellipse cx='310' cy='200' rx='45' ry='30' fill='%236FAE5A' transform='rotate(-20 310 200)'/><ellipse cx='355' cy='195' rx='40' ry='28' fill='%237dc265' transform='rotate(15 355 195)'/><ellipse cx='335' cy='225' rx='38' ry='25' fill='%235a9e48' transform='rotate(-5 335 225)'/><ellipse cx='370' cy='220' rx='35' ry='22' fill='%236FAE5A' transform='rotate(25 370 220)'/><ellipse cx='298' cy='230' rx='30' ry='20' fill='%238ac872' transform='rotate(-35 298 230)'/><circle cx='292' cy='185' r='14' fill='%23e05a4e'/><ellipse cx='292' cy='178' rx='4' ry='2.5' fill='white' opacity='.4'/><line x1='292' y1='171' x2='295' y2='166' stroke='%234a8c38' stroke-width='1.5' stroke-linecap='round'/><circle cx='382' cy='188' r='12' fill='%23e05a4e'/><ellipse cx='382' cy='182' rx='3.5' ry='2' fill='white' opacity='.4'/><line x1='382' y1='176' x2='385' y2='171' stroke='%234a8c38' stroke-width='1.5' stroke-linecap='round'/><circle cx='360' cy='243' r='11' fill='%23f07060'/><ellipse cx='315' cy='245' rx='16' ry='16' fill='%23a8d890' stroke='%237ab868' stroke-width='.8'/><ellipse cx='315' cy='245' rx='10' ry='10' fill='%23c4e8a8' stroke='%238ac878' stroke-width='.5'/><line x1='305' y1='245' x2='325' y2='245' stroke='%237ab868' stroke-width='.5'/><line x1='315' y1='235' x2='315' y2='255' stroke='%237ab868' stroke-width='.5'/><ellipse cx='380' cy='242' rx='12' ry='10' fill='%23e8788a'/><line x1='380' y1='232' x2='378' y2='226' stroke='%234a8c38' stroke-width='1.2' stroke-linecap='round'/><path d='M330 165 Q332 155 328 148' fill='none' stroke='%234a8c38' stroke-width='1.2' stroke-linecap='round'/><path d='M336 162 Q340 150 342 144' fill='none' stroke='%234a8c38' stroke-width='1.2' stroke-linecap='round'/><path d='M342 166 Q348 158 346 150' fill='none' stroke='%234a8c38' stroke-width='1.2' stroke-linecap='round'/><ellipse cx='328' cy='147' rx='4' ry='3' fill='%236FAE5A' transform='rotate(-30 328 147)'/><ellipse cx='342' cy='143' rx='4' ry='3' fill='%237dc265' transform='rotate(20 342 143)'/><ellipse cx='346' cy='149' rx='3.5' ry='2.5' fill='%236FAE5A' transform='rotate(-10 346 149)'/></svg>");
  background-color: var(--card-bg-e);
  opacity: .45;
}

.card-photo-bg.p {
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 680 400'><rect width='680' height='400' fill='%23f5ecd8'/><ellipse cx='90' cy='350' rx='100' ry='45' fill='%23e8d4a8' transform='rotate(-25 90 350)'/><ellipse cx='600' cy='60' rx='85' ry='38' fill='%23ead8b0' transform='rotate(15 600 60)'/><ellipse cx='340' cy='218' rx='158' ry='158' fill='white' opacity='.94'/><ellipse cx='340' cy='218' rx='158' ry='158' fill='none' stroke='%23e8d8b8' stroke-width='1.5'/><ellipse cx='340' cy='218' rx='128' ry='128' fill='none' stroke='%23f0e4cc' stroke-width='1'/><ellipse cx='340' cy='225' rx='80' ry='55' fill='%23d4884a' opacity='.25'/><path d='M278 195 Q295 175 340 178 Q385 175 402 195 Q415 215 405 238 Q390 258 340 260 Q290 258 275 238 Q265 215 278 195Z' fill='%23c87840'/><path d='M280 198 Q296 180 340 183 Q384 180 400 198 Q411 216 402 237 Q388 255 340 257 Q292 255 278 237 Q268 217 280 198Z' fill='%23d88850'/><path d='M295 200 Q320 192 340 192 Q360 192 375 200' fill='none' stroke='%23c07038' stroke-width='1.2' stroke-linecap='round'/><path d='M290 203 Q310 196 340 196 Q368 196 378 206' fill='none' stroke='%23e8a060' stroke-width='2' stroke-linecap='round' opacity='.6'/><path d='M245 210 Q252 198 264 204 Q258 216 248 218Z' fill='%236FAE5A'/><path d='M240 225 Q248 213 260 220 Q254 232 243 233Z' fill='%235a9e48'/><path d='M246 240 Q255 228 266 235 Q260 246 250 247Z' fill='%237dc265'/><path d='M426 200 Q440 195 445 210 Q440 222 428 218Z' fill='%23e87838'/><path d='M432 218 Q446 213 451 228 Q446 240 434 236Z' fill='%23f08840'/><line x1='440' y1='195' x2='443' y2='189' stroke='%234a8c38' stroke-width='1.2' stroke-linecap='round'/><ellipse cx='340' cy='272' rx='50' ry='18' fill='%23e8d090'/><ellipse cx='340' cy='270' rx='46' ry='14' fill='%23f0dca0'/><path d='M332 185 Q334 178 330 172' fill='none' stroke='%234a8c38' stroke-width='1.2' stroke-linecap='round'/><path d='M340 182 Q342 174 344 168' fill='none' stroke='%234a8c38' stroke-width='1.2' stroke-linecap='round'/><circle cx='330' cy='171' r='3.5' fill='%236FAE5A'/><circle cx='344' cy='167' r='3.5' fill='%237dc265'/></svg>");
  background-color: var(--card-bg-p);
  opacity: .45;
}

.card-photo-bg.d {
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 680 400'><rect width='680' height='400' fill='%23f2e0eb'/><ellipse cx='95' cy='340' rx='95' ry='42' fill='%23e4c8d8' transform='rotate(-20 95 340)'/><ellipse cx='595' cy='65' rx='80' ry='36' fill='%23e8ccd8' transform='rotate(18 595 65)'/><ellipse cx='340' cy='218' rx='158' ry='158' fill='white' opacity='.92'/><ellipse cx='340' cy='218' rx='158' ry='158' fill='none' stroke='%23e8d0dc' stroke-width='1.5'/><ellipse cx='340' cy='218' rx='128' ry='128' fill='none' stroke='%23f0dce6' stroke-width='1'/><ellipse cx='340' cy='230' rx='95' ry='90' fill='%23e8c870'/><ellipse cx='340' cy='228' rx='93' ry='88' fill='%23f0d880'/><ellipse cx='340' cy='222' rx='78' ry='74' fill='%23fff8f0'/><ellipse cx='340' cy='220' rx='76' ry='72' fill='%23fffaf4'/><ellipse cx='340' cy='220' rx='60' ry='56' fill='none' stroke='%23f0e4d0' stroke-width='1'/><ellipse cx='340' cy='220' rx='40' ry='37' fill='none' stroke='%23f0e4d0' stroke-width='.8'/><path d='M318 208 Q322 198 328 202 Q325 215 318 215Z' fill='%23e84848'/><path d='M322 199 Q324 196 323 193' fill='none' stroke='%234a8c38' stroke-width='1' stroke-linecap='round'/><circle cx='320' cy='206' r='1' fill='%23c83838' opacity='.7'/><circle cx='323' cy='211' r='1' fill='%23c83838' opacity='.7'/><circle cx='326' cy='207' r='1' fill='%23c83838' opacity='.7'/><path d='M348 200 Q352 190 358 194 Q355 207 348 207Z' fill='%23e84848'/><path d='M352 191 Q354 188 353 185' fill='none' stroke='%234a8c38' stroke-width='1' stroke-linecap='round'/><circle cx='335' cy='235' r='9' fill='%23d84870'/><circle cx='332' cy='232' r='3.5' fill='%23e05878' opacity='.6'/><circle cx='338' cy='232' r='3.5' fill='%23e05878' opacity='.6'/><circle cx='335' cy='237' r='3.5' fill='%23e05878' opacity='.6'/><circle cx='358' cy='228' r='8' fill='%23d84870'/><circle cx='315' cy='232' r='7' fill='%237060a8'/><circle cx='313' cy='230' r='2.5' fill='white' opacity='.2'/><circle cx='368' cy='235' r='6.5' fill='%237060a8'/><path d='M326 222 Q322 215 328 212 Q332 218 326 222Z' fill='%234a9e58'/><path d='M362 218 Q366 211 372 214 Q370 221 362 218Z' fill='%235aae68'/><circle cx='308' cy='215' r='1.5' fill='white' opacity='.8'/><circle cx='372' cy='210' r='1.5' fill='white' opacity='.8'/><circle cx='345' cy='205' r='1.2' fill='white' opacity='.7'/></svg>");
  background-color: var(--card-bg-d);
  opacity: .45;
}

/* Option B — Couleurs unies (décommenter pour revenir aux couleurs)
.card-photo-bg.e { background: var(--card-bg-e); }
.card-photo-bg.p { background: var(--card-bg-p); }
.card-photo-bg.d { background: var(--card-bg-d); }
*/

.card-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px;
}

.card-cat-pill {
  align-self: flex-start;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: .62rem;
  font-weight: 600;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--ink-700);
}

.card-btns {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.card-fav,
.card-cam,
.card-del {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  color: var(--err);
  border: .5px solid rgba(14, 14, 16, .1);
  transition: background .15s;
}

.card-fav.on,
.card-del {
  color: var(--err);
}

.card-cam-del {
  display: flex;
  gap: 4px;
}

/* Corps */
.card-body {
  padding: .5rem .65rem .65rem;
  flex: 1;
}

.card-title {
  font-family: var(--font-d);
  font-size: .84rem;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.3;
  color: var(--ink-900);
  margin-bottom: .3rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  gap: .3rem;
  flex-wrap: wrap;
}

.chip {
  font-size: .65rem;
  color: var(--ink-400);
  background: var(--ink-50);
  padding: 2px 6px;
  border-radius: 999px;
}

/* ══ TAB BAR ════════════════════════════════════════════════ */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--sb) + var(--tabbar));
  padding-bottom: var(--sb);
  background: rgba(251, 250, 246, .92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: .5px solid rgba(14, 14, 16, .1);
  z-index: 80;
  display: flex;
  align-items: flex-start;
  padding-top: 6px;
}

.tabbar-inner {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  display: flex;
}

.tbitem {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 0;
  font-size: .6rem;
  font-weight: 500;
  color: var(--ink-400);
  transition: color .18s;
  -webkit-tap-highlight-color: transparent;
}

.tbitem svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.5;
  transition: transform .2s cubic-bezier(.34, 1.6, .64, 1);
}

.tbitem.on {
  color: var(--gold-d);
}

.tbitem.on svg {
  stroke: var(--gold-d);
  transform: scale(1.12);
}

/* ══ FICHE RECETTE ═══════════════════════════════════════════ */
.sheet-ovl {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(14, 14, 16, .5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.sheet-wrap {
  position: relative;
  width: 100%;
  max-width: 680px;
  height: 94vh;
  height: 94dvh;
  overflow: hidden;
  border-radius: var(--r) var(--r) 0 0;
}

.sheet-ghost {
  position: absolute;
  inset: 0;
  background: var(--white);
  border-radius: var(--r) var(--r) 0 0;
  overflow: hidden;
  pointer-events: none;
  display: flex;
  flex-direction: column;
}

.sheet {
  position: absolute;
  inset: 0;
  background: var(--white);
  border-radius: var(--r) var(--r) 0 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -8px 40px rgba(14, 14, 16, .18);
  animation: shup .32s cubic-bezier(.32, 1.1, .64, 1);
  will-change: transform;
}

.sheet.no-anim {
  animation: none !important;
}

.sheet.snapping {
  transition: transform .25s cubic-bezier(.25, .46, .45, .94);
}

@keyframes shup {
  from {
    transform: translateY(100%);
  }

  to {
    transform: none;
  }
}

.sh-handle-row {
  display: flex;
  justify-content: center;
  padding: 8px 0 4px;
  flex-shrink: 0;
}

.sh-handle {
  width: 36px;
  height: 4px;
  background: var(--ink-200);
  border-radius: 999px;
}

/* Header */
.sh-hdr {
  flex-shrink: 0;
  padding: .4rem 1rem .6rem;
  border-bottom: .5px solid var(--ink-100);
  position: relative;
}

.sh-actions {
  position: absolute;
  top: .4rem;
  right: 1rem;
  display: flex;
  gap: .3rem;
  align-items: center;
}

.sh-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ink-50);
  border: 1px solid var(--ink-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  color: var(--ink-700);
  transition: background .15s;
}

.sh-btn.on {
  color: var(--err);
  background: var(--err-bg);
  border-color: var(--err-bg);
}

.sh-btn-nav {
  font-size: 1.1rem;
  font-weight: 300;
}

.sh-del-photo {
  font-size: .68rem;
  color: var(--err);
  background: var(--err-bg);
  border-radius: 999px;
  padding: 3px 8px;
  cursor: pointer;
}

.sh-cat-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .72rem;
  color: var(--ink-500);
  margin-bottom: .3rem;
}

.sh-cat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sh-cat-dot.e {
  background: var(--cat-e);
}

.sh-cat-dot.p {
  background: var(--cat-p);
}

.sh-cat-dot.d {
  background: var(--cat-d);
}

.sh-hdr-inner {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
}

.sh-hdr-photo {
  width: 80px;
  height: 80px;
  border-radius: var(--rm);
  object-fit: cover;
  flex-shrink: 0;
  display: none;
  border: 1px solid var(--ink-100);
}

.sh-hdr-photo.show {
  display: block;
}

.sh-hdr-text {
  flex: 1;
  min-width: 0;
}

.sh-title {
  font-family: var(--font-d);
  font-size: clamp(1.1rem, 3.5vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
  color: var(--ink-900);
  margin-bottom: .4rem;
  padding-right: 80px;
}

.sh-pills {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
  align-items: center;
}

.sh-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--ink-50);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: .72rem;
  color: var(--ink-700);
}

.sh-portions {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: 2px 4px 2px 9px;
  background: var(--ink-50);
  border-radius: 999px;
  border: 1px solid var(--ink-100);
}

.sh-portions-label {
  font-size: .7rem;
  font-weight: 500;
  color: var(--ink-500);
}

.stpr {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.stpr-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--ink-200);
  font-size: .85rem;
  color: var(--ink-900);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stpr-btn:disabled {
  opacity: .3;
  pointer-events: none;
}

.stpr-val {
  min-width: 24px;
  text-align: center;
  font-weight: 600;
  font-size: .84rem;
}

.stpr-unit {
  font-size: .68rem;
  color: var(--ink-400);
  margin-right: 2px;
}

/* CTA */
.sh-cta {
  flex-shrink: 0;
  padding: .5rem 1rem;
  border-top: .5px solid var(--ink-100);
  display: flex;
  gap: .4rem;
}

.btn-cook {
  flex: 1;
  padding: 11px;
  background: var(--ink-900);
  color: var(--white);
  border-radius: var(--rm);
  font-size: .86rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  transition: opacity .15s;
}

.btn-shop-add {
  padding: 11px 13px;
  background: var(--ink-50);
  color: var(--ink-700);
  border-radius: var(--rm);
  font-size: .86rem;
  font-weight: 600;
  border: 1px solid var(--ink-200);
  transition: background .15s;
}

.btn-shop-add.ok {
  background: #e5f1ea;
  border-color: var(--ok);
  color: var(--ok);
}

/* Tabs Ingrédients / Préparation */
.sh-tabs {
  flex-shrink: 0;
  display: flex;
  border-bottom: .5px solid var(--ink-100);
  padding: 0 1rem;
  position: relative;
}

.sh-tab {
  flex: 1;
  padding: 10px 0;
  font-size: .84rem;
  font-weight: 500;
  color: var(--ink-400);
  text-align: center;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .18s, border-color .18s;
}

.sh-tab.on {
  color: var(--ink-900);
  border-bottom-color: var(--ink-900);
  font-weight: 600;
}

/* Corps scrollable */
.sh-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0 1rem;
  transition: none;
}

.sh-body::-webkit-scrollbar {
  display: none;
}

/* Ingrédients */
.ing-list {
  display: flex;
  flex-direction: column;
  padding-top: .5rem;
}

.ing-sub-hdr {
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-400);
  padding: .6rem 0 .1rem;
  margin-top: .3rem;
  border-top: 1px solid var(--ink-100);
}

.ing-sub-hdr:first-child {
  border-top: none;
  padding-top: 0;
}

.ing-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: .4rem;
  align-items: flex-start;
  padding: .55rem 0;
  border-top: .5px solid var(--ink-100);
  font-size: .84rem;
  cursor: pointer;
}

.ing-row:first-child {
  border-top: none;
}

.ing-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-200);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  color: transparent;
  flex-shrink: 0;
  transition: all .15s;
}

.ing-row.chk .ing-check {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink-900);
}

.ing-name {
  color: var(--ink-700);
  line-height: 1.4;
}

.ing-row.chk .ing-name {
  color: var(--ink-400);
  text-decoration: line-through;
}

.ing-qty {
  font-weight: 500;
  color: var(--gold-d);
}

/* Préparation */
.sh-steps {
  display: flex;
  flex-direction: column;
  gap: .9rem;
  padding: .5rem 0 1rem;
}

.sh-step {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: .5rem;
  align-items: start;
}

.sh-step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ink-900);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-d);
  font-size: .88rem;
  font-weight: 600;
  position: relative;
}

.sh-step-num::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  width: 1px;
  height: .9rem;
  background: var(--ink-200);
  transform: translateX(-50%);
}

.sh-steps .sh-step:last-child .sh-step-num::after {
  display: none;
}

.sh-step-body {
  padding-top: 7px;
}

.sh-step-text {
  font-size: .84rem;
  color: var(--ink-500);
  line-height: 1.65;
}

.sh-note {
  margin: .25rem 0 .75rem;
  padding: .65rem .85rem;
  background: var(--warn-bg);
  border: 1px solid var(--gold-200);
  border-radius: var(--rm);
}

.sh-note p {
  font-size: .8rem;
  color: var(--gold-900);
  line-height: 1.5;
  font-style: italic;
}

/* ══ MODE CUISINE ═══════════════════════════════════════════ */
.cook {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--white);
  display: none;
  flex-direction: column;
}

.cook-hdr {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: calc(var(--st) + .75rem) 1rem .6rem;
  border-bottom: .5px solid var(--ink-100);
}

.cook-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ink-50);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  color: var(--ink-500);
  flex-shrink: 0;
}

.cook-title {
  flex: 1;
  font-size: .82rem;
  font-weight: 500;
  color: var(--ink-500);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cook-ctr {
  font-size: .72rem;
  font-weight: 600;
  color: var(--ink-400);
  white-space: nowrap;
}

.wl {
  display: flex;
  align-items: center;
  gap: .3rem;
  flex-shrink: 0;
}

.wl-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-200);
  transition: background .4s;
}

.wl-dot.on {
  background: var(--ok);
}

.cook-prog {
  flex-shrink: 0;
  height: 2px;
  background: var(--ink-100);
}

.cook-fill {
  height: 100%;
  background: var(--ink-900);
  transition: width .35s;
}

.cook-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  overflow-y: auto;
}

.ck-ing-wrap {
  width: 100%;
  max-width: 440px;
}

.ck-lbl {
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-400);
  text-align: center;
  margin-bottom: 1rem;
}

.ck-ing-list {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.ck-ing {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .75rem;
  background: var(--ink-50);
  border: .5px solid var(--ink-100);
  border-radius: var(--rm);
  font-size: .86rem;
  color: var(--ink-900);
  line-height: 1.3;
}

.ck-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
}

.ck-sub {
  font-size: .6rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-400);
  padding: .35rem 0 .1rem;
}

.ck-step {
  width: 100%;
  max-width: 440px;
  text-align: center;
  animation: step-in .2s ease;
}

@keyframes step-in {
  from {
    opacity: 0;
    transform: translateX(14px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.ck-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--ink-900);
  color: var(--white);
  font-family: var(--font-d);
  font-size: .95rem;
  font-weight: 700;
  margin: 0 auto 1.1rem;
}

.ck-text {
  font-family: var(--font-d);
  font-size: clamp(.95rem, 3.5vw, 1.4rem);
  font-weight: 400;
  line-height: 1.65;
  color: var(--ink-900);
}

.ck-done {
  text-align: center;
  animation: step-in .3s ease;
}

.ck-done-icon {
  font-size: 3rem;
  margin-bottom: .8rem;
}

.ck-done-title {
  font-family: var(--font-d);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -.025em;
  margin-bottom: .3rem;
}

.ck-done-sub {
  font-size: .88rem;
  color: var(--ink-500);
}

.swipe-hint {
  text-align: center;
  font-size: .62rem;
  color: var(--ink-400);
  padding: 2px 0;
  flex-shrink: 0;
}

.cook-nav {
  flex-shrink: 0;
  display: flex;
  gap: .5rem;
  padding: .65rem 1rem calc(var(--sb) + .65rem);
  border-top: .5px solid var(--ink-100);
}

.btn-nav {
  flex: 1;
  padding: 11px;
  border-radius: var(--rm);
  font-size: .86rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
}

.btn-nav:disabled {
  opacity: .3;
  pointer-events: none;
}

.btn-prev {
  background: var(--ink-50);
  color: var(--ink-900);
  border: 1px solid var(--ink-200);
}

.btn-next {
  background: var(--ink-900);
  color: var(--white);
}

/* ══ COURSES ════════════════════════════════════════════════ */
.shop-fab {
  position: fixed;
  bottom: calc(var(--sb) + var(--tabbar) + .8rem);
  right: 1rem;
  z-index: 90;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--ink-900);
  color: var(--white);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(14, 14, 16, .22);
  opacity: 0;
  transform: scale(.5);
  pointer-events: none;
  transition: opacity .2s, transform .22s cubic-bezier(.34, 1.56, .64, 1);
}

.shop-fab.show {
  opacity: 1;
  transform: scale(1);
  pointer-events: all;
}

.shop-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  padding: 0 3px;
  background: var(--err);
  color: var(--white);
  font-size: .56rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--paper);
}

.shop-ovl {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(14, 14, 16, .4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.shop-panel {
  width: 100%;
  max-width: 680px;
  max-height: 92vh;
  max-height: 92dvh;
  background: var(--white);
  border-radius: var(--r) var(--r) 0 0;
  display: flex;
  flex-direction: column;
  animation: shup .3s cubic-bezier(.32, 1.1, .64, 1);
  box-shadow: 0 -4px 40px rgba(14, 14, 16, .14);
}

.sp-handle-row {
  display: flex;
  justify-content: center;
  padding: 8px 0;
  flex-shrink: 0;
}

.sp-handle {
  width: 36px;
  height: 4px;
  background: var(--ink-200);
  border-radius: 999px;
}

.sp-hdr {
  flex-shrink: 0;
  padding: .2rem 1rem .7rem;
  border-bottom: .5px solid var(--ink-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sp-hdr-l {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sp-hdr-title {
  font-family: var(--font-d);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -.02em;
}

.sp-hdr-sub {
  font-size: .7rem;
  color: var(--ink-400);
}

.sp-hdr-r {
  display: flex;
  gap: .35rem;
  align-items: center;
}

.btn-clr {
  font-size: .72rem;
  font-weight: 500;
  color: var(--ink-400);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--ink-200);
  background: transparent;
  transition: all .15s;
}

.btn-sp-cls {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ink-50);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-500);
  font-size: .78rem;
}

.sp-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sp-body::-webkit-scrollbar {
  display: none;
}

.sp-empty {
  padding: 3.5rem 1.5rem;
  text-align: center;
  color: var(--ink-400);
}

.sp-grp {
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-400);
  background: var(--ink-50);
  padding: .35rem 1rem;
  border-bottom: .5px solid var(--ink-100);
}

.sp-item {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: .6rem;
  align-items: center;
  padding: .55rem 1rem;
  border-bottom: .5px solid var(--ink-100);
}

.sp-item.chk {
  background: var(--ink-50);
}

.sp-chk {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-200);
  background: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  color: transparent;
  transition: all .15s;
}

.sp-item.chk .sp-chk {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink-900);
}

.sp-text {
  font-size: .83rem;
  color: var(--ink-700);
  line-height: 1.3;
}

.sp-item.chk .sp-text {
  text-decoration: line-through;
  color: var(--ink-400);
}

/* ══ FILTRES AVANCÉS ════════════════════════════════════════ */
.adv-ovl {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(14, 14, 16, .4);
  backdrop-filter: blur(6px);
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.adv-sheet {
  width: 100%;
  max-width: 540px;
  background: var(--white);
  border-radius: var(--r) var(--r) 0 0;
  padding: 0 0 calc(var(--sb) + 1rem);
  animation: shup .28s cubic-bezier(.32, 1.1, .64, 1);
  box-shadow: 0 -4px 40px rgba(14, 14, 16, .14);
}

.adv-handle-row {
  display: flex;
  justify-content: center;
  padding: 8px 0;
}

.adv-handle {
  width: 36px;
  height: 4px;
  background: var(--ink-200);
  border-radius: 999px;
}

.adv-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .2rem 1rem .7rem;
}

.adv-title {
  font-family: var(--font-d);
  font-size: 1.05rem;
  font-weight: 700;
}

.adv-reset {
  font-size: .76rem;
  color: var(--gold-d);
  font-weight: 500;
}

.adv-body {
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.adv-sec-title {
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-400);
  margin-bottom: .5rem;
}

.adv-chips {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
}

.adv-chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--ink-200);
  background: var(--white);
  font-size: .78rem;
  font-weight: 500;
  color: var(--ink-600);
  cursor: pointer;
  transition: all .15s;
}

.adv-chip.on {
  background: var(--ink-900);
  border-color: var(--ink-900);
  color: var(--white);
}

.adv-footer {
  padding: .7rem 1rem 0;
}

.btn-adv-apply {
  width: 100%;
  padding: 12px;
  background: var(--ink-900);
  color: var(--white);
  border-radius: var(--rm);
  font-size: .88rem;
  font-weight: 600;
}

/* ══ BANNERS ════════════════════════════════════════════════ */
.install-banner {
  position: fixed;
  bottom: calc(var(--sb) + var(--tabbar) + .6rem);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink-900);
  color: var(--white);
  border-radius: var(--r);
  padding: .75rem .9rem;
  display: flex;
  align-items: center;
  gap: .65rem;
  box-shadow: 0 8px 24px rgba(14, 14, 16, .2);
  z-index: 300;
  max-width: calc(100vw - 2rem);
  font-size: .8rem;
  font-weight: 500;
  line-height: 1.4;
}

.install-banner.hidden {
  display: none;
}

.install-banner small {
  display: block;
  color: rgba(255, 255, 255, .55);
  font-size: .68rem;
  font-weight: 400;
  margin-top: 1px;
}

.install-banner .btn-install {
  padding: 5px 11px;
  background: var(--gold);
  color: var(--ink-900);
  border-radius: var(--rs);
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.install-banner .btn-x {
  color: rgba(255, 255, 255, .45);
  font-size: .88rem;
  padding: 3px;
  flex-shrink: 0;
}

/* Bouton filtres dans la barre de recherche */
.btn-filters {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ink-50);
  border: 1px solid var(--ink-200);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--ink-500);
  transition: all .15s;
}

.btn-filters .sticky-bar {
  position: sticky;
  top: calc(var(--st) + var(--topbar));
  z-index: 70;
  background: rgba(251, 250, 246, .94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: .5px solid rgba(14, 14, 16, .07);
}

/* ── Cascade d'entrée des cartes ── */
@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Slide horizontal entre onglets ── */
.sh-body.slide-left {
  animation: slideBodyLeft .2s cubic-bezier(.25, .46, .45, .94) both;
}

.sh-body.slide-right {
  animation: slideBodyRight .2s cubic-bezier(.25, .46, .45, .94) both;
}

@keyframes slideBodyLeft {
  from {
    opacity: 0;
    transform: translateX(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes slideBodyRight {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* ── Tab active : indicateur animé ── */
.sh-tab-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--ink-900);
  border-radius: 2px;
  transition: left .22s cubic-bezier(.25, .46, .45, .94), width .22s cubic-bezier(.25, .46, .45, .94);
}


@keyframes shDown {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(100%);
  }
}

.sheet.closing {
  animation: shDown .25s cubic-bezier(.25, .46, .45, .94) both;
  pointer-events: none;
}

/* Overlays */
.sheet-ovl.open,
.shop-ovl.open,
.adv-ovl.open,
.cook.open {
  display: flex;
}