/* Toggle-Button auf Desktop ausblenden */
#lelegend-toggle {
  display: none;
}

@media screen and (max-width: 768px) {

  /* === Textauswahl und Verschieben verhindern === */
  body {
    -webkit-user-select: none !important;
    user-select: none !important;
    touch-action: manipulation !important;
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
  }

  /* === Header === */
  #menu_info, #menu_snapshot {
    display: none !important;
  }

  .menu-trigger {
    font-size: 0px !important;
    padding: 0 1.5em !important;
    line-height: 50px !important;
  }

  .menu-trigger.ss-icon::before {
    font-size: 20px !important;
    font-family: "SSStandard" !important;
  }

  .main-menu {
    background: url('//www.wetterdienst.de/imgs/icon-menu.png') no-repeat 28px top;
  }

  .main-menu:hover {
    background-position: 28px -54px !important;
  }

  #menu_conf {
    position: absolute !important;
    right: 7px !important;
    top: 0 !important;
    width: 50px !important;
    height: 55px !important;
    line-height: 55px !important;
  }

  #historyForm {
    left: 80px !important;
    width: calc(100% - 140px) !important;
  }

  #logo,
  .logo {
    display: none !important;
  }

  .headright a,
  .headright .hbtn {
    padding-left: 4px !important;
    padding-right: 4px !important;
  }

  /* === Model Tabs === */
  #mmaps {
    width: auto !important;
    max-width: calc(100% - 55px) !important;
    white-space: nowrap !important;
    top: 62px !important;
  }

  #mmaps .moremaps {
    font-size: 14px !important;
    padding: 8px 10px !important;
  }

  /* === Layer Buttons - auf Mobil ausblenden === */
  .righttopbuttons {
    display: none !important;
  }

  /* === Settings Slider - größere Touch-Targets === */
  .ui-slider-handle {
    width: 1.4em !important;
    height: 1.4em !important;
    top: -0.3em !important;
  }

  /* === Radar Checkbox Label === */
  label.checkboxes_radar {
    display: inline-block !important;
    font-size: 14px !important;
    padding: 8px 8px 8px 24px !important;
    color: #333 !important;
  }

  /* === Map Settings === */
  #mapPropsContainer {
    margin-top: 50px !important;
    max-width: calc(100% - 12px) !important;
  }

  /* === Map Info === */
  .mapinfo {
    bottom: 60px !important;
    font-size: 14px !important;
    max-width: calc(100% - 50px) !important;
  }

  .mapinfo_date {
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 15px !important;
    width: 120px !important;
  }

  .mapinfo_name {
    font-size: 14px !important;
    line-height: 15px !important;
    max-width: none !important;
    flex: 1 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    display: inline-block !important;
  }

  .mapinfo {
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
  }

  #frcplay, #frcstop, #frcrepeat {
    font-size: 20px !important;
    padding: 0 6px !important;
    top: 0 !important;
    left: 0 !important;
    float: none !important;
    flex-shrink: 0 !important;
  }

  #frcplay, #frcstop { order: 1 !important; }
  #frcrepeat { order: 2 !important; margin-right: -3px !important; }

  .mapinfo_name2 {
    display: none !important;
  }

  /* === Legend with toggle === */
  #lelegend-wrap {
    position: absolute !important;
    z-index: 100;
    right: 6px !important;
    top: 115px !important;
    bottom: auto !important;
  }

  #lelegend {
    position: fixed !important;
    right: 46px !important;
    top: 115px !important;
    bottom: 70px !important;
    left: auto !important;
    max-width: 0;
    overflow: hidden;
    transition: max-width 0.3s ease;
  }

  #lelegend-wrap.legend-open #lelegend {
    max-width: 200px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #lelegend .letable {
    font-size: 10px !important;
    width: auto !important;
    margin: 4px !important;
    padding: 4px !important;
  }

  #lelegend .letda {
    width: 16px !important;
    height: 10px !important;
  }

  #lelegend-toggle {
    display: block;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    background: rgba(0,0,0,0.85);
    color: #69c;
    border: 1px solid #000;
    border-radius: 0px;
    cursor: pointer;
    font-size: 16px;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
  }

  #lelegend-toggle:hover {
    color: #fff;
    cursor: pointer;
    text-shadow: 0 0 10px rgba(51,102,153,0.8);
  }

  #lelegend-toggle:active {
    color: #fff;
  }

  /* === Time Slider - fit to screen width === */
  .esrislider {
    width: 100% !important;
    margin: 0 !important;
    left: 0 !important;
    bottom: 0px !important;
    box-sizing: border-box !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-bottom: 0 !important;
  }

  #timeSliderDiv {
    max-width: none !important;
    width: calc(100% - 100px) !important;
    left: 50px !important;
    top: 16px !important;
  }

  .slide-prevnext {
    font-size: 26px !important;
    padding: 6px !important;
  }

  /* Tick labels ausblenden - kein Platz auf Mobil */
  .dijitRuleLabelH {
    display: none !important;
  }

  /* Tick marks entfernen */
  .dijitRuleMark {
    display: none !important;
  }

  /* Slider-Balken einheitliche Höhe */
  .dijitSliderBarH,
  .dijitSliderLeftBumper,
  .dijitSliderRightBumper {
    height: 18px !important;
    border-width: 0 !important;
  }

  /* Larger touch targets */
  .dijitSliderImageHandle {
    width: 28px !important;
    height: 28px !important;
  }

  /* === Zoom Controls - rechts oben, gleiche Höhe wie Tabs === */
  .esriSimpleSlider {
    top: 6px !important;
    bottom: auto !important;
    left: auto !important;
    right: 6px !important;
    z-index: 90 !important;
  }

  .esriSimpleSlider div {
    width: 40px !important;
    height: 40px !important;
    line-height: 40px !important;
    font-size: 24px !important;
    cursor: pointer !important;
    text-align: center !important;
  }

  .esriSimpleSlider div * {
    pointer-events: none !important;
  }

  /* === PGW Modal === */
  #pgwModal .pm-body {
    margin-top: 60px !important;
    max-width: 95% !important;
  }

  /* === Model Info Box === */
  #model_info {
    top: auto !important;
    bottom: 60px !important;
    max-width: calc(100% - 100px) !important;
  }

  /* === Menü-Footer auf Mobil ausblenden === */
  #jPanelMenu-menu .menu-footer {
    display: none !important;
  }

  #jPanelMenu-menu ul {
    padding-bottom: 0 !important;
  }

}
