/* Mon appart à Paris — design system « Vanille » (direction A).
   Structure façon appli (barre d'onglets, cartes centrées sur la photo, feuilles du bas), ambiance conservée :
   crème / bordeaux / or, Fraunces pour les prix et les titres. Mobile d'abord ; ≥ 1024 px : rail à gauche + tiroir de détail.
   Jetons d'abord (§1), composants ensuite (§2…). Les noms de jetons historiques (--chip, --line…) sont conservés. */

/* §1 — Jetons ------------------------------------------------------------------------------------------------- */
:root {
  --bg: #fbf7f3; --surface: #ffffff; --sunk: #f4ece7; --ink: #2b1a20; --muted: #6f5e63; --line: #eadfda;
  --accent: #8a1f3a; --accent-ink: #ffffff; --gold: #b58a3e; --good: #3f7a54; --mid: #8a6320; --low: #766469;
  --warn-bg: #fbeecf; --warn-ink: #5e4210; --danger: #b3261e;
  --chip: var(--sunk);
  --r-s: 12px; --r: 18px; --r-pill: 999px;
  --shadow: 0 1px 2px rgba(60, 20, 30, .06), 0 8px 24px rgba(60, 20, 30, .08);
  --shadow-sheet: 0 -8px 40px rgba(40, 10, 20, .22);
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --tabbar-h: 60px; --cible: 44px; --dur: .18s;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #181015; --surface: #241820; --sunk: #2d1e27; --ink: #f4e9e6; --muted: #b8a3a9; --line: #3a2731;
    --accent: #e59aab; --accent-ink: #2a0e17; --gold: #dcbb76; --good: #6fbd8d; --mid: #dcbb76; --low: #a08d94;
    --warn-bg: #3d2c10; --warn-ink: #f1d9a3; --danger: #f2a29c; --shadow: none; --shadow-sheet: 0 -8px 40px rgba(0, 0, 0, .5);
  }
}

/* §2 — Base --------------------------------------------------------------------------------------------------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-bottom: 96px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--sans); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
body.detail-ouvert { overflow: hidden; }
h1, h2, h3 { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--accent); }
em { font-style: normal; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hint { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.saut { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.saut:focus { left: 8px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; } }

/* Boutons */
.btn { white-space: nowrap; min-height: var(--cible); padding: 0 18px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; transition: border-color var(--dur), background var(--dur); }
.btn:hover { border-color: var(--gold); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.ghost { background: transparent; }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 13px; }
.btn img { border-radius: 50%; }
.texte-btn { min-height: var(--cible); padding: 0 6px; border: 0; background: none; color: var(--muted); font-size: 13.5px; font-weight: 500; }
.texte-btn:hover { color: var(--accent); }
.rond { width: var(--cible); height: var(--cible); border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; font-size: 26px; line-height: 1; padding: 0 0 3px; }

/* §3 — Coque : en-tête, onglets, contenu ---------------------------------------------------------------------- */
.haut { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(14px + env(safe-area-inset-top)) 16px 4px; max-width: 1240px; margin: 0 auto; }
.haut h1 { font: 600 26px/1.1 var(--serif); letter-spacing: -.01em; }
.sub { margin: 3px 0 0; color: var(--muted); font-size: 14px; }
.banniere { max-width: 1240px; margin: 6px auto; padding: 10px 14px; border-radius: var(--r-s); background: var(--warn-bg); color: var(--warn-ink); font-size: 14px; }
.banniere:not([hidden]) { margin-inline: 16px; }
.bandeau { display: block; width: calc(100% - 32px); max-width: 720px; margin: 8px auto; min-height: var(--cible); padding: 8px 14px; border-radius: var(--r-s); border: 1px solid var(--gold); background: var(--warn-bg); color: var(--warn-ink); font-weight: 600; text-align: left; }
.bandeau[hidden] { display: none; }

.principal { max-width: 1240px; margin: 0 auto; }
.vue { padding: 0 16px calc(var(--tabbar-h) + 90px + env(safe-area-inset-bottom)); max-width: 760px; margin: 0 auto; min-height: 60vh; }
.titre-ecran { font: 600 22px/1.2 var(--serif); margin: 14px 0 12px; }
.retour-lien { display: inline-flex; align-items: center; min-height: var(--cible); text-decoration: none; font-weight: 600; margin-top: 6px; }
.maj { color: var(--muted); font-size: 12.5px; margin: 20px 0 0; text-align: center; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 4px 4px env(safe-area-inset-bottom); }
.tabbar a { position: relative; flex: 1; min-height: var(--tabbar-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-weight: 500; color: var(--muted); text-decoration: none; }
.tabbar a[aria-current='true'] { color: var(--accent); font-weight: 600; }
.tabbar a[aria-current='true'] svg { stroke-width: 2.2; }
.pastille { position: absolute; top: 5px; left: calc(50% + 6px); min-width: 18px; height: 18px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font: 600 11px/18px var(--sans); text-align: center; padding: 0 5px; font-style: normal; }
.pastille[hidden] { display: none; }

/* Segments (Nouveautés / Meilleures) */
.segs { display: flex; gap: 4px; padding: 4px; background: var(--sunk); border-radius: var(--r-pill); margin: 10px 0 8px; }
.segs button { flex: 1; min-height: 40px; border: 0; border-radius: var(--r-pill); background: none; font-weight: 500; color: var(--muted); }
.segs button[aria-selected='true'] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(60, 20, 30, .14); }
.segs em { margin-left: 6px; color: var(--accent); font-weight: 600; }
.pills-barre { position: sticky; top: env(safe-area-inset-top); z-index: 10; margin: 0 -16px; padding: 4px 16px 8px; background: var(--bg); }
.pills { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pill { flex: none; min-height: var(--cible); display: inline-flex; align-items: center; gap: 6px; padding: 0 16px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 500; white-space: nowrap; transition: background var(--dur), color var(--dur); }
.pill em { color: var(--muted); font-size: 12px; }
.pill[aria-pressed='true'] { background: var(--ink); color: var(--bg); border-color: var(--ink); } .pill[aria-pressed='true'] em { color: inherit; opacity: .75; }
.pill:disabled { opacity: .45; cursor: default; }
.pill-filtres { font-weight: 600; }
.pill-filtres .pastille-n { background: var(--accent); color: var(--accent-ink); border-radius: 9px; min-width: 18px; padding: 0 5px; line-height: 18px; text-align: center; font-weight: 600; }
.tri { display: inline-flex; align-items: center; gap: 4px; }
.tri select { min-height: var(--cible); border: 0; background: none; font: 600 14px var(--sans); color: var(--ink); padding: 0 2px; max-width: 170px; }
.texte-btn.en-ligne { display: inline; min-height: 0; padding: 0; margin-left: 4px; color: var(--accent); text-decoration: underline; }
.barre-liste { display: flex; justify-content: space-between; align-items: center; min-height: var(--cible); color: var(--muted); font-size: 14px; }
.plus-btn { display: flex; margin: 20px auto; }

/* §4 — Carte d'annonce ---------------------------------------------------------------------------------------- */
.liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
@media (min-width: 640px) { .liste { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.carte { position: relative; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; content-visibility: auto; contain-intrinsic-size: auto 340px; transition: transform var(--dur); }
.carte:has(.lien-carte:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.lien-carte { color: inherit; text-decoration: none; outline: none; }
.lien-carte::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.carte.pepite::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; z-index: 3; background: linear-gradient(90deg, var(--gold), var(--accent), var(--gold)); }
.visuel { position: relative; }
.visuel img, .det-hero img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--sunk); }
.tuile { height: 112px; display: grid; align-content: end; padding: 14px 16px; position: relative; color: var(--accent);
  background: linear-gradient(135deg, hsl(calc(350 + var(--t, 0)) 60% 94%), hsl(calc(335 + var(--t, 0)) 55% 90%)); }
@media (prefers-color-scheme: dark) { .tuile { background: linear-gradient(135deg, hsl(calc(340 + var(--t, 0)) 22% 17%), hsl(calc(330 + var(--t, 0)) 25% 21%)); } }
.tuile svg { position: absolute; left: 16px; top: 14px; width: 48px; height: 30px; opacity: .3; }
.tuile-surface { font: 600 30px/1 var(--serif); }
.tuile-detail { font-size: 13px; color: var(--muted); margin-top: 4px; }
.verdict { position: absolute; left: 12px; bottom: 12px; z-index: 2; max-width: calc(100% - 24px); padding: 5px 11px; border-radius: var(--r-pill); background: var(--surface); font: 600 12.5px var(--sans); box-shadow: 0 1px 4px rgba(0, 0, 0, .2); pointer-events: none; }
.verdict-txt, .verdict-ligne { font: 600 13px var(--sans); margin-top: 3px; }
.v-haut { color: var(--accent); } .v-moyen { color: var(--mid); } .v-bas { color: var(--muted); }
.coeur { position: absolute; top: 10px; right: 10px; z-index: 2; width: var(--cible); height: var(--cible); border-radius: 50%; border: 0; background: color-mix(in srgb, var(--surface) 92%, transparent); display: grid; place-items: center; color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
.coeur[aria-pressed='true'] { color: var(--accent); --fill: currentColor; }
.corps { padding: 12px 16px 6px; }
.lieu { font: 600 16px/1.3 var(--sans); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prix { margin-top: 3px; } .prix b { font: 600 22px/1.1 var(--serif); } .prix small { color: var(--muted); font-size: 13px; }
.prix.grand b { font-size: 34px; }
.infos { margin-top: 4px; color: var(--muted); font-size: 14px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; } .badges:empty { display: none; }
.b { padding: 3px 10px; border-radius: var(--r-pill); background: var(--sunk); font-size: 12.5px; font-weight: 500; }
.b-new { background: var(--accent); color: var(--accent-ink); }
.b-drop { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); font-weight: 600; }
.b-warn, .b-contact.due { background: var(--warn-bg); color: var(--warn-ink); font-weight: 600; }
.b-contact { background: color-mix(in srgb, var(--gold) 20%, transparent); }
.pied { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 4px; color: var(--muted); font-size: 12.5px; }
.pied .texte-btn { position: relative; z-index: 2; margin-right: -6px; }
.carte.squelette { pointer-events: none; }
.sq { display: block; height: 14px; border-radius: 7px; margin: 10px 0; background: var(--sunk); }
.sq.l1 { width: 55%; height: 18px; } .sq.l2 { width: 35%; height: 22px; } .sq.l3 { width: 75%; }
.squelette .tuile, .sq { animation: pulse 1.4s ease-in-out infinite; }
.squelette .tuile { background: var(--sunk); } .squelette .tuile svg, .squelette .tuile span { display: none; }
@keyframes pulse { 50% { opacity: .55; } }

/* États vides */
.vide { text-align: center; color: var(--muted); padding: 48px 16px; display: grid; gap: 10px; justify-items: center; }
.vide b { color: var(--ink); font: 600 20px var(--serif); } .vide p { margin: 0; max-width: 34ch; }

/* Groupes (Suivi, Plus) */
.groupe { margin-top: 18px; }
.groupe-titre { font: 600 12px var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 22px 0 10px; }
.groupe-titre em { margin-left: 8px; color: var(--accent); }
.lignes { display: grid; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.ligne { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 8px 16px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; text-decoration: none; color: var(--ink); width: 100%; }
.ligne:first-child { border-top: 0; }
.ligne-ic { width: 28px; display: grid; place-items: center; color: var(--accent); }
.ligne-txt { flex: 1; min-width: 0; display: grid; } .ligne-txt small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne-fl { color: var(--muted); font-size: 22px; }
.sources { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted); }
.src-pill { border: 1px solid var(--line); border-radius: var(--r-pill); padding: 4px 12px; background: var(--surface); }
.src-pill.ok::before { content: '● '; color: var(--good); } .src-pill.erreur::before { content: '● '; color: var(--danger); } .src-pill.partiel::before { content: '● '; color: var(--mid); }
.src-pill.todo { border-style: dashed; }

/* §5 — Détail : écran plein sur mobile, tiroir à droite sur grand écran ---------------------------------------- */
.detail { position: fixed; inset: 0; z-index: 40; background: var(--bg); display: flex; flex-direction: column; animation: monte .2s ease-out; }
.detail[hidden] { display: none; }
@keyframes monte { from { transform: translateY(20px); opacity: 0; } }
.det-barre { display: flex; align-items: center; gap: 10px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; border-bottom: 1px solid var(--line); background: var(--bg); }
.det-barre .coeur { position: static; margin-left: auto; box-shadow: none; border: 1px solid var(--line); background: var(--surface); }
.rond.petit { width: 40px; height: 40px; font-size: 20px; }
.rond:disabled { opacity: .35; }
.det-nav { flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px; }
.det-pos { min-width: 56px; text-align: center; font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.det-barre > .rond, .det-barre .coeur { flex: none; }
.suivi-resume { background: color-mix(in srgb, var(--gold) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--line)); border-radius: var(--r-s); padding: 10px 14px; margin-bottom: 10px; font-size: 14px; }
.suivi-resume.due { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--gold); }
.suivi-resume small { display: block; color: var(--muted); margin-top: 2px; } .suivi-resume.due small { color: inherit; opacity: .8; } .suivi-resume p { margin: 6px 0 0; }
.lignes-detail { margin: 0; display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-s); overflow: hidden; }
.lignes-detail div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); } .lignes-detail div:first-child { border-top: 0; }
.lignes-detail dt { color: var(--muted); } .lignes-detail dd { margin: 0; font-weight: 600; text-align: right; }
.histo { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.histo li { display: flex; align-items: baseline; gap: 10px; } .histo span { color: var(--muted); min-width: 64px; } .histo em.baisse { color: var(--good); font-weight: 600; } .histo em.hausse { color: var(--danger); font-weight: 600; }
.det-titre { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.det-defile { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.det-hero .tuile { height: 160px; }
.det-corps { padding: 16px 16px 28px; max-width: 640px; margin: 0 auto; }
.det-h { margin: 14px 0 0; font: 600 20px/1.25 var(--serif); }
.det-annonce { margin: 6px 0 0; color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.faits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-s); overflow: hidden; margin: 16px 0 0; }
.faits div { background: var(--surface); padding: 10px 12px; } .faits dt { color: var(--muted); font-size: 12px; } .faits dd { margin: 2px 0 0; font-weight: 600; } .inconnu { color: var(--muted); font-weight: 400; }
.sec { font: 600 12px var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 24px 0 8px; }
.pourquoi { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pourquoi li { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; font-size: 14px; }
.pourquoi .pts { color: var(--muted); }
.pourquoi i { grid-column: 1 / -1; display: block; height: 6px; border-radius: 3px; background: var(--sunk); position: relative; overflow: hidden; }
.pourquoi i::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--w); background: linear-gradient(90deg, var(--gold), var(--accent)); }
.rejets { margin: 0; padding-left: 18px; color: var(--muted); }
.descr { margin-top: 20px; font-size: 14px; } .descr summary { cursor: pointer; min-height: var(--cible); display: flex; align-items: center; color: var(--muted); font-weight: 600; } .descr p { margin: 0; white-space: pre-wrap; }
.det-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.pied-det { margin: 18px 0 0; color: var(--muted); font-size: 12.5px; }
.det-cta { display: flex; gap: 10px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.det-cta .btn { flex: 1; min-height: 50px; border-radius: 14px; } .det-cta .btn.primary { flex: 1.3; }
select.suivi, .champ select { width: 100%; min-height: var(--cible); padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface); color: var(--ink); font: 16px var(--sans); }
textarea, input[type='text'], input[type='url'], input[type='number'], input[type='tel'], input:not([type]) { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface); color: var(--ink); font: 16px/1.4 var(--sans); margin-top: 4px; }
textarea { resize: vertical; min-height: 72px; }

@media (min-width: 1024px) {
  body.detail-ouvert { overflow: auto; }
  .detail { inset: 0 0 0 auto; width: min(500px, 100vw); box-shadow: -16px 0 40px rgba(0, 0, 0, .18); border-left: 1px solid var(--line); animation-name: glisse; }
  @keyframes glisse { from { transform: translateX(24px); opacity: 0; } }
  .det-cta { padding-bottom: 12px; }
}

/* §6 — Grand écran : rail de navigation à gauche ----------------------------------------------------------------- */
@media (min-width: 1024px) {
  .haut { padding: 28px 32px 6px; }
  .principal { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 24px; padding: 0 32px; }
  .banniere:not([hidden]), .bandeau { margin-inline: auto; width: min(1000px, calc(100% - 64px)); }
  .tabbar { position: sticky; top: 16px; align-self: start; flex-direction: column; justify-content: flex-start; gap: 6px; background: none; backdrop-filter: none; border: 0; padding: 0; }
  .tabbar a { border-radius: 14px; min-height: 68px; } .tabbar a[aria-current='true'] { background: var(--sunk); } .pastille { left: calc(50% + 8px); }
  .vue { max-width: none; margin: 0; padding: 0 0 80px; }
  .liste { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 24px; }
  .lignes, .criteres { max-width: 640px; }
  .segs { max-width: 380px; }
  .pills-barre { margin-inline: 0; padding-inline: 0; }
  .pills { flex-wrap: wrap; overflow: visible; margin: 0; padding: 2px 0; }
  .carte:hover { transform: translateY(-2px); }
}

/* §7 — Formulaires (critères, dialogs) --------------------------------------------------------------------------- */
.criteres { margin-top: 10px; }
.bloc { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; margin-top: 14px; }
.bloc-titre { font: 600 12px var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 12px; }
.champ { display: block; margin-bottom: 14px; font-size: 14px; }
.champ output { float: right; font-weight: 600; color: var(--accent); }
.champ.case, .cases label, .seg label { display: flex; gap: 10px; align-items: center; min-height: var(--cible); font-size: 14px; }
.champ.case { margin: 0; }
input[type='range'] { width: 100%; accent-color: var(--accent); margin: 8px 0 0; min-height: 28px; }
input[type='checkbox'], input[type='radio'] { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
fieldset { border: 0; padding: 0; margin: 0 0 12px; } legend { font-size: 14px; padding: 0; margin-bottom: 4px; }
.seg { display: flex; flex-wrap: wrap; gap: 0 16px; } .seg legend { width: 100%; }
.cases { display: flex; flex-direction: column; }
.arr-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.arr { min-height: var(--cible); border: 1px solid var(--line); background: var(--bg); border-radius: 10px; font: 500 14px var(--sans); color: var(--ink); }
.arr[data-etat='pref'] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.arr[data-etat='exclu'] { background: transparent; color: var(--low); text-decoration: line-through; }
.poids > summary { cursor: pointer; font-weight: 600; min-height: var(--cible); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.poids-row { display: grid; grid-template-columns: 1fr 22px; gap: 2px 10px; margin-top: 10px; font-size: 14px; align-items: center; }
.poids-row input { grid-column: 1 / -1; margin: 0; } .poids-row output { text-align: right; font-weight: 600; }

dialog { border: 1px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--ink); padding: 0; width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); overflow: auto; }
dialog::backdrop { background: rgba(40, 10, 20, .5); }
dialog[open] { animation: monte .2s ease-out; }
.dlg { padding: 20px; display: grid; gap: 12px; }
.dlg h2 { font: 600 20px var(--serif); margin: 0; }
.dlg label { font-size: 14px; display: block; }
.dlg .checks label { display: flex; align-items: center; gap: 10px; min-height: var(--cible); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.dlg.wide { width: 100%; } dialog:has(.dlg.wide) { width: min(720px, calc(100vw - 24px)); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
/* Sur mobile, les formulaires sont des feuilles du bas */
@media (max-width: 600px) {
  dialog:not(#dlg-bot) { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 22px 22px 0 0; max-height: 92dvh; border-bottom: 0; box-shadow: var(--shadow-sheet); padding-bottom: env(safe-area-inset-bottom); }
}

/* Feuille « Filtres » */
.filtres-dlg { padding-bottom: 0; }
.case-filtre { display: flex !important; align-items: center; gap: 10px; min-height: var(--cible); }
.case-filtre em { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.cases-filtre { margin: 0; }
.sticky-actions { position: sticky; bottom: 0; background: var(--surface); padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); margin: 8px -20px 0; padding-inline: 20px; }
.sticky-actions .btn { flex: 1; }

/* §8 — Chat, propositions, mascotte (repris de l'ancienne feuille de style, jetons mis à jour) ------------------------- */
dialog#dlg-bot { height: min(680px, 84vh); }
.bot-dlg { display: flex; flex-direction: column; height: 100%; }
.bot-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 2px; }
.bot-msg { max-width: 85%; padding: 8px 12px; border-radius: 16px; font-size: 14px; line-height: 1.4; white-space: pre-wrap; }
.bot-msg.user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.bot-msg.bot { align-self: flex-start; background: var(--sunk); border-bottom-left-radius: 4px; }
.bot-proposal { border: 1px solid var(--gold); border-radius: var(--r-s); padding: 10px 12px; font-size: 13px; margin-top: 8px; background: color-mix(in srgb, var(--gold) 8%, var(--surface)); }
.bot-proposal h4 { margin: 0 0 6px; font: 600 14px var(--serif); }
.bot-proposal ul { margin: 0; padding-left: 18px; }
.bot-proposal.prop { margin-top: 8px; }
.bot-proposal .dlg-actions { flex-wrap: wrap; } .bot-proposal .dlg-actions .btn { white-space: nowrap; }
.bot-proposal .brouillon { width: 100%; margin: 6px 0; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: 16px/1.4 var(--sans); }
.bot-proposal .avert { background: var(--warn-bg); color: var(--warn-ink); border-radius: 8px; padding: 6px 8px; }
.bot-proposal p { margin: 4px 0; }
/* « Contacter mes favoris » (js/contacts.mjs) */
.cf-ouvrir { width: 100%; margin-top: 4px; }
#contacts-corps .brouillon { width: 100%; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: 16px/1.4 var(--sans); }
#contacts-corps .avert { background: var(--warn-bg); color: var(--warn-ink); border-radius: 8px; padding: 6px 8px; }
#contacts-corps .dlg-actions { flex-wrap: wrap; }
.cf-annonce { font-size: 14px; } .cf-annonce small { color: var(--muted); margin-left: 4px; }
.appareil-id { font-variant-numeric: tabular-nums; }
.bot-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 8px; flex-shrink: 0; }
.bot-form textarea { flex: 1; resize: none; max-height: 120px; min-height: var(--cible); margin: 0; border-radius: 14px; } /* 16 px : évite le zoom auto de Safari iOS au focus */
.bot-idees { flex-shrink: 0; margin-top: 6px; max-height: 38vh; overflow-y: auto; font-size: 13px; }
.bot-idees > summary { cursor: pointer; color: var(--muted); font-weight: 600; min-height: var(--cible); display: flex; align-items: center; }
.bot-idees h5 { margin: 10px 0 4px; font: 600 12px var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.bot-idees .idee-liste { display: flex; flex-wrap: wrap; gap: 6px; }
.bot-idees .idee { text-align: left; font: 13px/1.3 var(--sans); padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); cursor: pointer; }
.bot-idees .idee:hover { border-color: var(--gold); }
@media (max-width: 480px) {
  dialog#dlg-bot { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; position: fixed; inset: 0; }
  .bot-form { padding-bottom: max(0px, env(safe-area-inset-bottom)); }
}

.mascotte-btn { flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--surface); border: 2px solid var(--gold); cursor: pointer; padding: 0; overflow: hidden; display: grid; place-items: center; box-shadow: 0 2px 8px rgba(60, 20, 30, .2); transition: transform var(--dur); }
.mascotte-btn img { width: 100%; height: 100%; object-fit: cover; }
.mascotte-btn:hover { transform: scale(1.06); }
.mascotte-bulle { position: fixed; right: 12px; top: calc(70px + env(safe-area-inset-top)); z-index: 45; max-width: min(300px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--gold); border-radius: 16px 4px 16px 16px; padding: 12px 14px; box-shadow: var(--shadow); font-size: 14px; }
.mascotte-bulle[hidden] { display: none; }
.mascotte-bulle p { margin: 0 0 8px; } .mascotte-bulle-actions { display: flex; flex-wrap: wrap; gap: 6px; }
@media (min-width: 1024px) { .mascotte-bulle { top: 88px; right: max(32px, calc((100vw - 1240px) / 2 + 32px)); } }

/* §9 — Toasts ---------------------------------------------------------------------------------------------------- */
#toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom)); z-index: 60; display: flex; justify-content: center; pointer-events: none; padding: 0 16px; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 14px; max-width: 480px; padding: 12px 8px 12px 16px; border-radius: 14px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow); font-size: 14px; animation: monte .2s ease-out; }
.toast-action { min-height: var(--cible); padding: 0 12px; border: 0; background: none; color: var(--gold); font-weight: 700; }
