/* =============================================================================
   v13.8.4 — AFFICHAGE ADAPTÉ À TOUS LES ÉCRANS (téléphone, tablette, ordinateur)
   Aucun débordement, aucun chevauchement : chargée en dernier, cette feuille ne
   fait que corriger les cas relevés par l'audit (6 largeurs d'écran, 37 modules,
   menus déroulants, panneaux et fenêtres).
============================================================================= */

/* ---- 1. Tableaux : aucun mot coupé en son milieu ; un tableau plus large que
        l'écran défile horizontalement dans son cadre au lieu d'être écrasé. ---- */
@media (max-width: 1100px){
  html body table td, html body table th{word-break:normal !important;overflow-wrap:normal !important;hyphens:manual}
  html body :is(div, section, form, details, article):has(> table){overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%}
  html body table.donnees td, html body table.donnees th{white-space:normal}
  html body table :is(td, th).ecr-insecable{white-space:nowrap !important}
  html body table :is(td, th).ecr-long{overflow-wrap:anywhere !important}
}

/* ---- 2. Barres de filtres et d'outils : les champs passent à la ligne au lieu
        d'être écrasés (largeur minimale lisible). ---- */
@media (max-width: 1100px){
  html body :is(.dx-barre, .outils, .om-filtres, .filtres, .barre-filtres){flex-wrap:wrap}
  html body :is(.dx-barre, .outils, .om-filtres, .filtres, .barre-filtres) > :is(input:not([type=checkbox]):not([type=radio]), select){flex:1 1 150px;min-width:140px;max-width:100%}
  html body :is(.dx-barre, .outils) > textarea{flex:1 1 100%;min-width:0}
  html body .chat-saisie{flex-wrap:wrap}
  html body .chat-saisie textarea{flex:1 1 180px;min-width:0}
}
@media (max-width: 420px){
  html body :is(.dx-barre, .outils, .om-filtres, .filtres, .barre-filtres) > :is(input:not([type=checkbox]):not([type=radio]), select){flex-basis:100%;min-width:0}
}

/* ---- 3. Champs et listes déroulantes : jamais plus larges que leur cadre. ---- */
html body :is(input:not([type=checkbox]):not([type=radio]), select, textarea){max-width:100%}
html body select{text-overflow:ellipsis}

/* ---- 4. Page publique : menu « Espaces professionnels » entièrement à l'écran
        sur téléphone (il s'ouvrait vers la gauche, hors de l'écran). ---- */
@media (max-width: 700px){
  html body #portail .pt-espaces{position:relative}
  html body #portail .pt-espaces-menu{left:0;right:auto;min-width:0;width:min(320px, calc(100vw - 32px))}
}

/* ---- 5. Espace agent, barre du haut : le titre du module s'affiche en entier
        (sur deux lignes au besoin) au lieu d'être tronqué. ---- */
@media (max-width: 900px){
  html body .tb-titre{white-space:normal !important;overflow:visible !important;text-overflow:clip !important;
    max-width:none !important;line-height:1.2;overflow-wrap:break-word;min-width:0;flex:1 1 auto}
  html body .tb-gauche{min-width:0;flex:1 1 auto}
}

/* ---- 6. Fenêtres, menus et panneaux : toujours contenus dans l'écran, avec
        défilement interne si leur contenu est plus haut que l'écran. ---- */
html body .voile .modale{min-width:0}
html body .voile .modale > *{max-width:100%;min-width:0}
html body .voile .modale :is(.modale-corps, .modale-contenu){overflow-x:auto}
html body :is(.rg-resultats, .nav-fam-menu, .ba-menu, .pt-espaces-menu, .menu-deroulant, [role=listbox], [role=menu]){max-width:calc(100vw - 16px);max-height:calc(100vh - 80px);overflow-y:auto}

/* ---- 7. Textes longs (adresses, références, liens) : passent à la ligne dans
        les cartes et les listes au lieu de sortir de leur cadre. ---- */
html body :is(.panneau-corps, .carte, .dx-cadre, .om-agent, .om-item, .pt-service, .pt-faq, .bulle) :is(p, li, dd, small, span, b, a){overflow-wrap:break-word}

/* ---- 8. Cadres dont le texte était posé directement dans le panneau, sans marge :
        le texte touchait le bord arrondi et sa première lettre était rognée. ---- */
html body .panneau > :is(p, h4, small, .dx-aide, .aide, [id$="Grille"]){padding-left:22px;padding-right:22px}
@media (max-width: 900px){ html body .panneau > :is(p, h4, small, .dx-aide, .aide, [id$="Grille"]){padding-left:12px;padding-right:12px} }

/* ---- 9. Tableau vide (« Aucun… ») : le message part de la gauche, visible sans
        faire défiler le tableau sur un écran étroit. ---- */
@media (max-width: 1100px){
  html body table td[colspan] .ecr-vide{position:sticky;left:8px;max-width:calc(100vw - 72px);text-align:left}
}

/* ---- 10. Téléphone : un tableau de données s'affiche ligne par ligne, en fiches
         (intitulé de la colonne : valeur), entièrement visible à l'écran. ---- */
@media (max-width: 600px){
  html body table.ecr-pile{min-width:0 !important;width:100% !important;border-collapse:separate;border-spacing:0}
  html body table.ecr-pile thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  html body table.ecr-pile, html body table.ecr-pile tbody, html body table.ecr-pile tr, html body table.ecr-pile td{display:block;width:auto !important}
  html body table.ecr-pile tbody tr{border:1px solid var(--ligne, #DDE5E0);border-radius:12px;margin:0 0 10px;padding:6px 12px;background:var(--blanc, #fff)}
  html body table.ecr-pile tbody td{border:0 !important;padding:5px 0 !important;display:grid;grid-template-columns:minmax(84px, 38%) minmax(0, 1fr);gap:10px;align-items:start;text-align:left !important;white-space:normal !important;min-width:0}
  html body table.ecr-pile tbody td::before{content:attr(data-label);font-size:11px;font-weight:700;letter-spacing:.03em;text-transform:uppercase;color:var(--gris, #5F6E66);line-height:1.5}
  html body table.ecr-pile tbody td[data-label=""]::before{content:none}
  html body table.ecr-pile tbody td[data-label=""]{grid-template-columns:minmax(0, 1fr)}
  html body table.ecr-pile tbody td[colspan]{grid-template-columns:minmax(0, 1fr)}
  html body table.ecr-pile tbody td[colspan]::before{content:none}
  html body table.ecr-pile tbody td > *{min-width:0;max-width:100%}
  html body table.ecr-pile tbody td.ecr-insecable{white-space:normal !important}
  html body table.ecr-pile tbody td{overflow-wrap:anywhere !important}
  html body table.ecr-pile tfoot, html body table.ecr-pile tfoot tr, html body table.ecr-pile tfoot td{display:block}
  html body table.ecr-pile td[colspan] .ecr-vide{position:static;max-width:none}
}

/* ---- 11. Téléphone : un champ extensible placé à côté d'un autre dans une rangée
         prend toute la largeur de la ligne (il était réduit à quelques lettres). ---- */
@media (max-width: 600px){
  html body div[style*="display:flex"] > :is(input, select)[style*="flex:1"]{flex:1 1 100% !important;min-width:0 !important}
  html body div[style*="display:flex"] > :is(input, select)[style*="width:180px"]{flex:1 1 100%;width:auto !important}
}
/* empreinte de livraison (contrôle des copies périmées du CDN) */ .emp--portail-08-ecrans--13-8-9{--empreinte:1}
