:root {
  /* Charte graphique 2026 — Jaune Moutarde, Chocolat, Crème ; Orange et Rouge en accents (10 % max) */
  --yellow: #FFC61A;
  --choco: #2A0F08;
  --cream: #FFF8EC;
  --orange: #F59A12;
  --red: #E8323C;

  --bg: var(--cream);
  --surface: #FFFFFF;
  --surface-2: #F6EBD6;
  --text: var(--choco);
  --muted: #7A5E52;
  --line: #EEDFC6;
  --primary: var(--choco);
  --primary-ink: var(--cream);
  --primary-soft: #FFEDB3;
  --accent: var(--orange);
  --accent-soft: #FDE6C4;
  --danger: #C8242E;
  --price: #C8242E;
  --prot: var(--red);
  --carb: var(--yellow);
  --fat: #A0582B;
  --water: #3B9AD9;
  --ring: var(--orange);
  --shadow: 0 1px 2px rgba(42, 15, 8, .05), 0 8px 24px rgba(42, 15, 8, .07);
  --radius: 20px;
  --appbar-h: 60px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font-title: "Baloo 2", "Arial Rounded MT Bold", system-ui, sans-serif;
  --font-text: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1C0A05; --surface: #2A140C; --surface-2: #3A1F14; --text: var(--cream); --muted: #CBB3A3;
    --line: #4A2C1F; --primary: var(--yellow); --primary-ink: var(--choco); --primary-soft: #45300C;
    --accent-soft: #46280C; --danger: #FF6B72; --price: #FF8A8F; --fat: #D98C5F;
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1C0A05; --surface: #2A140C; --surface-2: #3A1F14; --text: var(--cream); --muted: #CBB3A3;
  --line: #4A2C1F; --primary: var(--yellow); --primary-ink: var(--choco); --primary-soft: #45300C;
  --accent-soft: #46280C; --danger: #FF6B72; --price: #FF8A8F; --fat: #D98C5F;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.3);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--font-text);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--font-title); }
h1 { font-size: 30px; line-height: 1.05; font-weight: 800; }
h2 { font-size: 21px; line-height: 1.15; font-weight: 800; }
h3 { font-size: 16.5px; line-height: 1.2; font-weight: 700; }
.price, .big, .ring-label strong, .kpi strong, .macros4 strong, .cal b { font-family: var(--font-title); }
.eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.outlined { font-family: var(--font-title); font-weight: 800; color: var(--cream); -webkit-text-stroke: 6px var(--choco); paint-order: stroke fill; letter-spacing: .01em; }
.sep { display: flex; align-items: center; gap: 12px; font-size: 12px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; }
.sep::before, .sep::after { content: ""; height: 3px; width: 26px; border-radius: 3px; background: var(--yellow); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.mt { margin-top: 12px; }
.center { text-align: center; }

/* ---------- Shell (cadre téléphone sur grand écran) ---------- */
.app {
  position: relative;
  max-width: 440px;
  height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
@media (min-width: 600px) {
  body { background: radial-gradient(circle at 30% 20%, #FFD95C, #F59A12); }
  .app { height: min(900px, 96dvh); margin-top: 2dvh; border-radius: 36px; box-shadow: 0 30px 80px rgba(0,0,0,.18); border: 8px solid var(--choco); }
}
@media (min-width: 600px) and (prefers-color-scheme: dark) {
  body { background: radial-gradient(circle at 30% 20%, #3A1F14, #120604); }
}
.view {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 16px calc(var(--tabbar-h) + var(--safe-b) + 24px);
  scrollbar-width: none;
}
.view::-webkit-scrollbar { display: none; }
.view.has-fab { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 92px); }
.view > * + * { margin-top: 16px; }

.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.top h1 { margin-top: 2px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin-top: 24px !important; }
.section-title button { color: var(--text); font-weight: 600; font-size: 14px; text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: 3px; text-underline-offset: 4px; }

/* ---------- Tab bar ---------- */
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  z-index: 10;
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 10.5px; font-weight: 600; color: var(--muted);
}
.tab svg { width: 22px; height: 22px; padding: 3px 14px; box-sizing: content-box; border-radius: 99px; transition: background .2s; }
.tab.active { color: var(--text); }
.tab.active svg { background: var(--yellow); color: var(--choco); }


/* ---------- Composants ---------- */
.card { background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.icon-btn {
  width: 42px; height: 42px; border-radius: 14px; flex: none;
  display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow);
  position: relative;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.ghost { background: var(--surface-2); box-shadow: none; }
.badge {
  position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 10px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--choco);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 22px; border-radius: 99px; font-weight: 700;
  background: var(--primary); color: var(--primary-ink); width: 100%;
  transition: transform .1s, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.secondary { background: var(--primary-soft); color: var(--text); }
.btn.cta { background: var(--red); color: #fff; border: 2px solid var(--choco); }
.btn.yellow { background: var(--yellow); color: var(--choco); border: 2px solid var(--choco); }
.btn.outline { background: transparent; border: 1.5px solid var(--line); color: var(--text); }
.btn.danger { background: transparent; color: var(--danger); border: 1.5px solid color-mix(in srgb, var(--danger) 35%, transparent); }
.btn.accent { background: var(--accent); color: #fff; }
.btn.sm { height: 38px; padding: 0 16px; border-radius: 99px; font-size: 14px; width: auto; }
.btn svg { width: 18px; height: 18px; }
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 700; background: var(--primary-soft); color: var(--text); border: 1.5px solid var(--choco);
}
:root[data-theme="dark"] .pill { border-color: color-mix(in srgb, var(--yellow) 55%, transparent); }
.pill.red { background: var(--red); color: #fff; }
.pill.price-pill { background: var(--yellow); color: var(--choco); font-family: var(--font-title); font-size: 15px; font-weight: 800; padding: 2px 12px; }
.pill.warn { background: var(--accent-soft); color: var(--text); }
.pill.grey { background: var(--surface-2); color: var(--muted); border-color: transparent; }

.chips { display: flex; gap: 8px; overflow-x: auto; margin-left: -16px; margin-right: -16px; padding: 2px 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 36px; padding: 0 16px; border-radius: 99px; font-size: 14px; font-weight: 600;
  background: var(--surface-2); border: 1.5px solid transparent; color: var(--text);
}
.chip.on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }

.search {
  display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
}
.search svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; height: 100%; }

.bar { height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 8px; transition: width .5s cubic-bezier(.2,.8,.2,1); }

/* ---------- Anneau calories ---------- */
.today { display: flex; align-items: center; gap: 18px; }
.ring-wrap { position: relative; flex: none; }
.ring-bg { stroke: var(--surface-2); }
.ring-fg { stroke: var(--ring); transition: stroke-dashoffset .8s cubic-bezier(.2,.8,.2,1); }
.ring.over .ring-fg { stroke: var(--red); }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-label strong { font-size: 28px; letter-spacing: -.03em; line-height: 1; }
.ring-label span { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.today-stats { flex: 1; min-width: 0; display: grid; gap: 10px; }
.macro-top { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 4px; }
.macro-top b { font-weight: 600; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kpi { background: var(--surface-2); border-radius: 14px; padding: 8px 10px; }
.kpi strong { display: block; font-size: 16px; }

/* ---------- Eau ---------- */
.water { display: flex; gap: 6px; justify-content: space-between; margin-top: 10px; }
.drop { width: 34px; height: 40px; display: grid; place-items: center; color: color-mix(in srgb, var(--muted) 30%, transparent); transition: transform .15s; }
.drop svg { width: 26px; height: 30px; }
.drop.on { color: var(--water); }
.drop:active { transform: scale(.88); }

/* ---------- Repas ---------- */
.meal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.meal {
  background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  cursor: pointer; display: flex; flex-direction: column; transition: transform .15s;
}
.meal:active { transform: scale(.98); }
.meal-img {
  aspect-ratio: 4/3; display: grid; place-items: center; font-size: 52px; position: relative;
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.7), transparent 60%), var(--tile);
}
:root[data-theme="dark"] .meal-img, :root[data-theme="dark"] .hero-tile { background: color-mix(in srgb, var(--tile) 38%, var(--surface-2)); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .meal-img, :root:not([data-theme="light"]) .hero-tile { background: color-mix(in srgb, var(--tile) 38%, var(--surface-2)); }
}
.meal-img .tag { position: absolute; top: 8px; left: 8px; font-size: 10.5px; padding: 1px 8px; background: var(--cream); color: var(--choco); border: 1.5px solid var(--choco); border-radius: 99px; font-weight: 700; }
.meal-price { color: var(--price); font-family: var(--font-title); font-weight: 800; font-size: 16px; }
.meal-info { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.meal-info h3 { font-size: 15.5px; line-height: 1.15; }
.meal-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 6px; }
.add {
  width: 34px; height: 34px; border-radius: 50%; background: var(--yellow); color: var(--choco); border: 2px solid var(--choco);
  display: grid; place-items: center;
}
.add svg { width: 18px; height: 18px; }
.hscroll { display: flex; gap: 12px; overflow-x: auto; margin: 0 -16px; padding: 4px 16px 8px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll .meal { flex: 0 0 156px; scroll-snap-align: start; }

/* ---------- Listes ---------- */
.list { display: grid; }
.li { display: flex; align-items: center; gap: 12px; padding: 11px 0; }
.li + .li { border-top: 1px solid var(--line); }
.li .emo { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-size: 22px; flex: none; background: var(--tile, var(--surface-2)); }
.li .name { font-weight: 600; font-size: 14.5px; line-height: 1.25; }
.li.menu-li { cursor: pointer; width: 100%; text-align: left; }
.li.menu-li > svg { width: 18px; height: 18px; color: var(--muted); }
.li .lead-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--text); flex: none; }
.li .lead-ic svg { width: 20px; height: 20px; }

.stepper { display: flex; align-items: center; gap: 4px; background: var(--surface-2); border-radius: 12px; padding: 3px; }
.stepper button { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; }
.stepper button:not(:disabled):active { background: var(--surface); }
.stepper button:disabled { opacity: .3; }
.stepper svg { width: 16px; height: 16px; }
.stepper span { min-width: 20px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Journal ---------- */
.date-nav { display: flex; align-items: center; justify-content: space-between; background: var(--surface); border-radius: 16px; padding: 6px; box-shadow: var(--shadow); }
.date-nav button.icon-btn { box-shadow: none; background: var(--surface-2); width: 38px; height: 38px; border-radius: 12px; }
.date-nav button:disabled { opacity: .3; }
.slot-head { display: flex; align-items: center; justify-content: space-between; }
.slot-head h3 { display: flex; align-items: center; gap: 8px; }
.slot-add { color: var(--choco); width: 34px; height: 34px; border-radius: 50%; background: var(--yellow); border: 2px solid var(--choco); display: grid; place-items: center; }
.slot-add svg { width: 18px; height: 18px; }
.empty-slot { color: var(--muted); font-size: 13px; padding: 8px 0 2px; }
.rm { color: var(--muted); width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; }
.rm svg { width: 17px; height: 17px; }

.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 10px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .target { stroke: var(--red); stroke-dasharray: 4 4; stroke-width: 1.5; }
.chart .line { stroke: var(--orange); stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.chart .area { fill: var(--yellow); opacity: .3; }
.chart .dot { fill: var(--surface); stroke: var(--orange); stroke-width: 2; }
.chart .barv { fill: var(--yellow); stroke: var(--choco); stroke-width: 1.5; }
.chart .barv.over { fill: var(--red); }
.chart .barv.today { opacity: 1; }
.chart .barv.empty { fill: var(--surface-2); stroke: none; }

/* ---------- Abonnement ---------- */
.hero {
  border-radius: 24px; padding: 20px; color: var(--choco); position: relative; overflow: hidden;
  background: var(--yellow); border: 2px solid var(--choco);
}
.hero::after { content: "🍲"; position: absolute; right: -8px; bottom: -14px; font-size: 100px; opacity: .9; transform: rotate(-10deg); }
.hero h2 { font-size: 26px; max-width: 75%; line-height: 1.05; }
.hero h2.outlined { -webkit-text-stroke-width: 5px; }
.hero p { margin-top: 8px; max-width: 72%; font-size: 14px; }
.hero .btn { margin-top: 14px; width: auto; height: 42px; font-size: 14px; background: var(--choco); color: var(--cream); }
.plan {
  display: block; width: 100%; text-align: left; background: var(--surface); border: 2px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; position: relative; transition: border-color .2s, background .2s;
}
.plan + .plan { margin-top: 10px; }
.plan.on { border-color: var(--choco); background: color-mix(in srgb, var(--yellow) 22%, var(--surface)); }
.plan .radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: grid; place-items: center; }
.plan.on .radio { border-color: var(--primary); }
.plan.on .radio::after { content: ""; width: 11px; height: 11px; border-radius: 50%; background: var(--primary); }
.plan .ribbon { position: absolute; top: -11px; right: 14px; background: var(--red); color: #fff; border: 1.5px solid var(--choco); font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 99px; }
.price { font-size: 22px; font-weight: 800; line-height: 1.1; }
.days { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.day { height: 54px; border-radius: 14px; background: var(--surface); border: 1.5px solid var(--line); font-weight: 700; font-size: 13px; display: grid; place-content: center; text-align: center; line-height: 1.15; }
.day small { font-weight: 500; color: var(--muted); font-size: 11px; }
.day.on { border-color: var(--choco); background: var(--yellow); color: var(--choco); }
.day.on small { color: inherit; opacity: .8; }
.sub-status {
  border-radius: 24px; padding: 18px; color: var(--cream); background: var(--choco);
  position: relative; overflow: hidden; border: 2px solid var(--choco);
}
.sub-status.paused { background: #6B5249; }
.sub-status .pill { background: var(--yellow); color: var(--choco); border-color: var(--yellow); }
.sub-status .big { font-size: 28px; font-weight: 800; line-height: 1.05; margin-top: 12px; color: var(--yellow); }
.sub-status .bar { background: rgba(255,248,236,.18); margin-top: 8px; }
.sub-status .bar > i { background: var(--yellow); }
.sub-status .btn { background: var(--yellow); color: var(--choco); height: 44px; font-size: 14px; margin-top: 14px; }
.sub-status::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,198,26,.1); }
.week { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.week + .week { border-top: 1px solid var(--line); }
.cal { width: 48px; height: 52px; border-radius: 14px; background: var(--surface-2); display: grid; place-content: center; text-align: center; flex: none; line-height: 1.05; }
.cal b { font-size: 19px; }
.cal small { font-size: 10.5px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.week.skipped .cal, .week.skipped .grow { opacity: .45; }
.toggle { width: 46px; height: 28px; border-radius: 99px; background: var(--line); position: relative; transition: background .2s; flex: none; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.toggle.on { background: var(--orange); }
.toggle.on::after { transform: translateX(18px); }
.actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.action-tile { background: var(--surface); border-radius: 16px; padding: 14px; text-align: left; box-shadow: var(--shadow); display: grid; gap: 8px; font-weight: 600; font-size: 14px; }
.action-tile svg { width: 22px; height: 22px; color: var(--orange); }
.action-tile.danger svg, .action-tile.danger { color: var(--danger); }

/* ---------- Commandes ---------- */
.order-banner { display: flex; align-items: center; gap: 12px; background: var(--accent-soft); border-radius: 18px; padding: 12px 14px; }
.order-banner .emo { font-size: 26px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 8px; }
.steps i { height: 4px; border-radius: 4px; background: var(--line); }
.steps i.on { background: var(--orange); }

/* ---------- Profil ---------- */
.avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--yellow); color: var(--cream); -webkit-text-stroke: 4px var(--choco); paint-order: stroke fill; border: 2px solid var(--choco); font-family: var(--font-title); font-size: 30px; font-weight: 800; display: grid; place-items: center; flex: none; }

/* ---------- Formulaires ---------- */
.field { display: grid; gap: 6px; }
.field + .field, .field-row + .field, .field + .field-row, .field-row + .field-row { margin-top: 14px; }
.field label, .field .lbl { font-size: 13px; font-weight: 600; color: var(--muted); }
.field input, .field select {
  height: 48px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface);
  padding: 0 14px; outline: 0; width: 100%; appearance: none; -webkit-appearance: none;
}
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B736E' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 38px; }
.field input:focus, .field select:focus { border-color: var(--primary); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-row .field + .field { margin-top: 0; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border-radius: 14px; padding: 4px; gap: 4px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: grid; place-items: center; height: 40px; border-radius: 11px; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.seg input:focus-visible + span { outline: 2.5px solid var(--accent); }
.goals { display: grid; gap: 8px; }
.goal { position: relative; }
.goal input { position: absolute; opacity: 0; }
.goal span { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 16px; background: var(--surface); }
.goal span em { font-style: normal; font-size: 24px; }
.goal span small { display: block; color: var(--muted); font-size: 12.5px; }
.goal input:checked + span { border-color: var(--choco); background: color-mix(in srgb, var(--yellow) 22%, var(--surface)); }
.goal input:focus-visible + span { outline: 2.5px solid var(--accent); }

/* ---------- Onboarding ---------- */
.onb { flex: 1; overflow-y: auto; padding: calc(var(--safe-t) + 20px) 20px calc(var(--safe-b) + 24px); display: flex; flex-direction: column; }
.onb-splash { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.onb-logo { width: 100%; max-width: 230px; height: auto; border-radius: 28px; border: 2px solid var(--choco); display: block; }
.onb h1 { font-size: 34px; }
.onb .outlined { font-size: 46px; line-height: 1; }
.onb .feat { display: flex; gap: 12px; align-items: flex-start; }
.onb .feat em { font-style: normal; font-size: 22px; width: 44px; height: 44px; border-radius: 14px; background: var(--surface); display: grid; place-items: center; flex: none; box-shadow: var(--shadow); }
.onb .feat b { display: block; }

/* ---------- Bottom sheet ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(10, 15, 12, .45); z-index: 40; }
.sheet {
  position: fixed; left: 50%; bottom: 0; width: 100%; max-width: 440px; transform: translateX(-50%);
  max-height: 90dvh; background: var(--bg); border-radius: 28px 28px 0 0; z-index: 41;
  display: flex; flex-direction: column; box-shadow: 0 -10px 40px rgba(0,0,0,.2);
}
@media (min-width: 600px) { .sheet { bottom: 2dvh; border-radius: 28px; max-height: 86dvh; } }
.backdrop.in { animation: fade .25s ease both; }
.sheet.in { animation: up .32s cubic-bezier(.2,.9,.25,1) both; }
.backdrop.out { animation: fade .2s ease reverse both; }
.sheet.out { animation: up .22s ease-in reverse both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes up { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
.grab { width: 40px; height: 5px; border-radius: 5px; background: var(--line); margin: 8px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px 6px; flex: none; }
.sheet-head .icon-btn { width: 36px; height: 36px; border-radius: 12px; background: var(--surface-2); box-shadow: none; }
.sheet-body { overflow-y: auto; padding: 8px 16px 16px; flex: 1; }
.sheet-body > * + * { margin-top: 14px; }
.sheet-foot { padding: 12px 16px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--bg); flex: none; display: grid; gap: 8px; border-radius: 0 0 28px 28px; }
.hero-tile { height: 170px; border-radius: 22px; display: grid; place-items: center; font-size: 92px; background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.7), transparent 60%), var(--tile); }
.macros4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.macros4 div { background: var(--surface); border-radius: 14px; padding: 10px 6px; text-align: center; }
.macros4 strong { display: block; font-size: 17px; }
.macros4 span { font-size: 11.5px; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.summary-line { display: flex; justify-content: space-between; padding: 4px 0; }
.summary-line.total { font-weight: 800; font-size: 17px; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 6px; }
.note { font-size: 12.5px; color: var(--muted); background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }

/* ---------- FAB panier ---------- */
.cart-fab {
  position: absolute; left: 16px; right: 16px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px); z-index: 9;
  height: 56px; border-radius: 99px; background: var(--red); color: #fff; border: 2px solid var(--choco);
  display: flex; align-items: center; justify-content: space-between; padding: 0 20px; font-weight: 700;
  box-shadow: 0 10px 30px rgba(232,50,60,.35); animation: pop .3s cubic-bezier(.2,.9,.3,1.3) both;
}
.cart-fab .count { background: rgba(255,255,255,.2); border-radius: 10px; padding: 3px 9px; margin-right: 8px; }
@keyframes pop { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Toast ---------- */
#toast-root { position: fixed; left: 0; right: 0; top: calc(var(--safe-t) + 14px); display: grid; justify-items: center; z-index: 60; pointer-events: none; }
.toast {
  background: var(--choco); color: var(--cream); padding: 11px 18px; border-radius: 99px; border: 2px solid var(--yellow); font-weight: 600; font-size: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: toast 2.6s ease both; max-width: calc(100% - 32px);
}
@keyframes toast { 0% { opacity: 0; transform: translateY(-14px); } 10%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-8px); } }

.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty em { font-style: normal; font-size: 42px; display: block; margin-bottom: 6px; }

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

/* ---------- Barre d'application (charte : icône 32 px + nom en Baloo 2) ---------- */
.appbar {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: calc(var(--safe-t) + 10px) 16px 10px; min-height: calc(var(--appbar-h) + var(--safe-t));
  background: var(--yellow); color: var(--choco); border-bottom: 2px solid var(--choco); z-index: 5;
}
.appbar img { width: 36px; height: 36px; border-radius: 10px; border: 1.5px solid var(--choco); }
.appbar .brand { font-family: var(--font-title); font-weight: 800; font-size: 19px; line-height: 1; flex: 1; }
.appbar .icon-btn { background: var(--cream); border: 2px solid var(--choco); box-shadow: none; border-radius: 50%; color: var(--choco); }
.hero-tile, .meal-img { border-bottom: 0; }
:root[data-theme="dark"] .sub-status, :root[data-theme="dark"] .hero { border-color: var(--yellow); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sub-status, :root:not([data-theme="light"]) .hero { border-color: var(--yellow); } }

/* ---------- Paiement, badges, épuisé ---------- */
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pay { position: relative; }
.pay input { position: absolute; opacity: 0; }
.pay span { display: flex; align-items: center; gap: 6px; min-height: 46px; padding: 8px 10px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 600; line-height: 1.2; }
.pay input:checked + span { border-color: var(--choco); background: color-mix(in srgb, var(--yellow) 22%, var(--surface)); }
.pay input:focus-visible + span { outline: 2.5px solid var(--orange); }
.meal-img .tag.hot { left: auto; right: 8px; background: var(--red); color: #fff; }
.meal.sold-out .meal-img { filter: grayscale(.9); opacity: .6; }
.meal.sold-out .meal-img .tag.hot { background: var(--choco); color: var(--cream); filter: none; }
.add:disabled { opacity: .35; cursor: not-allowed; }
