/* intMobile V2.8.1 — « fit » : rien ne doit dépasser du cadre sur un téléphone (320 px et plus).
   Chargé en dernier par topbar() : corrige sans réécrire les anciennes feuilles de style. */

/* 1. Le texte long (adresses, liens, numéros, noms composés) passe à la ligne au lieu de déborder */
main, .card, .row, .alert, .msg, .document-body, label, legend, p, li, td, th, dd, summary, .badge{overflow-wrap:anywhere;word-break:normal}
/* Titres et tuiles : coupure avec trait d'union (« Question-naire ») plutôt qu'au milieu d'un mot */
h1, h2, h3, .tile, .tile b, .tile strong{overflow-wrap:break-word;hyphens:auto;-webkit-hyphens:auto}
@media (max-width:360px){.tile{font-size:16px;padding:14px}}
pre, code{white-space:pre-wrap;overflow-wrap:anywhere}

/* 2. Les enfants de grilles et de flex peuvent rétrécir (cause n° 1 des débordements) */
main :where(.grid, .list, .slots, .admin-day, .admin-day-slots, .pr-shift-block, .card, .row, form, .field-grid, .choice-grid, .ts-actions, .ts-admin-actions, .month-control, .section-head) > *{min-width:0}

/* 3. Champs de formulaire : jamais plus larges que leur cadre */
input, select, textarea, button, .btn{max-width:100%}
select{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}
input[type=file]{font-size:14px;padding:10px;overflow:hidden}
textarea{resize:vertical}
button, .btn{white-space:normal;line-height:1.25;overflow-wrap:normal;word-break:keep-all}
input[type=checkbox], input[type=radio]{width:auto;max-width:none}

/* 4. Images, cartes et iframes */
img, video, iframe, svg{max-width:100%}
img{height:auto}
header img{height:38px}

/* 5. Tableaux (feuilles de temps) : défilement horizontal dans leur carte plutôt que débordement de la page */
.ts-card, .card{max-width:100%}
.ts-table{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%}
.ts-table td, .ts-table th{overflow-wrap:normal;word-break:normal;min-width:64px}
@media print{.ts-table{display:table;overflow:visible}}

/* 6. En-tête : titre et nom tronqués proprement sur petit écran */
header > div:not(.spacer){min-width:0;flex:1 1 150px}
header > div:not(.spacer) b, header > div:not(.spacer) .small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* 7. Correctifs ciblés repérés à l'audit */
.availability-count{white-space:normal;overflow-wrap:normal;min-width:0}
.assign-actions{min-width:0!important}
@media (max-width:420px){
  .assign-actions{grid-template-columns:1fr 1fr!important;grid-template-areas:"assign force" "count count"!important}
  .assign-actions button{padding:10px 8px}
}
.radio-follow-controls{flex-wrap:wrap}
.radio-follow-controls button{width:auto;flex:0 0 auto}
.tile{min-width:0}

/* 8. La barre de navigation du bas ne cache plus le dernier bouton d'un formulaire */
main{padding-bottom:calc(96px + env(safe-area-inset-bottom))}
