/* Recette du 14/09 : ce que la sonde ?audit=1 a relevé sur 123 routes, en bureau (1440) et en téléphone (375).
   Règle : ce qui est plus large que l'écran défile dans son propre cadre ; un texte trop long se coupe en ellipse ; rien ne se superpose. */

/* ── bureau ── */
.cm-page .mc-field,.mc-page input.mc-field,.mc-page textarea.mc-field,.mc-page select.mc-field{max-width:100%;min-width:0;box-sizing:border-box}
.cm-form-host .paie-form,.mc-ai-workspace,.mc-ai-desk{min-width:0}
.de-page .gros,.de-page .gros.xl{font-size:clamp(26px,3.2vw,54px);white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}
.ch-etape{width:auto;min-width:0;max-width:150px}
.sem-corps b,.sem-corps small,.semaine .sem-case b,.semaine .sem-case small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
.dm-conv-txt>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;min-width:0}
.dm-conv-txt b{min-width:0}.dm-conv-txt b small{white-space:nowrap;flex:none}
.de-agents-reading,.de-page .de-agents-reading .dir-tete{overflow-wrap:anywhere;padding-bottom:calc(var(--barre-h,66px) + 24px)}

/* ── téléphone ── */
@media (max-width:640px){
  .page{padding-left:14px;padding-right:14px}
  .tete-action{flex-wrap:wrap;gap:10px}.tete-action h1.titre,.tete-action h1.titre.fixe{white-space:normal;overflow-wrap:anywhere}
  .haut{min-width:0;max-width:100%}.haut .droite{flex-wrap:wrap;justify-content:flex-end}
  .semaine,.sem-corps,.rhp-time-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch}.semaine{padding:12px 10px 14px}
  .sem-tete,.sem-corps>div{min-width:560px}
  .cr-grille{overflow-x:auto;grid-template-columns:34px repeat(12,minmax(40px,1fr))}
  .rec-candidates-table{display:block;overflow-x:auto;min-width:0}.rec-candidates-table thead,.rec-candidates-table tbody{display:table;width:max-content;min-width:100%}
  .rp-page :has(> .rp-calendar-inner),.rp-calendar,.rp-calendar-scroll{overflow-x:auto}
  .pd-stock-row{grid-template-columns:minmax(0,1fr) auto;gap:10px 14px}.pd-stock-row>*{min-width:0}
  .pr-market{width:auto;max-width:100%;flex-wrap:wrap}.pr-content{padding-left:14px;padding-right:14px}.pr-page,.pr-page .pr-content{min-width:0;max-width:100%}
  .pa-lignes{overflow-x:auto}.pa-l{min-width:0}.pa-l.tete{white-space:nowrap}
  :has(> .gc-l.gc-tete){overflow-x:auto}.gc-l{min-width:max-content}
  .seg-haut{flex-wrap:wrap;gap:6px}
  .bk-page nav,.bk-tabs{overflow-x:auto;white-space:nowrap}
  .chaine{overflow-x:auto}
  .fi-scene{overflow:hidden}
  .dc-row-actions{flex-wrap:wrap;justify-content:flex-start}
}
/* seconde passe bureau */
.fi-main{overflow:hidden}
.ch-etape{overflow:hidden}.ch-etape>*{max-width:100%;min-width:0;overflow-wrap:anywhere}
.mc-ai-desk .paie-form,.mc-ai-workspace .paie-form{grid-template-columns:minmax(0,1fr);padding:18px}
.mc-page,.cm-page,main.page{padding-bottom:calc(var(--barre-h,66px) + 80px)}
.mc-ai-desk .paie-form label,.mc-ai-desk .paie-form select.mc-field,.mc-ai-desk .paie-form textarea.mc-field,.mc-ai-desk .paie-form input.mc-field{width:100%;max-width:100%;min-width:0;box-sizing:border-box;display:block}
.dm-page{padding-bottom:calc(var(--barre-h,66px) + 90px)}.dm-page .dm-liste,.dm-page .dm-fil{padding-bottom:calc(var(--barre-h,66px) + 30px)}
/* troisième passe téléphone */
@media (max-width:640px){
  .haut .droite{flex:0 1 auto;min-width:0;gap:6px}.haut .droite .vue-bascule:not(.reglages-lien){display:none}
  .pa-lignes,.semaine,.cr-grille,.gc-lignes,.rp-calendar,.rec-candidates-table{max-width:100%;box-sizing:border-box}
  :has(> .cr-grille){overflow-x:auto;max-width:100%}.cr-grille{min-width:560px}
  :has(> .rp-calendar-inner){overflow-x:auto;max-width:100%}
  .pr-toolbar{flex-wrap:wrap;gap:8px}
  .seg-haut .visages{flex-wrap:wrap}
  .fi-scene,.fi-scene-canvas{overflow:hidden;max-width:100%}
}
@media (max-width:640px){
  .tete-action>div,.tete-action .gestes{min-width:0;max-width:100%;flex:1 1 100%}.tete-action form,.tete-action .ligne-etat{flex-wrap:wrap;max-width:100%;min-width:0}
  .pr-filters{flex-wrap:wrap;max-width:100%;min-width:0}.pr-search{max-width:100%;min-width:0}
}
@media (max-width:640px){.segment .visages,.visages{flex-wrap:wrap}.dm-page .dm-convs{padding-bottom:calc(var(--barre-h,66px) + 30px)}}
