/* ==========================================================================
   Parcellea — interface
   ========================================================================== */
:root {
  --bg: #f4f3ee;
  --surface: #ffffff;
  --surface-2: #f7f6f2;
  --fg: #17201a;
  --fg-2: #3c463f;
  --muted: #69736b;
  --faint: #98a199;
  --line: #e7e5dd;
  --line-strong: #d9d6cb;

  --brand: #1f5130;
  --brand-2: #2f7a47;
  --brand-soft: #e6f1e8;
  --brand-fg: #ffffff;

  --vente: #d97a1e;
  --vente-strong: #b35f0d;
  --vente-soft: #fcefe0;
  --location: #0e8a8c;
  --location-strong: #0a6b6d;
  --location-soft: #dcf1f1;
  --select: #2563eb;
  --neighbor: #8b5cf6;

  --warn-bg: #fff4dc;
  --warn-fg: #7a4a00;
  --info-bg: #ecf2ff;
  --info-fg: #1d3a8a;
  --danger: #b42318;
  --danger-soft: #fdecea;

  --r: 12px;
  --r-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(20, 30, 22, .06), 0 1px 3px rgba(20, 30, 22, .06);
  --shadow: 0 2px 6px rgba(20, 30, 22, .06), 0 12px 32px rgba(20, 30, 22, .12);
  --shadow-lg: 0 8px 24px rgba(20, 30, 22, .10), 0 24px 64px rgba(20, 30, 22, .16);
  --ease: cubic-bezier(.2, .8, .2, 1);

  --panel-w: 440px;
  --gap: 16px;

  font-family: Inter, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-feature-settings: "cv11", "ss01";
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body { background: var(--bg); color: var(--fg); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
a { color: var(--brand-2); text-underline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid rgba(47, 122, 71, .35); outline-offset: 2px; border-radius: 6px; }

/* Icônes (SVG injectés par app.js) */
[data-icon] { display: inline-flex; width: 18px; height: 18px; flex: none; }
[data-icon] svg { width: 100%; height: 100%; }
.ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Carte plein écran ---------- */
#map { position: fixed; inset: 0; background: #dfe3d6; }
#map.mode-lot, #map.mode-recherche { cursor: crosshair; }
.leaflet-container { font-family: inherit; }
.leaflet-control-attribution { font-size: 10px; background: rgba(255,255,255,.75) !important; border-radius: 6px 0 0 0; }
.leaflet-tooltip { font-family: inherit; border: 0; border-radius: 8px; box-shadow: var(--shadow); padding: 6px 10px; font-size: 13px; }
.cadastre { filter: grayscale(1) brightness(1.9) contrast(1.2); opacity: .62; }

/* ---------- Barre de progression globale ---------- */
.progress-global { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 3000; background: linear-gradient(90deg, var(--brand-2), #7cc48f); box-shadow: 0 0 8px rgba(47,122,71,.5); opacity: 0; transition: width .4s var(--ease), opacity .3s; }
.progress-global.on { opacity: 1; width: 75%; transition: width 8s cubic-bezier(.1,.7,.2,1), opacity .2s; }
.progress-global.done { opacity: 0; width: 100%; transition: width .25s, opacity .4s .2s; }

/* ---------- Barre du haut flottante ---------- */
.topbar { position: fixed; z-index: 1000; top: var(--gap); left: var(--gap); right: var(--gap); display: flex; align-items: center; gap: 10px; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px 0 9px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); color: var(--brand); text-decoration: none; font-weight: 800; letter-spacing: -.02em; font-size: 17px; }
.brand-mark { display: flex; color: var(--brand); }
.search { position: relative; width: calc(var(--panel-w) - 150px); min-width: 220px; }
.search input { width: 100%; height: 48px; border: 0; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); padding: 0 16px 0 44px; font: inherit; color: var(--fg); outline: none; transition: box-shadow .2s; }
.search input:focus { box-shadow: var(--shadow), 0 0 0 3px rgba(47,122,71,.25); }
.search-icon { position: absolute; left: 15px; top: 15px; color: var(--muted); pointer-events: none; }
.nav { margin-left: auto; display: flex; gap: 8px; }

.dropdown { position: absolute; top: calc(100% + 8px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 1100; animation: pop .16s var(--ease); max-height: 60vh; overflow: auto; }
.dropdown li { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 9px; cursor: pointer; }
.dropdown li:hover, .dropdown li.active { background: var(--surface-2); }
.dropdown .lieu-ico { width: 30px; height: 30px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.dropdown b { font-weight: 600; display: block; font-size: 14px; }
.dropdown small { color: var(--muted); font-size: 12px; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px; border: 1px solid transparent; border-radius: 11px; font-weight: 600; font-size: 14.5px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .12s var(--ease), background .15s, box-shadow .15s; background: var(--surface-2); color: var(--fg); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: progress; transform: none; }
.btn.primary { background: var(--brand); color: var(--brand-fg); box-shadow: 0 4px 14px rgba(31,81,48,.28); }
.btn.primary:hover { background: #24603a; }
.btn.vente { background: var(--vente); color: #fff; box-shadow: 0 4px 14px rgba(217,122,30,.3); }
.btn.vente:hover { background: var(--vente-strong); }
.btn.location { background: var(--location); color: #fff; box-shadow: 0 4px 14px rgba(14,138,140,.28); }
.btn.location:hover { background: var(--location-strong); }
.btn.ghost { background: var(--surface); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.glass { height: 48px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); position: relative; }
.topbar .btn.primary { height: 48px; border-radius: 14px; }
.btn.small { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 9px; gap: 6px; }
.btn.small [data-icon] { width: 16px; height: 16px; }
.btn.block { width: 100%; height: 48px; font-size: 15px; }
.btn.link { background: none; height: auto; padding: 4px 0; color: var(--brand-2); }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 700; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 10px; background: var(--surface-2); cursor: pointer; color: var(--muted); transition: background .15s, color .15s; flex: none; }
.icon-btn:hover { background: var(--line); color: var(--fg); }

/* ---------- Contrôles de carte ---------- */
.map-ui { position: fixed; inset: 0; pointer-events: none; z-index: 900; }
.map-ui > * { pointer-events: auto; }
.control-stack { position: absolute; right: var(--gap); top: calc(var(--gap) + 64px); display: flex; flex-direction: column; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.ctrl { width: 44px; height: 44px; border: 0; background: none; display: grid; place-items: center; cursor: pointer; color: var(--fg-2); }
.ctrl + .ctrl { border-top: 1px solid var(--line); }
.ctrl:hover { background: var(--surface-2); }
.basemap { position: absolute; right: var(--gap); bottom: 34px; display: flex; gap: 2px; padding: 4px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); }
.basemap button { border: 0; background: none; padding: 8px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.basemap button.on { background: var(--fg); color: #fff; }
.basemap .toggle { margin-left: 6px; }
.basemap .toggle.on { background: var(--brand-soft); color: var(--brand); }
.chips { position: absolute; left: calc(var(--panel-w) + var(--gap) * 2); top: calc(var(--gap) + 64px); display: flex; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-sm), 0 4px 12px rgba(20,30,22,.08); font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.chip.on { color: var(--fg); }
.chip:not(.on) .dot { background: var(--line-strong) !important; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.dot.vente { background: var(--vente); }
.dot.location { background: var(--location); }
.dot.select { background: var(--select); }
.dot.neighbor { background: var(--neighbor); }
.map-hint[hidden] { display: none; }
.map-hint { position: absolute; left: calc(50% + (var(--panel-w) + var(--gap)) / 2); bottom: 34px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; background: rgba(23, 32, 26, .88); backdrop-filter: blur(6px); color: #fff; font-weight: 500; font-size: 14px; padding: 10px 16px; border-radius: 999px; box-shadow: var(--shadow); animation: pop .2s var(--ease); white-space: nowrap; }

/* ---------- Panneau ---------- */
.panel { position: fixed; z-index: 950; top: calc(var(--gap) + 64px); left: var(--gap); bottom: var(--gap); width: var(--panel-w); display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.sheet-handle { display: none; }
.panel-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 22px 22px 28px; }
.panel-body > .vue { animation: fade-up .28s var(--ease); }
.panel-footer { border-top: 1px solid var(--line); padding: 14px 22px; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); display: grid; gap: 8px; }
.panel-footer:empty { display: none; }
.panel-footer .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.panel h2 { font-size: 22px; line-height: 1.22; margin: 4px 0 6px; letter-spacing: -.025em; font-weight: 750; }
.kicker { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.sub { color: var(--muted); font-size: 14px; margin: 0; }
.hint { color: var(--faint); font-size: 13px; margin: 8px 0 0; line-height: 1.45; }
.back { display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--surface-2); color: var(--fg-2); cursor: pointer; padding: 6px 12px 6px 8px; border-radius: 999px; margin-bottom: 14px; font-size: 13.5px; font-weight: 600; transition: background .15s; }
.back [data-icon] { width: 16px; height: 16px; }
.back:hover { background: var(--line); }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.head-row .back { margin-bottom: 14px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

.section { margin-top: 26px; }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0 0 12px; }
.section-title [data-icon] { width: 16px; height: 16px; color: var(--faint); }

/* Indicateurs */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.kpi { display: flex; gap: 10px; align-items: flex-start; background: var(--surface-2); border-radius: var(--r); padding: 12px; min-width: 0; }
.kpi-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--surface); color: var(--brand-2); box-shadow: var(--shadow-sm); flex: none; }
.kpi-ico [data-icon] { width: 17px; height: 17px; }
.kpi .label { font-size: 12px; color: var(--muted); line-height: 1.3; }
.kpi .value { font-weight: 650; font-size: 14.5px; line-height: 1.35; overflow-wrap: anywhere; margin-top: 2px; }

.card { background: var(--surface-2); border-radius: var(--r); padding: 16px; }
.card.outline { background: var(--surface); border: 1px solid var(--line); }
.card.hero { background: linear-gradient(160deg, #f6faf5, #edf5ee); border: 1px solid #dfece1; }

/* Estimation */
.estimate .range { font-size: 28px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.estimate .median { font-size: 14px; color: var(--muted); margin-top: 4px; }
.segmented { display: flex; gap: 2px; padding: 3px; background: var(--surface-2); border-radius: 11px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.segmented button { flex: 1; border: 0; background: none; padding: 7px 10px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; transition: background .15s, color .15s, box-shadow .15s; }
.segmented button.on { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-sm); }

/* Graphique de l'estimation : bande interquartile, médiane et ventes comparables (une seule série) */
.strip { position: relative; height: 58px; margin: 22px 8px 2px; }
.strip-track { position: absolute; left: 0; right: 0; top: 22px; height: 6px; border-radius: 3px; background: var(--line); }
.strip-band { position: absolute; top: 18px; height: 14px; border-radius: 7px; background: rgba(47, 122, 71, .2); }
.strip-median { position: absolute; top: 12px; width: 4px; height: 26px; margin-left: -2px; border-radius: 4px; background: var(--brand); }
.strip-dot { position: absolute; top: 18px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--surface); border: 2px solid var(--fg-2); box-shadow: 0 0 0 2px var(--surface-2); cursor: default; transition: transform .12s; padding: 0; }
.strip-dot:hover, .strip-dot:focus-visible { transform: scale(1.3); z-index: 2; outline: none; }
.strip-dot::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); white-space: nowrap; background: var(--fg); color: #fff; font-size: 12px; font-weight: 500; padding: 5px 8px; border-radius: 7px; opacity: 0; pointer-events: none; transition: opacity .12s; }
.strip-dot:hover::after, .strip-dot:focus-visible::after { opacity: 1; }
.strip-dot.bord-g::after { left: -4px; transform: none; }
.strip-dot.bord-d::after { left: auto; right: -4px; transform: none; }
.strip-dot.hors { border-style: dashed; }
.strip-axis { position: absolute; left: -8px; right: -8px; top: 42px; display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.strip-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.strip-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-band { width: 18px; height: 8px; border-radius: 4px; background: rgba(47, 122, 71, .28); }
.lg-med { width: 4px; height: 12px; border-radius: 2px; background: var(--brand); }
.lg-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--fg-2); }

/* Demande */
.demand { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.demand .cell { background: var(--brand-soft); border-radius: var(--r); padding: 12px; }
.demand .cell.zero { background: var(--surface-2); }
.demand .big { font-size: 28px; font-weight: 800; color: var(--brand); line-height: 1; letter-spacing: -.02em; }
.demand .cell.zero .big { color: var(--faint); }
.demand .lbl { font-size: 12px; color: var(--muted); line-height: 1.3; margin-top: 6px; }

/* Listes, étiquettes */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding: 7px 0; font-size: 14px; }
.timeline li + li { border-top: 1px dashed var(--line); }
.timeline .year { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 500; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--fg-2); }
.tag.fort { background: var(--warn-bg); color: var(--warn-fg); font-weight: 600; }
.tag.nature { background: var(--brand-soft); color: var(--brand); }
.tag a { color: inherit; }
.owner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; }
.owner + .owner { border-top: 1px solid var(--line); }
.avatar { width: 38px; height: 38px; border-radius: 11px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: 14px; flex: none; }
.owner b { font-weight: 650; }
.list { list-style: none; padding: 0; margin: 0; }
.list > li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.parcel-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }

.notice { display: flex; gap: 10px; border-radius: var(--r); padding: 12px 14px; font-size: 14px; line-height: 1.45; }
.notice > [data-icon] { margin-top: 2px; }
.notice.warn { background: var(--warn-bg); color: var(--warn-fg); }
.notice.info { background: var(--info-bg); color: var(--info-fg); }
.notice b { display: block; margin-bottom: 2px; }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 650; padding: 3px 10px; border-radius: 999px; margin-right: 4px; }
.badge.vente { background: var(--vente-soft); color: var(--vente-strong); }
.badge.location { background: var(--location-soft); color: var(--location-strong); }
.badge.verif { background: var(--warn-bg); color: var(--warn-fg); }
.badge.ok { background: var(--brand-soft); color: var(--brand); }

table.sales { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 10px; }
table.sales th { font-weight: 600; color: var(--muted); font-size: 12px; }
table.sales th, table.sales td { padding: 7px 4px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
table.sales th:first-child, table.sales td:first-child { text-align: left; }
details summary { cursor: pointer; color: var(--brand-2); font-size: 14px; margin-top: 12px; font-weight: 600; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "›"; font-size: 18px; line-height: 1; transition: transform .2s; }
details[open] summary::before { transform: rotate(90deg); }

/* Cartes d'annonce */
.ad-card { display: flex; gap: 12px; width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: var(--surface); cursor: pointer; margin-bottom: 10px; transition: box-shadow .2s, transform .2s var(--ease), border-color .2s; }
.ad-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); border-color: transparent; }
.ad-thumb { width: 60px; height: 60px; border-radius: 12px; flex: none; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, var(--vente), var(--vente-strong)); }
.ad-card.location .ad-thumb { background: linear-gradient(145deg, var(--location), var(--location-strong)); }
.ad-thumb [data-icon] { width: 26px; height: 26px; }
.ad-body { min-width: 0; flex: 1; }
.ad-card .price { font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.ad-card .title { font-weight: 600; font-size: 14.5px; margin: 1px 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-card .meta { font-size: 12.5px; color: var(--muted); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 14px 0 16px; }
.filters select { width: auto; height: 36px; padding: 0 32px 0 12px; font-size: 13.5px; border-radius: 10px; }

.price-big { font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; font-size: 14px; margin: 14px 0 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.offer { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.offer-amount { font-weight: 750; font-variant-numeric: tabular-nums; }
.msg-meta { font-size: 12px; color: var(--faint); }
.empty { text-align: center; padding: 26px 10px; color: var(--muted); font-size: 14px; }
.empty [data-icon] { width: 32px; height: 32px; color: var(--faint); margin-bottom: 6px; }

/* Étapes numérotées */
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { position: relative; padding-left: 40px; margin-bottom: 16px; }
.steps li::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: 13px; display: grid; place-items: center; }

/* ---------- Formulaires ---------- */
input, select, textarea { font: inherit; color: inherit; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); width: 100%; outline: none; transition: border-color .15s, box-shadow .15s; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2369736b' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(47,122,71,.18); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
input[type="range"] { padding: 0; border: 0; accent-color: var(--brand-2); box-shadow: none; }
textarea { resize: vertical; }
label { display: block; font-size: 13px; font-weight: 600; margin: 16px 0 6px; color: var(--fg-2); }
label .opt { font-weight: 400; color: var(--faint); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 14px; margin: 12px 0; cursor: pointer; color: var(--fg); }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand-2); flex: none; }
.choices { display: flex; flex-wrap: wrap; gap: 6px; }
.choices label { margin: 0; }
.choices input { position: absolute; opacity: 0; pointer-events: none; }
.choices span { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 13.5px; font-weight: 600; cursor: pointer; background: var(--surface); color: var(--fg-2); transition: background .15s, border-color .15s, color .15s; }
.choices input:checked + span { background: var(--fg); border-color: var(--fg); color: #fff; }
.choices input:focus-visible + span { box-shadow: 0 0 0 3px rgba(47,122,71,.25); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.error { display: flex; gap: 8px; align-items: center; color: var(--danger); background: var(--danger-soft); padding: 10px 12px; border-radius: 10px; font-size: 14px; margin: 12px 0 0; }
.error[hidden] { display: none; }

/* ---------- Chargement ---------- */
.loader-card { background: var(--surface-2); border-radius: var(--r); padding: 16px; margin-top: 18px; }
.loader-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; font-weight: 650; }
.loader-head .num { color: var(--muted); font-weight: 500; font-size: 13px; }
.loader-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin: 10px 0 14px; }
.loader-bar > div { height: 100%; width: 4%; border-radius: 3px; background: linear-gradient(90deg, var(--brand-2), #6dbb84); transition: width .35s var(--ease); }
.loader-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.loader-steps li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--faint); transition: color .2s; }
.loader-steps li.en_cours, .loader-steps li.ok { color: var(--fg-2); }
.loader-steps li.indisponible { color: var(--warn-fg); }
.st { width: 16px; height: 16px; flex: none; display: grid; place-items: center; }
.st-wait { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--brand-2); animation: spin .7s linear infinite; }
.st [data-icon] { width: 16px; height: 16px; }
.loader-steps li.ok .st { color: var(--brand-2); animation: pop .25s var(--ease); }
.loader-note { font-size: 12.5px; color: var(--faint); margin-top: 12px; }
.skeleton { display: grid; gap: 10px; margin-top: 18px; }
.sk { border-radius: 10px; background: linear-gradient(90deg, var(--surface-2) 25%, #ecebe5 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }

/* Clic sur la carte */
.ripple-icon { background: none; border: 0; }
.ripple { width: 22px; height: 22px; transform: translate(-11px, -11px); border-radius: 50%; border: 3px solid #fff; background: rgba(37, 99, 235, .6); animation: ripple 1.1s ease-out infinite; }
.parcel-loading { animation: pulse-fill 1s ease-in-out infinite; }

/* Repères de prix */
.pin { display: inline-flex; align-items: center; background: var(--vente); color: #fff; font-weight: 700; font-size: 12.5px; padding: 4px 10px; border-radius: 999px; white-space: nowrap; box-shadow: 0 3px 10px rgba(0,0,0,.25); border: 2px solid #fff; transform: translate(-50%, -50%); font-variant-numeric: tabular-nums; transition: transform .15s var(--ease); cursor: pointer; }
.pin:hover { transform: translate(-50%, -50%) scale(1.08); }
.pin.location { background: var(--location); }
.pin-icon { background: none; border: 0; }

/* ---------- Notifications ---------- */
.toasts { position: fixed; left: calc(50% + (var(--panel-w) + var(--gap)) / 2); bottom: 90px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 2000; justify-items: center; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--fg); color: #fff; padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 500; animation: toast-in .3s var(--ease); max-width: min(92vw, 460px); }
.toast [data-icon] { color: #8fe0a6; }
.toast.erreur [data-icon] { color: #ffb4a8; }
.toast.out { animation: toast-out .25s ease-in forwards; }

/* ---------- Animations ---------- */
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }
@keyframes ripple { 0% { box-shadow: 0 0 0 0 rgba(37,99,235,.45); } 100% { box-shadow: 0 0 0 26px rgba(37,99,235,0); } }
@keyframes pulse-fill { 50% { fill-opacity: .06; } }

/* ---------- Mobile : panneau en bas d'écran ---------- */
@media (max-width: 820px) {
  :root { --gap: 10px; }
  .brand { width: 48px; padding: 0; justify-content: center; }
  .brand-name { display: none; }
  .search { flex: 1; width: auto; min-width: 0; }
  .nav .hide-sm { display: none; }
  .nav .btn { width: 48px; padding: 0; }
  .nav .count { position: absolute; top: -6px; right: -6px; box-shadow: 0 0 0 2px var(--surface); }
  .chips { left: var(--gap); top: calc(var(--gap) + 58px); }
  .chip { height: 32px; padding: 0 11px; font-size: 13px; }
  .control-stack { top: calc(var(--gap) + 58px); right: var(--gap); }
  .ctrl { width: 40px; height: 40px; }
  .basemap { display: none; }
  .map-hint { left: 50%; bottom: auto; top: calc(var(--gap) + 100px); font-size: 13px; }
  .panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; border-radius: 22px 22px 0 0; height: 52vh; transition: height .35s var(--ease); }
  .panel.sheet-peek { height: 150px; }
  .panel.sheet-half { height: 52vh; }
  .panel.sheet-full { height: calc(100% - 70px); }
  .panel.dragging { transition: none; }
  .sheet-handle { display: grid; place-items: center; width: 100%; height: 26px; border: 0; background: none; cursor: grab; flex: none; touch-action: none; }
  .sheet-handle span { width: 42px; height: 5px; border-radius: 3px; background: var(--line-strong); }
  .panel-body { padding: 2px 16px 20px; }
  .panel-footer { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
  .panel h2 { font-size: 20px; }
  .toasts { left: 50%; bottom: auto; top: calc(var(--gap) + 104px); }
  .loader-steps { grid-template-columns: 1fr; }
  .leaflet-control-attribution { display: none; }
}

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

/* ---------- Comptes, revendications, messagerie ---------- */
.compte-btn .avatar-mini { width: 28px; height: 28px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 800; margin-left: -6px; }
.count.alerte { background: var(--danger); color: #fff; }
.count[hidden] { display: none; }
.nav .count.alerte { position: absolute; top: -6px; right: -6px; box-shadow: 0 0 0 2px var(--surface); }

.niveau { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; padding: 3px 10px 3px 6px; border-radius: 999px; }
.niveau i { display: inline-flex; gap: 2px; }
.niveau i b { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .25; }
.niveau i b.on { opacity: 1; }
.niveau.n0 { background: var(--surface-2); color: var(--muted); }
.niveau.n1 { background: var(--warn-bg); color: var(--warn-fg); }
.niveau.n2 { background: var(--info-bg); color: var(--info-fg); }
.niveau.n3 { background: var(--brand-soft); color: var(--brand); }

.niveaux { display: grid; gap: 8px; margin-top: 12px; }
.niveaux > div { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; }
.niveaux > div.actuel { outline: 2px solid var(--brand-2); background: var(--brand-soft); }
.niveaux .num-niveau { width: 24px; height: 24px; border-radius: 7px; background: var(--surface); display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: none; box-shadow: var(--shadow-sm); }

.depot { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px; border: 2px dashed var(--line-strong); border-radius: 12px; background: var(--surface-2); text-align: center; cursor: pointer; font-size: 13.5px; color: var(--muted); transition: border-color .15s, background .15s; }
.depot:hover, .depot.survol { border-color: var(--brand-2); background: var(--brand-soft); }
.depot input { display: none; }
.depot b { color: var(--fg); }
.depot [data-icon] { width: 26px; height: 26px; color: var(--brand-2); }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; margin: 0; font-weight: 500; }
.switch input { position: absolute; opacity: 0; }
.switch span.piste { width: 38px; height: 22px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background .2s; flex: none; }
.switch span.piste::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s var(--ease); }
.switch input:checked + span.piste { background: var(--brand-2); }
.switch input:checked + span.piste::after { transform: translateX(16px); }
.switch input:focus-visible + span.piste { box-shadow: 0 0 0 3px rgba(47,122,71,.25); }

.carte-parcelle { border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.carte-parcelle .entete { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.carte-parcelle .actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }

.profil-tete { display: flex; gap: 14px; align-items: center; }
.profil-tete .avatar { width: 52px; height: 52px; font-size: 18px; border-radius: 15px; background: var(--brand); color: #fff; }

.conv { display: flex; gap: 12px; width: 100%; text-align: left; padding: 12px; border: 0; border-radius: 12px; background: none; cursor: pointer; align-items: center; }
.conv:hover { background: var(--surface-2); }
.conv + .conv { border-top: 1px solid var(--line); border-radius: 0; }
.conv .corps { flex: 1; min-width: 0; }
.conv .ligne1 { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.conv .apercu { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv.non-lu .apercu { color: var(--fg); font-weight: 600; }
.pastille { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; }

.fil { display: flex; flex-direction: column; gap: 8px; padding: 6px 0 4px; }
.bulle { max-width: 82%; padding: 9px 13px; border-radius: 16px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); align-self: flex-start; border-bottom-left-radius: 5px; animation: fade-up .2s var(--ease); }
.bulle.moi { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-left-radius: 16px; border-bottom-right-radius: 5px; }
.bulle .heure { display: block; font-size: 11px; opacity: .65; margin-top: 3px; }
.bulle.offre { background: var(--vente-soft); color: var(--fg); border: 1px solid #f4d3ae; }
.bulle.offre.moi { background: var(--vente); color: #fff; border-color: transparent; }
.bulle .montant { font-weight: 800; font-size: 16px; display: block; }
.jour { align-self: center; font-size: 11.5px; color: var(--faint); margin: 6px 0; }
.composer { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { min-height: 44px; max-height: 140px; resize: none; border-radius: 14px; }
.composer .btn { height: 44px; width: 44px; padding: 0; border-radius: 14px; flex: none; }

.vendeur-carte { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 14px; }

/* Champ mot de passe avec bouton Afficher / Masquer */
.champ-mdp { display: flex; gap: 8px; align-items: stretch; }
.champ-mdp input { flex: 1; min-width: 0; }
.champ-mdp .btn { flex: none; }

/* Mon compte : tableau de bord en rubriques */
.menu-groupe { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.menu-ligne { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 14px; border: 0; background: none; color: var(--fg); text-decoration: none; text-align: left; font: inherit; cursor: pointer; }
.menu-ligne + .menu-ligne { border-top: 1px solid var(--line); }
.menu-ligne:hover { background: var(--surface-2); }
.menu-ligne > [data-icon] { width: 20px; height: 20px; color: var(--brand); flex: none; }
.menu-ligne .corps { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.menu-ligne .corps b { font-size: 14.5px; font-weight: 600; }
.menu-ligne .corps span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chevron { color: var(--faint); font-size: 20px; line-height: 1; flex: none; }
.a-faire { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.a-faire a { display: flex; align-items: center; justify-content: flex-start; text-align: left; gap: 10px; padding: 12px 14px; border-radius: var(--r); background: var(--brand-soft); color: var(--brand); text-decoration: none; font-size: 14px; font-weight: 600; }
.a-faire a > [data-icon] { width: 18px; height: 18px; flex: none; }
.a-faire a > span:not(.chevron):not([data-icon]) { flex: 1; text-align: left; }
.a-faire a:hover { filter: brightness(.97); }

/* Photos d'annonce */
.ad-thumb.photo, .ad-card.location .ad-thumb.photo { background: var(--surface-2) center / cover no-repeat; }
.galerie { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 14px 0 0; border-radius: var(--r); }
.galerie a { flex: 0 0 88%; scroll-snap-align: start; }
.galerie a:only-child { flex-basis: 100%; }
.galerie img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r); background: var(--surface-2); }
.photos-editeur { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.photo-vignette, .photo-ajout { position: relative; aspect-ratio: 1; border-radius: 10px; background: var(--surface-2) center / cover no-repeat; }
.photo-vignette.chargement { display: grid; place-items: center; }
.photo-ajout { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1.5px dashed var(--line-strong); color: var(--muted); font-size: 12px; font-weight: 600; text-align: center; cursor: pointer; margin: 0; }
.photo-ajout:hover { border-color: var(--brand); color: var(--brand); }
.photo-action { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; display: grid; place-items: center; cursor: pointer; font-size: 13px; padding: 0; }
.photo-action.gauche { right: auto; left: 4px; }
.photo-action [data-icon] { width: 14px; height: 14px; }
.photo-couverture { position: absolute; left: 4px; bottom: 4px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 10.5px; font-weight: 700; padding: 2px 6px; border-radius: 6px; }

/* Annonce à la une */
.ad-card.une { border-color: var(--vente); box-shadow: 0 0 0 1px var(--vente-soft); }
.ad-card.location.une { border-color: var(--location); box-shadow: 0 0 0 1px var(--location-soft); }
.badge-une { display: inline-block; margin-right: 6px; padding: 1px 6px; border-radius: 6px; background: var(--fg); color: var(--surface); font-size: 11px; font-weight: 700; vertical-align: 1px; }

/* Offre du rapport */
.liste-offre { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14.5px; }
