/* TentoniNumérik R44.3.18
   Correctif ciblé, sans reconstruction.
   - drapeau France visible téléphone + tablette ;
   - Accueil identifié sur téléphone connecté ;
   - Tableau de bord identifié sur téléphone super-admin. */

/* Téléphone + tablette : rendre seulement le sélecteur de langue visible dans top-meta.
   Date / heure / météo restent masquées comme validé auparavant. */
@media(max-width:1050px){
  html:not(.tn-r42-desktop) body.home-route .top-meta{
    display:contents!important;
    visibility:visible!important;
    width:auto!important;
    height:auto!important;
    overflow:visible!important;
  }

  html:not(.tn-r42-desktop) body.home-route .top-meta .top-date,
  html:not(.tn-r42-desktop) body.home-route .top-meta .top-time,
  html:not(.tn-r42-desktop) body.home-route .top-meta .top-weather-inline{
    display:none!important;
    visibility:hidden!important;
  }

  html:not(.tn-r42-desktop) body.home-route .language-btn{
    order:20!important;
    display:inline-flex!important;
    visibility:visible!important;
    opacity:1!important;
    align-items:center!important;
    justify-content:center!important;
    width:38px!important;
    min-width:38px!important;
    height:34px!important;
    min-height:34px!important;
    padding:0!important;
    margin:0!important;
    border:1px solid #d7e3f2!important;
    border-radius:10px!important;
    background:#fff!important;
    box-shadow:0 3px 10px rgba(20,65,120,.08)!important;
    overflow:hidden!important;
  }

  /* Drapeau français fixe comme repère du menu Langues. */
  html:not(.tn-r42-desktop) body.home-route .language-btn > img,
  html:not(.tn-r42-desktop) body.home-route .language-btn .language-code{
    display:none!important;
  }

  html:not(.tn-r42-desktop) body.home-route .language-btn::before{
    content:""!important;
    display:block!important;
    width:25px!important;
    height:17px!important;
    border-radius:2px!important;
    background:url('/assets/ui/flag-fr.svg') center/contain no-repeat!important;
  }
}

/* TABLETTE : le drapeau reste lisible sans toucher au reste de la rangée. */
@media(min-width:721px) and (max-width:1050px){
  html:not(.tn-r42-desktop) body.home-route .language-btn{
    width:42px!important;
    min-width:42px!important;
    height:36px!important;
    min-height:36px!important;
  }
  html:not(.tn-r42-desktop) body.home-route .language-btn::before{
    width:28px!important;
    height:19px!important;
  }
}

/* TÉLÉPHONE connecté : identifier clairement la case Accueil et le Tableau de bord. */
@media(max-width:720px){
  html:not(.tn-r42-desktop) body.home-route.tn-auth-home .topbar-inner{
    gap:4px!important;
  }

  /* Compacter légèrement la marque pour laisser la place au drapeau. */
  html:not(.tn-r42-desktop) body.home-route.tn-auth-home .brand{
    min-width:0!important;
    max-width:128px!important;
    flex:1 1 128px!important;
    gap:4px!important;
  }

  html:not(.tn-r42-desktop) body.home-route.tn-auth-home .brand-mark,
  html:not(.tn-r42-desktop) body.home-route.tn-auth-home .brand-mark img{
    width:30px!important;
    height:30px!important;
    min-width:30px!important;
  }

  html:not(.tn-r42-desktop) body.home-route.tn-auth-home .brand-copy{
    min-width:0!important;
    overflow:hidden!important;
  }

  html:not(.tn-r42-desktop) body.home-route.tn-auth-home .brand-copy strong{
    font-size:14px!important;
    line-height:1!important;
    white-space:nowrap!important;
  }

  html:not(.tn-r42-desktop) body.home-route.tn-auth-home .brand-copy small{
    display:block!important;
    max-width:94px!important;
    font-size:6px!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }

  /* La case de gauche est explicitement présentée comme Accueil. */
  html:not(.tn-r42-desktop) body.home-route.tn-auth-home .mobile-menu-btn{
    display:grid!important;
    grid-template-rows:18px 9px!important;
    place-items:center!important;
    align-content:center!important;
    width:44px!important;
    min-width:44px!important;
    height:44px!important;
    min-height:44px!important;
    padding:3px 2px!important;
    margin:0!important;
    border:1px solid #d8e0e8!important;
    border-radius:10px!important;
    background:#f1f3f5!important;
    color:#154d91!important;
    box-shadow:none!important;
    overflow:hidden!important;
    font-size:0!important;
  }

  html:not(.tn-r42-desktop) body.home-route.tn-auth-home .mobile-menu-btn span{
    display:none!important;
  }

  html:not(.tn-r42-desktop) body.home-route.tn-auth-home .mobile-menu-btn::before{
    content:"⌂"!important;
    display:block!important;
    color:#176fd1!important;
    font-size:18px!important;
    font-weight:900!important;
    line-height:18px!important;
  }

  html:not(.tn-r42-desktop) body.home-route.tn-auth-home .mobile-menu-btn::after{
    content:"Accueil"!important;
    display:block!important;
    color:#31597f!important;
    font-size:6.5px!important;
    font-weight:850!important;
    line-height:8px!important;
    letter-spacing:-.15px!important;
  }

  /* Tableau de bord : garder le cercle mais y écrire clairement TDB. */
  html:not(.tn-r42-desktop) body.home-route.tn-auth-home .top-actions #tn141-manager-launch{
    position:static!important;
    display:grid!important;
    grid-template-rows:16px 8px!important;
    place-items:center!important;
    align-content:center!important;
    width:40px!important;
    min-width:40px!important;
    max-width:40px!important;
    height:40px!important;
    min-height:40px!important;
    padding:2px!important;
    margin:0!important;
    border-radius:50%!important;
    font-size:0!important;
    line-height:1!important;
    color:transparent!important;
    overflow:hidden!important;
  }

  html:not(.tn-r42-desktop) body.home-route.tn-auth-home .top-actions #tn141-manager-launch span{
    display:none!important;
  }

  html:not(.tn-r42-desktop) body.home-route.tn-auth-home .top-actions #tn141-manager-launch::before{
    content:"▦"!important;
    display:block!important;
    color:#176fd1!important;
    font-size:14px!important;
    font-weight:900!important;
    line-height:15px!important;
  }

  html:not(.tn-r42-desktop) body.home-route.tn-auth-home .top-actions #tn141-manager-launch::after{
    content:"TDB"!important;
    display:block!important;
    color:#174b86!important;
    font-size:6.5px!important;
    font-weight:900!important;
    line-height:8px!important;
    letter-spacing:.1px!important;
  }

  html:not(.tn-r42-desktop) body.home-route.tn-auth-home .language-btn{
    width:32px!important;
    min-width:32px!important;
    height:32px!important;
    min-height:32px!important;
    border-radius:9px!important;
  }

  html:not(.tn-r42-desktop) body.home-route.tn-auth-home .language-btn::before{
    width:22px!important;
    height:15px!important;
  }

  /* Sur compte connecté : bouton utilisateur en icône compacte, sans toucher à son action. */
  html:not(.tn-r42-desktop) body.home-route.tn-auth-home #header-logout{
    width:40px!important;
    min-width:40px!important;
    max-width:40px!important;
    height:40px!important;
    padding:0!important;
    justify-content:center!important;
    border-radius:20px!important;
  }

  html:not(.tn-r42-desktop) body.home-route.tn-auth-home #header-logout span{
    display:none!important;
  }

  html:not(.tn-r42-desktop) body.home-route.tn-auth-home .top-actions .round-action,
  html:not(.tn-r42-desktop) body.home-route.tn-auth-home .top-actions .education-alert-bell{
    width:34px!important;
    min-width:34px!important;
    height:34px!important;
    min-height:34px!important;
  }
}
