/* Version mobile (telephone) : une seule apparence pour Courrier, Chat, Equipes et Activite.
   Charge seulement si l'ecran fait 760 px ou moins (attribut media). */
:root{--m-top:52px;--m-nav:58px;--m-violet:#5B5FC7;--m-violet-f:#464EB8;--m-bord:#E0E0E0;--m-gris:#616161;--app-h:100vh}
@supports (height:100dvh){:root{--app-h:100dvh}}
html{-webkit-text-size-adjust:100%}
body.appli,body.tm{height:100%;overflow:hidden;overscroll-behavior:none;font-size:15px}
/* cadre : hauteur reelle de l'ecran (clavier compris, voir mobile.js) */
.cadre,#tm{height:var(--app-h)!important;min-height:0}
/* barre du haut identique partout */
.haut,.tm-top{height:calc(var(--m-top) + env(safe-area-inset-top));padding:env(safe-area-inset-top) 12px 0 12px!important;gap:10px;background:var(--m-violet-f)!important;color:#fff;flex-shrink:0}
.haut .marque,.tm-top #tm-replier,.tm-top #tm-plus,.tm-top .tm-pop:has(#tm-plus){display:none!important}
.haut .recherche,.tm-top .tm-search{flex:1;max-width:none;margin:0;height:38px;border-radius:19px;background:rgba(255,255,255,.95)!important;border:0;padding:0 12px}
.haut .recherche input,.tm-top .tm-search input{height:38px;min-height:38px;font-size:16px!important;background:transparent!important;border:0!important;outline:0!important;padding-left:30px}
.tm-top .tm-search input{padding-left:4px}
.haut .recherche .svg{left:12px}
.haut .avatar.moi,.tm-top .tm-moi{width:38px;height:38px;font-size:13px;background:#C5CBFA;color:#3D3E78}
.tm-top .tm-dot,.haut .avatar .dot{box-shadow:0 0 0 2px var(--m-violet-f);border-color:var(--m-violet-f)}
.haut .menu,.tm-menu-profil{position:fixed!important;top:calc(var(--m-top) + env(safe-area-inset-top) - 4px)!important;right:8px!important;left:auto;min-width:0;width:min(320px,calc(100vw - 16px));z-index:60}
.menu-item,.tm-menu a,.tm-menu button{min-height:48px;font-size:16px!important;display:flex!important;align-items:center}
/* barre de navigation du bas : toujours la meme, sur toutes les pages */
.corps-appli{flex-direction:column-reverse!important}
.tm-body{flex-direction:column-reverse!important}
.rail,.tm-rail{display:flex!important;flex-direction:row!important;width:100%!important;height:calc(var(--m-nav) + env(safe-area-inset-bottom))!important;padding:0 0 env(safe-area-inset-bottom)!important;
 justify-content:space-around!important;align-items:stretch;background:#fff!important;border:0!important;border-top:1px solid var(--m-bord)!important;flex-shrink:0;overflow:visible!important;z-index:20}
.rail a,.tm-rail a{flex:1 1 0!important;width:auto!important;min-width:0!important;height:auto!important;min-height:var(--m-nav)!important;padding:6px 2px 4px!important;border-radius:0!important;
 display:flex!important;flex-direction:column;align-items:center;justify-content:center;gap:3px;font-size:11px!important;line-height:1.1;color:var(--m-gris);text-decoration:none;font-weight:500}
.rail a span,.tm-rail a span{font-size:11px!important;max-width:none}
.rail a .svg,.tm-rail a svg{width:24px!important;height:24px!important}
.rail a.actif,.tm-rail a.actif{color:var(--m-violet)!important;font-weight:700}
.rail a.actif::before,.tm-rail a.actif::before{content:"";position:absolute;left:30%!important;right:30%!important;top:0!important;bottom:auto!important;width:auto!important;height:3px!important;border-radius:0 0 3px 3px!important;background:var(--m-violet)}
.rail .badge,.tm-rail .tm-badge{position:absolute;top:5px!important;left:calc(50% + 5px)!important;right:auto!important}
.rail-sep{display:none!important}
body.clavier .rail,body.clavier .tm-rail{display:none!important}
/* admin (beaucoup d'onglets) : defilement horizontal de la barre du bas */
body.appli:not(.agent) .rail{justify-content:flex-start!important;overflow-x:auto!important}
body.appli:not(.agent) .rail a{flex:0 0 76px!important}
/* titre de page identique */
.barre-page,.tm-lh,.tm-ch{min-height:56px;height:auto;padding:6px 12px 6px 16px!important;gap:8px;background:#fff!important;border-bottom:1px solid var(--m-bord)}
.barre-page h2,.tm-lh h2{font-size:20px!important;font-weight:700;margin:0;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tm-ch .tm-ct b{font-size:17px}.tm-ch .tm-ct small{font-size:13px}
.tm-ch .tm-tabs{display:none!important}
.tm-pills{padding:8px 16px!important;background:#fff;border-bottom:1px solid var(--m-bord)}
.tm-pill{min-height:34px;padding:4px 14px!important;font-size:14px!important}
.contenu{-webkit-overflow-scrolling:touch}
.page{padding:12px!important}
h1{font-size:22px}
/* bouton « Nouveau message » : rond, a droite du titre */
.barre-page .btn{margin:0 0 0 auto!important;width:44px;height:44px;min-height:44px;padding:0!important;border-radius:50%;justify-content:center;font-size:0!important;gap:0;flex-shrink:0}
.barre-page .btn .svg{width:20px;height:20px}
.barre-page .onglets{gap:14px}
/* dossiers du courrier : tiroir */
.ol-wrap{flex-direction:column!important;flex:1;min-height:0}
.ol-main{flex:1;min-width:0;display:flex;flex-direction:column}
/* dossiers toujours visibles (pas de tiroir) : pastilles sous l'en-tete */
.ol-ouvrir{display:none!important}
.ol-pane{position:static!important;display:block!important;width:auto!important;background:#F5F5F5!important;border:0!important;border-bottom:1px solid #E0E0E0!important;padding:8px 10px!important;transform:none!important;overflow:visible!important}
.ol-pane .ol-sec,.ol-pane .ol-grp[data-g="favoris"],.ol-pane .ol-nouveau{display:none!important}
.ol-pane .ol-grp{display:flex!important;flex-wrap:wrap;gap:6px}
.ol-f{flex:0 0 auto;min-height:38px;font-size:14px;padding:6px 12px!important;gap:6px!important;border-radius:19px!important;background:#fff;border:1px solid #E0E0E0}
.ol-f span{flex:none!important}.ol-f.actif{background:#E8EBFA!important;border-color:#5B5FC7}
.ol-fond{display:none!important}
/* chat / equipes : pas de dossiers ni de marque sur telephone (barre du bas a 3 onglets) */
.tm .ol-pane,.tm-marque{display:none!important}
.ol-chat{flex-direction:row!important}.ol-chat>.ol-pane{display:none!important}
/* listes */
.ligne{min-height:64px;padding:10px 14px!important}
.liste,.carte{border-radius:10px}
.carte{padding:16px!important;margin-bottom:12px}
.sel-barre{position:sticky;top:0;z-index:3;background:#F5F5F5;padding:6px 0;display:flex;flex-wrap:wrap;gap:8px;align-items:center}
/* boutons, champs : 44 px et 16 px (pas de zoom automatique sur iPhone) */
.btn{min-height:44px;padding:8px 16px;font-size:15px;border-radius:8px}
.btn.petit{min-height:38px;padding:6px 12px;font-size:14px;border-radius:8px}
.icone-btn,.tm-ib{min-width:44px;min-height:44px;width:44px!important;height:44px!important}
.tm-tools .tm-ib{width:40px!important;height:40px!important;min-width:40px;min-height:40px;font-size:19px!important}
.tm-send{width:44px!important;height:44px!important}
input:not([type=checkbox]):not([type=radio]):not([type=file]),select,textarea,[contenteditable=true]{font-size:16px!important}
input:not([type=checkbox]):not([type=radio]):not([type=file]),select{min-height:44px}
input[type=checkbox],input[type=radio]{width:22px;height:22px}
label.case{display:flex;align-items:center;gap:10px;min-height:44px}
/* tableaux larges : defilement dans la carte, jamais de la page */
.tab{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch;white-space:nowrap}
img,video{max-width:100%}
.corps,.corps-html{overflow-wrap:anywhere}.corps-html table{max-width:100%}
/* chat */
.tm-list{width:100%!important;border-radius:0!important}
.tm-convs{padding:0 0 12px!important;background:#fff}
.tm-item{min-height:64px;padding:10px 16px!important;border-radius:0!important;border-bottom:1px solid #F2F2F2}
.tm-msgs{padding:12px 12px 8px!important}
.tm-compose{padding:6px 8px 8px!important;background:#F5F5F5}
.tm-box{border-radius:12px}
.tm-box textarea{font-size:16px!important;padding:10px 12px 4px!important}
.tm-retour{display:inline-flex!important;font-size:22px!important}
.tm-m{max-width:88%!important;min-width:0}
.tm-bulle{max-width:100%;min-width:0;overflow:hidden}
.tm-img{display:block;max-width:100%}.tm-img img{max-width:100%!important;max-height:260px!important;height:auto;width:auto}
.tm-cam{display:inline-flex!important}
.tm-accueil{display:none}
dialog{width:calc(100vw - 24px)!important;max-height:calc(var(--app-h) - 40px);padding:18px!important}
/* chat : la liste et la conversation occupent toute la hauteur disponible */
.tm-body{flex:1 1 auto;min-height:0}
.tm-list,.tm-main{flex:1 1 auto!important;min-height:0;height:auto!important}
.tm-conv{min-height:0}
/* petites commandes agrandies */
.ed-btn{min-width:40px;min-height:40px}.ed-sel{min-height:40px}
.btn-ico{min-width:44px;min-height:44px}
.oeil{width:40px!important;height:40px!important}
#lien-cc,#lien-cci{display:inline-flex;align-items:center;min-height:40px;padding:0 8px}
/* liste des employes (admin) : nom sur toute la largeur, boutons en dessous */
.liste-employes .ligne{flex-wrap:wrap;row-gap:8px}
.liste-employes .ligne .ct{flex:1 1 calc(100% - 64px);min-width:0;overflow-wrap:anywhere}
.liste-employes .ligne .etat{flex:1 1 100%;margin-left:52px;display:flex;flex-wrap:wrap;align-items:center;gap:6px;white-space:normal}
.liste-employes .ligne .etat .btn-suppr-ligne{margin-right:0;min-height:36px;display:inline-flex;align-items:center}
