/* La colonne de gauche de la recherche foncière (src/foncier-colonne.js) */
.fgc-col { display: none; }
@media (min-width: 900px) {
  :is(html, html[data-theme]) :is(.page-app, body) .pg.pg.pg.fgc > .pg-appli { grid-template-columns: 340px minmax(0, 1fr) !important; }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.pg.pg.fgc > .pg-appli > .fc-plateau { grid-column: 2; grid-row: 1; }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.pg.pg.fgc .fgc-col { display: flex; flex-direction: column; gap: 10px; grid-column: 1; grid-row: 1; min-height: 0; overflow-y: auto; padding: 10px 8px; border-right: 1px solid var(--filet); }
  /* le titre du mode est aussi le menu des modes (Henri, 02/11/2026 : « fusionne ») */
  .pg.pg.pg.fgc .fgc-col h3 { margin: 0 0 2px; padding: 0 8px; font-size: 11px; line-height: 18px; font-weight: 500; color: var(--encre-douce, inherit); opacity: .7; }
  .pg.pg.pg.fgc .fgc-modes { display: flex; flex-direction: column; gap: 8px; flex: none; }
  .pg.pg.pg.fgc .fgc-parcelles, .pg.pg.pg.fgc .fgc-autres { display: flex; flex-direction: column; }
  .pg.pg.pg.fgc .fgc-mode { display: block; width: 100%; height: 26px; padding: 0 8px; font: inherit; font-size: 13px; line-height: 26px; text-align: left; color: inherit; background: none; border: 0; border-radius: 6px; cursor: pointer; }
  .pg.pg.pg.fgc .fgc-mode:hover { background: var(--survol); }
  .pg.pg.pg.fgc .fgc-mode.fgc-actif { font-weight: 600; background: var(--survol); }
  .pg.pg.pg.fgc .fgc-noms { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; border-top: 1px solid var(--filet); padding-top: 8px; }
  .pg.pg.pg.fgc .fgc-noms .pm-societes { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; padding: 0 4px; }
  /* comme Pappers : le champ, puis la liste des noms ; les catégories en menu pour laisser la place aux noms */
  .pg.pg.pg.fgc .fgc-noms .pm-champ-soc { flex: none; height: 30px; }
  .pg.pg.pg.fgc .fgc-noms .pc-cats { display: none; }
  .pg.pg.pg.fgc .fgc-noms .menu-tel { display: block; flex: none; margin: 6px 0 0; }
  .pg.pg.pg.fgc .fgc-noms .pc-tri { flex: none; font-size: 11px; }
  .pg.pg.pg.fgc .fgc-noms .pc-tri label { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
  .pg.pg.pg.fgc .fgc-noms .pm-soc { white-space: normal; overflow: visible; text-overflow: clip; font-size: 12px; line-height: 16px; }
  .pg.pg.pg.fgc .fgc-noms .fc-option { align-items: flex-start; }
  .pg.pg.pg.fgc .fgc-noms .pm-soc { flex: 1 1 auto; min-width: 0; padding-right: 8px; overflow-wrap: anywhere; }
  .pg.pg.pg.fgc .fgc-noms .pm-liste-soc { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; }
}

/* Le menu de ce que l'on cherche, à droite du champ (src/foncier-recherche.js) */
@media (min-width: 900px) {
  :is(html, html[data-theme]) :is(.page-app, body) .pg.pg.d2f.fs .fe-recherche { display: flex; align-items: center; width: clamp(340px, 30vw, 460px); }
}
.pg.pg.pg .fe-recherche input { flex: 1 1 auto; min-width: 0; width: auto; }
.pg.pg.pg .fe-recherche .fe-genre, .pg.pg.pg .fe-recherche .ml-bouton { flex: 0 0 auto; width: 92px; min-width: 0; max-width: 92px; height: 26px; margin: 0 3px 0 0; padding: 0 6px; font-size: 12px; color: inherit; background: none; border: 0; box-shadow: none; }

/* Rien ne se recouvre (src/foncier-colonne.js, ranger) ; la fenêtre Projets prend sa place à droite au lieu de passer sur la fiche ou les résultats */
@media (min-width: 900px) {
  :is(html, html[data-theme]) :is(.page-app, body) .pg.d2f.fs .fc-plateau[data-colonne].fgc-serre { --fs-largeur: var(--fgc-res) !important; }
  body:has(> .ent:not([hidden])) > .pg { right: min(400px, 100vw); width: auto; }
  body:has(> .ent:not([hidden])) .d2-fiche { right: calc(min(400px, 100vw) + var(--marge)); }
}

/* Les modes en menu déroulant (01/11/2026, Henri : « fonctionne par menu déroulant et pas sidebar […] plus sobre et design ») : le
   déclencheur et la liste suivent le Select de shadcn/Radix (déclencheur de 34 px au bord fin, chevron discret, liste en carte avec
   libellés de groupe, coche à droite du choix) */
@media (min-width: 900px) {
  .pg.pg.pg.fgc .fgc-modes { position: relative; gap: 0; }
  .pg.pg.pg.fgc .fgc-declencheur { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; height: calc(var(--h-bouton) + 4px); padding: 0 10px 0 12px; font: inherit; font-size: 13.5px; font-weight: 500; color: inherit; background: transparent; border: 0; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--filet-2, var(--filet)); cursor: pointer; }
  .pg.pg.pg.fgc .fgc-declencheur:hover { background: var(--survol); }
  .pg.pg.pg.fgc .fgc-declencheur:focus-visible { outline: none; box-shadow: inset 0 0 0 1px var(--encre), 0 0 0 3px color-mix(in srgb, var(--encre) 14%, transparent); }
  .pg.pg.pg.fgc .fgc-declencheur svg { flex: none; width: 12px; height: 12px; opacity: .55; transition: transform .15s; }
  .pg.pg.pg.fgc .fgc-declencheur[aria-expanded="true"] svg { transform: rotate(180deg); }
  .pg.pg.pg.fgc .fgc-etiquette { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pg.pg.pg.fgc .fgc-liste { position: absolute; z-index: 300; top: calc(100% + 6px); left: 0; right: 0; display: flex; flex-direction: column; gap: 0; padding: 4px; border-radius: 10px; background: var(--verre-plein, var(--fond)); box-shadow: var(--menu-ombre, 0 10px 30px rgba(0, 0, 0, .25)), 0 0 0 1px var(--filet); animation: surgir .12s ease-out; }
  .pg.pg.pg.fgc .fgc-liste[hidden] { display: none; }
  .pg.pg.pg.fgc .fgc-liste h3 { margin: 0; padding: 6px 8px 4px; font-size: 11px; font-weight: 500; letter-spacing: .02em; opacity: .6; }
  .pg.pg.pg.fgc .fgc-liste .fgc-autres { margin-top: 4px; padding-top: 2px; border-top: 1px solid var(--filet); }
  .pg.pg.pg.fgc .fgc-liste .fgc-mode { position: relative; height: 30px; padding: 0 28px 0 8px; line-height: 30px; font-size: 13px; }
  .pg.pg.pg.fgc .fgc-liste .fgc-mode:focus-visible { outline: none; background: var(--survol); }
  .pg.pg.pg.fgc .fgc-liste .fgc-mode.fgc-actif { font-weight: 500; background: none; }
  .pg.pg.pg.fgc .fgc-liste .fgc-mode.fgc-actif:hover { background: var(--survol); }
  .pg.pg.pg.fgc .fgc-liste .fgc-mode.fgc-actif::after { content: ""; position: absolute; right: 10px; top: 50%; width: 9px; height: 5px; border-left: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: translateY(-70%) rotate(-45deg); }

  /* les menus de la colonne (catégorie, tri), au même dessin : bord fin, 32 px, sans fond plein */
  :is(html, html[data-theme]) :is(.page-app, body) .pg.pg.pg.fgc .fgc-noms .ml-bouton.ml-bouton { height: calc(var(--h-bouton) + 2px); min-height: calc(var(--h-bouton) + 2px); padding: 0 10px; font-size: 13px; background: transparent; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--filet-2, var(--filet)); }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.pg.pg.fgc .fgc-noms .ml-bouton.ml-bouton:hover { background: var(--survol); }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.pg.pg.fgc .fgc-noms .ml-bouton.ml-bouton svg { width: 11px; height: 11px; opacity: .5; }
  .pg.pg.pg.fgc .fgc-noms .pc-tri { display: flex; align-items: center; gap: 6px; font-size: 12px; }
  .pg.pg.pg.fgc .fgc-noms .pc-tri .ml-bouton.ml-bouton { width: auto; min-width: 110px; }

  /* la liste des propriétaires : le nom sur toute la largeur, les chiffres dessous (le nom se coupait toutes les syllabes) */
  .pg.pg.pg.fgc .fgc-noms .fc-option { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; row-gap: 1px; align-items: start; padding: 6px 4px; }
  .pg.pg.pg.fgc .fgc-noms .fc-option .fc-case-v { grid-row: 1 / span 2; margin-top: 2px; }
  .pg.pg.pg.fgc .fgc-noms .fc-option .pm-soc { grid-column: 2; padding-right: 0; overflow-wrap: break-word; word-break: normal; font-size: 12.5px; }
  .pg.pg.pg.fgc .fgc-noms .fc-option small { grid-column: 2; font-size: 11px; opacity: .65; white-space: normal; }
}

/* Le panneau de filtres ouvert se range à gauche des résultats (largeur lue par src/foncier-colonne.js, aside) : jamais l'un sur l'autre */
@media (min-width: 900px) {
  :is(html, html[data-theme]) :is(.page-app, body) .pg.pg.pg.pg.fgc[data-fe-ouverte] > .pg-appli > .pg-reglages { left: auto !important; right: calc(var(--fgc-aside-droite, 0px) + 24px) !important; }
}

/* Fusion du titre et de la colonne, et repli des panneaux (Henri, 02/11/2026) */
@media (min-width: 900px) {
  .pg.pg.pg.fgc .og-barre .og-choix[data-fgc-choix] { cursor: pointer; }
  .pg.pg.pg.fgc .og-barre > .fgc-liste { right: auto; width: 270px; top: calc(100% - 4px); background: var(--panneau, var(--fond)); }
  .pg.pg.pg.fgc > .og-barre { z-index: 30; }
  /* la colonne n'existe que pour la liste des noms ; sans elle, ou repliée, la carte reprend la place */
  :is(html, html[data-theme]) :is(.page-app, body) .pg.pg.pg.pg.fgc:is(:not(.fgc-avec-col), .fgc-g-replie) > .pg-appli { grid-template-columns: 0 minmax(0, 1fr) !important; }
  :is(html, html[data-theme]) :is(.page-app, body) .pg.pg.pg.pg.fgc:is(:not(.fgc-avec-col), .fgc-g-replie) .fgc-col { display: none; }
  /* les résultats repliés : la largeur du panneau tombe à zéro, tout ce qui la suit (poignée, outils, aperçu) se replace */
  :is(html, html[data-theme]) :is(.page-app, body) .pg.pg.pg.fgc.fgc-r-replie .fc-plateau[data-colonne] { --fs-largeur: 0px !important; }
  .pg.pg.pg.fgc.fgc-r-replie .fc-plateau > .fc-resultats, .pg.pg.pg.fgc.fgc-r-replie .fc-plateau > .fs-poignee { display: none; }
  .pg.pg.pg.fgc .fgc-bascule { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--r-bouton); background: none; color: var(--encre); cursor: pointer; opacity: .75; }
  .pg.pg.pg.fgc .fgc-bascule:hover { background: var(--survol); opacity: 1; }
  .pg.pg.pg.fgc .fgc-bascule[aria-pressed="true"] { opacity: 1; background: var(--survol); }
  .pg.pg.pg.fgc .fgc-bascule svg { width: 16px; height: 16px; }
  .pg.pg.pg.fgc .fgc-bascule:focus-visible { outline: 2px solid var(--encre); outline-offset: 2px; }
  .pg.pg.pg.fgc:not(.fgc-avec-col) .fgc-bascule-g { display: none; }
}
@media (max-width: 899px) { .fgc-bascule { display: none; } .og-barre > .fgc-liste { display: none; } }
