:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --ink: #111827;
  --ink-2: #4b5563;
  --ink-3: #9ca3af;
  --line: #e5e7eb;
  --brand: #1d4ed8;
  --brand-2: #2563eb;
  --brand-soft: #e8efff;
  --ok: #059669;
  --ok-soft: #e6f6ef;
  --warn: #d97706;
  --warn-soft: #fff4e0;
  --bad: #dc2626;
  --bad-soft: #fdecec;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 4px 16px rgba(16,24,40,.06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.45; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; }
h2 { font-size: 20px; } h3 { font-size: 16px; } h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
.muted { color: var(--ink-2); } .small { font-size: 12px; } .tiny { font-size: 11px; }
.hidden { display: none !important; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.col { display: flex; flex-direction: column; gap: 8px; }
.spacer { flex: 1; }

/* ---------- barre du haut */
.topbar { position: sticky; top: 0; z-index: 900; height: 56px; background: var(--panel); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px; padding: 0 16px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; color: var(--ink); letter-spacing: -.02em; }
.logo svg { width: 28px; height: 28px; }
.logo b { color: var(--brand); }
.nav { display: flex; gap: 2px; }
.nav a { padding: 8px 12px; border-radius: 8px; color: var(--ink-2); font-weight: 500; }
.nav a:hover { background: var(--bg); text-decoration: none; }
.nav a.active { color: var(--brand); background: var(--brand-soft); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--bg); color: var(--ink-2); font-size: 12px; white-space: nowrap; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.pill.run .dot { background: var(--brand); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* ---------- boutons & champs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--panel);
  padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 500; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--bg); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--bg); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.lg { padding: 12px 18px; font-size: 15px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; outline: none; min-width: 0; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea.input { resize: vertical; min-height: 90px; }
label.lbl { font-size: 12px; font-weight: 600; color: var(--ink-2); display: block; margin-bottom: 4px; }
.range2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.chk { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.chk input { accent-color: var(--brand); width: 16px; height: 16px; }

/* chips (sélection multiple) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 11px; cursor: pointer; font-size: 13px; user-select: none; }
.chip:hover { border-color: var(--brand); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.dpe { width: 34px; padding: 5px 0; text-align: center; font-weight: 700; }
.seg { display: inline-flex; background: var(--bg); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 8px; cursor: pointer; font-weight: 500; color: var(--ink-2); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }

/* tri-état oui / non / indifférent */
.tri { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.tri-item { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 8px; padding: 4px 4px 4px 10px; background: #fff; font-size: 13px; }
.tri-item .tri-btns { display: flex; gap: 2px; }
.tri-item button { border: 0; background: var(--bg); border-radius: 6px; width: 28px; height: 24px; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--ink-3); }
.tri-item button.on.yes { background: var(--ok); color: #fff; }
.tri-item button.on.no { background: var(--bad); color: #fff; }
.tri-item.set { border-color: var(--brand); }

/* ---------- mise en page recherche */
.modes { display: flex; gap: 4px; padding: 12px 16px 0; background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto; }
.modes button { border: 0; background: transparent; padding: 10px 16px; font-weight: 600; color: var(--ink-2); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.modes button.on { color: var(--brand); border-bottom-color: var(--brand); }
.layout { display: grid; grid-template-columns: 380px 1fr; height: calc(100vh - 56px - 47px); }
.side { background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; display: flex; flex-direction: column; }
.side-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.side-foot { position: sticky; bottom: 0; background: var(--panel); border-top: 1px solid var(--line); padding: 12px 16px; display: flex; gap: 8px; }
.section { border: 1px solid var(--line); border-radius: var(--radius); }
.section > summary { list-style: none; cursor: pointer; padding: 10px 12px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.section > summary::-webkit-details-marker { display: none; }
.section > summary::after { content: "▾"; margin-left: auto; color: var(--ink-3); transition: transform .15s; }
.section:not([open]) > summary::after { transform: rotate(-90deg); }
.section > summary .count { background: var(--brand); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; }
.section-body { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 10px; }

.main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.toolbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.toolbar .total { font-weight: 700; font-size: 15px; }
.content { flex: 1; display: grid; grid-template-columns: minmax(380px, 1fr) minmax(320px, 1fr); min-height: 0; }
.content.list-only { grid-template-columns: 1fr; } .content.list-only .mapwrap { display: none; }
.content.map-only { grid-template-columns: 1fr; } .content.map-only .results { display: none; }
.content.stats-only { grid-template-columns: 1fr; } .content.stats-only .mapwrap, .content.stats-only .results { display: none; }
.results { overflow-y: auto; padding: 14px 16px; }
.mapwrap { position: relative; border-left: 1px solid var(--line); }
.map { position: absolute; inset: 0; }
.statswrap { overflow-y: auto; padding: 16px; }

/* ---------- cartes d'annonce */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.list-only .cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; transition: transform .12s, box-shadow .12s; position: relative; }
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(16,24,40,.12); }
.card.hl { outline: 2px solid var(--brand); }
.card.seen .card-title { color: var(--ink-2); }
.card-img { position: relative; aspect-ratio: 16/10; background: #e5e7eb center/cover no-repeat; }
.card-img .nav-ph { position: absolute; top: 50%; transform: translateY(-50%); border: 0; background: rgba(0,0,0,.4); color: #fff; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; opacity: 0; transition: opacity .15s; }
.card:hover .nav-ph { opacity: 1; }
.card-img .nav-ph.prev { left: 6px; } .card-img .nav-ph.next { right: 6px; }
.badges { position: absolute; top: 8px; left: 8px; display: flex; gap: 4px; flex-wrap: wrap; max-width: 80%; }
.badge { font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 6px; background: rgba(17,24,39,.75); color: #fff; }
.badge.new { background: var(--brand); } .badge.drop { background: var(--bad); } .badge.gone { background: #6b7280; }
.badge.ok { background: var(--ok); } .badge.warn { background: var(--warn); }
.score { position: absolute; top: 8px; right: 8px; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.fav-btn { position: absolute; bottom: 8px; right: 8px; border: 0; background: rgba(255,255,255,.92); border-radius: 50%; width: 34px; height: 34px; cursor: pointer; font-size: 17px; display: grid; place-items: center; }
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.price-line { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price { font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.ppsm { color: var(--ink-2); font-size: 12px; }
.gap { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 5px; }
.gap.lo { background: var(--ok-soft); color: var(--ok); } .gap.hi { background: var(--bad-soft); color: var(--bad); } .gap.mid { background: var(--bg); color: var(--ink-2); }
.card-title { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.facts { display: flex; gap: 10px; color: var(--ink-2); font-size: 12px; flex-wrap: wrap; }
.facts span { white-space: nowrap; }
.ficons { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.ficon { font-size: 11px; background: var(--bg); border-radius: 5px; padding: 2px 6px; color: var(--ink-2); }
.card-foot { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 11px; color: var(--ink-3); }
.srcs { display: flex; gap: 3px; flex-wrap: wrap; }
.src { font-size: 10px; font-weight: 700; background: var(--brand-soft); color: var(--brand); border-radius: 4px; padding: 1px 5px; text-transform: uppercase; }
.crit-mini { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.crit-mini span { font-size: 10.5px; border-radius: 4px; padding: 1px 5px; }
.st-ok { background: var(--ok-soft); color: var(--ok); } .st-non { background: var(--bad-soft); color: var(--bad); }
.st-partiel { background: var(--warn-soft); color: var(--warn); } .st-q, .st-probable { background: var(--bg); color: var(--ink-3); }
.more { display: flex; justify-content: center; padding: 18px; }
.empty { text-align: center; padding: 60px 20px; color: var(--ink-2); }
.empty .big { font-size: 42px; margin-bottom: 8px; }

/* marqueurs de prix sur la carte */
.pm { background: #fff; border: 1.5px solid var(--brand); color: var(--ink); font-weight: 700; font-size: 11.5px; padding: 2px 6px; border-radius: 6px; white-space: nowrap; box-shadow: 0 1px 4px rgba(0,0,0,.25); transform: translate(-50%, -100%); position: absolute; }
.pm::after { content: ""; position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%); border: 5px solid transparent; border-top-color: var(--brand); border-bottom: 0; }
.pm.new { border-color: var(--brand); background: var(--brand); color: #fff; }
.pm.drop { border-color: var(--bad); } .pm.drop::after { border-top-color: var(--bad); }
.pm.s-hi { border-color: var(--ok); background: var(--ok); color: #fff; } .pm.s-hi::after { border-top-color: var(--ok); }
.pm.s-mid { border-color: var(--warn); } .pm.s-mid::after { border-top-color: var(--warn); }
.pm.hl { background: var(--ink); color: #fff; border-color: var(--ink); z-index: 1000; } .pm.hl::after { border-top-color: var(--ink); }
.pm.dvf { border-color: #7c3aed; } .pm.dvf::after { border-top-color: #7c3aed; }
.leaflet-div-icon.pm-wrap { background: transparent; border: 0; }
.map-legend { position: absolute; bottom: 14px; left: 14px; z-index: 500; background: #fff; border-radius: 8px; padding: 6px 10px; box-shadow: var(--shadow); font-size: 11px; display: flex; gap: 10px; }
.map-tools { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 500; display: flex; gap: 6px; }
.map-tools .btn { box-shadow: var(--shadow); }
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div { background: var(--brand) !important; color: #fff; font-weight: 700; }
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large { background: rgba(29,78,216,.25) !important; }

/* ---------- autocomplete */
.ac { position: relative; }
.ac-list { position: absolute; top: 100%; left: 0; right: 0; z-index: 1000; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); margin-top: 4px; max-height: 260px; overflow-y: auto; }
.ac-list div { padding: 8px 10px; cursor: pointer; } .ac-list div:hover, .ac-list div.on { background: var(--brand-soft); }
.ac-list small { color: var(--ink-3); margin-left: 6px; }

/* ---------- modale annonce */
.overlay { position: fixed; inset: 0; background: rgba(17,24,39,.55); z-index: 2000; display: flex; justify-content: center; align-items: flex-start; overflow-y: auto; padding: 28px 16px; }
.modal { background: var(--panel); border-radius: 16px; width: min(1180px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.3); position: relative; }
.modal-close { position: absolute; top: 12px; right: 12px; z-index: 5; border: 0; background: #fff; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; font-size: 20px; box-shadow: var(--shadow); }
.gallery { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 4px; height: 420px; border-radius: 16px 16px 0 0; overflow: hidden; background: #e5e7eb; }
.gallery div { background: #d1d5db center/cover no-repeat; cursor: zoom-in; position: relative; }
.gallery div:first-child { grid-row: span 2; }
.gallery .count { position: absolute; bottom: 10px; right: 10px; background: rgba(0,0,0,.65); color: #fff; padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.detail { display: grid; grid-template-columns: 1fr 360px; gap: 24px; padding: 22px 26px 30px; }
.detail h1 { font-size: 24px; letter-spacing: -.01em; }
.big-price { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 14px 0; }
.kv div { background: var(--bg); border-radius: 10px; padding: 9px 11px; }
.kv b { display: block; font-size: 15px; } .kv span { font-size: 11px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .03em; }
.feat-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 14px; }
.feat { border-radius: 8px; padding: 5px 10px; font-size: 13px; font-weight: 500; }
.feat.yes { background: var(--ok-soft); color: var(--ok); } .feat.no { background: var(--bg); color: var(--ink-3); text-decoration: line-through; } .feat.maybe { background: var(--warn-soft); color: var(--warn); }
.desc { white-space: pre-line; color: var(--ink); background: var(--bg); padding: 14px 16px; border-radius: 10px; max-height: 360px; overflow-y: auto; }
.box { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; background: #fff; }
.box h3 { display: flex; align-items: center; gap: 8px; }
.offers { width: 100%; border-collapse: collapse; }
.offers td { padding: 7px 4px; border-bottom: 1px solid var(--line); font-size: 13px; }
.offers tr:last-child td { border-bottom: 0; }
.gauge { height: 10px; border-radius: 99px; background: linear-gradient(90deg, #d1fae5, #fde68a, #fecaca); position: relative; margin: 10px 0 6px; }
.gauge i { position: absolute; top: -4px; width: 4px; height: 18px; background: var(--ink); border-radius: 2px; }
.reasons { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; }
.dpe-scale { display: flex; gap: 3px; margin-top: 6px; }
.dpe-scale span { flex: 1; text-align: center; font-weight: 800; color: #fff; padding: 4px 0; border-radius: 4px; opacity: .35; font-size: 12px; }
.dpe-scale span.on { opacity: 1; transform: scaleY(1.25); }
.dA { background: #009036; } .dB { background: #53af31; } .dC { background: #c6d300; } .dD { background: #fce600; color: #333 !important; } .dE { background: #fbba00; } .dF { background: #eb6909; } .dG { background: #e2001a; }
.minimap { height: 220px; border-radius: 10px; overflow: hidden; margin-top: 8px; }
.sticky-actions { position: sticky; top: 12px; }
.lightbox { position: fixed; inset: 0; z-index: 3000; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 6px; }
.lightbox button { position: absolute; border: 0; background: rgba(255,255,255,.15); color: #fff; width: 48px; height: 48px; border-radius: 50%; cursor: pointer; font-size: 22px; }
.lightbox .lb-prev { left: 20px; } .lightbox .lb-next { right: 20px; } .lightbox .lb-close { top: 20px; right: 20px; }
.lightbox .lb-count { position: absolute; bottom: 20px; color: #fff; }

/* ---------- pages simples */
.page { max-width: 1200px; margin: 0 auto; padding: 24px 16px 60px; }
.panel { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; color: var(--ink-2); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:hover td { background: #fafbfc; }
.status-ok { color: var(--ok); font-weight: 600; } .status-err { color: var(--bad); font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.stat b { display: block; font-size: 24px; letter-spacing: -.02em; } .stat span { color: var(--ink-2); font-size: 12px; }
.src-row { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; background: #fff; }
.src-row.off { background: #fafafa; }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #d1d5db; border-radius: 99px; cursor: pointer; transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--brand); } .switch input:checked + span::before { transform: translateX(16px); }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; background: var(--bg); border-radius: 6px; padding: 8px; white-space: pre-wrap; word-break: break-all; max-height: 260px; overflow: auto; }
.bookmarklet { display: inline-block; padding: 10px 16px; background: var(--brand); color: #fff !important; border-radius: 8px; font-weight: 700; cursor: grab; }
.parsed { display: flex; flex-wrap: wrap; gap: 6px; }
.pchip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 6px 4px 10px; font-size: 13px; border: 1px solid var(--line); background: #fff; }
.pchip .imp { font-size: 10px; font-weight: 800; border-radius: 99px; padding: 2px 7px; cursor: pointer; text-transform: uppercase; }
.imp-must { background: var(--bad); color: #fff; } .imp-normal { background: var(--brand-soft); color: var(--brand); } .imp-nice { background: var(--bg); color: var(--ink-2); }
.pchip .x { border: 0; background: transparent; cursor: pointer; color: var(--ink-3); font-size: 15px; }
.kanban { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; }
.kcol { background: #eef1f6; border-radius: var(--radius); padding: 10px; min-height: 200px; }
.kcol h4 { display: flex; justify-content: space-between; }
.kcard { background: #fff; border-radius: 10px; box-shadow: var(--shadow); margin-bottom: 8px; overflow: hidden; cursor: pointer; }
.kcard .ph { aspect-ratio: 16/9; background: #ddd center/cover; }
.kcard .b { padding: 8px 10px; font-size: 12px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 4000; box-shadow: var(--shadow); max-width: 90vw; }
.toast.err { background: var(--bad); }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.bar { display: flex; align-items: center; gap: 8px; font-size: 12px; margin: 3px 0; }
.bar i { display: block; height: 14px; background: var(--brand); border-radius: 3px; min-width: 2px; }
.est-result { text-align: center; padding: 20px; background: linear-gradient(135deg, var(--brand-soft), #fff); border-radius: var(--radius); }
.est-result .v { font-size: 38px; font-weight: 800; color: var(--brand); letter-spacing: -.02em; }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, #1e3a8a, #1d4ed8 50%, #60a5fa); padding: 20px; }
.login { background: #fff; border-radius: 18px; padding: 34px 30px; width: min(380px, 100%); box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.login .logo { justify-content: center; font-size: 24px; margin-bottom: 4px; }
.login p { text-align: center; color: var(--ink-2); margin: 0 0 22px; }
.login .err { color: var(--bad); font-size: 13px; min-height: 18px; margin-top: 8px; text-align: center; }

/* ---------- responsive */
.mob-only { display: none; }
@media (max-width: 1100px) {
  .content { grid-template-columns: 1fr; }
  .content:not(.map-only) .mapwrap { display: none; }
  .detail { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; height: auto; }
  .side { display: none; border-right: 0; }
  .layout.show-filters .side { display: flex; position: fixed; inset: 56px 0 0 0; z-index: 1500; }
  .layout.show-filters .main { display: none; }
  .main { height: calc(100vh - 56px - 47px); }
  .mob-only { display: inline-flex; }
  .nav a span { display: none; }
  .nav a { padding: 8px; }
  .topbar .pill { display: none; }
  .topbar { gap: 6px; padding: 0 8px; } .topbar .logo { font-size: 0; gap: 0; }
  .gallery { height: 260px; grid-template-columns: 1fr; } .gallery div:not(:first-child) { display: none; }
  .detail { padding: 16px; } .grid2, .grid3 { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: repeat(5, 260px); }
  .cards { grid-template-columns: 1fr; }
}

/* ---------- impression (fiche PDF) */
@media print {
  body { background: #fff; }
  .topbar, .modes, .layout, .modal-close, .no-print, .page { display: none !important; }
  .overlay { position: static; background: none; padding: 0; overflow: visible; }
  .modal { box-shadow: none; width: 100%; }
  .detail { grid-template-columns: 1fr; }
  .gallery { height: 300px; }
  .desc { max-height: none; }
}

/* ---------- v2 : critères, tableau intelligent, fiche en onglets, paramètres */
.picker .ac-list { max-height: 340px; }
.picker .grp { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); padding: 8px 10px 4px; cursor: default; background: #fafbfc; }
.picker .grp:hover { background: #fafbfc; }
.crit-list { display: flex; flex-direction: column; gap: 6px; }
.crit-row { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fff; }
.crit-row .x, .bchip .x { border: 0; background: transparent; cursor: pointer; color: var(--ink-3); font-size: 18px; line-height: 1; padding: 0 2px; }
.crit-row .x:hover, .bchip .x:hover { color: var(--bad); }
.cv { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; font-size: 13px; }
.cv input, .cv select { width: 92px; border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; }
.cv .chips { gap: 4px; } .cv .chip { padding: 2px 8px; font-size: 12px; }
.board { display: flex; flex-direction: column; gap: 8px; }
.zone { border: 1.5px dashed var(--line); border-radius: 12px; padding: 8px; transition: background .15s, border-color .15s; }
.zone.over { background: var(--brand-soft); border-color: var(--brand); }
.zone-h { font-weight: 700; font-size: 13px; margin-bottom: 6px; display: flex; justify-content: space-between; }
.zone-indispensable .zone-h { color: var(--bad); } .zone-important .zone-h { color: var(--brand); }
.zone-souhaite .zone-h { color: var(--warn); } .zone-bonus .zone-h { color: var(--ink-2); }
.zone-b { display: flex; flex-direction: column; gap: 6px; min-height: 26px; }
.zone-empty { font-size: 12px; color: var(--ink-3); text-align: center; padding: 4px; }
.bchip { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 6px 8px; cursor: grab; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.bchip.drag { opacity: .4; }
.bchip .grip { color: var(--ink-3); cursor: grab; font-size: 12px; }
.bchip .lv { border: 1px solid var(--line); border-radius: 6px; font-size: 11px; padding: 2px; max-width: 100px; }
.detail-head { padding: 20px 26px 0; }
.detail-head h1 { font-size: 22px; margin: 4px 0; }
.dtabs { display: flex; gap: 4px; padding: 14px 26px 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.dtabs button { border: 0; background: transparent; padding: 10px 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.dtabs button.on { color: var(--brand); border-bottom-color: var(--brand); }
.verdict { color: #fff; font-weight: 800; padding: 6px 14px; border-radius: 999px; font-size: 14px; }
.addr-big { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.addr-box { background: var(--ok-soft); border-color: #b7e4d0; }
.steps > div { border-left: 3px solid var(--brand-soft); padding: 6px 0 10px 12px; margin-bottom: 6px; }
.panel h4 { margin-top: 4px; }
@media (max-width: 820px) {
  .detail-head, .dtabs { padding-left: 16px; padding-right: 16px; }
  .detail-head h1 { font-size: 18px; }
}

/* ================================================================ v2.4 */
/* DPE sur les vignettes */
.dpe-pill { position: absolute; top: 8px; right: 8px; display: flex; align-items: center; gap: 5px; padding: 3px 4px 3px 8px; border-radius: 99px; color: #fff; font-size: 11px; font-weight: 700; box-shadow: 0 2px 6px rgba(0,0,0,.25); cursor: help; z-index: 2; }
.dpe-pill.under { top: 60px; }
.dpe-pill b { font-size: 13px; }
.dpe-pill i { font-style: normal; width: 16px; height: 16px; border-radius: 50%; background: rgba(255,255,255,.9); color: #374151; display: grid; place-items: center; font-size: 10px; font-weight: 800; font-family: Georgia, serif; }
.dpe-tip { display: none; position: absolute; top: 6px; right: 96px; background: #fff; color: var(--ink); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.25); padding: 7px 9px; z-index: 5; min-width: 128px; cursor: default; }
.dpe-tip.under { top: 6px; }
.dpe-pill:hover + .dpe-tip, .dpe-pill.open + .dpe-tip { display: block; }
.dpe-t { border-collapse: collapse; font-size: 11px; margin: 4px 0 2px; width: 100%; }
.dpe-t td { padding: 1px 4px; white-space: nowrap; }
.dpe-t tr.on td { font-weight: 800; background: #f3f4f6; }
.dpe-t .dl { display: inline-block; width: 18px; text-align: center; border-radius: 3px; color: #fff; font-weight: 800; }
.info-i { position: relative; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--ink-3); color: var(--ink-2); font: 700 10px Georgia, serif; cursor: help; margin-left: 4px; vertical-align: 1px; }
.info-pop { display: none; position: absolute; left: 22px; top: -8px; background: #fff; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.2); padding: 8px 10px; z-index: 30; min-width: 170px; font-family: var(--font); color: var(--ink); }
.info-i:hover .info-pop, .info-i:focus .info-pop { display: block; }
/* masquer depuis la vignette */
.hide-btn { position: absolute; bottom: 8px; right: 48px; border: 0; background: rgba(255,255,255,.92); border-radius: 50%; width: 34px; height: 34px; cursor: pointer; font-size: 16px; display: grid; place-items: center; opacity: 0; transition: opacity .15s; }
.card:hover .hide-btn { opacity: 1; }
@media (hover: none) { .hide-btn { opacity: .85; } }
.card.leaving { opacity: 0; transform: scale(.96); transition: opacity .2s, transform .2s; }
.toast.undo { display: flex; align-items: center; gap: 14px; }
.toast.undo button { border: 0; background: transparent; color: #93c5fd; font-weight: 700; cursor: pointer; font-size: 14px; }
.hid-list { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; }
.hid-row { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
.hid-row .ph { width: 72px; height: 50px; border-radius: 6px; background: #ddd center/cover; flex: none; }
/* prix & saisie */
.price-block { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.price-block .lvsel { border: 1px solid var(--line); border-radius: 6px; font-size: 12px; padding: 2px 4px; }
.eur { position: relative; }
.eur input { padding-right: 24px; width: 100%; }
.eur span { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 13px; pointer-events: none; }
input.num { font-variant-numeric: tabular-nums; }
.cv input.num { width: 104px; }
/* trajet */
.seg.sm button { padding: 4px 10px; font-size: 12px; }
.travel .row { gap: 8px; }
.input.sm { padding: 4px 8px; font-size: 13px; }
/* ajout de critères */
.add-row { display: flex; gap: 6px; align-items: flex-start; }
.add-row .picker { flex: 1; }
.zone-h { align-items: center; }
.zone-add { border: 1px dashed currentColor; background: #fff; color: inherit; border-radius: 7px; font-size: 11px; font-weight: 700; padding: 2px 8px; cursor: pointer; }
.zone-add:hover { background: var(--brand-soft); }
.steps-mini { margin: 4px 0 0; padding-left: 18px; }
.steps-mini li { margin: 2px 0; }
.cat-ov { z-index: 3000; }
.cat-modal { max-width: 880px; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; max-height: 88vh; }
.cat-head { display: flex; justify-content: space-between; align-items: center; }
.cat-lv { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cat-lv .seg button.on.lvb-indispensable { color: var(--bad); } .cat-lv .seg button.on.lvb-important { color: var(--brand); }
.cat-lv .seg button.on.lvb-souhaite { color: var(--warn); }
.cat-body { overflow-y: auto; flex: 1; min-height: 200px; }
.cat-g h4 { margin: 12px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.cat-g .chip { cursor: pointer; }
.cat-g .chip small { opacity: .8; font-size: 10px; text-transform: uppercase; margin-left: 2px; }
.chip.lvc-indispensable { background: var(--bad); border-color: var(--bad); color: #fff; }
.chip.lvc-souhaite { background: var(--warn); border-color: var(--warn); color: #fff; }
.chip.lvc-bonus { background: #6b7280; border-color: #6b7280; color: #fff; }
.cat-foot { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
/* graphique DVF */
.chart-ctl { gap: 8px; margin-bottom: 8px; }
/* favoris : glisser-déposer */
.kcard[draggable=true] { cursor: grab; }
.kcard.drag { opacity: .35; transform: rotate(1deg); }
.kcol.over { background: #dfe7f6; outline: 2px dashed var(--brand); outline-offset: -4px; }
.kph { height: 64px; border: 2px dashed var(--brand); border-radius: 10px; margin-bottom: 8px; background: rgba(29,78,216,.06); }
/* paramètres */
.chk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 14px; }
/* fiche : analyse, modification */
.ck-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.ck-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ck { border-radius: 10px; padding: 8px 10px; background: var(--bg); }
.ck h4 { margin: 0 0 4px; font-size: 13px; }
.ck ul { margin: 0; padding-left: 16px; font-size: 13px; } .ck li { margin: 3px 0; }
.ck.pros { background: var(--ok-soft); } .ck.cons { background: var(--bad-soft); } .ck.imp { background: var(--warn-soft); } .ck.ver { background: #eef2ff; } .ck.ask { background: #f3f4f6; }
@media (max-width: 760px) { .ck-grid, .ck-grid3 { grid-template-columns: 1fr; } }
.edited-box { background: #fffbeb; border-color: #fde68a; }
.tri-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 12px; }
.tri { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 13px; border-bottom: 1px dotted var(--line); padding: 2px 0; }
.tri select { border: 1px solid var(--line); border-radius: 6px; padding: 2px 4px; }
.notary-presets { gap: 6px; margin-top: 8px; align-items: center; }
.notary-presets .chip { cursor: pointer; font-size: 12px; }

/* fiche PDF */
#print-sheet { display: none; }
@media print {
  @page { size: A4; margin: 12mm; }
  body.printing > *:not(#print-sheet) { display: none !important; }
  body.printing #print-sheet { display: block; font-size: 11pt; color: #111; }
  #print-sheet header { display: flex; justify-content: space-between; gap: 16px; border-bottom: 3px solid #1d4ed8; padding-bottom: 8px; margin-bottom: 10px; }
  #print-sheet h1 { font-size: 17pt; margin: 2px 0 4px; }
  #print-sheet h3 { font-size: 12pt; margin: 0 0 4px; color: #1d4ed8; }
  .ps-type { text-transform: uppercase; font-size: 9pt; letter-spacing: .05em; color: #6b7280; }
  .ps-addr { font-size: 10pt; color: #374151; }
  .ps-price { font-size: 20pt; font-weight: 800; text-align: right; white-space: nowrap; }
  .ps-price small { display: block; font-size: 10pt; font-weight: 500; color: #6b7280; }
  .ps-photos { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); gap: 4px; height: 68mm; margin-bottom: 10px; overflow: hidden; }
  .ps-photos.one { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr); }
  .ps-photos img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: cover; border-radius: 4px; }
  .ps-photos img.main { grid-row: span 2; }
  .ps-kv { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px 10px; margin-bottom: 8px; }
  .ps-kv div { border-bottom: 1px solid #e5e7eb; padding: 2px 0; }
  .ps-kv span { display: block; font-size: 8pt; color: #6b7280; }
  .ps-feats { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 10pt; margin-bottom: 8px; }
  .ps-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .ps-col { break-inside: avoid; margin-bottom: 8px; border-radius: 6px; padding: 6px 8px; border: 1px solid #e5e7eb; }
  .ps-col ul { margin: 0; padding-left: 15px; font-size: 10pt; }
  .ps-col.pros { border-left: 4px solid #059669; } .ps-col.cons { border-left: 4px solid #dc2626; } .ps-col.imp { border-left: 4px solid #d97706; }
  .ps-market { break-inside: avoid; margin: 6px 0; }
  .ps-desc p { white-space: pre-line; font-size: 10pt; line-height: 1.45; margin: 0; }
  .ps-desc { margin-top: 8px; }
  #print-sheet footer { margin-top: 10px; border-top: 1px solid #e5e7eb; padding-top: 6px; font-size: 8pt; color: #6b7280; word-break: break-all; }
}
