/* ============================================================
   MIO — Application sur téléphone et tablette (round 27 « Perfection », bloc L)
   Chargée en dernier par app.html : ces règles passent devant celles des modules.
   - Menu burger : vrai bouton « menu », voile sur le contenu, bouton Fermer, Échap ;
     fermé, le menu ne reçoit plus le focus.
   - Aucun défilement horizontal : grilles et lignes flexibles qui peuvent rétrécir,
     mots longs (adresses, noms en cyrillique, e-mails) coupés plutôt que de pousser
     la page ; tableaux qui défilent dans leur cadre.
   - Cibles tactiles d'au moins 44 px : hauteur minimale pour les boutons et les
     champs ; zone de toucher agrandie (pseudo-élément) pour les petites commandes
     posées dans le texte, sans changer la mise en page.
   ============================================================ */

.sb-close{display:none}

@media (max-width:900px){
  /* ---------- Menu burger ---------- */
  .sidebar{z-index:70;overflow-y:auto;overscroll-behavior:contain;visibility:hidden;transition:transform .25s ease,visibility 0s linear .25s}
  .sidebar.open{visibility:visible;transition:transform .25s ease}
  .sidebar .brand{display:flex;align-items:center;justify-content:space-between;gap:8px;padding-right:0}
  .sb-close{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:12px;border:1px solid var(--border);background:#fff;color:var(--ink);flex:none}
  .sb-close:hover{background:var(--bg)}
  .sidebar.open + .main::before{content:"";position:fixed;inset:0;background:rgba(13,20,65,.38);z-index:65}
  body.nav-open{overflow:hidden}
  .menu-burger{align-items:center;justify-content:center;min-width:44px;min-height:44px;border-radius:12px}

  /* ---------- Barre du haut : commandes de 44 px ---------- */
  .tb-search-btn,.tb-bell-btn,.tb-copilot-btn{min-width:44px;min-height:44px;justify-content:center}
  .tb-bell-btn{display:inline-flex;align-items:center}
  .tb-period-btn{min-height:44px}
  .lang-switch{padding:0;gap:0;border-radius:12px;overflow:hidden}
  .lang-switch button{min-width:44px;min-height:44px;border-radius:0;font-size:12px}

  /* ---------- Rien ne déborde de l'écran ---------- */
  .view{overflow-wrap:anywhere}
  .view table{overflow-wrap:normal}
  .view .grid-2>*,.view .grid-3>*,.view .grid-23>*,.view .card,.view .kpis>*{min-width:0}
  .country-grid{grid-template-columns:minmax(0,1fr)}
  .country-card{min-width:0}
  .view .badge{white-space:normal;max-width:100%}
  .access-banner span{min-width:0}
  .table-scroll,.mk-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%}

  /* ---------- Boutons, puces et champs : 44 px de haut ---------- */
  .btn,.btn-sm{min-height:44px}
  .fchip,.toolbar select,.sugg,.mk-cand,.mk-grp-c,.check-chip,.subnav a,.org-tabs a,.suser-btn{min-height:44px}
  .mk-grp-c,.mk-cand,.fchip{display:inline-flex;align-items:center}
  .view-tabs button,.syncbar button{min-height:44px}
  /* Listes de sources et pages lues (diagnostic) : une ligne de 44 px par lien. */
  .diag-sources li>a,.diag-pages li>a,.diag-site a,.diag-rule small>a,.diag-next-t small>a,.diag-kv span>a,.view .kv a{display:inline-flex;align-items:center;min-height:44px}
  .sidebar .brand a{display:inline-flex;align-items:center;min-height:44px}
  .toast-action{min-height:44px}
  .sidebar .snav a,.sidebar .snav a.snav-step,.sidebar .snav a.snav-pin-name,.sidebar .snav-cat{min-height:44px}
  .sidebar .snav-switch,.sidebar .snav-fold{min-width:44px;min-height:44px;align-items:center;justify-content:center}
  .sidebar .snav a.snav-cur-name{min-height:44px}
  .sidebar .snav-cur{padding-top:0;padding-bottom:0}
  .view input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]),.view select,.view textarea,
  .copilot-panel input:not([type=checkbox]),.copilot-panel select,.copilot-panel textarea,
  .modal input:not([type=checkbox]):not([type=radio]),.modal select,.modal textarea{min-height:44px;font-size:16px}
  .copilot-panel .chat-input input{min-height:44px}
  .copilot-panel .chat-input .send,.chat-input .send{min-width:44px;min-height:44px}
  /* Inscription et connexion (écran plein, hors de .view). */
  .auth-input input{min-height:44px;font-size:16px}
  .auth-tabs button,.auth-btn{min-height:44px}
  .diag-msg summary,.view details>summary{min-height:44px;display:flex;align-items:center}

  /* ---------- Petites commandes : zone de toucher de 44 px ----------
     Jamais sur un .btn (son ::after porte le cadenas des boutons verrouillés). */
  .ckb,button.link,a.link,.icon-btn,.peek,.country-pin,.crumbs a,.access-banner button,.diag-next-go,
  .copilot-panel .cp-x,.copilot-panel .cp-meta button,.card>button:not([class]),.card-top>a:not(.btn),.notif .n-src,
  .tb-bell-panel .head button{position:relative}
  .ckb::after,button.link:not(.btn)::after,a.link:not(.btn)::after,.icon-btn::after,.peek::after,.country-pin::after,.crumbs a::after,
  .access-banner button::after,.diag-next-go::after,.copilot-panel .cp-x::after,.copilot-panel .cp-meta button::after,
  .card>button:not([class])::after,.card-top>a:not(.btn)::after,.notif .n-src::after,.tb-bell-panel .head button::after{
    content:"";position:absolute;left:50%;top:50%;width:max(100%,44px);height:max(100%,44px);transform:translate(-50%,-50%)
  }
  .switch{overflow:visible}
  .switch::before{content:"";position:absolute;left:50%;top:50%;width:max(100%,44px);height:44px;transform:translate(-50%,-50%)}
}

/* Téléphone : barre du haut serrée pour garder six commandes de 44 px sur 390 px. */
@media (max-width:600px){
  .topbar{gap:4px;padding:10px 12px 0}
  .view{padding:14px 14px 40px}
}

@media (prefers-reduced-motion:reduce){
  .sidebar,.sidebar.open{transition:none}
}
