@font-face { font-family: 'Inter'; font-weight: 400; font-style: normal; font-display: swap; src: url('/fonts/Inter-400.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-style: normal; font-display: swap; src: url('/fonts/Inter-500.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-style: normal; font-display: swap; src: url('/fonts/Inter-600.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-style: normal; font-display: swap; src: url('/fonts/Inter-700.ttf') format('truetype'); }
@font-face { font-family: 'Fraunces'; font-weight: 600; font-style: normal; font-display: swap; src: url('/fonts/Fraunces-600.ttf') format('truetype'); }
@font-face { font-family: 'Fraunces'; font-weight: 800; font-style: normal; font-display: swap; src: url('/fonts/Fraunces-800.ttf') format('truetype'); }

:root {
  --bg: #FAF8F5;
  --card: #FFFFFF;
  --soft: #F3EFE9;
  --ink: #1C1B18;
  --muted: #767067;
  --rule: #E8E2D9;
  --red: #D91E36;
  --red-soft: #FDECEF;
  --red-dark: #AE1328;
  --green: #16794B;
  --green-soft: #E8F6EE;
  --amber: #92400E;
  --amber-soft: #FEF3C7;
  --arnaud: #2563EB;
  --arnaud-soft: #EBF2FE;
  --alexe: #DB2777;
  --alexe-soft: #FCEAF3;
  --shadow-sm: 0 1px 2px rgba(28, 27, 24, .05), 0 4px 12px -6px rgba(28, 27, 24, .08);
  --shadow-md: 0 8px 26px -12px rgba(28, 27, 24, .18);
  --radius: 18px;
  --nav-h: 70px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font-family: 'Inter', system-ui, -apple-system, sans-serif; -webkit-tap-highlight-color: transparent; }
body { font-size: 15px; line-height: 1.45; }
h1, h2, h3, .serif { font-family: 'Fraunces', Georgia, serif; }
.num { font-variant-numeric: tabular-nums; }
button, input, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }

/* ---------- Auth / Login & Profile Picker ---------- */
.auth-body {
  min-height: 100dvh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(circle at 15% 15%, #FFE7EB 0%, transparent 45%),
              radial-gradient(circle at 85% 85%, #FEF3C7 0%, transparent 45%), var(--bg);
}
.auth-card {
  width: 100%; max-width: 400px; background: var(--card); border-radius: 24px;
  padding: 28px 24px; box-shadow: var(--shadow-md); border: 1px solid var(--rule); text-align: center;
}
.auth-badge {
  width: 60px; height: 60px; border-radius: 18px; background: var(--red-soft); color: var(--red);
  display: inline-grid; place-items: center; font-size: 30px; margin-bottom: 12px;
}
.auth-card h1 { margin: 0 0 6px; font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
.auth-sub { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.auth-err { background: #FDECEC; color: #9F1D1D; border-radius: 12px; padding: 10px 12px; font-size: 13.5px; margin-bottom: 14px; }
.auth-form { display: grid; gap: 10px; }
.auth-form input {
  width: 100%; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--rule);
  font-size: 16px; background: var(--bg); transition: border-color .15s, box-shadow .15s;
}
.auth-form input:focus { outline: none; border-color: var(--red); background: #fff; box-shadow: 0 0 0 4px rgba(217, 30, 54, .12); }
.auth-form button {
  padding: 14px; border-radius: 14px; border: 0; background: linear-gradient(135deg, #F02E46, var(--red));
  color: #fff; font-weight: 700; font-size: 16px; cursor: pointer;
}
.pick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pick-btn {
  border: 2px solid var(--rule); background: var(--card); border-radius: 20px; padding: 22px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; cursor: pointer;
  font-weight: 700; font-size: 17px; color: var(--ink); transition: transform .12s, border-color .15s;
}
.pick-btn:active { transform: scale(.97); }
.pick-btn:hover { border-color: var(--red); }
.pick-av {
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-size: 24px; font-weight: 800; font-family: 'Fraunces', serif;
}
.pick-btn.p-arnaud .pick-av { background: var(--arnaud); }
.pick-btn.p-alexe .pick-av { background: var(--alexe); }

/* ---------- Boot Loader ---------- */
.boot-loader { min-height: 80dvh; display: grid; place-content: center; text-align: center; color: var(--muted); gap: 8px; }
.boot-logo { font-size: 40px; animation: pulse 1.4s infinite ease-in-out; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

/* ---------- App Shell & Sticky Header ---------- */
.app-shell { max-width: 640px; margin: 0 auto; min-height: 100dvh; padding-bottom: calc(var(--nav-h) + 22px + env(safe-area-inset-bottom)); }
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(250, 248, 245, .88); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(232, 226, 217, .85);
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
}
.topbar-row { display: flex; align-items: center; gap: 8px; }
.brand { flex: 1; min-width: 0; }
.brand-title { font-family: 'Fraunces', serif; font-size: 21px; font-weight: 800; letter-spacing: -.02em; display: flex; align-items: center; gap: 6px; line-height: 1.1; }
.week-select {
  margin-top: 2px; border: 0; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 600;
  padding: 0; cursor: pointer; max-width: 100%;
}
.top-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--rule); background: var(--card);
  color: var(--ink); border-radius: 999px; padding: 6px 11px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.04); min-height: 34px;
}
.pill-btn:active { transform: scale(.96); }
.me-pill { padding: 4px 10px 4px 4px; }
.av-dot {
  width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 11.5px; flex: none;
}
.av-arnaud { background: var(--arnaud); }
.av-alexe { background: var(--alexe); }

/* ---------- Live Job Progress Banner ---------- */
.job-banner {
  margin-top: 9px; background: var(--card); border: 1px solid #F7C7CE; border-radius: 14px;
  padding: 9px 12px; box-shadow: var(--shadow-sm);
}
.job-banner.err { border-color: #F2B8B5; background: #FFF5F5; }
.job-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; font-weight: 600; }
.job-msg { display: flex; align-items: center; gap: 7px; min-width: 0; }
.spinner {
  width: 13px; height: 13px; border: 2px solid var(--red-soft); border-top-color: var(--red);
  border-radius: 50%; animation: spin .8s linear infinite; flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.prog-track { height: 6px; background: var(--soft); border-radius: 999px; overflow: hidden; margin-top: 7px; }
.prog-fill { height: 100%; background: linear-gradient(90deg, #FF3B53, var(--red)); border-radius: 999px; transition: width .4s ease; }

/* ---------- Main View & Cards ---------- */
.view { padding: 14px; display: grid; gap: 14px; }
.card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--rule); box-shadow: var(--shadow-sm); padding: 14px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 2px 2px -4px; flex-wrap: wrap; }
.sec-head h2 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.sec-head small { color: var(--muted); font-size: 12px; font-weight: 600; }

/* ---------- Tab 1: Courses Summary & Filters ---------- */
.summary-card {
  background: linear-gradient(135deg, #221E1C 0%, #332B27 100%); color: #fff;
  border: 0; padding: 16px; position: relative; overflow: hidden;
}
.summary-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.sum-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .09em; opacity: .72; font-weight: 600; }
.sum-price { font-family: 'Fraunces', serif; font-size: 30px; font-weight: 800; line-height: 1.05; margin-top: 2px; }
.sum-sub { font-size: 12.5px; opacity: .82; margin-top: 3px; }
.sum-right { text-align: right; }
.sum-count { font-size: 18px; font-weight: 700; }
.sum-bar { height: 8px; background: rgba(255,255,255,.16); border-radius: 999px; overflow: hidden; margin-top: 12px; }
.sum-bar-fill { height: 100%; background: linear-gradient(90deg, #4ADE80, #22C55E); border-radius: 999px; transition: width .25s ease; }
.warn-strip {
  margin-top: 10px; background: rgba(254, 243, 199, .18); border: 1px solid rgba(254, 243, 199, .35);
  color: #FEF3C7; border-radius: 10px; padding: 7px 10px; font-size: 12px;
}

.controls-bar { display: grid; gap: 8px; }
.seg-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.seg-btn {
  border: 1px solid var(--rule); background: var(--card); color: var(--muted); border-radius: 999px;
  padding: 6px 10px; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; min-height: 34px;
}
.seg-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.seg-spacer { flex: 1; }
.reset-btn { background: transparent; border: 0; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; padding: 6px 4px; white-space: nowrap; }

.search-wrap { position: relative; }
.search-wrap input {
  width: 100%; padding: 11px 36px 11px 36px; border-radius: 14px; border: 1px solid var(--rule);
  background: var(--card); font-size: 15px; box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.search-wrap input:focus { outline: none; border-color: var(--red); }
.search-ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.clear-ic { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: var(--soft); color: var(--muted); width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-size: 12px; }

.quick-add { display: flex; gap: 8px; }
.quick-add input {
  flex: 1; min-width: 0; padding: 11px 14px; border-radius: 14px; border: 1px solid var(--rule);
  background: var(--card); font-size: 15px;
}
.quick-add input:focus { outline: none; border-color: var(--red); }
.btn-primary {
  border: 0; border-radius: 14px; padding: 11px 16px; background: linear-gradient(135deg, #F02E46, var(--red));
  color: #fff; font-weight: 700; font-size: 14.5px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px;
}
.btn-primary:active { transform: scale(.97); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.btn-soft {
  border: 1px solid var(--rule); border-radius: 14px; padding: 11px 14px; background: var(--card);
  color: var(--ink); font-weight: 600; font-size: 14.5px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px;
}

/* ---------- Rayons & Items ---------- */
.rayon-card { padding: 0; overflow: hidden; }
.rayon-card.all-done { opacity: .72; }
.rayon-hd {
  width: 100%; border: 0; background: var(--soft); padding: 11px 14px; display: flex; align-items: center; gap: 8px;
  cursor: pointer; text-align: left; color: var(--ink);
}
.rayon-ic { font-size: 18px; line-height: 1; }
.rayon-title { font-weight: 700; font-size: 14px; flex: 1; }
.rayon-meta { font-size: 12px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.rayon-chev { font-size: 11px; color: var(--muted); transition: transform .2s; }
.rayon-card.collapsed .rayon-chev { transform: rotate(-90deg); }
.rayon-list { display: grid; }
.rayon-card.collapsed .rayon-list { display: none; }

.item-row {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; border-top: 1px solid #F2EEE8;
  background: var(--card); transition: background .15s;
}
.item-row.checked { background: #FAFDFB; }
.chk-btn {
  width: 28px; height: 28px; border-radius: 9px; border: 2px solid #CFC8BD; background: #fff;
  display: grid; place-items: center; flex: none; margin-top: 1px; cursor: pointer; color: #fff; font-size: 15px; font-weight: 800;
  transition: all .15s;
}
.item-row.checked .chk-btn { background: var(--green); border-color: var(--green); }
.item-body { flex: 1; min-width: 0; cursor: pointer; }
.item-title { font-size: 15px; font-weight: 500; line-height: 1.32; overflow-wrap: anywhere; }
.item-row.checked .item-title { text-decoration: line-through; color: var(--muted); }
.qte-pill {
  display: inline-block; background: var(--red-soft); color: var(--red); font-weight: 800; font-size: 12px;
  padding: 1px 6px; border-radius: 6px; margin-right: 5px;
}
.item-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 4px; font-size: 11.5px; color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 999px; font-weight: 700; font-size: 11px; }
.b-arnaud { background: var(--arnaud-soft); color: var(--arnaud); }
.b-alexe { background: var(--alexe-soft); color: var(--alexe); }
.b-promo { background: var(--amber-soft); color: var(--amber); }
.b-ko { background: #FDECEC; color: #B42318; }
.b-rempl { background: #EEF2F6; color: #475569; }
.item-end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.item-price { font-weight: 700; font-size: 14.5px; }
.drive-link {
  font-size: 11.5px; font-weight: 700; color: var(--red); background: var(--red-soft);
  padding: 3px 8px; border-radius: 8px; display: inline-flex; align-items: center; gap: 2px;
}

/* ---------- Placard ---------- */
.placard-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.placard-chip {
  border: 1px solid var(--rule); background: var(--bg); color: var(--ink); border-radius: 999px;
  padding: 6px 11px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.placard-chip:hover { border-color: var(--red); color: var(--red); }

/* ---------- Tab 2: Menu ---------- */
.day-card { padding: 14px; display: grid; gap: 10px; }
.day-card.today { border-color: var(--red); box-shadow: 0 0 0 1px rgba(217,30,54,.22), var(--shadow-sm); }
.day-head { display: flex; align-items: center; justify-content: space-between; }
.day-name { font-family: 'Fraunces', serif; font-size: 18px; font-weight: 800; }
.today-tag { background: var(--red); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; }
.meal-slot { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 13px; background: var(--bg); }
.meal-slot.clickable { cursor: pointer; transition: background .15s; }
.meal-slot.clickable:hover { background: var(--soft); }
.meal-thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex: none; background: var(--soft); }
.meal-thumb.empty { display: grid; place-items: center; font-size: 20px; }
.meal-info { flex: 1; min-width: 0; }
.meal-kicker { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.meal-name { font-size: 14.5px; font-weight: 600; line-height: 1.3; margin-top: 1px; }
.meal-name.muted { color: var(--muted); font-weight: 500; }
.meal-go { color: var(--red); font-weight: 700; font-size: 13px; flex: none; }

/* ---------- Tab 3: Recettes Grid ---------- */
.rec-grid { display: grid; gap: 12px; }
.rec-card {
  background: var(--card); border-radius: var(--radius); border: 1px solid var(--rule); box-shadow: var(--shadow-sm);
  overflow: hidden; cursor: pointer; transition: transform .12s;
}
.rec-card:active { transform: scale(.985); }
.rec-media { position: relative; height: 165px; background: linear-gradient(135deg, #F8E8E2, #F4ECE1); overflow: hidden; }
.rec-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rec-media-fallback { height: 100%; display: grid; place-items: center; font-size: 46px; }
.rec-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(20,18,16,.62) 0%, transparent 55%); pointer-events: none; }
.rec-badges { position: absolute; left: 12px; right: 12px; bottom: 10px; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rec-badge { background: rgba(255,255,255,.92); color: var(--ink); font-size: 11.5px; font-weight: 700; padding: 4px 9px; border-radius: 999px; }
.rec-body { padding: 12px 14px 14px; }
.rec-title { margin: 0; font-family: 'Fraunces', serif; font-size: 18px; font-weight: 800; line-height: 1.22; }
.rec-sub { margin-top: 5px; color: var(--muted); font-size: 12.5px; display: flex; align-items: center; justify-content: space-between; }

/* ---------- Modal Mode Cuisine ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(20, 18, 16, .55);
  display: flex; align-items: flex-end; justify-content: center; backdrop-filter: blur(4px);
}
.modal-sheet {
  width: 100%; max-width: 640px; max-height: 94dvh; background: var(--bg);
  border-radius: 24px 24px 0 0; overflow-y: auto; padding-bottom: calc(28px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(0,0,0,.25);
}
.modal-hero { position: relative; height: 220px; background: var(--soft); }
.modal-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.modal-close {
  position: absolute; top: 12px; right: 12px; z-index: 3; width: 38px; height: 38px; border-radius: 50%;
  border: 0; background: rgba(28, 27, 24, .72); color: #fff; font-size: 18px; cursor: pointer;
}
.modal-content { padding: 16px; display: grid; gap: 14px; }
.modal-title { margin: 0; font-family: 'Fraunces', serif; font-size: 24px; font-weight: 800; line-height: 1.15; }
.meta-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.meta-pill { background: var(--card); border: 1px solid var(--rule); border-radius: 999px; padding: 5px 10px; font-size: 12.5px; font-weight: 600; }
.wake-btn {
  width: 100%; padding: 10px 14px; border-radius: 13px; border: 1px solid var(--rule); background: var(--card);
  font-weight: 700; font-size: 13.5px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.wake-btn.on { background: var(--amber-soft); border-color: #F59E0B; color: var(--amber); }
.cook-ing { display: grid; gap: 7px; }
.cook-ing-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 11px; background: var(--bg); cursor: pointer;
}
.cook-ing-row.done { opacity: .55; text-decoration: line-through; }
.step-card {
  display: flex; gap: 12px; padding: 12px; border-radius: 14px; border: 1.5px solid var(--rule); background: var(--card);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.step-card.active { border-color: var(--red); background: #FFF9FA; }
.step-card.done { opacity: .55; }
.step-num {
  width: 28px; height: 28px; border-radius: 50%; background: var(--soft); color: var(--ink);
  font-weight: 800; font-size: 13px; display: grid; place-items: center; flex: none;
}
.step-card.active .step-num { background: var(--red); color: #fff; }
.step-card.done .step-num { background: var(--green); color: #fff; }
.astuce-box { background: var(--amber-soft); color: #78350F; border-radius: 14px; padding: 12px 14px; font-size: 13.5px; }
.photo-credit { font-size: 11px; color: var(--muted); text-align: center; }

/* ---------- Tab 4: Ajouts, Favoris, Consigne, Actions IA ---------- */
.fav-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.fav-chip {
  border: 1px solid var(--rule); background: var(--bg); color: var(--ink); border-radius: 999px;
  padding: 8px 12px; font-size: 13.5px; font-weight: 600; cursor: pointer; min-height: 38px;
}
.fav-chip:hover { border-color: var(--red); color: var(--red); }
.fav-chip.in { background: var(--green-soft); border-color: #B4E2C6; color: var(--green); }
.wait-list { display: grid; gap: 8px; }
.wait-row {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px;
  background: var(--bg); border: 1px solid var(--rule);
}
.wait-info { flex: 1; min-width: 0; }
.wait-name { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.wait-meta { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 0; background: var(--card); color: var(--muted);
  cursor: pointer; display: grid; place-items: center; font-size: 16px; border: 1px solid var(--rule);
}
.icon-btn.star-on { background: var(--amber-soft); color: #D97706; border-color: #FCD34D; }
.consigne-ta {
  width: 100%; min-height: 76px; padding: 11px 13px; border-radius: 13px; border: 1px solid var(--rule);
  background: var(--bg); resize: vertical; font-size: 14.5px;
}
.consigne-ta:focus { outline: none; border-color: var(--red); background: #fff; }
.ai-actions { display: grid; gap: 10px; }
.ai-card-btn {
  width: 100%; text-align: left; border-radius: 16px; padding: 14px 16px; border: 0; cursor: pointer;
  display: flex; align-items: center; gap: 12px;
}
.ai-card-btn.primary { background: linear-gradient(135deg, #F02E46, var(--red)); color: #fff; }
.ai-card-btn.secondary { background: var(--card); color: var(--ink); border: 1.5px solid var(--rule); }
.ai-card-btn:disabled { opacity: .45; cursor: not-allowed; }
.ai-ic { font-size: 24px; flex: none; }
.ai-txt strong { display: block; font-size: 15px; }
.ai-txt span { display: block; font-size: 12px; opacity: .82; margin-top: 2px; }

/* ---------- Bottom Navigation ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; justify-content: center;
  background: rgba(255, 255, 255, .9); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--rule); padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.bottom-nav-inner { width: 100%; max-width: 640px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.nav-tab {
  border: 0; background: transparent; color: var(--muted); border-radius: 14px; padding: 6px 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11px; font-weight: 700; cursor: pointer; position: relative; min-height: 52px;
}
.nav-tab .nav-ic { font-size: 20px; line-height: 1; }
.nav-tab.active { color: var(--red); background: var(--red-soft); }
.nav-badge {
  position: absolute; top: 4px; right: 16%; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 800; min-width: 17px; height: 17px; border-radius: 999px;
  display: grid; place-items: center; padding: 0 4px;
}

/* ---------- Toast & Empty State ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 70; background: #1C1B18; color: #fff;
  padding: 10px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow-md); max-width: 90vw; text-align: center;
}
.toast.err { background: #9F1D1D; }
.empty-box { text-align: center; color: var(--muted); padding: 24px 16px; font-size: 14px; }
details.fav-manage summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); padding: 6px 0; }

/* ---------- Sélection « Garder / Régénérer les autres » ---------- */
.rec-card.kept {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(22, 121, 75, .18), var(--shadow-sm);
}
.keep-btn {
  border: 1px solid rgba(28, 27, 24, .14); background: rgba(255, 255, 255, .94); color: var(--ink);
  border-radius: 999px; padding: 6px 11px; font-size: 12px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px; box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
  transition: transform .12s, background .15s, color .15s, border-color .15s;
}
.keep-btn:active { transform: scale(.95); }
.keep-btn.on { background: var(--green); color: #fff; border-color: var(--green); }
.rec-keep-pos { position: absolute; top: 10px; right: 10px; z-index: 3; }

.meal-slot.kept { background: #F1FAF5; border: 1px solid #BFE6D0; }
.meal-keep-btn {
  border: 1px solid var(--rule); background: var(--card); color: var(--muted);
  border-radius: 999px; padding: 5px 9px; font-size: 11.5px; font-weight: 700;
  cursor: pointer; flex: none; display: inline-flex; align-items: center; gap: 3px;
}
.meal-keep-btn.on { background: var(--green); color: #fff; border-color: var(--green); }

.regen-card {
  background: linear-gradient(135deg, #FFFFFF 0%, #FAF5EE 100%);
  border: 1.5px solid var(--rule); display: grid; gap: 10px; padding: 13px 14px;
}
.regen-card.has-kept {
  background: linear-gradient(135deg, #F2FBF6 0%, #FFFFFF 100%);
  border-color: #9ED9B9;
}
.regen-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.regen-status { font-size: 13.5px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.regen-sub { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.regen-clear {
  border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700;
  text-decoration: underline; cursor: pointer; padding: 2px 4px;
}
.regen-note {
  width: 100%; padding: 9px 12px; border-radius: 11px; border: 1px solid var(--rule);
  background: #fff; font-size: 13.5px;
}
.regen-note:focus { outline: none; border-color: var(--red); }
.modal-actions-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 420px) { .modal-actions-row { grid-template-columns: 1fr; } }

.gen-opts { display: grid; gap: 8px; }
.gen-opt-group { display: grid; gap: 5px; }
.gen-opt-lbl { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.opt-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.opt-chip {
  border: 1px solid var(--rule); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 5px 11px; font-size: 12.5px; font-weight: 700;
  cursor: pointer; min-height: 32px; transition: background .15s, color .15s, border-color .15s;
}
.opt-chip:hover { border-color: var(--red); }
.opt-chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
