/* MOBILE_MAP_BUTTONS_R1: reuse reorder dimensions, white surface and tricolor frame. */
#lsMobileMapButtons, .ls-mobile-elevation-icon, .ls-mobile-poi-icon { display: none; }
html[data-ls-menu-unified] .topbar #lsTopbarRibbon #btnStartNavigation.ls-mobile-menu-navigation { display: none !important; }

@media (pointer: coarse) and (max-width: 1100px) {
  html.lastrada-map-first body.map-full .topbar {
    padding-left: max(8px, env(safe-area-inset-left, 0px)) !important;
    padding-right: max(8px, env(safe-area-inset-right, 0px)) !important;
  }
  html[data-ls-menu-unified] .topbar.is-nav-open #lsTopbarRibbon #btnStartNavigation.ls-mobile-menu-navigation { display: flex !important; }
  html[data-ls-menu-unified] #lsMobileMapButtons {
    --ls-map-button-size: 52px;
    display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
    width: var(--ls-map-button-size); flex: 0 0 auto;
    pointer-events: none;
  }
  html[data-ls-menu-unified] #lsMobileMapButtons > :is(#lsElevationToggle, #btnGlanceCards) {
    box-sizing: border-box !important;
    display: flex !important; align-items: center !important; justify-content: center !important;
    flex: 0 0 var(--ls-map-button-size) !important;
    width: var(--ls-map-button-size) !important; height: var(--ls-map-button-size) !important;
    min-width: 0 !important; min-height: 0 !important; max-width: none !important;
    padding: 0 !important; margin: 0 !important; gap: 0 !important;
    border: 2px solid transparent !important; border-radius: 8px !important;
    background: linear-gradient(#fff, #fff) padding-box,
      linear-gradient(90deg, #007B3E 0 33.33%, #fff 33.33% 66.66%, #C8102E 66.66% 100%) border-box !important;
    box-shadow: 0 2px 6px rgba(0,0,0,.18) !important;
    color: #007B3E !important; overflow: hidden !important;
    line-height: 1 !important; cursor: pointer; pointer-events: auto; touch-action: manipulation;
  }
  html[data-ls-menu-unified] #lsMobileMapButtons > :is(#lsElevationToggle, #btnGlanceCards) > :is(.label, .chip-ico) { display: none !important; }
  #lsMobileMapButtons .ls-mobile-elevation-icon { display: block; width: 30px; height: 30px; }
  html[data-ls-menu-unified] #lsMobileMapButtons > #lsElevationToggle[aria-expanded="true"] {
    background: linear-gradient(#e8f7ee, #e8f7ee) padding-box,
      linear-gradient(90deg, #007B3E 0 33.33%, #fff 33.33% 66.66%, #C8102E 66.66% 100%) border-box !important;
  }
  /* The entire button is a miniature POI card, with the catalogue's photo/body ratio. */
  #lsMobileMapButtons .ls-mobile-poi-icon { display: flex; flex-direction: column; width: 100%; height: 100%; background: #fffdf8; }
  #lsMobileMapButtons .ls-mobile-poi-icon img { display: block; width: 100%; height: 65%; min-height: 0; object-fit: cover; }
  #lsMobileMapButtons .ls-mobile-poi-lines { display: flex; flex-direction: column; gap: 3px; flex: 1; justify-content: center; padding: 2px 5px; }
  #lsMobileMapButtons .ls-mobile-poi-lines::before,
  #lsMobileMapButtons .ls-mobile-poi-lines::after { content: ''; display: block; height: 2px; background: #1a1208; border-radius: 1px; }
  #lsMobileMapButtons .ls-mobile-poi-lines::after { width: 65%; background: #7a6d5a; }
  #lsMobileMapButtons #btnGlanceCards[aria-pressed="false"] .ls-mobile-poi-icon { filter: grayscale(1); opacity: .55; }
  html[data-ls-menu-unified] #lsMobileMapButtons > button:focus-visible { outline: 3px solid #FFD600; outline-offset: 2px; }
  body.vfm-active #lsMobileMapButtons { display: none !important; }
}
@media (pointer: coarse) and (max-width: 1100px) and (orientation: landscape) {
  html[data-ls-menu-unified] #lsMobileMapButtons { --ls-map-button-size: 44px; }
  #lsMobileMapButtons .ls-mobile-elevation-icon { width: 26px; height: 26px; }
  /* Reserve the left control column; do not cover the first POI photo. */
  html.lastrada-map-first body.map-full:not(.vfm-active) .ls-poi-glance {
    left: calc(max(8px, env(safe-area-inset-left, 0px)) + 60px);
    top: calc(84px + env(safe-area-inset-top, 0px));
    width: min(260px, 34vw);
  }
}
