/* ==========================================================================
   Auto Cooking — feuille de style « Frais & épuré »
   Remplace app/static/css/app.css (mêmes sélecteurs, nouveau look).
   Blanc, vert sauge, cartes photo immersives, typographie Manrope.
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400..800&display=swap");

:root {
  --bg: #FFFFFF;
  --card: #F7F8F5;          /* surfaces douces */
  --card-solid: #FFFFFF;
  --ink: #1E211C;
  --ink-soft: #7B8276;
  --line: #E9ECE5;
  --primary: #55754F;        /* vert sauge */
  --primary-dark: #2C4029;   /* vert forêt */
  --primary-soft: #EDF1E8;
  --green: #55754F;
  --green-soft: #EDF1E8;
  --gold: #D9A114;
  --gold-soft: #FBF3DE;
  --danger: #B3402E;
  --danger-soft: #F7E0DC;
  --info-soft: #E8EEF3;
  --radius: 18px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(30, 33, 28, 0.04);
  --nav-height: 68px;
}

* { box-sizing: border-box; }

/* Icônes SVG inline (macro _icons.html) */
.ico { vertical-align: -0.22em; flex-shrink: 0; }
.side-link { display: flex; align-items: center; gap: 10px; }
.side-link .ico { color: var(--ink-soft); }
.side-link.active .ico { color: var(--primary-dark); }
.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--primary-dark);
  color: #fff;
}
.brand-icon .ico { vertical-align: 0; }
.card-title .ico, h2 .ico { color: var(--primary); }
.recipe-fav .ico { color: var(--gold); vertical-align: 0; }
.nav-icon .ico { vertical-align: 0; }
.meal-sub .ico, .muted .ico, .badge .ico { vertical-align: -0.18em; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + 26px);
}

h1 { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.02em; margin: 0.4em 0; }
h2 { font-size: 1.12rem; font-weight: 800; letter-spacing: -0.01em; margin: 1.1em 0 0.5em; }
h3 { font-size: 1rem; font-weight: 800; margin: 0.8em 0 0.4em; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
p { margin: 0.5em 0; }

/* --- Barre du haut --- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-icon { font-size: 1.3rem; }
.topbar-settings { font-size: 1.25rem; padding: 4px; }

/* --- Contenu --- */
.content {
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 18px 24px;
}

/* --- Messages flash --- */
.flashes { max-width: 720px; margin: 10px auto 0; padding: 0 18px; }
.flash {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  animation: fadein 0.25s ease;
}
.flash-success { background: var(--green-soft); color: #2C4029; }
.flash-error { background: var(--danger-soft); color: var(--danger); }
.flash-info { background: var(--info-soft); color: #33566E; }
@keyframes fadein { from { opacity: 0; transform: translateY(-4px); } }

/* --- Navigation basse : pilule flottante sombre --- */
.bottomnav {
  position: fixed;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  left: 14px;
  right: 14px;
  z-index: 30;
  display: flex;
  align-items: center;
  height: var(--nav-height);
  padding: 0 8px;
  background: #1E211C;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(30, 33, 28, 0.3);
}
.bottomnav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #9AA094;
  font-size: 0.64rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 6px 0;
}
.bottomnav a.active { color: #fff; }
.bottomnav a.active .nav-icon { transform: scale(1.06); }
.bottomnav .nav-icon { font-size: 1.3rem; line-height: 1; transition: transform 0.15s; }
.bottomnav .nav-cta .nav-icon {
  background: var(--primary);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -20px;
  box-shadow: 0 6px 16px rgba(85, 117, 79, 0.45);
  color: #fff;
}
.bottomnav .nav-cta.active .nav-icon { background: var(--primary-dark); }

/* --- Menu latéral --- */
.menu-btn {
  border: none;
  background: none;
  font-size: 1.35rem;
  line-height: 1;
  padding: 4px 6px;
  cursor: pointer;
  color: var(--ink);
}
.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 248px;
  background: var(--card);
  border-right: 1px solid var(--line);
  padding: 16px 14px calc(24px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  z-index: 95;
  transform: translateX(-100%);
}
@media (max-width: 899.98px) {
  .sidebar { transition: transform 0.22s ease; }
}
.sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(30, 33, 28, 0.18); }
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(30, 33, 28, 0.35);
  z-index: 94;
  display: none;
}
.sidebar-backdrop.open { display: block; }
.sidebar-brand { margin: 2px 6px 16px; font-size: 1.1rem; }
.side-section {
  margin: 16px 8px 5px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}
.side-link {
  display: block;
  padding: 9px 12px;
  border-radius: 12px;
  color: var(--ink);
  font-size: 0.93rem;
  font-weight: 600;
  margin-bottom: 2px;
}
.side-link:hover { background: #EDF1E8; color: var(--ink); }
.side-link.active {
  background: #DFE8D8;
  color: var(--primary-dark);
  font-weight: 800;
}

@media (min-width: 900px) {
  .sidebar { transform: none; box-shadow: none; }
  .sidebar-backdrop { display: none !important; }
  .menu-btn { display: none; }
  .bottomnav { display: none; }
  body { padding-left: 248px; padding-bottom: 24px; }
  .topbar { display: none; }
  .content { padding-top: 24px; }
  .flashes { margin-top: 16px; }
}

/* --- Cartes --- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: none;
  padding: 18px;
  margin-bottom: 14px;
}
.card-title {
  font-weight: 800;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --- Boutons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 20px;
  border: none;
  border-radius: 14px;
  font-size: 0.92rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  background: var(--primary-dark);
  color: #fff;
  transition: background 0.15s, transform 0.1s;
  text-align: center;
  white-space: nowrap;
}
.btn:hover { background: #223321; }
.btn:active { transform: scale(0.98); }
.btn-secondary { background: #F1F3EE; color: #2C4029; border: none; }
.btn-secondary:hover { background: #E4E8DF; }
.btn-green { background: var(--primary); }
.btn-green:hover { background: #486343; }
.btn-danger { background: transparent; color: var(--danger); border: 1.5px solid var(--danger-soft); }
.btn-sm { padding: 8px 14px; font-size: 0.82rem; border-radius: 11px; }
.btn-block { display: flex; width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #F1F3EE;
  color: #4A5246;
  border: none;
  white-space: nowrap;
}
.badge-primary { background: var(--primary-dark); color: #fff; }
.badge-green { background: var(--green-soft); color: #2C4029; font-weight: 800; }
.badge-gold { background: var(--gold-soft); color: #8A6414; }

/* --- Formulaires --- */
label { font-weight: 700; font-size: 0.88rem; display: block; margin: 12px 0 5px; }
input[type="text"], input[type="password"], input[type="number"], input[type="date"],
input[type="url"], select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #DDE2D8;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(85, 117, 79, 0.14);
}
textarea { min-height: 110px; resize: vertical; }
.form-row { display: flex; gap: 10px; }
.form-row > * { flex: 1; }
.checkbox-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  font-weight: 600;
  font-size: 0.93rem;
}
.checkbox-line input { width: 20px; height: 20px; accent-color: var(--primary); }
.hint { font-size: 0.8rem; color: var(--ink-soft); font-weight: 500; margin: 3px 0 0; }

/* --- Grille de recettes : cartes photo immersives --- */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.recipe-card {
  background: transparent;
  border-radius: var(--radius);
  box-shadow: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--ink);
  position: relative;
  transition: transform 0.12s;
}
.recipe-card:active { transform: scale(0.98); }
.recipe-photo {
  width: 100%;
  height: 128px;
  object-fit: cover;
  border-radius: 16px;
  background: var(--card);
}
.detail-photo-full {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: none;
  margin-bottom: 14px;
}
.recipe-emoji {
  font-size: 2.2rem;
  line-height: 1;
  width: 100%;
  height: 128px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border-radius: 16px;
}
.recipe-card h3 { margin: 0; font-size: 0.92rem; font-weight: 800; line-height: 1.3; }
.recipe-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; }
.recipe-meta .badge { background: transparent; padding: 0 6px 0 0; color: var(--ink-soft); font-weight: 700; }
.recipe-meta .badge-green { color: var(--primary); background: transparent; }
.recipe-meta .badge-gold { color: #8A6414; background: transparent; }
.recipe-fav {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(30, 33, 28, 0.12);
}

/* --- Filtres --- */
.filterbar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filterbar::-webkit-scrollbar { display: none; }
.filterbar select, .filterbar input {
  width: auto;
  min-width: 110px;
  flex-shrink: 0;
  font-size: 0.83rem;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 12px;
  background: #F1F3EE;
  border-color: transparent;
  color: #4A5246;
}
.searchbar { display: flex; gap: 8px; margin-bottom: 10px; }
.searchbar input { flex: 1; border-radius: 14px; background: #F1F3EE; border-color: transparent; }
.searchbar input:focus { background: #fff; border-color: var(--primary); }

/* --- Fiche recette --- */
.detail-header { display: flex; gap: 14px; align-items: flex-start; }
.detail-emoji {
  font-size: 3rem;
  width: 84px;
  height: 84px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border-radius: 22px;
  box-shadow: none;
}
.ing-list { list-style: none; padding: 0; margin: 0; }
.ing-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.ing-list li:last-child { border-bottom: none; }
.ing-qty { color: var(--primary); white-space: nowrap; font-weight: 800; }
.steps-list { padding-left: 0; list-style: none; counter-reset: step; margin: 0; }
.steps-list li {
  counter-increment: step;
  display: flex;
  gap: 13px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.steps-list li:last-child { border-bottom: none; }
.steps-list li::before {
  content: counter(step);
  flex-shrink: 0;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: var(--primary-dark);
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}
.rating-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.rating-bar button {
  flex: 1;
  min-width: 70px;
  background: #fff;
  border: 1.5px solid transparent;
  border-radius: 12px;
  padding: 10px 6px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  color: #4A5246;
}
.rating-bar button.selected {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-dark);
  font-weight: 800;
}

/* --- Planning --- */
.week-block { margin-bottom: 22px; }
.week-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.day-row {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: none;
  margin-bottom: 10px;
  padding: 12px 16px;
}
.day-row.today {
  border: 2px solid var(--primary);
  background: #fff;
  box-shadow: 0 6px 18px rgba(85, 117, 79, 0.14);
}
.day-name { font-weight: 800; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); margin-bottom: 6px; }
.day-row.today .day-name { color: var(--primary-dark); }
.day-name .today-tag {
  color: #fff;
  background: var(--primary);
  font-size: 0.66rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
  letter-spacing: 0;
  text-transform: none;
}
.meal-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  color: var(--ink);
}
.meal-line + .meal-line { border-top: 1px solid var(--line); }
.meal-slot {
  flex-shrink: 0;
  width: 44px;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--ink-soft);
  text-transform: uppercase;
}
.meal-body { flex: 1; min-width: 0; }
.meal-title {
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
a.meal-title:active { color: var(--primary-dark); }
.meal-sub { font-size: 0.75rem; font-weight: 600; color: var(--ink-soft); }
.meal-empty { display: block; color: var(--ink-soft); font-size: 0.9rem; font-style: italic; }
.meal-people { font-size: 0.73rem; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.meal-edit {
  flex-shrink: 0;
  font-size: 1rem;
  padding: 4px 6px;
  margin-left: 4px;
  border-radius: 8px;
  text-decoration: none;
}
.meal-edit:active { background: var(--card); }

/* --- Liste de courses --- */
.rayon-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  font-weight: 800;
  margin: 20px 0 8px;
}
.rayon-toggle {
  flex: none;
  border: 1px solid var(--line, #d9d9d9);
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.rayon-toggle:hover { background: var(--surface-2, #efefef); color: var(--ink, #222); }
.shop-item {
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--card);
  border-radius: 16px;
  padding: 12px 15px;
  margin-bottom: 8px;
  box-shadow: none;
}
.shop-row { display: flex; align-items: stretch; gap: 8px; }
.shop-row .shop-item { flex: 1; margin-bottom: 8px; }
.list-del {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  margin-bottom: 8px;
  background: var(--card);
  border: 1px solid transparent;
  border-radius: 16px;
  color: var(--ink-soft);
  cursor: pointer;
}
.list-del:hover {
  color: #c0392b;
  border-color: #c0392b;
  background: rgba(192, 57, 43, 0.06);
}
.shop-item input[type="checkbox"] {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  accent-color: var(--primary);
  flex-shrink: 0;
}
.shop-item .shop-name { flex: 1; font-weight: 700; }
.shop-item .shop-qty { color: var(--ink-soft); font-size: 0.82rem; font-weight: 700; white-space: nowrap; }
.shop-item.done .shop-name { text-decoration: line-through; color: var(--ink-soft); }
.shop-item.done { opacity: 0.55; }
.shop-item.have { opacity: 0.45; }
.shop-item .have-btn {
  border: none;
  background: none;
  font-size: 1.05rem;
  cursor: pointer;
  padding: 4px;
  color: var(--ink-soft);
}
.merge-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.merge-row select { flex: 1 1 40%; min-width: 120px; padding: 6px 8px; font-size: 0.85rem; }
.merge-arrow { color: var(--ink-soft); font-weight: 700; }
.rayon-form { margin: 0; flex-shrink: 0; }
.rayon-pick {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 5px;
  max-width: 104px;
  border: none;
  border-radius: 8px;
  color: var(--ink-soft);
  background: #EDEFE9;
}
.shop-total {
  position: sticky;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + 22px);
  background: #1E211C;
  color: #fff;
  border-radius: 999px;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(30, 33, 28, 0.3);
  margin-top: 18px;
}
.shop-total [data-shop-total] { color: #A9C79E; }

/* --- Accueil --- */
.hero {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
}
.hero h1 { margin: 0 0 4px; }
.hero p { color: var(--ink-soft); font-weight: 600; margin: 0; font-size: 0.93rem; }
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
}
.quick-actions .btn { padding: 15px 10px; }

/* --- Écrans auth --- */
.auth-wrap { max-width: 400px; margin: 8vh auto 0; padding: 0 18px; }
.auth-logo { text-align: center; font-size: 3.2rem; margin-bottom: 6px; }
.auth-wrap h1 { text-align: center; }
.auth-wrap .card { margin-top: 18px; }

/* --- Propositions IA --- */
.proposal { border: 1.5px solid #DDE2D8; background: #fff; }
.proposal .missing { background: var(--gold-soft); color: #8A6414; font-weight: 600; border-radius: 12px; padding: 10px 14px; font-size: 0.84rem; margin-top: 8px; }
.tabbar { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 14px; scrollbar-width: none; }
.tabbar::-webkit-scrollbar { display: none; }
.tabbar button {
  flex-shrink: 0;
  border: none;
  background: #F1F3EE;
  border-radius: 12px;
  padding: 9px 15px;
  font-size: 0.83rem;
  font-weight: 700;
  font-family: inherit;
  color: #4A5246;
  cursor: pointer;
  white-space: nowrap;
}
.tabbar button.active {
  background: var(--primary-dark);
  color: #fff;
  font-weight: 800;
}
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* --- Import par lien --- */
.import-box {
  background: var(--card);
  border-radius: var(--radius-sm);
  box-shadow: none;
  padding: 12px 16px;
  margin-bottom: 12px;
}
.import-box summary {
  cursor: pointer;
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--primary);
}
.import-box[open] summary { margin-bottom: 4px; }

/* --- Semaines types --- */
.tpl-card { padding: 14px 16px; }
.week-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 10px;
}
.week-table {
  border-collapse: separate;
  border-spacing: 4px;
  width: 100%;
  min-width: 640px;
  font-size: 0.79rem;
}
.week-table th, .week-table td {
  border: none;
  padding: 6px 8px;
  text-align: left;
  vertical-align: middle;
}
.week-table thead th {
  background: transparent;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.68rem;
  color: var(--ink-soft);
}
.week-table tbody th {
  background: transparent;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.66rem;
  color: var(--ink-soft);
  width: 44px;
  white-space: nowrap;
}
.week-table td { min-width: 84px; padding: 0; background: #F7F8F5; border-radius: 12px; }
.week-table td .cell-link {
  display: block;
  padding: 8px 10px;
  color: var(--ink);
  font-weight: 600;
  min-height: 34px;
  border-radius: 12px;
}
.week-table td .cell-link:active { background: var(--primary-soft); }
.week-table .cell-empty { color: var(--primary); font-weight: 800; }
.week-table th.today-col { background: #DFE8D8; border-radius: 999px; color: var(--primary-dark); }
.week-table td.today-col { background: #fff; box-shadow: inset 0 0 0 2px var(--primary); }
.week-table td.today-col .cell-link { background: transparent; }
.week-table.edit select {
  width: 100%;
  min-width: 120px;
  padding: 5px 6px;
  font-size: 0.8rem;
  border-radius: 8px;
}

/* --- Pastilles / tuiles d'appareil --- */
.appli-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45em;
  height: 1.45em;
  border-radius: 7px;
  font-weight: 800;
  font-size: 0.82em;
  line-height: 1;
  color: #fff;
  vertical-align: -0.28em;
  flex-shrink: 0;
}
.appli-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 128px;
  border-radius: 16px;
  font-size: 1.9rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.detail-header > .appli-tile { width: 84px; height: 84px; font-size: 2.6rem; border-radius: 22px; }

/* Teintes appareil adoucies, assorties à la palette */
.appli-cookeo { background: #B3402E; }
.appli-thermomix { background: #55754F; }
.appli-monsieur_cuisine { background: #4A6B8A; }
.appli-airfryer { background: #C98A3D; }
.appli-four { background: #7A6A58; }
.appli-classique { background: #A2674C; }
.appli-sans_cuisson { background: #4E938E; }

/* --- Résultats de recherche avec vignette --- */
.result-row { align-items: center; }
.result-thumb {
  width: 56px;
  height: 44px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
  background: var(--card);
}
.result-meta { font-size: 0.76rem; font-weight: 600; color: var(--ink-soft); margin-top: 2px; }
.result-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

/* --- Affecter une semaine type --- */
.affect-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 8px 0 0;
}
.affect-label { font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); flex-shrink: 0; }
.affect-row input[type="date"] { padding: 7px 9px; font-size: 0.85rem; }

/* --- Préférences de génération --- */
.gen-prefs { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.gen-prefs > summary {
  cursor: pointer;
  list-style: none;
  font-weight: 800;
  color: var(--primary);
  padding: 4px 2px;
  user-select: none;
}
.gen-prefs > summary::-webkit-details-marker { display: none; }
.pref-block { margin-top: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: none;
  border-radius: 999px;
  background: #F1F3EE;
  font-size: 0.84rem;
  font-weight: 700;
  color: #4A5246;
  cursor: pointer;
  white-space: nowrap;
}
.chip:has(input:checked) { background: var(--primary-dark); color: #fff; }
.chip input { accent-color: var(--primary); }

/* --- Panneau « où ajouter cette recette » --- */
.result-block { border-bottom: 1px solid var(--line); }
.result-block:last-child { border-bottom: none; }
.dest-panel { margin: 2px 0 8px; }
.dest-panel > summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  padding: 4px 2px;
  user-select: none;
}
.dest-panel > summary::-webkit-details-marker { display: none; }
.dest-panel[open] > summary { font-weight: 800; }
.dest-form {
  margin: 4px 0 0;
  padding: 10px;
  background: #F1F3EE;
  border-radius: var(--radius-sm);
}
.dest-label { display: block; font-size: 0.78rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 4px; }
.dest-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dest-row input[type="date"], .dest-row select {
  flex: 1 1 auto;
  min-width: 84px;
  padding: 7px 9px;
  font-size: 0.85rem;
}
.dest-row .btn { flex: 0 0 auto; }
.scroll-list {
  max-height: 440px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
  margin-top: 4px;
}
.pick-form { margin: 0; display: contents; }
button.pick-card {
  font-family: inherit;
  text-align: left;
  border: none;
  cursor: pointer;
  width: 100%;
  background: transparent;
}
button.pick-card:hover { background: var(--card); border-radius: 16px; }

/* --- Aperçu photo au survol --- */
.photo-preview {
  position: fixed;
  z-index: 100;
  display: none;
  pointer-events: none;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  border: 2px solid #fff;
  box-shadow: 0 12px 36px rgba(30, 33, 28, 0.3);
}
.photo-preview img {
  display: block;
  width: 380px;
  max-width: 80vw;
  height: 285px;
  max-height: 60vh;
  object-fit: cover;
}

/* --- Divers --- */
.empty-state { text-align: center; padding: 34px 16px; color: var(--ink-soft); font-weight: 600; }
.empty-state .big { font-size: 2.6rem; margin-bottom: 6px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 6px; }
.list-plain { list-style: none; padding: 0; margin: 0; }
.mt { margin-top: 14px; }
.muted { color: var(--ink-soft); font-weight: 500; font-size: 0.88rem; }
.right { text-align: right; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

@media (min-width: 640px) {
  .content { padding-top: 22px; }
  .recipe-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
}

/* ==========================================================================
   Compléments post-pack « Frais & épuré » : fonctionnalités ajoutées après
   la génération du pack (menu masquable, modale Ajouter, sources M/CA…).
   ========================================================================== */

/* Aperçu photo au survol : au-dessus de tout (modales 120, menu 95, lightbox 200) */
.photo-preview { z-index: 500; }

/* Badges des nouvelles sources de recherche */
.appli-marmiton { background: #f0642c; }         /* Marmiton — orange corail */
.appli-cuisineactuelle { background: #c8102e; }  /* Cuisine Actuelle — rouge */

/* --- Modale générique (Ajouter une recette, etc.) --- */
.ac-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(30, 33, 28, 0.45);
  z-index: 120;   /* au-dessus du menu latéral (95) */
  align-items: flex-start;
  justify-content: center;
  padding: 24px 12px;
}
.ac-modal.open { display: flex; }
.ac-modal-box {
  background: var(--bg);
  border-radius: 18px;
  padding: 16px 18px;
  width: min(560px, 96vw);
  max-height: 86vh;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(30, 33, 28, 0.35);
}
.ac-modal-x { border: none; background: none; font-size: 22px; cursor: pointer; line-height: 1; padding: 0 6px; }
.ac-modal-section {
  margin: 16px 2px 6px;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

/* --- Menu latéral masquable à la demande (mémorisé) --- */
:root { --sidebar-w: 248px; }
html.sidebar-collapsed { --sidebar-w: 0px; }
.side-collapse {
  display: none;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--ink-soft);
  padding: 2px 8px;
  border-radius: 8px;
}
.side-collapse:hover { background: var(--primary-soft); }
.sidebar-reopen {
  display: none;
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 96;
  border: 1px solid var(--line);
  background: var(--card-solid);
  border-radius: 12px;
  font-size: 1.2rem;
  padding: 6px 11px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(30, 33, 28, 0.12);
}
@media (min-width: 900px) {
  body { padding-left: var(--sidebar-w); }
  .side-collapse { display: inline-block; }
  html.sidebar-collapsed .sidebar { transform: translateX(-100%); }
  html.sidebar-collapsed .sidebar-reopen { display: block; }
}
