:root {
  --fond: #ffffff;
  --fond-2: #f4f5f7;
  --texte: #1b1d21;
  --texte-2: #555b66;
  --bordure: #d5d8de;
  --accent: #1f4fbf;
  --accent-texte: #ffffff;
  --focus: #1f4fbf;
  --survol: #e8eefc;
  --alerte: #8a4b00;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #16181c;
    --fond-2: #1f2228;
    --texte: #e7e9ed;
    --texte-2: #a3a9b5;
    --bordure: #3a3f48;
    --accent: #8fb0ff;
    --accent-texte: #0e1220;
    --focus: #8fb0ff;
    --survol: #26314b;
    --alerte: #f0b46a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.entete, main, .pied { max-width: 72rem; margin: 0 auto; padding: 0 16px; }
.entete { padding-top: 2rem; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 .5rem; }
h2 { font-size: 1.25rem; margin: 2rem 0 .25rem; }
.entete p { margin: 0; color: var(--texte-2); max-width: 46rem; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.evitement { position: absolute; left: -999px; }
.evitement:focus { left: 16px; top: 8px; background: var(--fond); padding: .5rem; z-index: 10; }

/* Recherche */
.recherches { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 0 2rem; }
.recherche { margin-top: 1.5rem; max-width: 36rem; }
.recherche label { display: block; font-weight: 600; margin-bottom: .25rem; }
.combobox { position: relative; }
.combobox input {
  width: 100%; font: inherit; padding: .6rem .75rem;
  color: var(--texte); background: var(--fond);
  border: 1px solid var(--bordure); border-radius: 4px;
}
.combobox [role="listbox"] {
  position: absolute; z-index: 5; left: 0; right: 0; top: 100%;
  margin: 2px 0 0; padding: 0; list-style: none;
  background: var(--fond); border: 1px solid var(--bordure); border-radius: 4px;
  max-height: 22rem; overflow-y: auto;
}
.combobox [role="option"] { padding: .5rem .75rem; cursor: pointer; border-top: 1px solid var(--bordure); }
.combobox [role="option"]:first-child { border-top: 0; }
.combobox [role="option"][aria-selected="true"], .combobox [role="option"]:hover { background: var(--survol); }
.combobox .detail { display: block; font-size: .875rem; color: var(--texte-2); }
.aide { margin: .25rem 0 0; font-size: .875rem; color: var(--texte-2); }
.statut { margin: .5rem 0 0; min-height: 1.5em; }

/* Résultats */
.sous-titre { margin: 0; color: var(--texte-2); }
.perimetre { margin-top: 1rem; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.perimetre label { font-weight: 600; }
select, .bouton {
  font: inherit; color: var(--texte); background: var(--fond);
  border: 1px solid var(--bordure); border-radius: 4px; padding: .5rem .75rem;
}
.bouton { cursor: pointer; }
.bouton:hover { background: var(--survol); }
.lien { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }
.notes p { margin: .75rem 0 0; color: var(--texte-2); max-width: 52rem; }

.qualite {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1px; margin: 1.25rem 0 0; background: var(--bordure);
  border: 1px solid var(--bordure); border-radius: 4px; overflow: hidden;
}
.qualite div { background: var(--fond-2); padding: .6rem .8rem; }
.qualite dt { font-size: .875rem; color: var(--texte-2); }
.qualite dd { margin: 0; font-size: 1.15rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.detail-nr { font-size: .875rem; color: var(--texte-2); margin: .4rem 0 0; }
.vide { margin-top: 1.25rem; }

.controles { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: flex-end; margin: 1.5rem 0 .75rem; }
fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
legend { font-weight: 600; padding: 0; margin-bottom: .25rem; width: 100%; }
fieldset label { display: inline-flex; gap: .35rem; align-items: center; cursor: pointer; }
input[type="radio"] { accent-color: var(--accent); margin: 0; }

/* Tableau */
.tableau { overflow-x: auto; border: 1px solid var(--bordure); border-radius: 4px; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.lecteur-ecran { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.resume-tableau { margin: 0 0 .4rem; font-size: .875rem; color: var(--texte-2); }
th, td { padding: .5rem .75rem; text-align: left; border-bottom: 1px solid var(--bordure); vertical-align: top; }
thead th { background: var(--fond-2); font-size: .875rem; white-space: nowrap; }
thead th[aria-sort]::after { content: " ▼"; font-size: .7em; }
tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; white-space: nowrap; }
td.nom { min-width: 14rem; }
.entites-nb { display: block; font-size: .8rem; color: var(--texte-2); }
.lien-maps { display: block; width: fit-content; margin-top: .15rem; font-size: .8rem; }
.note-maps { margin: 0 0 .5rem; font-size: .8rem; color: var(--texte-2); }
#hors th { background: var(--fond-2); font-size: .875rem; font-weight: 600; border-top: 2px solid var(--bordure); }
#hors td { color: var(--texte-2); }
#tout-afficher { margin-top: .75rem; }

.methode ul { padding-left: 1.2rem; max-width: 52rem; color: var(--texte-2); }
.methode li + li { margin-top: .35rem; }
.pied { margin-top: 2.5rem; padding-top: 1rem; padding-bottom: 2rem; border-top: 1px solid var(--bordure); font-size: .875rem; color: var(--texte-2); }
.pied p { margin: .25rem 0; }
.erreur { color: var(--alerte); }

@media (max-width: 600px) {
  h1 { font-size: 1.35rem; }
  .controles { gap: .75rem; }
  th, td { padding: .5rem .5rem; }
  td.nom { min-width: 9rem; }
  .col-type { display: none; }
}

/* Résultats par adresse */
.copros { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .75rem; }
.copro { border: 1px solid var(--bordure); border-radius: 4px; padding: .75rem 1rem; }
.copro h3, .copro h4 { font-size: 1rem; margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
#titre-proximite, #titre-similaires { font-size: 1.1rem; margin: 1.5rem 0 0; }
.copro-adresse { margin: .15rem 0 .5rem; color: var(--texte-2); font-size: .9rem; }
.copro-details { display: grid; grid-template-columns: max-content 1fr; gap: .2rem 1rem; margin: 0; font-size: .9rem; }
.copro-details dt { color: var(--texte-2); }
.copro-details dd { margin: 0; }
.copro-details .type-syndic { display: block; font-size: .8rem; color: var(--texte-2); }
