/*
 * MHH Design : coque mobile (Standard mobile MHH). Tout est sous 1 000 pixels :
 * à 1 000 pixels et plus, rien ne change. Classes posées par le logiciel :
 *   <html class="mhh-mob-cadre">  : modèle complet (cadre fixe) allumé ;
 *   .mhh-mob-defileur              : la SEULE zone qui défile ;
 *   .mhh-mob-bas                   : barre du bas (imprimée par mhh_design_mobile_barre()) ;
 *   .mhh-mob-feuille               : boîte d'une fenêtre, en feuille du bas sous 600 pixels ;
 *   .mhh-mob-regles                : règles communes (longs mots, médias) sur une zone.
 * Classes posées par mobile.js : mhh-mob-clavier, mhh-mob-haut-cache, mhh-mob-verrou.
 * Aucune hauteur écrite et aucune unité d'écran (vh, dvh, svh) sur le cadre.
 */
:root{--mhh-mob-ac:var(--mhh-accent,#1d5c8f);--mhh-mob-haut:52px;--mhh-mob-admin:0px;--mhh-mob-bas-h:64px;--mhh-mob-bd:rgba(0,0,0,.10)}

/* Règles communes (toutes surfaces) */
.mhh-mob-regles{overflow-wrap:anywhere}
.mhh-mob-regles img,.mhh-mob-regles video,.mhh-mob-regles iframe{max-width:100%;height:auto}
.mhh-mob-regles table{display:block;max-width:100%;overflow-x:auto}

/* Barre du bas : cachée par défaut, visible seulement dans le cadre sous 1 000 pixels */
.mhh-mob-bas{display:none}
.mhh-mob-fleche{display:none}

@media (max-width:999px){
  html.mhh-mob-cadre,html.mhh-mob-cadre body{overflow:hidden;overscroll-behavior:none;height:auto}
  html.mhh-mob-cadre .mhh-mob-defileur{position:fixed;top:calc(var(--mhh-mob-admin) + var(--mhh-mob-haut));left:0;right:0;bottom:var(--mhh-mob-bas-h);
    overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;padding-bottom:16px;transition:top .2s ease}
  /* « :not(#mhh-mob-aucun) » (identifiant qui n'existe pas) donne le poids d'un identifiant, sans forcer la règle (11 novembre 2026). */
  html.mhh-mob-cadre .mhh-mob-defileur:not(#mhh-mob-aucun){margin:0}
  html.mhh-mob-cadre.mhh-mob-haut-cache .mhh-mob-defileur{top:var(--mhh-mob-admin)}
  html.mhh-mob-cadre.mhh-mob-verrou .mhh-mob-defileur{overflow:hidden}
  /* Verrou sans le cadre (barre MHH de mhh-backend, RU Atelier) : la page elle-même ne défile plus derrière la fenêtre.
     Le second sélecteur couvre le cadre des pages publiques, où c'est le corps qui défile (coque-publique.css). */
  html.mhh-mob-verrou,html.mhh-mob-verrou body,html.mhh-mob-verrou.mhh-cp-cadre body.mhh-cp-on{overflow:hidden;overscroll-behavior:none}

  html.mhh-mob-cadre .mhh-mob-bas{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;position:fixed;left:0;right:0;bottom:0;height:var(--mhh-mob-bas-h);
    background:#fff;border-top:1px solid var(--mhh-mob-bd);z-index:900;padding:0 4px}
  html.mhh-mob-cadre.mhh-mob-clavier .mhh-mob-bas{display:none}
  html.mhh-mob-cadre.mhh-mob-clavier .mhh-mob-defileur{bottom:0}

  .mhh-mob-onglet{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:44px;max-width:96px;height:var(--mhh-mob-bas-h);margin:0 auto;width:100%;
    border:0;background:none;color:#111;font:600 13px/1.1 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
  .mhh-mob-onglet .mhh-mob-ic{width:26px;height:26px}
  .mhh-mob-onglet.on{color:var(--mhh-mob-ac)}
  .mhh-mob-onglet.on .mhh-mob-ic{stroke-width:2.3}
  .mhh-mob-onglet.on::after{content:"";position:absolute;bottom:6px;width:18px;height:3px;border-radius:2px;background:var(--mhh-mob-ac)}
  .mhh-mob-onglet.centre .mhh-mob-ic{width:44px;height:32px;padding:4px 10px;border-radius:16px;background:var(--mhh-mob-ac);color:#fff;stroke:#fff}
  .mhh-mob-onglet:focus-visible{outline:2px solid var(--mhh-mob-ac);outline-offset:-4px;border-radius:10px}
  .mhh-mob-bas.sans-libelles .mhh-mob-lib{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  .mhh-mob-nb{position:absolute;top:6px;left:calc(50% + 6px);min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--mhh-mob-ac);color:#fff;font-size:13px;line-height:18px;text-align:center}

  html.mhh-mob-cadre .mhh-mob-fleche{display:inline-flex;align-items:center;gap:2px;min-width:44px;height:44px;padding:0 8px 0 2px;border:0;background:none;color:var(--mhh-mob-ac);font:600 16px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;cursor:pointer;max-width:45%}
  html.mhh-mob-cadre .mhh-mob-fleche[hidden]{display:none}
  .mhh-mob-fleche .mhh-mob-fleche-nom{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
}
@media (max-width:359px){.mhh-mob-fleche .mhh-mob-fleche-nom{display:none}}

/* Fenêtres en feuille du bas sous 600 pixels */
@media (max-width:599px){
  .mhh-mob-feuille{max-height:90%;overflow-y:auto;overscroll-behavior:contain;padding-bottom:16px}
  body .mhh-mob-feuille:not(#mhh-mob-aucun){position:fixed;left:0;right:0;bottom:0;top:auto;width:auto;max-width:none;margin:0;border-radius:16px 16px 0 0}
}

/* Mode application installée seulement : place de l'encoche et de la zone de geste */
@media (display-mode:standalone) and (max-width:999px){
  html.mhh-mob-cadre{--mhh-mob-admin:env(safe-area-inset-top,0px)}
  html.mhh-mob-cadre .mhh-mob-bas{height:calc(var(--mhh-mob-bas-h) + env(safe-area-inset-bottom,0px));padding-bottom:env(safe-area-inset-bottom,0px)}
}

@media (prefers-reduced-motion:reduce){html.mhh-mob-cadre .mhh-mob-defileur{transition:none}}
