/* HotelDelta V1.19 — Surface : fermeture souveraine */

/* Si Surface est hidden, aucune ancienne règle ne peut la rendre visible. */
#surface-panel.hidden,
body.hd-surface-focus #surface-panel.hidden,
body.hd-map-focus #surface-panel.hidden{
  display:none!important;
  visibility:hidden!important;
  opacity:0!important;
  pointer-events:none!important;
  transform:none!important;
}

/* Quand ouverte, une seule géométrie de panneau. */
#surface-panel:not(.hidden){
  display:block!important;
  visibility:visible!important;
  opacity:1!important;
  pointer-events:auto!important;
}

/* La croix doit toujours rester au-dessus du contenu et tactile. */
#surface-panel .btn-close-panel{
  position:relative!important;
  z-index:30!important;
  pointer-events:auto!important;
  touch-action:manipulation!important;
}

/* ==========================================================================
   HotelDelta V1.35.8 — correctifs ciblés confirmés sur captures terrain
   Ce fichier est le dernier CSS chargé : ces règles sont volontairement ici
   afin qu'aucune feuille antérieure ne puisse les annuler.
   ========================================================================== */

/* A. Bandeau itinéraire : réserve systématiquement la colonne Maison.
   Le résumé n'existe pas en navigation active ; aucun impact sur le HUD drive. */
#route-resume:not(.hidden){
  left:calc(82px + env(safe-area-inset-left,0px))!important;
}
@media (orientation:landscape){
  #route-resume:not(.hidden){
    left:calc(92px + env(safe-area-inset-left,0px))!important;
  }
}

/* B. Paramètres : Référentiel et À propos ne doivent jamais dépasser à droite.
   Leur ancien width:100% + marges latérales provoquait la coupe de l'arrondi. */
#parametres-panel .hd-reference-settings-entry,
#parametres-panel .hd-about-entry{
  width:auto!important;
  max-width:none!important;
  margin-left:max(14px,env(safe-area-inset-left,0px))!important;
  margin-right:max(14px,env(safe-area-inset-right,0px))!important;
  border-radius:18px!important;
  overflow:hidden!important;
}

/* C. Référentiel : supprime tout débordement horizontal responsable des
   bords droits coupés. Le panneau reste plein écran et seule la verticale défile. */
#doctrine-panel,
#glossaire-panel{
  padding-left:0!important;
  padding-right:0!important;
  overflow-x:hidden!important;
}
#doctrine-panel > .hd-ref-tabs,
#glossaire-panel > .hd-ref-tabs{
  width:auto!important;
  max-width:none!important;
  margin-left:max(14px,env(safe-area-inset-left,0px))!important;
  margin-right:max(14px,env(safe-area-inset-right,0px))!important;
  border-radius:18px!important;
  overflow:hidden!important;
}
#doctrine-content,
#glossaire-content{
  width:auto!important;
  max-width:none!important;
  margin-left:max(14px,env(safe-area-inset-left,0px))!important;
  margin-right:max(14px,env(safe-area-inset-right,0px))!important;
  box-sizing:border-box!important;
  overflow-x:hidden!important;
}
#doctrine-content .doctrine-section,
#doctrine-content .doctrine-intro,
#glossaire-content .glossaire-terme,
#glossaire-content .secteur-detail,
#glossaire-content .secteur-ligne{
  max-width:100%!important;
  box-sizing:border-box!important;
  border-radius:18px!important;
}
#doctrine-panel .doctrine-onglets{
  max-width:100%!important;
  box-sizing:border-box!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  overscroll-behavior-x:contain!important;
}

/* D. Panneaux plein écran : verrouillage au viewport pour empêcher le
   glissement horizontal / effet "page flottante" pendant les aller-retours.
   Concerne aussi Risque incendie, Feux et À propos. */
#parametres-panel,
#doctrine-panel,
#glossaire-panel,
#about-panel,
#info-journaliere-panel,
#feux-liste-panel,
#meteo-panel,
#legende-panel{
  position:fixed!important;
  inset:0!important;
  width:100vw!important;
  max-width:100vw!important;
  min-width:0!important;
  height:100dvh!important;
  max-height:100dvh!important;
  margin:0!important;
  transform:none!important;
  overflow-x:hidden!important;
  overscroll-behavior-x:none!important;
  overscroll-behavior-y:contain!important;
  touch-action:pan-y!important;
  box-sizing:border-box!important;
}

/* Le détail de risque météo est lui aussi une vraie page verrouillée. */
.hd-wx-risk-detail{
  position:fixed!important;
  inset:0!important;
  width:100vw!important;
  max-width:100vw!important;
  height:100dvh!important;
  max-height:100dvh!important;
  margin:0!important;
  transform:none!important;
  overflow-x:hidden!important;
  overscroll-behavior:none!important;
  touch-action:pan-y!important;
  box-sizing:border-box!important;
}

/* E. À propos : carte centrée et jamais coupée à droite. */
#about-panel .hd-about-card{
  width:auto!important;
  max-width:min(760px,calc(100vw - 28px - env(safe-area-inset-left,0px) - env(safe-area-inset-right,0px)))!important;
  margin-left:auto!important;
  margin-right:auto!important;
  border-radius:20px!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
}

/* ==========================================================================
   HotelDelta V1.35.9 — correctif ciblé DFCI / Maison
   ========================================================================== */

/* Le bandeau itinéraire ne doit jamais passer sous le bouton Maison.
   left fixe le point de départ ; margin-left crée une réserve physique
   supplémentaire qui reste effective malgré les anciennes règles de layout. */
#route-resume:not(.hidden){
  left:max(12px,env(safe-area-inset-left,0px))!important;
  margin-left:70px!important;
  right:max(12px,env(safe-area-inset-right,0px))!important;
  width:auto!important;
  max-width:none!important;
  box-sizing:border-box!important;
}
@media (orientation:landscape){
  #route-resume:not(.hidden){
    margin-left:76px!important;
  }
}

/* ==========================================================================
   HotelDelta V1.35.10 — correctif réel Maison / bandeau itinéraire
   La règle reprend #ecran-carte pour battre les anciennes règles !important.
   ========================================================================== */
#ecran-carte:not(.masque) #route-resume:not(.hidden){
  position:absolute!important;
  left:calc(86px + env(safe-area-inset-left,0px))!important;
  right:calc(12px + env(safe-area-inset-right,0px))!important;
  margin:0!important;
  width:auto!important;
  max-width:none!important;
  box-sizing:border-box!important;
}
@media (orientation:landscape){
  #ecran-carte:not(.masque) #route-resume:not(.hidden){
    left:calc(94px + env(safe-area-inset-left,0px))!important;
    right:calc(12px + env(safe-area-inset-right,0px))!important;
    margin:0!important;
  }
}

