/* Permis et maîtres d'ouvrage (src/permis.js), ouvert au-dessus de la recherche foncière */
.pm .pg-appli { grid-template-columns: 280px minmax(0, 1fr); }
/* carte en haut, tableau dessous : la grille et les outils de la recherche foncière (.fc-plateau) */
.pm-plateau .fc-resultats { display: flex; flex-direction: column; gap: 10px; }
.pm-legende { flex-direction: row; flex-wrap: wrap; max-width: calc(100% - 70px); }
.pm-lien { padding: 0; border: 0; background: none; color: var(--accent-fort); font: inherit; cursor: pointer; text-decoration: underline; }
.pm-fiche { height: 26px; padding: 0 9px; border: 0; border-radius: var(--r-bouton); background: var(--survol); box-shadow: inset 0 0 0 1px var(--filet-2); color: var(--encre); font: inherit; font-size: var(--t-12); cursor: pointer; }
.pm-fiche:hover { background: var(--actif); }
.pm-bouton-filtres { display: none; }
.pm-tete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.pm-tete .fc-compte { margin: 0; }
.pm-tete .pg-seg { min-width: 260px; }
/* une règle du téléphone agrandit les boutons des résultats : ici, la hauteur d'un segment */
.pm-tete .pg-seg button { height: 30px; min-height: 0; padding: 0 8px; }
.pm-types { display: flex; flex-direction: column; gap: 2px; }
.pm-types label { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: var(--t-13); cursor: pointer; }
.pm-types input { margin: 0; width: 16px; height: 16px; accent-color: var(--accent); }
.pm-types small { margin-left: 4px; color: var(--encre-4); font-size: var(--t-11); font-variant-numeric: tabular-nums; }
.pm-aide { margin: 0; color: var(--encre-3); font-size: var(--t-12); line-height: 1.45; }
.pm-table a { color: var(--accent-fort); text-decoration: none; }
.pm-table a:hover { text-decoration: underline; }
/* Le tableau tient dans la largeur de l'écran (Henri, 27/09) : demandeur et adresse prennent la
   place qui reste et s'abrègent (le texte entier au survol), au lieu d'élargir le tableau */
.pm-table .pm-dem, .pm-table .pm-adr { max-width: 0; width: 26%; overflow: hidden; text-overflow: ellipsis; }
.pm-table .pm-adr { width: 20%; }
/* Pagination : lignes par page, plage, pages */
.pm-pages { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: var(--t-13); color: var(--encre-3); font-variant-numeric: tabular-nums; }
.pm-pages label { display: flex; align-items: center; gap: 6px; }
.pm-pages select { height: 30px; padding: 0 6px; border: 0; border-radius: var(--r-bouton); background: var(--survol); box-shadow: inset 0 0 0 1px var(--filet-2); color: var(--encre); font: inherit; font-size: var(--t-13); }
.pm-nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.pm-nav button { min-width: 30px; height: 30px; min-height: 0; padding: 0 8px; border: 0; border-radius: var(--r-bouton); background: none; color: var(--encre-2); font: inherit; font-size: var(--t-13); cursor: pointer; }
.pm-nav button:hover:not(:disabled) { background: var(--survol); }
.pm-nav button[aria-current="page"] { background: var(--actif); color: var(--encre); font-weight: 600; box-shadow: 0 0 0 1px var(--filet-2); }
.pm-nav button:disabled { opacity: 0.35; cursor: default; }
.pm-ellipse { padding: 0 2px; }
.pm-plateau .fc-resultats > .bouton { align-self: center; }
@media (max-width: 899px) {
  .pm .pg-appli { grid-template-columns: 1fr; }
  /* sur téléphone : la carte et le tableau d'abord, les filtres derrière le bouton « Filtres » */
  .pm .pg-reglages { display: none; }
  .pm.pm-filtres-ouverts .pg-reglages { display: flex; order: 0; border-top: 0; border-bottom: 1px solid var(--filet); padding-bottom: 14px; }
  .pm-bouton-filtres { display: inline-flex; margin: 0; }
  .pm .fc-plateau { grid-template-rows: 46svh auto; }
  .pm-tete .fc-compte { width: 100%; }
  .pm-tete .pg-seg { min-width: 0; flex: 1; }
  /* au téléphone le tableau défile de côté : les colonnes de texte gardent une largeur lisible */
  .pm-table { min-width: 860px; }
  .pm-table .pm-dem, .pm-table .pm-adr { max-width: 200px; width: auto; }
  .pm-nav { margin-left: 0; }
  /* sous 16 px, Safari iOS zoome la page quand le champ prend le focus */
  .pm-deroulant .fc-menu-cherche input { font-size: 1rem; }
  .pm-deroulant .fc-menu { max-height: 60svh; }
  .pm-bouton-filtres { height: 44px; }
}
/* Menu des communes : au-dessus du reste du panneau, et le raccourci vers la recherche foncière */
.pm-deroulant .fc-menu { z-index: 30; }
.pm-reprendre { display: block; width: 100%; margin: 0 0 4px; padding: 6px 8px; border: 0; border-radius: var(--r-bouton); background: none; color: var(--accent-fort); font: inherit; font-size: var(--t-13); text-align: left; cursor: pointer; }
.pm-reprendre:hover { background: var(--actif); }
.pm-deroulant .fc-groupe-tete { white-space: nowrap; }
/* Seuils rapides de surface créée */
.pm-puces { display: flex; flex-wrap: wrap; gap: 6px; }
.pm-puces button { height: 28px; min-height: 0; padding: 0 10px; border: 0; border-radius: var(--r-rond); background: var(--survol); box-shadow: inset 0 0 0 1px var(--filet-2); color: var(--encre-2); font: inherit; font-size: var(--t-12); font-variant-numeric: tabular-nums; cursor: pointer; }
.pm-puces button[aria-pressed="true"] { background: var(--actif); color: var(--encre); box-shadow: inset 0 0 0 1px var(--accent); }
/* un champ numérique a une largeur propre qui débordait l'écran du téléphone */
.pm .pg-ligne2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.pm .pg-champ input { width: 100%; min-width: 0; box-sizing: border-box; }
/* Nature du projet : trois groupes à cases */
.pm-natures { display: flex; flex-direction: column; gap: 6px; }
.pm-natures .fc-groupe-tete { padding: 2px 0; }
.pm-table .pm-nat { max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
/* Sociétés : recherche, puces des sociétés choisies, liste à cases */
.pm-societes { display: flex; flex-direction: column; gap: 6px; }
.pm-champ-soc { height: 36px; padding: 0 10px; border: 0; border-radius: var(--r-bouton); background: var(--survol); box-shadow: inset 0 0 0 1px var(--filet-2); color: var(--encre); font: inherit; font-size: var(--t-13); }
.pm-champ-soc:focus { outline: none; box-shadow: inset 0 0 0 1px var(--accent); }
.pm-choisies { display: flex; flex-wrap: wrap; gap: 5px; }
.pm-choisies:empty { display: none; }
.pm-puce { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; height: 26px; min-height: 0; padding: 0 9px; border: 0; border-radius: var(--r-rond); background: var(--actif); box-shadow: inset 0 0 0 1px var(--filet-2); color: var(--encre); font: inherit; font-size: var(--t-12); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-puce span { color: var(--encre-3); }
.pm-liste-soc { max-height: 232px; overflow-y: auto; border-radius: var(--r-bouton); box-shadow: inset 0 0 0 1px var(--filet); padding: 3px; }
.pm-liste-soc .fc-option { height: auto; min-height: 30px; padding: 4px 8px; }
.pm-soc { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--t-13); }
.pm-soc em { color: var(--encre-4); font-size: var(--t-11); font-style: normal; }
.pm-rien { padding: 8px; }
.pm-vide { opacity: 0.45; }
.pm-masquees { margin: 0; padding: 7px 10px; border-radius: var(--r-bouton); background: var(--survol); color: var(--encre-2); font-size: var(--t-13); }
@media (max-width: 899px) { .pm-champ-soc { font-size: 1rem; } }
/* un nom de société trop long élargissait le panneau au-delà de l'écran du téléphone */
.pm .pg-reglages, .pm-societes, .pm-liste-soc, .pm-liste-soc .fc-option { min-width: 0; }
@media (max-width: 899px) { .pm .pg-appli { grid-template-columns: minmax(0, 1fr); } }
