/* La recherche foncière au téléphone : carte plein écran et feuille à trois crans (src/foncier-mobile.js). */
@media (max-width: 699px) {
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt { --fmt-sa: env(safe-area-inset-bottom, 0px); --fmt-haut: env(safe-area-inset-top, 0px); --fmt-tete: 102px; --fmt-verre: color-mix(in srgb, var(--fond) 76%, transparent); --fmt-ombre: 0 1px 10px rgba(0, 0, 0, .16); overflow: hidden; background: var(--fond); }

  /* En haut : fermer, le mode, Plus */
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt > .pg-barre-haut { position: absolute; z-index: 60; top: calc(var(--fmt-haut) + 10px); left: 10px; right: 10px; display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 8px; height: 44px; padding: 0; border: 0; background: none; box-shadow: none; pointer-events: none; }
  .pg.fmt > .pg-barre-haut > * { pointer-events: auto; }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt .og-fermer, .pg.fmt .fmt-rond { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: var(--fmt-verre); color: var(--encre); box-shadow: var(--fmt-ombre); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); cursor: pointer; }
  .pg.fmt .fmt-rond svg { width: 18px; height: 18px; fill: currentColor; }
  .pg.fmt .fmt-rond:is([data-fmt-couches], .fmt-filtres) svg { fill: none; }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt .og-choix { flex: 0 1 auto; min-width: 0; max-width: calc(100% - 104px); height: 44px; padding: 0 14px; border-radius: 22px; background: var(--fmt-verre); box-shadow: var(--fmt-ombre); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); font-size: var(--t-14); font-weight: 600; justify-content: center; gap: 6px; }
  .pg.fmt .og-choix > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  /* Plus : les actions du mode en menu */
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt .og-droite { display: none; }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt-plus .og-droite { position: absolute; top: 52px; right: 0; display: flex; flex-direction: column; flex: none; gap: 0; width: 220px; margin: 0; padding: 6px; border-radius: 14px; background: var(--fond); box-shadow: 0 8px 30px rgba(0, 0, 0, .25); }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt-plus .og-droite :is(.bouton, .fc-deroulant) { flex: none; width: 100%; min-height: 44px; }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt-plus .og-droite .bouton { justify-content: flex-start; gap: 10px; padding: 0 10px; background: none; font-size: var(--t-14); }
  .pg.fmt .og-droite [data-fz-filtres] { display: none !important; }
  .pg.fmt .og-droite .fm-libelle { position: static; width: auto; height: auto; margin: 0; clip: auto; clip-path: none; overflow: visible; white-space: nowrap; }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt .og-droite::after { display: none; }
  /* le menu des modes, opaque et devant tout */
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt .og-barre.og-ouvert .og-onglets { position: absolute; top: 52px; left: 0; right: 0; z-index: 70; max-height: calc(100dvh - 90px); overflow-y: auto; background: var(--fond) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }

  /* La carte partout */
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt > .pg-appli { position: absolute; inset: 0; display: block; overflow: hidden; padding: 0; }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt.fmt .fc-plateau { display: contents; }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt.fmt .fc-carte { position: absolute; inset: 0; display: block; visibility: visible; width: 100%; height: 100% !important; min-height: 0; border: 0; border-radius: 0; }
  .pg.fmt .fc-carte :is(.maplibregl-ctrl-zoom, .maplibregl-ctrl-group:has(.maplibregl-ctrl-zoom-in)) { display: none; }
  .pg.fmt.fmt.fmt .fc-carte :is(.maplibregl-ctrl-bottom-right, .maplibregl-ctrl-bottom-left) { bottom: calc(var(--fmt-bas) + 2px); }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt .fc-carte :has(> .gl-bouton) { border: 0; background: none; box-shadow: none; }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt .gl-bouton { width: 44px; height: 44px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: var(--fmt-verre); box-shadow: var(--fmt-ombre); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
  /* sur la carte, des boutons ronds ; le reste à la demande */
  .pg.fmt .fmt-ronds { position: absolute; z-index: 5; top: calc(var(--fmt-haut) + 62px); right: 10px; display: flex; flex-direction: column; gap: 8px; }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt .fc-outils { position: absolute; z-index: 5; top: calc(var(--fmt-haut) + 114px); right: 10px; left: auto; }
  .pg.fmt .fc-outils .fc-seg { display: none; }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt .fc-outils .fz-bouton-zone { width: 44px; min-width: 0; height: 44px; min-height: 0; padding: 0; justify-content: center; border: 0; border-radius: 50%; background: var(--fmt-verre); font-size: 0; box-shadow: var(--fmt-ombre); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt :is(.fc-legende, .d2f-kp) { display: none; }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt-couches .d2f-kp { position: absolute; z-index: 6; display: block; top: calc(var(--fmt-haut) + 62px); left: 10px; right: 62px; width: auto; max-height: calc(var(--fmt-y) - 186px); overflow-y: auto; }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt-couches .fc-legende { position: absolute; z-index: 6; display: block; top: auto; bottom: calc(var(--fmt-bas) + 10px); left: 10px; right: 10px; width: auto; max-width: none; }
  .pg.fmt.fmt-couches .gl-bouton { display: none; }
  /* la fiche courte et l'aperçu : au-dessus de la feuille, jamais sous la capsule */
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt :is(.fe-fiche, .d2f-apercu) { position: absolute; z-index: 7; top: auto; left: 10px; right: 10px; bottom: calc(var(--fmt-bas) + 10px); width: auto; max-width: none; max-height: 44dvh; overflow-y: auto; }

  /* La feuille : la recherche, une ligne, un seul panneau */
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt > .d2f-outils { position: absolute; z-index: 13; top: var(--fmt-y); left: 0; right: 0; display: flex; gap: 8px; align-items: center; height: 66px; padding: 18px 12px 4px; border: 0; border-radius: 20px 20px 0 0; background: var(--fond); box-shadow: 0 -1px 14px rgba(0, 0, 0, .12); touch-action: none; }
  .pg.fmt > .d2f-outils::before { content: ""; position: absolute; top: 7px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: var(--filet-2); }
  .pg.fmt .fs-historique { display: none; }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt .fe-recherche .suggestions { left: 0; right: 0; width: auto; max-height: 40dvh; }
  .pg.fmt > .d2f-outils .fmt-filtres { background: var(--champ); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt .d2f-cherche { flex: 1; min-width: 0; }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt .d2f-cherche .fe-recherche { display: flex; flex: 1; width: 100%; height: 44px; margin: 0; border: 0; border-radius: 22px; background: var(--champ); box-shadow: none; }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt.fmt .d2f-cherche .fe-recherche input { height: 44px; border: 0; border-radius: 22px 0 0 22px; background: transparent; box-shadow: none; font-size: 16px; }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt.fmt .d2f-cherche .fe-genre { flex: none; width: 84px; height: 44px; min-height: 0; padding: 0 24px 0 8px; border: 0; border-radius: 0 22px 22px 0; background-color: transparent; box-shadow: none; color: var(--encre-3); font-size: var(--t-13); }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt :is(.fc-bascule, .pc-mobile-nav) { display: none; }
  .pg.fmt > .fmt-ligne { position: absolute; z-index: 13; top: calc(var(--fmt-y) + 66px); left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 36px; padding: 0 20px; background: var(--fond); color: var(--encre-3); font-size: var(--t-13); touch-action: none; }
  .pg.fmt .fmt-resume { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
  .pg.fmt .fmt-titre-filtres { color: var(--encre); font-weight: 600; font-size: var(--t-14); }
  .pg.fmt .fmt-ligne > button { min-height: 0; height: 100%; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
  .pg.fmt[data-fmt-vue="resultats"] .fmt-ligne > :is(.fmt-titre-filtres, button), .pg.fmt[data-fmt-vue="filtres"] .fmt-resume { display: none; }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt :is(.fc-resultats, .pg-reglages) { position: absolute; z-index: 12; top: calc(var(--fmt-y) + var(--fmt-tete)); left: 0; right: 0; bottom: 0; width: auto; max-width: none; height: auto; min-height: 0; margin: 0; padding-bottom: calc(var(--fmt-sa) + 16px); overflow-y: auto; overscroll-behavior: contain; border: 0; background: var(--fond) !important; -webkit-backdrop-filter: none; backdrop-filter: none; -webkit-overflow-scrolling: touch; }
  .pg.fmt :is(.d2f-outils, .fmt-ligne, .fc-resultats, .pg-reglages) { transition: top .28s cubic-bezier(.2, .8, .2, 1); }
  .pg.fmt.fmt-glisse :is(.d2f-outils, .fmt-ligne, .fc-resultats, .pg-reglages) { transition: none; }
  @media (prefers-reduced-motion: reduce) { .pg.fmt :is(.d2f-outils, .fmt-ligne, .fc-resultats, .pg-reglages) { transition: none; } }
  /* un seul panneau, quel que soit le mode ; le bouton rond et « Voir les résultats » remplacent ceux des modules */
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt[data-fmt-vue="resultats"] .pg-reglages, :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt[data-fmt-vue="filtres"] .fc-resultats { display: none; }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt[data-fmt-vue="filtres"] .pg-reglages { display: flex !important; flex-direction: column; gap: 8px; padding: 4px 16px calc(var(--fmt-sa) + 16px); }
  .pg.fmt .pg-reglages > * { flex: none; }
  .pg.fmt :is([data-pm-filtrer], [data-rf-filtrer], [data-pc-filtrer], [data-ec-filtrer], [data-pm-voir], [data-rf-voir], [data-pc-voir], [data-ec-voir]) { display: none !important; }

  /* Les résultats : les chiffres sans cadre, le tri discret, la liste */
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt .fc-resultats { display: flex; flex-direction: column; }
  .pg.fmt .fc-resultats > * { flex: none; }
  .pg.fmt .fs-tete > h2, .pg.fmt .fs-vues { display: none !important; }
  .pg.fmt .fc-resultats > .fc-synthese { order: -3; }
  .pg.fmt .fc-resultats > .fs-tete { order: -2; display: flex; align-items: center; justify-content: flex-end; gap: 4px; padding: 0 12px; }
  .pg.fmt .fc-resultats > .fc-synthese-note { order: 5; margin: 12px 20px 0; color: var(--encre-4); font-size: var(--t-12); }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt .fs-tri { margin: 0; font-size: 0; }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt.fmt .fs-tri select { width: auto; min-width: 0; border: 0; background-color: transparent; box-shadow: none; color: var(--encre-3); font-size: var(--t-13); }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt .fc-synthese { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin: 4px 20px 6px; padding: 0 0 12px; border: 0; border-bottom: 1px solid var(--filet); border-radius: 0; background: none; box-shadow: none; }
  .pg.fmt .fc-synthese > div { padding: 0; border: 0; background: none; }
  .pg.fmt .fc-synthese > div:nth-child(-n+2) { display: none; }   /* parcelles et surface : déjà dans la ligne du résumé */
  .pg.fmt[data-fmt-cran="plein"] :is(.gl-bouton, .fmt-ronds, .fc-outils) { display: none; }
  .pg.fmt .fc-synthese dd { font-size: var(--t-15); font-weight: 600; font-variant-numeric: tabular-nums; }
  .pg.fmt .fc-synthese dt { color: var(--encre-3); font-size: var(--t-12); }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt .fs-liste { margin: 0; padding: 0 16px; border: 0; background: none; }
}

/* Le menu des modes au téléphone, plus fin (01/11/2026, Henri : « c'est surtout la version mobile dans recherche foncière […]
   tous les menus déroulants sont trop grossiers », vu au simulateur iPhone) : titre de 15 px, une seule ligne de description,
   lignes de 48 px, pas d'anneau de focus épais sur la première ligne, ombre douce. */
@media (max-width: 699px) {
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt .og-barre.og-ouvert .og-onglets { padding: 4px; gap: 0; border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt .og-barre.og-ouvert .og-onglets > button { min-height: calc(var(--h-bouton) + 18px); padding: 7px 12px; gap: 1px; border-radius: 10px; }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt .og-barre.og-ouvert .og-onglets > button:focus-visible { outline: none; box-shadow: none; }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt .og-barre.og-ouvert .og-long { font-size: 15px; line-height: 1.25; }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt .og-barre.og-ouvert .og-desc { font-size: 12.5px; line-height: 1.3; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden; }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt .og-barre.og-ouvert .og-onglets > button[aria-selected="true"]::after { content: ""; position: absolute; right: 16px; top: 50%; width: 10px; height: 5px; border-left: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor; transform: translateY(-70%) rotate(-45deg); }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt .og-barre.og-ouvert .og-onglets > button { position: relative; }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt.fmt .og-barre.og-ouvert .og-sep { margin: 2px 12px; }
  /* le menu « Ce que l'on cherche » : le déclencheur de la barre de recherche, plus bas */
  :is(html, html[data-theme]) :is(.page-app, body) .pg.fmt .ml-bouton.fe-genre { min-height: calc(var(--h-bouton) + 6px); }
}
