/* HotelDelta V1.13 — Carte & couches portrait réellement compact */

/* Portrait uniquement. Le paysage V1.12 reste strictement inchangé. */
@media (orientation:portrait){
  #layers-panel{
    position:fixed!important;
    left:calc(16px + env(safe-area-inset-left,0px))!important;
    right:calc(16px + env(safe-area-inset-right,0px))!important;
    top:auto!important;
    bottom:calc(96px + env(safe-area-inset-bottom,0px))!important;
    width:auto!important;
    height:auto!important;
    min-height:0!important;
    max-height:min(54dvh,590px)!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior:contain!important;
    scrollbar-width:none!important;
    border-radius:22px!important;
  }
  #layers-panel::-webkit-scrollbar{display:none!important}

  #layers-panel .panel-header{
    position:sticky!important;
    top:0!important;
    z-index:20!important;
    min-height:48px!important;
    padding:9px 13px!important;
    margin:0!important;
  }
  #layers-panel .panel-header>span{
    font-size:18px!important;
    line-height:1.15!important;
  }

  #layers-panel #hd-layer-health{
    margin:7px 12px 8px!important;
    min-height:42px!important;
    padding:8px 10px!important;
  }

  #layers-panel .hd-basemap-block{
    padding-top:0!important;
    margin-top:0!important;
  }
  #layers-panel .hd-basemap-title,
  #layers-panel .hd-layer-section-title{
    margin-top:8px!important;
    margin-bottom:7px!important;
  }

  #layers-panel .hd-basemap-segment{
    gap:7px!important;
  }
  #layers-panel .hd-basemap-segment>button{
    min-height:72px!important;
    height:72px!important;
    padding:7px!important;
  }
  #layers-panel .hd-basemap-segment>button b{
    font-size:13px!important;
  }
  #layers-panel .hd-basemap-segment>button small{
    font-size:9px!important;
  }

  #layers-panel .hd-layer-tools-block{
    margin-top:8px!important;
  }
  #layers-panel .hd-surface-entry{
    min-height:66px!important;
    padding:8px 10px!important;
  }
  #layers-panel .hd-surface-entry-icon{
    width:43px!important;
    height:43px!important;
    min-width:43px!important;
  }

  #layers-panel .hd-layer-section{
    margin-top:9px!important;
  }
  #layers-panel .hd-layer-list .toggle{
    min-height:48px!important;
    padding-top:7px!important;
    padding-bottom:7px!important;
  }

  /* La Maison reste entièrement hors du panneau. */
  body.hd-map-focus #hd-map-home,
  body.hd-surface-focus #hd-map-home{
    left:calc(14px + env(safe-area-inset-left,0px))!important;
    right:auto!important;
    bottom:calc(14px + env(safe-area-inset-bottom,0px))!important;
    z-index:9950!important;
  }
}

/* Petits écrans portrait : le panneau ne dépasse jamais la moitié haute utile. */
@media (orientation:portrait) and (max-height:740px){
  #layers-panel{
    max-height:51dvh!important;
    bottom:calc(92px + env(safe-area-inset-bottom,0px))!important;
  }
}
