/* À table ! — styles : sobre, aéré, une seule couleur d'accent. Téléphone d'abord, tablette en cuisine. */
:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --surface-2: #f3efea;
  --text: #1f1b17;
  --muted: #8a8178;
  --line: #ebe6e0;
  --accent: #c4502f;
  --accent-soft: #f8ebe6;
  --accent-text: #ffffff;
  --good: #3b8158;
  --warn: #b26b12;
  --warn-soft: #fbf1e3;
  --danger: #b8402f;
  --radius: 14px;
  --gutter: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151311; --surface: #1d1a17; --surface-2: #272320; --text: #f1ece6; --muted: #9c938a; --line: #2f2a26;
    --accent: #e7785a; --accent-soft: #3a241c; --accent-text: #1a0f0b; --good: #6cbf8c; --warn: #e0a24e; --warn-soft: #332716;
    --danger: #ec7a68; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151311; --surface: #1d1a17; --surface-2: #272320; --text: #f1ece6; --muted: #9c938a; --line: #2f2a26;
  --accent: #e7785a; --accent-soft: #3a241c; --accent-text: #1a0f0b; --good: #6cbf8c; --warn: #e0a24e; --warn-soft: #332716;
  --danger: #ec7a68; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; max-width: 100%; overflow-x: hidden; }
body {
  background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100dvh;
  padding-bottom: calc(68px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
h1 { font-size: 1.6rem; line-height: 1.2; letter-spacing: -0.02em; margin: 0; font-weight: 700; }
h2 { font-size: 1.05rem; margin: 0 0 10px; font-weight: 650; letter-spacing: -0.01em; }
h3 { font-size: 0.95rem; margin: 20px 0 6px; }
p { margin: 0 0 8px; }
small { font-size: 0.82rem; }
.muted { color: var(--muted); }
.center { text-align: center; justify-content: center; }
.hint { color: var(--muted); font-size: 0.88rem; margin: 8px 0 14px; }
.label { display: inline-block; min-width: 92px; color: var(--muted); font-size: 0.85rem; }
.ic { flex: none; display: block; }
.ic.tiny { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; }
.ic.down { transform: scaleY(-1); }

/* En-tête et navigation */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) var(--gutter) 8px; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; min-width: 0; }
.brand img { width: 26px; height: 26px; border-radius: 7px; }
.brand small { font-weight: 450; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 4px; }
.pending { font-size: 0.78rem; color: var(--muted); animation: pulse 1.2s infinite; white-space: nowrap; }
.pending.offline { animation: none; background: var(--line); color: var(--text); padding: 2px 8px; border-radius: 99px; }
@keyframes pulse { 50% { opacity: 0.35; } }
.nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 0 7px; font-size: 0.66rem; color: var(--muted); text-decoration: none; min-width: 0; }
.nav a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.nav a .ic { width: 22px; height: 22px; }
.nav a.active { color: var(--accent); font-weight: 600; }
.view { max-width: 760px; margin: 0 auto; padding: 8px var(--gutter) 32px; }
@media (min-width: 900px) {
  body { padding-bottom: 0; padding-left: 88px; }
  .nav { top: 0; bottom: 0; right: auto; width: 88px; grid-template-columns: 1fr; grid-auto-rows: min-content; padding-top: 72px; border-top: 0; border-right: 1px solid var(--line); }
  .nav a { font-size: 0.72rem; padding: 12px 4px; }
  .view { max-width: 1040px; }
}

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 14px; max-width: 100%;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-decoration: none;
  font-weight: 550; font-size: 0.95rem; touch-action: manipulation; transition: background 0.15s, border-color 0.15s;
}
.btn:hover { border-color: color-mix(in srgb, var(--text) 25%, var(--line)); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.dark { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); }
.btn.danger, .btn.ghost.danger { color: var(--danger); }
.btn.small { min-height: 34px; padding: 4px 12px; font-size: 0.88rem; }
.btn.big { min-height: 54px; font-size: 1.05rem; padding: 10px 18px; }
.btn.wide { width: 100%; }
.btn.grow { flex: 1; }
.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center; flex: none; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; text-decoration: none; padding: 0;
}
.icon-btn.plain { border-color: transparent; background: transparent; color: var(--muted); }
.icon-btn.plain:hover { color: var(--text); background: var(--surface-2); }
.icon-btn.small { width: 30px; height: 30px; }
.icon-btn.on { color: var(--accent); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }
.icon-btn.me { padding: 0; overflow: hidden; border-color: transparent; background: transparent; }
.text-link { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); text-decoration: none; font-weight: 600; font-size: 0.92rem; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, .icon-btn:focus-visible, .face:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* Formulaires */
input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%; min-width: 0; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); min-height: 40px;
}
textarea { resize: vertical; line-height: 1.5; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); flex: none; margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; min-width: 0; }
.field > span:first-child { font-size: 0.85rem; color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 10px; margin: 6px 14px 6px 0; cursor: pointer; }
.check.block { display: flex; margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.check.block:last-child { border-bottom: 0; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); margin: 12px 0; padding: 8px 12px; min-width: 0; }
legend { color: var(--muted); font-size: 0.85rem; padding: 0 4px; }
.file-btn { cursor: pointer; }
select.avatar-select { width: 72px; flex: none; }

/* Mise en page */
.row { display: flex; gap: 8px; align-items: center; margin: 10px 0; min-width: 0; }
.row > * { min-width: 0; }
.row.wrap, .wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.spread { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 8px; margin: 8px 0; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 4px 0 12px; }
.grid2 { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.grid3 { display: grid; gap: 0 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.page-head { margin: 12px 0 18px; }
.page-head p { margin: 4px 0 0; }
.section-title { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; margin: 26px 0 10px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0; min-width: 0; }
.card.accent { background: var(--warn-soft); border-color: transparent; }
.empty { text-align: center; color: var(--muted); padding: 32px 12px; }
.empty .btn { margin-top: 8px; }
.seg { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.seg.vertical { flex-direction: column; }
.seg.switch { gap: 0; background: var(--surface-2); padding: 3px; border-radius: 10px; margin-bottom: 10px; }
.seg.switch a { padding: 4px 14px; border-radius: 8px; text-decoration: none; font-size: 0.88rem; color: var(--muted); }
.seg.switch a.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.badge, .tag { display: inline-block; font-size: 0.72rem; padding: 1px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-weight: 600; vertical-align: 2px; }
.tag { background: var(--accent-soft); color: var(--accent); }
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--surface-2); font-size: 0.75rem; color: var(--muted); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.pill { font-size: 0.8rem; padding: 2px 10px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.pill.ok { color: var(--good); }
.pill.warn { color: var(--warn); border-color: currentColor; }
.tabs { display: flex; gap: 2px; background: var(--surface-2); padding: 3px; border-radius: 12px; margin: 8px 0 14px; }
.tabs button { flex: 1; min-width: 0; border: 0; background: transparent; padding: 7px 4px; border-radius: 9px; font-weight: 550; font-size: 0.9rem; cursor: pointer; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabs button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.back { display: inline-flex; align-items: center; margin: 8px 0; text-decoration: none; color: var(--muted); font-size: 0.92rem; }
.lead { font-size: 1.05rem; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); margin: 4px 0 12px; }
.banner p { margin: 0; font-size: 0.92rem; }
.spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 0.9s linear infinite; margin: 16px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
ul.plain { list-style: none; padding: 0; margin: 0 0 8px; }

/* Listes d'actions (accueil) */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; text-decoration: none; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list-row small { color: var(--muted); }
.list-row .ic { color: var(--muted); }

/* Avatars et visages de présence */
.av { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); font-size: 1.05rem; line-height: 1; flex: none; }
.av.small { width: 22px; height: 22px; font-size: 0.78rem; }
.av.big { width: 64px; height: 64px; font-size: 2.2rem; }
.faces { display: flex; flex-wrap: wrap; gap: 4px 2px; margin: 10px 0 2px; }
.face {
  display: flex; flex-direction: column; align-items: center; gap: 2px; width: 54px; padding: 2px 0; border: 0; background: none;
  cursor: pointer; border-radius: 10px; touch-action: manipulation;
}
.face:disabled { cursor: default; }
.face .av { width: 36px; height: 36px; font-size: 1.2rem; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px transparent; transition: 0.15s; }
.face.me .av { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--line); }
.face-name { font-size: 0.7rem; color: var(--muted); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.face.absent .av { filter: grayscale(1); opacity: 0.35; }
.face.absent .face-name { text-decoration: line-through; opacity: 0.6; }
.face.plateau .av { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--warn); }
.face.plateau .face-name { color: var(--warn); font-weight: 600; }
.face.guest .av { background: var(--accent-soft); }
.face.add .av { background: transparent; border: 1.5px dashed var(--line); color: var(--muted); }
.face.add .av .ic { width: 16px; height: 16px; }
.face.add:hover .av { border-color: var(--accent); color: var(--accent); }

/* Repas */
.meal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.meal.past { opacity: 0.6; }
.meal-head { display: flex; align-items: center; gap: 8px; min-height: 30px; }
.meal-head .meta { flex: 1; min-width: 0; color: var(--muted); font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meal-head .icon-btn { margin: -4px -6px -4px 0; }
.slot { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--accent); }
.locked { color: var(--muted); }
.meal-title { font-size: 1.1rem; font-weight: 650; letter-spacing: -0.01em; margin: 2px 0; overflow-wrap: anywhere; }
.meal-title a { text-decoration: none; }
.meal.vide .meal-title, .meal.libre .meal-title, .meal.frigo .meal-title { color: var(--muted); font-weight: 450; }
.meal-note { font-size: 0.88rem; color: var(--muted); margin: 2px 0; font-style: italic; }
.meal .text-link { margin-top: 8px; }
.rate-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rate-row:first-child { padding-top: 0; }
.rate-row:last-child { border-bottom: 0; padding-bottom: 0; }
.rate-row > div:first-child { display: flex; flex-direction: column; min-width: 0; }

/* Semaine */
.weeknav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 12px; }
.weeknav-title { text-align: center; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.weeknav-title strong { font-size: 1.02rem; }
.status-dot { font-size: 0.78rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.status-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.status-dot.ok::before { background: var(--good); }
.week { display: grid; gap: 22px; }
.day-title { font-size: 0.95rem; margin: 0 0 8px; }
.day-title::first-letter { text-transform: uppercase; }
.day-meals { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .day-meals { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stepper { display: inline-flex; align-items: center; gap: 14px; }
.stepper strong { min-width: 20px; text-align: center; font-size: 1.1rem; }
table.recurring { width: 100%; border-collapse: collapse; }
table.recurring th, table.recurring td { padding: 8px 6px; text-align: center; border-bottom: 1px solid var(--line); font-weight: 500; }
table.recurring tbody th { text-align: left; }
table.recurring tbody th::first-letter { text-transform: uppercase; }

/* Menu */
.menu-list { display: grid; gap: 8px; }
.menu-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.menu-row.locked { border-color: var(--accent); }
.menu-when { grid-column: 1 / -1; display: flex; gap: 6px; align-items: baseline; font-size: 0.9rem; }
.menu-when small { margin-left: auto; }
.menu-what { min-width: 0; }
.menu-what select { font-weight: 550; }
.why { display: block; color: var(--muted); margin-top: 4px; font-size: 0.8rem; }
.menu-tools { display: flex; gap: 0; align-items: flex-start; }
@media (min-width: 760px) {
  .menu-row { grid-template-columns: 120px minmax(0, 1fr) auto; align-items: center; }
  .menu-when { grid-column: auto; flex-direction: column; gap: 0; }
  .menu-when small { margin-left: 0; }
  .menu-tools { align-items: center; }
}

/* Votes et recettes */
.vote-list { display: grid; gap: 8px; }
.vote-card { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px 8px 8px; }
.vote-body { display: flex; flex-direction: column; min-width: 0; }
.vote-body a { text-decoration: none; }
.vote-body strong { overflow-wrap: anywhere; }
.vote-who { display: flex; justify-content: flex-start; gap: 10px; min-height: 22px; margin-top: 2px; }
.vote-who span { display: flex; gap: 2px; }
.vote-who span + span .av { filter: grayscale(1); opacity: 0.6; }
.vote-card .seg .btn { width: 40px; padding: 0; }
.thumb { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: 1.3rem; flex: none; }
.hero { width: 100%; max-height: 300px; object-fit: cover; border-radius: var(--radius); display: block; margin: 4px 0 14px; }
.pic { position: relative; overflow: hidden; }
.pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
span.hero { display: none; }
span.hero.pic { display: block; aspect-ratio: 16 / 9; max-height: 300px; color: transparent; background: var(--surface-2); }
.warn-text { color: var(--warn); font-weight: 600; }
.have { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 12px 0; }
.tag-btn { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 4px 10px; cursor: pointer; font-size: 0.9rem; }
.tag-btn .ic { color: var(--muted); }
.fridge-list { display: grid; gap: 8px; }
.fridge-card { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px 8px 8px; }
.fridge-card > a { text-decoration: none; }
.fridge-body { display: flex; flex-direction: column; min-width: 0; }
.fridge-body a { text-decoration: none; }
.fridge-body small { overflow-wrap: anywhere; }
.fridge-body small.ok { color: var(--good); font-weight: 600; }
.pick-list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; max-height: 55dvh; overflow-y: auto; }
.pick-list .list-row { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; }
/* Réglages en accordéon */
.acc-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.acc { border-bottom: 1px solid var(--line); }
.acc-list > :last-child .acc:last-child, .acc-list > .acc:last-child { border-bottom: 0; }
.acc summary { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; list-style: none; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary:hover { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.acc-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.acc-title small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc .chev { color: var(--muted); transition: transform 0.2s; }
.acc[open] .chev { transform: rotate(90deg); }
.acc[open] summary { border-bottom: 1px solid var(--line); }
.acc-body { padding: 4px 16px 16px; }
.acc-body > h3:first-child { margin-top: 12px; }
.hint.version { margin: 16px 0 0; font-size: 0.8rem; }
.update-banner {
  position: fixed; left: 50%; transform: translateX(-50%); top: calc(64px + env(safe-area-inset-top)); z-index: 60;
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border-radius: 12px;
  background: var(--text); color: var(--bg); font-size: 0.92rem; width: max-content; max-width: calc(100vw - 32px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.credit { font-size: 0.75rem; color: var(--muted); margin: -8px 0 14px; }
.credit a { color: inherit; }
.filters { margin: 10px 0 12px; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; max-width: 100%; }
.filters .btn { flex: none; }
.recipe-grid { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .recipe-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.recipe-card { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; }
.recipe-card > div { display: flex; flex-direction: column; min-width: 0; }
.recipe-card strong { overflow-wrap: anywhere; }
.recipe h1 { margin-bottom: 6px; overflow-wrap: anywhere; }
.recipe .meta { color: var(--muted); font-size: 0.92rem; }
.recipe section { margin-top: 22px; }
.recipe h2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ingredients { list-style: none; padding: 0; margin: 0; }
.ingredients li { padding: 8px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.ingredients li:last-child { border-bottom: 0; }
.ingredients .qty, .ingredients strong { display: inline-block; min-width: 76px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ingredients.big { font-size: 1.25rem; }
.ingredients.big .qty { min-width: 110px; }
.steps { padding-left: 1.3em; margin: 0; }
.steps li { margin: 10px 0; padding-left: 4px; overflow-wrap: anywhere; }
.steps small { display: block; }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.choice { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; }
.choice:hover { border-color: var(--accent); }
.choice small { color: var(--muted); }
.suggestions { display: grid; margin-top: 10px; }
.suggestion { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); }
.suggestion > div:first-child { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.photo-edit { display: flex; align-items: center; gap: 12px; }
.tags { display: flex; flex-wrap: wrap; }
.profiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.profile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px 8px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.profile:hover { border-color: var(--accent); }
.member-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 8px; align-items: center; margin: 8px 0; }
.member-row .check { margin: 0; }
.welcome { text-align: center; padding: 28px 0 12px; }
.welcome h1 { font-size: 1.7rem; }
.welcome .lead { color: var(--muted); margin-top: 8px; }
.members { list-style: none; padding: 0; margin: 0; }
.members li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.members li:last-child { border-bottom: 0; }
.members li .btn { margin-left: auto; }

/* Courses */
.add-form { display: flex; gap: 6px; flex: 1; min-width: 200px; }
.add-form input { flex: 1; }
.aisle h2 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; margin: 20px 0 6px; }
.aisle ul, .at-home ul { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.shop-item { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-bottom: 1px solid var(--line); min-height: 50px; }
.shop-item:last-child { border-bottom: 0; }
.shop-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.shop-main > span, div.shop-main { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.shop-name { overflow-wrap: anywhere; }
.shop-main small { font-size: 0.75rem; }
.shop-qty { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 0.92rem; }
.shop-item.checked .shop-name, .shop-item.checked .shop-qty { text-decoration: line-through; color: var(--muted); }
.at-home { margin-top: 24px; }
.at-home summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; padding: 6px 0; }
.at-home ul { margin-top: 6px; }
.at-home li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 6px 6px 12px; border-bottom: 1px solid var(--line); }
.at-home li:last-child { border-bottom: 0; }
.at-home li > span { color: var(--muted); min-width: 0; overflow-wrap: anywhere; }

/* Cuisine */
.recipe-link a { text-decoration: none; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); margin-left: 4px; }
.timeline li { position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px; padding: 0 0 16px 16px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--muted); }
.timeline li.wait::before { border-color: var(--warn); }
.timeline li.serve::before { background: var(--good); border-color: var(--good); }
.timeline li.serve { font-weight: 650; padding-bottom: 0; }
.timeline time { font-weight: 650; font-variant-numeric: tabular-nums; }
.timeline span { overflow-wrap: anywhere; }
.timeline small { display: block; }
.batch-recipe { border-top: 1px solid var(--line); padding: 10px 0; }
.batch-recipe:first-of-type { border-top: 0; }
.batch-recipe summary { cursor: pointer; }
.batch-recipe .ingredients { margin: 8px 0; }

/* Mode pas à pas : plein écran, ne déborde jamais en largeur */
.cook-mode {
  position: fixed; inset: 0; z-index: 50; width: 100%; max-width: 100vw; overflow: hidden; background: var(--bg);
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  padding: calc(10px + env(safe-area-inset-top)) var(--gutter) calc(12px + env(safe-area-inset-bottom));
}
.cook-mode header { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cook-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cook-title strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cook-title small { color: var(--muted); }
.progress { height: 3px; background: var(--line); border-radius: 3px; margin: 8px 0 4px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); transition: width 0.2s; }
.cook-timers { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; min-width: 0; }
.cook-timers:empty { margin: 0; }
.timer { max-width: 100%; border: 0; border-radius: 99px; padding: 5px 12px; background: var(--warn-soft); color: var(--text); font-size: 0.85rem; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer b { font-variant-numeric: tabular-nums; margin-left: 4px; }
.timer.done { background: var(--danger); color: #fff; animation: pulse 0.8s infinite; }
.cook-body { min-width: 0; overflow-y: auto; display: flex; flex-direction: column; justify-content: center; gap: 16px; width: 100%; max-width: 760px; margin: 0 auto; }
.cook-text { font-size: clamp(1.35rem, 5vw, 2.2rem); line-height: 1.35; font-weight: 600; letter-spacing: -0.01em; overflow-wrap: anywhere; margin: 0; }
.cook-body .btn { align-self: flex-start; }
.cook-mode footer { display: flex; gap: 8px; min-width: 0; padding-top: 10px; }
.cook-mode footer .btn { min-width: 54px; }

/* Fenêtre modale et notifications */
.modal {
  border: 0; border-radius: 18px; padding: 22px 18px 18px; width: min(520px, calc(100vw - 24px)); max-height: 88dvh;
  background: var(--surface); color: var(--text); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}
.modal::backdrop { background: rgba(20, 15, 10, 0.4); }
.modal-close { position: absolute; top: 12px; right: 12px; }
.modal h2 { padding-right: 40px; font-size: 1.15rem; }
.toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translate(-50%, 16px); opacity: 0;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; z-index: 100; transition: 0.2s; pointer-events: none;
  width: max-content; max-width: calc(100vw - 32px); font-size: 0.92rem;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); color: #fff; }
.toast.with-action { pointer-events: auto; display: flex; align-items: center; gap: 14px; }
.toast button { border: 0; background: none; color: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 4px 0; }
.who-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--line); }
.who-row:last-child { border-bottom: 0; }
.seg.tight { gap: 2px; }
.seg.tight .btn { padding: 4px 9px; }
.tray { display: flex; align-items: center; gap: 8px; width: 100%; padding-left: 42px; color: var(--muted); font-size: 0.88rem; white-space: nowrap; }
.tray input { width: 130px; flex: none; min-height: 34px; padding: 4px 8px; }

/* Code parent */
.pin-input { font-size: 1.6rem; letter-spacing: 0.6em; text-align: center; max-width: 9rem; }
.pin-row { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 8px; }
.profile small .icon { width: 14px; height: 14px; vertical-align: -2px; }
.pin-row p { display: flex; gap: 8px; align-items: flex-start; font-size: 0.88rem; margin: 0 0 8px; }
.pin-row p .icon { flex: none; width: 18px; height: 18px; margin-top: 2px; }
.small { font-size: 0.88rem; }

/* Cuisiner double */
.doubled { margin: 2px 0 8px; font-size: 0.85rem; color: var(--accent); display: flex; gap: 6px; align-items: center; }
.shop-qty { text-align: right; }
.shop-qty small { display: block; font-weight: 450; font-size: 0.75rem; color: var(--muted); }

/* Historique et favoris */
.fav-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.people-favs li { display: flex; gap: 12px; align-items: center; padding: 8px 0; }
.people-favs li + li { border-top: 1px solid var(--line); }
.people-favs small { display: block; color: var(--muted); }
.history-week h3 { margin: 0 0 6px; font-size: 0.95rem; }
.history-week li { padding: 5px 0; display: grid; grid-template-columns: 6.2em minmax(0, 1fr) auto; gap: 8px; align-items: baseline; font-size: 0.92rem; }
.history-week li + li { border-top: 1px solid var(--line); }
.history-week li > span.muted { font-size: 0.82rem; white-space: nowrap; }
.history-week li a, .people-favs a { color: inherit; text-decoration: none; }
.history-week li small { color: var(--muted); white-space: nowrap; }

/* Recette de saison du jour */
.season { display: grid; gap: 10px; }
.season .plain-card { border: 0; padding: 0; background: none; }
.plan-choice { display: flex; justify-content: space-between; gap: 12px; text-align: left; }
.plan-choice small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
