:root {
  --ink: #17211e;
  --muted: #687570;
  --cream: #f6f4ee;
  --paper: #ffffff;
  --forest: #16362d;
  --sage: #dce9df;
  --mint: #eaf3ed;
  --line: #e3e7e2;
  --accent: #e96f45;
  --shadow: 0 18px 45px rgba(24, 47, 39, .09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
  font-synthesis: none;
}

/* Identité visuelle de la LOCATION. Les deux pages partagent l'intégralité
   de la feuille de style : seul l'accent change, mais il est repris partout
   (pastilles, liens actifs, icônes, boutons), ce qui suffit à ce qu'un coup
   d'oeil dise sur quelle page on se trouve — sans entretenir deux thèmes.
   Un bleu-vert franc, assez éloigné de l'orange de l'achat pour qu'aucune
   capture d'écran des deux pages ne prête à confusion. */
body[data-transaction="location"] {
  --accent: #1f8a8c;
  --mint: #e6f2f2;
  --sage: #d3e7e7;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-width: 0; overflow-x: hidden; background: var(--cream); }
a { color: inherit; }
button, input, select { font: inherit; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
button, summary { touch-action: manipulation; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.topbar {
  height: 76px; padding: 0 max(24px, calc((100vw - 1480px) / 2));
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  border-bottom: 1px solid rgba(23, 33, 30, .08); background: rgba(246, 244, 238, .92);
  position: sticky; top: 0; z-index: 20; backdrop-filter: blur(16px);
}
.brand { display: inline-flex; align-items: center; gap: 11px; width: fit-content; font-size: 20px; font-weight: 760; text-decoration: none; letter-spacing: -.4px; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: white; background: var(--forest); transform: rotate(-2deg); }
.brand-mark svg { width: 20px; }
.location-pill { display: flex; gap: 8px; align-items: center; padding: 9px 15px; background: white; border: 1px solid var(--line); border-radius: 99px; font-size: 14px; font-weight: 650; }
.location-pill svg { width: 17px; color: var(--accent); }
.topbar-center { display: flex; align-items: center; gap: 10px; }
/* Bascule Achat / Location. Deux pages distinctes, donc deux liens francs
   plutôt qu'un sélecteur : l'onglet actif est plein, l'autre reste discret. */
.mode-switch { display: flex; gap: 4px; padding: 4px; background: white; border: 1px solid var(--line); border-radius: 99px; }
.mode-switch a { padding: 7px 17px; border-radius: 99px; font-size: 14px; font-weight: 680; color: var(--muted); text-decoration: none; transition: background .15s, color .15s; }
.mode-switch a:hover { color: var(--ink); }
.mode-switch a.active { color: white; background: var(--forest); }

.topbar form { justify-self: end; }
.refresh-button { min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 10px 16px; border: 0; border-radius: 10px; color: white; background: var(--forest); font-weight: 680; cursor: pointer; box-shadow: 0 7px 18px rgba(22, 54, 45, .18); }
.refresh-button svg { width: 17px; }
.refresh-button:disabled, .primary-button:disabled { opacity: .55; cursor: wait; }

.page-shell { width: min(1480px, calc(100% - 48px)); margin: 0 auto; }
.intro { min-height: 262px; padding: 54px 4px 39px; display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.eyebrow { margin: 0 0 8px; color: #72827b; font-size: 11px; line-height: 1; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.intro h1 { margin: 0; max-width: 780px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(40px, 4.3vw, 67px); font-weight: 500; line-height: .98; letter-spacing: -2.3px; }
.intro h1 span { color: #5e6e67; font-style: italic; }
.intro-copy { max-width: 640px; margin: 20px 0 0; color: var(--muted); font-size: 16px; line-height: 1.6; }
.freshness { padding: 11px 15px; display: flex; align-items: center; gap: 9px; white-space: nowrap; border: 1px solid #ccded1; border-radius: 10px; color: #315b48; background: var(--mint); font-size: 13px; font-weight: 650; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #36a269; box-shadow: 0 0 0 5px rgba(54,162,105,.12); }
.toast { margin-bottom: 18px; padding: 13px 16px; border-radius: 10px; color: #234f3a; background: #dcefe3; font-size: 14px; }
.toast-warning { color: #745116; background: #f8e9be; }
.toast-error { color: #873d34; background: #f6d9d4; }

.source-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-bottom: 18px; }
.source-status { min-width: 0; padding: 13px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.66); }
.source-logo { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: white; background: #777; font-size: 13px; font-weight: 850; }
.source-leboncoin { background: #f4633a; } .source-ouestfrance { background: #165caa; } .source-bienici { background: #ee4969; } .source-pap { background: #d7352f; } .source-immonot { background: #2d6073; } .source-kermarrec { background: #0b7285; } .source-blot { background: #8b2f52; } .source-seloger { background: #7354d4; } .source-foncia { background: #1f6f4a; } .source-giboire { background: #a1531f; } .source-guenno { background: #4a4e8c; } .source-lafrancaise { background: #7a1f3d; }
.source-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.source-copy strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.source-copy span { color: var(--muted); font-size: 11px; }
.source-health { display: flex; align-items: center; gap: 5px; color: #397250; font-size: 10px; font-weight: 730; white-space: nowrap; }
.source-health > span { width: 6px; height: 6px; border-radius: 50%; background: #46a76c; }
.source-health.etat-en_attente, .source-health.etat-desactivee, .source-health.etat-en_cours { color: #8b928f; }
.source-health.etat-en_attente > span, .source-health.etat-desactivee > span, .source-health.etat-en_cours > span { background: #b5bbb8; }
.source-health.etat-en_panne { color: #b64e40; } .source-health.etat-en_panne > span { background: #d45343; }
/* Session absente : la seule situation qui demande un geste à l'utilisateur. */
.source-health.etat-session_absente { color: #9a6b1f; } .source-health.etat-session_absente > span { background: #dda23a; }
/* Au repos : une protection qui fonctionne, jamais une alerte — d'où un bleu
   calme et non le rouge des pannes. */
.source-health.etat-au_repos { color: #4a6b8a; } .source-health.etat-au_repos > span { background: #739ab5; }
.source-detail { grid-column: 1 / -1; margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }

.workspace { display: grid; grid-template-columns: 286px minmax(0, 1fr); gap: 18px; align-items: start; }
.filters, .results { min-width: 0; border: 1px solid var(--line); background: var(--paper); border-radius: 16px; box-shadow: 0 5px 25px rgba(24,47,39,.035); }
.filters { padding: 22px; position: sticky; top: 94px; }
.filters-panel > .filters-toggle { display: none; }
.filters-panel > .filters-body { display: block; }
.filters-toggle { list-style: none; cursor: pointer; }
.filters-toggle::-webkit-details-marker { display: none; }
.filters-toggle-action { color: #487d64; font-size: 12px; font-weight: 720; }
.filter-heading, .results-top { display: flex; justify-content: space-between; align-items: start; }
.filter-heading h2, .results-top h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 27px; font-weight: 500; letter-spacing: -.5px; }
.reset-link { color: var(--muted); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.filter-form { margin-top: 23px; display: flex; flex-direction: column; gap: 15px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field label, .requirements legend { font-size: 12px; font-weight: 720; }
.field small { color: #8a938f; font-size: 10px; line-height: 1.4; }
.field input, .field select, .sort-form select { width: 100%; min-width: 0; height: 40px; padding: 0 11px; border: 1px solid #dce1dd; border-radius: 8px; outline: none; color: var(--ink); background: #fbfcfa; font-size: 13px; }
.field input:focus, .field select:focus, .sort-form select:focus { border-color: #739886; box-shadow: 0 0 0 3px rgba(72,125,100,.1); }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 37px; }
.input-suffix span { position: absolute; right: 12px; top: 10px; color: #7a8580; font-size: 12px; }
.split-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.requirements { margin: 2px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 7px; border: 0; }
.requirements legend { width: 100%; margin-bottom: 2px; }
.check-pill input { position: absolute; opacity: 0; pointer-events: none; }
.check-pill span { display: block; padding: 7px 10px; border: 1px solid #dde3df; border-radius: 99px; color: #5e6964; background: #fafbf9; font-size: 11px; cursor: pointer; }
.check-pill input:checked + span { border-color: #759884; color: #234e3c; background: var(--mint); }
.primary-button { width: 100%; padding: 11px 16px; border: 0; border-radius: 9px; color: white; background: var(--forest); font-size: 13px; font-weight: 720; cursor: pointer; }
.secondary-button { width: 100%; padding: 9px 14px; border: 1px solid #dde3df; border-radius: 9px; color: #234e3c; background: #fafbf9; font-size: 12px; font-weight: 600; cursor: pointer; }
.filter-note { margin: -3px 0 0; color: #8b938f; font-size: 10px; line-height: 1.45; text-align: center; }

.preset-liste { display: flex; flex-wrap: wrap; gap: 7px; }
.preset-chip { display: flex; align-items: stretch; border: 1px solid #dde3df; border-radius: 99px; overflow: hidden; background: #fafbf9; }
.preset-chip form { display: contents; }
.preset-chip button { border: 0; background: transparent; cursor: pointer; font-family: inherit; }
.preset-chip button:not(.preset-delete) { padding: 7px 10px; color: #234e3c; font-size: 11px; }
.preset-chip button:not(.preset-delete):hover { background: var(--mint); }
.preset-delete { padding: 7px 9px; color: #8b938f; font-size: 12px; border-left: 1px solid #dde3df; }
.preset-delete:hover { color: #b3402e; background: #fbe9e6; }
.preset-save { display: flex; gap: 7px; margin-top: 4px; }
.preset-save input { flex: 1; min-width: 0; padding: 9px 10px; border: 1px solid #dde3df; border-radius: 9px; font-size: 12px; font-family: inherit; }
.preset-save .secondary-button { width: auto; white-space: nowrap; }

.results { padding: 23px; min-height: 600px; }
.results-top { align-items: center; margin-bottom: 18px; }
.search-form { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; }
.search-form input[type="search"] { flex: 1; min-width: 0; height: 40px; padding: 0 11px; border: 1px solid #dce1dd; border-radius: 8px; outline: none; color: var(--ink); background: #fbfcfa; font-size: 13px; }
.search-form input[type="search"]:focus { border-color: #739886; box-shadow: 0 0 0 3px rgba(72,125,100,.1); }
.search-form .primary-button { width: auto; padding: 0 16px; height: 40px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sort-form { display: flex; align-items: center; gap: 8px; }
.sort-form label { color: var(--muted); font-size: 11px; font-weight: 650; white-space: nowrap; }
.sort-form select { width: 190px; background: white; }
.recent-tabs { display: flex; align-items: center; gap: 5px; margin: 0 0 10px; overflow-x: auto; }
.recent-tabs > span { margin-right: 3px; color: var(--muted); font-size: 11px; font-weight: 720; }
.recent-tabs a { padding: 7px 10px; border: 1px solid #dce5df; border-radius: 99px; color: #596760; background: #fafbf9; font-size: 11px; font-weight: 680; text-decoration: none; white-space: nowrap; }
.recent-tabs a b { margin-left: 3px; color: #8b9791; font-size: 10px; }
.recent-tabs a.active { border-color: #739886; color: #1d4032; background: var(--mint); }
.recent-tabs a.active b { color: #487d64; }
.source-tabs { display: flex; gap: 3px; padding: 4px; margin-bottom: 19px; overflow-x: auto; border-radius: 9px; background: #f3f5f2; }
.source-tabs a { padding: 8px 11px; border-radius: 7px; color: #63706a; font-size: 11px; font-weight: 680; text-decoration: none; white-space: nowrap; }
.source-tabs a.active { color: #1d4032; background: white; box-shadow: 0 2px 8px rgba(29,64,50,.08); }
.source-tabs a span { margin-left: 3px; color: #98a19d; }
.listing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.listing-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: white; transition: transform .18s ease, box-shadow .18s ease; }
.listing-media { height: 184px; display: block; position: relative; overflow: hidden; background: #e9ece8; }
.listing-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.image-placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: #a2aea8; background: linear-gradient(145deg,#e9ede9,#dfe6e1); }
.image-placeholder svg { width: 48px; opacity: .58; }
.portal-badge, .discovered-badge, .withdrawn-badge { position: absolute; top: 11px; padding: 5px 8px; border-radius: 6px; font-size: 9px; font-weight: 800; letter-spacing: .04em; }
.portal-badge { left: 11px; color: var(--ink); background: rgba(255,255,255,.93); }
.discovered-badge { right: 11px; color: white; background: var(--accent); }
/* Même emplacement que l'âge de découverte : une annonce retirée n'affiche
   plus une fraîcheur qui n'aurait pas de sens. */
.withdrawn-badge { right: 11px; color: white; background: #6b6f6c; text-transform: uppercase; }
.listing-card:has(.withdrawn-badge) .listing-media img { filter: grayscale(1); opacity: .72; }
/* Bandeau bas de l'image : le quartier ne doit pas concurrencer les badges
   de source et de nouveauté, en haut. */
.quartier-badge { position: absolute; left: 11px; bottom: 11px; max-width: calc(100% - 22px); padding: 4px 8px; border-radius: 6px; color: var(--ink); background: rgba(255,255,255,.93); font-size: 10px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quartier-badge.est-deduit { color: #6b6f6c; background: rgba(255,255,255,.82); font-style: italic; }
/* Douze lignes dans une colonne étroite : la lisibilité tient au fait que
   chaque ligne occupe exactement une ligne, nom tronqué au besoin (le nom
   officiel complet reste en infobulle) et compte aligné à droite. */
.quartiers { min-width: 0; margin: 0 0 14px; }
.quartiers-entete { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 650; }
.quartiers-actions { display: flex; gap: 6px; }
.quartiers-actions button { padding: 0; border: 0; background: none; color: #487d64; font-size: 11px; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.quartiers-actions button:hover { color: var(--ink); }
.quartiers-liste { display: flex; flex-direction: column; gap: 1px; }
/* Exposition : badge discret sous le badge de source, à droite de l'image. */
.expo-badge { position: absolute; right: 11px; bottom: 11px; padding: 4px 8px; border-radius: 6px; color: var(--ink); background: rgba(255,255,255,.93); font-size: 10px; font-weight: 700; }
.check-line { display: flex; align-items: center; gap: 7px; padding: 2px 4px; border-radius: 5px; cursor: pointer; font-size: 12px; line-height: 1.35; }
.check-line:hover { background: #f1f4f1; }
.check-line input { width: 13px; height: 13px; flex: none; margin: 0; accent-color: #487d64; }
.check-nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check-line.is-off .check-nom { color: var(--muted); }
.check-compte { flex: none; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
/* Secteurs d'un quartier : repliés sous leur quartier, décalés pour que la
   hiérarchie se lise sans couleur ni bordure. */
.sous-quartiers { margin: 0 0 2px 20px; }
.sous-quartiers summary { padding: 1px 4px; color: var(--muted); font-size: 11px; cursor: pointer; list-style: none; }
.sous-quartiers summary::before { content: "▸ "; }
.sous-quartiers[open] summary::before { content: "▾ "; }
.sous-quartiers summary:hover { color: var(--ink); }
.check-line--fin { font-size: 11px; }
.check-line--fin .check-nom { color: var(--muted); }
.check-line--fin:not(.is-off) .check-nom { color: var(--ink); }
.quartiers .filter-note { margin: 7px 0 0; }
/* Navigation de pages : sans JavaScript, deux liens et un repère. */
.pagination { margin-top: 22px; display: flex; align-items: center; justify-content: center; gap: 18px; font-size: 13px; }
.pagination a { padding: 8px 14px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--paper); font-weight: 650; text-decoration: none; }
.pagination a:hover { border-color: #739886; background: var(--mint); }
.pagination .inactif { padding: 8px 14px; color: #b3bbb7; }
.pagination-etat { color: var(--muted); font-variant-numeric: tabular-nums; }
.page-indicateur { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
/* Bloc de note : la justification compte autant que le chiffre — une note
   sans raison ne peut pas être contestée, donc pas corrigée. */
.note-bloc { display: flex; gap: 10px; margin: 0 0 10px; padding: 9px 10px; border-radius: 9px; background: #f4f7f4; }
.note-valeur { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; color: white; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.note-haute { background: #2f7d55; } .note-moyenne { background: #a8842c; } .note-basse { background: #9a5449; }
.note-texte { min-width: 0; }
.note-texte p { margin: 0; color: #4a5551; font-size: 11px; line-height: 1.45; }
.note-points { margin: 5px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px; }
.note-points li { padding: 2px 6px; border-radius: 5px; font-size: 10px; font-weight: 650; }
.note-points .plus { color: #2f6b4a; background: #dcece2; }
.note-points .moins { color: #8c4a3f; background: #f2e0dc; }
/* Le retour se déplie sur la carte : la correction doit se faire là où la
   note est lue, pas dans un écran séparé. */
.retour-note summary { min-width: 36px; min-height: 32px; list-style: none; cursor: pointer; padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; font-size: 12px; display: grid; place-items: center; }
.retour-note summary::-webkit-details-marker { display: none; }
.retour-note[open] { position: relative; }
.retour-note textarea { width: 100%; margin: 7px 0; padding: 8px; border: 1px solid #dce1dd; border-radius: 8px; font-size: 12px; resize: vertical; }
.retour-note .primary-button { padding: 7px 12px; font-size: 12px; }
.notation-switch { margin: 2px 0 0; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfa; }
.notation-switch .check-line { padding: 0; font-weight: 650; }
.notation-switch .filter-note { margin-top: 6px; text-align: left; }
.notation-switch code { font-size: 10px; }
.listing-content { padding: 15px; }
.price-drop-badge { display: inline-block; margin: 0 0 6px; padding: 4px 8px; border-radius: 6px; color: white; background: #b3261e; font-size: 10px; font-weight: 800; letter-spacing: .02em; }
.listing-price-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.listing-price-row strong { font-family: Georgia, "Times New Roman", serif; font-size: 23px; font-weight: 600; letter-spacing: -.5px; }
.listing-price-row span { color: var(--muted); font-size: 10px; white-space: nowrap; }
.listing-content h3 { height: 36px; margin: 8px 0 7px; overflow: hidden; font-size: 13px; line-height: 1.38; font-weight: 680; }
.listing-content h3 a { text-decoration: none; }
.listing-place { margin: 0; display: flex; align-items: center; gap: 5px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.listing-place svg { width: 12px; flex: none; color: var(--accent); }
.listing-description { max-height: 7.2em; margin: 11px 0 0; padding: 9px 10px; overflow-x: hidden; overflow-y: auto; border-radius: 7px; color: #4f5d56; background: #f7f8f6; font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-line; }
.facts { min-height: 32px; margin: 14px 0; display: flex; flex-wrap: wrap; gap: 5px; }
.facts span { padding: 5px 7px; border-radius: 5px; color: #53605a; background: #f2f4f1; font-size: 9px; }
.facts b { color: var(--ink); }
.facts .dpe { color: white; font-weight: 800; }
.dpe-a { background: #289e65!important; }.dpe-b { background: #55ad58!important; }.dpe-c { background: #b2b635!important; }.dpe-d { background: #e3a42a!important; }.dpe-e { background: #e47425!important; }.dpe-f { background: #d84b34!important; }.dpe-g { background: #af2d35!important; }
.actions { margin: -3px 0 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.actions button { min-width: 36px; min-height: 32px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; color: #53605a; background: #f7f8f6; font-size: 13px; cursor: pointer; }
.actions button:hover { background: var(--mint); }
.actions button.is-active { color: #b3791f; border-color: #f0dcae; background: #fdf3dd; }
.action-text { display: none; }
.also-on { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: -4px 0 12px; }
.also-on a { color: #2c5c46; font-size: 10px; font-weight: 650; text-decoration: underline; text-underline-offset: 2px; }
.listing-footer { padding-top: 11px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #edf0ed; color: #8a948f; font-size: 9px; }
.listing-dates { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.listing-dates strong { color: #65736c; font-size: 10px; font-weight: 720; }
.listing-footer a { display: flex; align-items: center; gap: 2px; color: #2c5c46; font-size: 10px; font-weight: 750; text-decoration: none; }
.listing-footer svg { width: 13px; }
.empty-state { min-height: 430px; padding: 50px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.empty-icon { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 20px; color: #5e806f; background: var(--mint); }
.empty-icon svg { width: 31px; }
.empty-state h3 { margin: 20px 0 8px; font-family: Georgia, "Times New Roman", serif; font-size: 27px; font-weight: 500; }
.empty-state p { max-width: 480px; margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.empty-state .primary-button { width: auto; }
.empty-state code { padding: 2px 5px; border-radius: 4px; background: #edf1ed; }
footer { width: min(1480px, calc(100% - 48px)); margin: 23px auto 30px; display: flex; justify-content: space-between; color: #84908a; font-size: 10px; }

/* Identité de l'utilisateur connecté, dans le bandeau. */
.topbar-fin { justify-self: end; display: flex; align-items: center; gap: 10px; }
.topbar-fin form { justify-self: initial; }
.compte__nom { font-size: 13px; font-weight: 680; color: var(--muted); white-space: nowrap; }
.compte__sortie { min-height: 36px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 9px; background: white; font-size: 13px; font-weight: 650; color: var(--muted); cursor: pointer; }
.compte__sortie:hover { color: var(--ink); }

/* Tiroir de compte, réservé au téléphone : sur grand écran les commandes
   tiennent en ligne dans le bandeau, et un menu à ouvrir serait un clic de
   plus pour rien. */
.compte-menu { display: none; position: relative; }
.compte-menu > summary { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: white; color: var(--muted); cursor: pointer; list-style: none; }
.compte-menu > summary::-webkit-details-marker { display: none; }
.compte-menu > summary svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.compte-menu[open] > summary { color: var(--ink); border-color: var(--forest); }
.compte-menu__tiroir { position: absolute; z-index: 30; top: calc(100% + 9px); right: 0; min-width: 208px; display: grid; gap: 4px; padding: 9px; background: var(--paper); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); }
.compte-menu__qui { padding: 6px 10px 8px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 700; }
.compte-menu__tiroir a, .compte-menu__tiroir button { width: 100%; min-height: 44px; padding: 10px 12px; display: flex; align-items: center; border: 0; border-radius: 9px; background: none; color: var(--ink); font: inherit; font-size: 14px; font-weight: 650; text-align: left; text-decoration: none; cursor: pointer; }
.compte-menu__tiroir a:hover, .compte-menu__tiroir button:hover { background: var(--cream); }

/* Les requêtes média commencent ici : tout ce qui précède est la mise en page
   de bureau. Le bloc « compte » ci-dessus y a été REMONTÉ — écrit en fin de
   fichier, sa règle `.compte-menu { display: none }` repassait après la
   surcharge mobile de même spécificité et gagnait par simple ordre : le tiroir
   de compte restait invisible sur téléphone, sans qu'aucune règle n'ait l'air
   fautive. */

@media (hover: hover) and (pointer: fine) {
  .listing-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
  .listing-card:hover .listing-media img { transform: scale(1.025); }
}

@media (pointer: coarse) {
  .field input, .field select, .sort-form select, .search-form input[type="search"], .retour-note textarea { min-height: 44px; font-size: 16px; }
  .actions button, .retour-note summary, .recent-tabs a, .source-tabs a, .check-line { min-width: 44px; min-height: 44px; }
  .quartiers-actions button { min-width: 44px; min-height: 44px; padding-inline: 6px; }
  .also-on a { min-height: 44px; display: inline-flex; align-items: center; }
}

/* Le tiroir de compte prend le relais bien avant le téléphone : entre 821 et
   990 px, le nom, « Configuration », « Actualiser » et « Se déconnecter »
   alignés dépassaient encore le bandeau de 92 px au plus serré. C'est la
   tranche des tablettes et des téléphones en paysage. */
@media (max-width: 1000px) {
  .compte__nom, .compte__direct { display: none; }
  .compte-menu { display: block; }
}

@media (max-width: 1180px) {
  .listing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .source-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  /* Deux rangées explicites, et non deux colonnes : le bandeau porte TROIS
     enfants (marque, bascule, compte). Avec `1fr auto`, le troisième tombait
     en deuxième rangée sans que rien ne lui réserve la largeur, et la page
     entière débordait de 283 px sur un écran de 320 — mesuré, pas supposé. */
  .topbar { height: auto; min-height: 68px; padding: max(8px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); grid-template-columns: auto 1fr; grid-template-areas: "marque compte" "modes modes"; column-gap: 12px; row-gap: 10px; }
  .brand { grid-area: marque; }
  .topbar-fin { grid-area: compte; }
  .topbar-center { grid-area: modes; }
  .location-pill { display: none; }
  /* La bascule occupe toute la largeur : c'est la navigation principale du
     site, et deux moitiés d'écran sont la cible la plus sûre pour un pouce. */
  .mode-switch { width: 100%; }
  .mode-switch a { flex: 1; padding: 9px 13px; font-size: 14px; text-align: center; }
  /* Cibles tactiles : 44 px est le minimum confortable pour un pouce, et ces
     quatre-là restaient sous la barre — mesurées à 33, 13, 27 et 36 px. La
     croix de suppression d'un lot est la plus critique : 25 px pour une
     action irréversible, juste à côté du bouton qui l'applique. */
  .brand { min-height: 44px; }
  .mode-switch a { min-height: 36px; display: flex; align-items: center; justify-content: center; }
  /* `:not(.compte__direct)` n'est pas une précaution de style mais une
     correction : posée sur `.compte__sortie` tout court, cette règle avait la
     même spécificité que le `display: none` ci-dessus et passait après lui —
     le lien « Configuration », qui porte les deux classes, ressuscitait dans
     le bandeau du téléphone alors qu'il vit désormais dans le tiroir. Ici,
     elle ne vise que le « Retour aux annonces » de la page de configuration. */
  .compte__sortie:not(.compte__direct) { min-height: 44px; display: inline-flex; align-items: center; }
  .filter-heading .reset-link { min-height: 44px; display: inline-flex; align-items: center; padding-inline: 6px; }
  .preset-chip button:not(.preset-delete) { min-height: 44px; padding: 7px 13px; font-size: 12px; }
  .preset-delete { min-width: 42px; min-height: 44px; font-size: 15px; }
  .mode-switch a { min-height: 40px; }
  .secondary-button { min-height: 44px; }
  /* Le dépliant des secteurs faisait 17 px de haut : large, mais impossible à
     viser sans tâtonner. Les liens de la carte suivent le même raisonnement —
     le titre et « Voir l'annonce » sont les deux sorties vers le portail. */
  .sous-quartiers summary { min-height: 40px; display: flex; align-items: center; padding: 2px 6px; font-size: 12px; }
  /* `block` et non `inline-flex` : le lien occupe alors toute la largeur du
     titre, et une annonce au titre court — « T3 » chez certains loueurs — ne
     se réduit pas à une cible de 17 px de large. Le texte continue de se
     replier normalement, ce qu'un conteneur flex empêcherait. */
  .listing-content h3 a { min-height: 44px; display: block; padding-block: 2px; }
  .listing-footer a { min-height: 44px; padding-inline: 4px; }
  .page-shell { width: min(100% - 24px, 700px); }
  .intro { min-height: 0; padding: 36px 4px 28px; align-items: start; flex-direction: column; gap: 18px; }
  .intro h1 { letter-spacing: -1.5px; }
  .freshness { align-self: start; }
  .workspace { grid-template-columns: 1fr; }
  .filters { padding: 0; position: static; overflow: hidden; }
  .filters-panel > .filters-toggle { min-height: 64px; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
  .filters-toggle .eyebrow { display: block; margin-bottom: 4px; }
  .filters-toggle strong { font-family: Georgia, "Times New Roman", serif; font-size: 20px; font-weight: 500; }
  .filters-panel:not([open]) > .filters-body { display: none; }
  .filters-panel[open] > .filters-body { display: block; }
  .filters-panel[open] > .filters-toggle { border-bottom: 1px solid var(--line); }
  .filters-panel[open] .filters-toggle-action { font-size: 0; }
  .filters-panel[open] .filters-toggle-action::after { content: "Masquer"; font-size: 12px; }
  .filters-body { padding: 20px; }
  /* Le dépliant n'existe que sur téléphone, et il annonce déjà « Affiner —
     Filtres et critères ». Le titre interne « Affiner — Mes critères »
     répétait donc la même chose deux lignes plus bas, en poussant les vrais
     champs hors de l'écran. Seul « Effacer » est conservé. */
  .filter-heading > div { display: none; }
  .filter-heading { justify-content: flex-end; margin-bottom: 4px; }
  .field input, .field select, .sort-form select, .search-form input[type="search"], .retour-note textarea { min-height: 44px; font-size: 16px; }
  .check-line { min-height: 44px; }
  .quartiers-actions button { min-width: 44px; min-height: 44px; padding-inline: 6px; }
  .primary-button { min-height: 44px; }
  .actions button, .retour-note summary { min-width: 44px; min-height: 44px; font-size: 14px; }
  .recent-tabs a, .source-tabs a { min-height: 44px; display: flex; align-items: center; }
  .also-on a { min-height: 44px; display: inline-flex; align-items: center; }
  footer { width: calc(100% - 24px); padding-bottom: env(safe-area-inset-bottom); }
}

@media (max-width: 640px) {
  .source-strip { margin-inline: -12px; padding: 0 12px 7px; display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: 12px; scrollbar-width: none; overscroll-behavior-inline: contain; }
  .source-strip::-webkit-scrollbar, .recent-tabs::-webkit-scrollbar, .source-tabs::-webkit-scrollbar { display: none; }
  .source-status { flex: 0 0 min(82vw, 320px); scroll-snap-align: start; }
  .results { padding: 16px; min-height: 480px; }
  .results-top { align-items: stretch; flex-direction: column; gap: 13px; }
  .sort-form { width: 100%; align-items: center; flex-direction: row; }
  .sort-form select { width: auto; flex: 1; }
  .search-form { flex-wrap: wrap; }
  .search-form input[type="search"] { flex: 1 0 100%; }
  .search-form .primary-button { flex: 1; }
  .recent-tabs, .source-tabs { margin-inline: -16px; padding-inline: 16px; scroll-padding-inline: 16px; scrollbar-width: none; overscroll-behavior-inline: contain; }
  .recent-tabs a, .source-tabs a { scroll-snap-align: start; }
  .recent-tabs, .source-tabs { scroll-snap-type: x proximity; }
  .listing-grid { grid-template-columns: 1fr; }
  .listing-card:hover { transform: none; box-shadow: none; }
  .listing-card:hover .listing-media img { transform: none; }
  .listing-media { height: auto; aspect-ratio: 16 / 9; }
  .listing-content { padding: 16px; }
  .listing-content h3 { height: auto; max-height: 3em; font-size: 15px; line-height: 1.45; }
  .listing-description { max-height: 12em; font-size: 13px; line-height: 1.5; }
  .facts { min-height: 0; margin: 14px 0; gap: 6px; }
  .facts span { padding: 6px 8px; font-size: 11px; }
  .retour-note[open] { width: 100%; }
  .retour-note[open] summary { width: 44px; }
  .search-form .reset-link { min-height: 44px; display: inline-flex; align-items: center; padding-inline: 8px; }
  .listing-footer { gap: 12px; flex-wrap: wrap; font-size: 11px; }
  .listing-dates strong, .listing-footer a { font-size: 12px; }
  .pagination { gap: 6px; }
  .pagination a, .pagination .inactif { min-height: 44px; padding: 8px 10px; display: flex; align-items: center; }
}

@media (max-width: 520px) {
  /* PAS de `height` fixe : le bandeau tient sur deux rangées sous 820 px, et
     la valeur de 68 px — écrite quand il n'en avait qu'une — faisait déborder
     la bascule Achat/Location de sa propre boîte. Elle recouvrait alors les
     42 premiers pixels de la page, dont le surtitre. */
  .topbar { min-height: 68px; }
  .brand span:last-child { display: none; }
  .refresh-button { padding: 9px 12px; font-size: 12px; }
  .intro h1 { font-size: clamp(34px, 11vw, 39px); }
  .intro-copy { font-size: 15px; }
  .action-text { display: inline; margin-left: 3px; }
  footer { gap: 10px; flex-direction: column; }
}

@media (max-width: 390px) {
  .page-shell, footer { width: calc(100% - 16px); }
  .topbar { padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .filters-body { padding: 15px; }
  .split-fields { grid-template-columns: 1fr; gap: 12px; }
  .freshness { width: 100%; justify-content: center; font-size: 12px; }
  .source-strip { margin-inline: -8px; padding-inline: 8px; }
  .source-status { flex-basis: min(88vw, 310px); }
  .results { padding: 13px; }
  .recent-tabs, .source-tabs { margin-inline: -13px; padding-inline: 13px; scroll-padding-inline: 13px; }
  .pagination { font-size: 12px; }
}

/* --- Page de connexion ---------------------------------------------------
   Volontairement dépouillée : une carte centrée, sans barre de navigation ni
   pied de page. Il n'y a rien d'autre à faire sur cette page, et tout ce qui
   s'y ajouterait ne ferait qu'offrir des liens à quelqu'un qui n'est pas
   encore identifié. */
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(408px, 100%); padding: 40px 36px; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); text-align: center; }
.login-mark { display: inline-grid; margin-bottom: 18px; }
.login-card h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 31px; font-weight: 500; letter-spacing: -.8px; }
.login-intro { margin: 8px 0 26px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.login-form { display: grid; gap: 15px; text-align: left; }
.login-form .field { display: grid; gap: 6px; }
.login-form label { font-size: 12px; font-weight: 700; letter-spacing: .02em; color: #55635d; }
.login-form input { min-height: 44px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--cream); }
.login-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.login-bouton { width: 100%; margin-top: 8px; min-height: 46px; }
.login-erreur { margin: 0 0 18px; padding: 11px 14px; border: 1px solid #e8c4b6; border-radius: 10px; background: #fdf1ec; color: #8a3c1d; font-size: 14px; font-weight: 600; }


/* --- Page de configuration (administrateur) ------------------------------ */
.admin-shell { padding-bottom: 60px; }
.admin-message { margin: 0 0 22px; padding: 13px 16px; border-radius: 11px; font-size: 14px; font-weight: 620; }
.admin-message--ok { border: 1px solid #b7d8c3; background: #eef7f1; color: #245c3c; }
.admin-message--erreur { border: 1px solid #e8c4b6; background: #fdf1ec; color: #8a3c1d; }
.admin-confirmation { margin: 0 0 26px; padding: 18px 20px; border: 1px solid #e0c58f; border-radius: 13px; background: #fdf7ea; }
.admin-confirmation p { margin: 0 0 9px; font-size: 14px; line-height: 1.55; }
.admin-groupe { margin: 0 0 30px; padding: 24px 26px; background: var(--paper); border: 1px solid var(--line); border-radius: 15px; }
.admin-groupe h2 { margin: 0 0 4px; font-size: 18px; font-weight: 700; letter-spacing: -.3px; }
.admin-champs { margin-top: 18px; display: grid; gap: 17px; grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr)); }
.admin-champ { display: grid; gap: 5px; align-content: start; }
.admin-champ label code { font-size: 12.5px; font-weight: 700; color: #3f4e48; }
.admin-champ input[type="text"], .admin-champ input[type="number"], .admin-champ input[type="password"], .admin-champ select { min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--cream); }
.admin-champ--protege { padding: 12px 13px; margin: -12px -13px; border-radius: 11px; background: #fdf7ea; }
.admin-bornes { font-size: 12px; color: var(--muted); }
.admin-etiquette { margin-left: 7px; padding: 2px 7px; border-radius: 99px; background: var(--mint); color: #2f5f4b; font-size: 10.5px; font-weight: 750; letter-spacing: .03em; text-transform: uppercase; }
.admin-etiquette--cadence { background: #f0ecf8; color: #4b3f6b; }
.admin-pied { display: grid; gap: 11px; justify-items: start; }

/* --- Configuration sur téléphone -----------------------------------------
   La page d'administration n'avait aucune règle mobile : ses cartes gardaient
   leur gouttière de bureau, et le fond des réglages protégés, tiré vers
   l'extérieur par une marge négative, dépassait l'écran de 18 px. */
@media (max-width: 640px) {
  .admin-shell { padding-bottom: max(40px, env(safe-area-inset-bottom)); }
  .admin-groupe { margin-bottom: 20px; padding: 19px 17px; border-radius: 13px; }
  .admin-groupe h2 { font-size: 17px; }
  .admin-champs { margin-top: 15px; gap: 15px; }
  .admin-champ--protege { padding: 11px; margin: -11px -9px; }
  .admin-confirmation { padding: 15px 16px; }
  .admin-message { padding: 12px 14px; font-size: 13.5px; }
  .admin-pied { justify-items: stretch; }
  .admin-pied .primary-button { width: 100%; }
}
@media (max-width: 390px) {
  .admin-groupe { padding: 16px 14px; }
  .admin-champ input[type="text"], .admin-champ input[type="number"], .admin-champ input[type="password"], .admin-champ select { min-height: 44px; font-size: 16px; }
  .admin-etiquette { margin-left: 0; margin-top: 3px; display: inline-block; }
}
