@media screen and (max-width: 1366px) and (max-height: 800px) {

  :root {
    --top-nav-height: 52px;
    --bottom-bar-height: 44px;
    --bottom-bar-margin: 0;
  }

  html {
    font-size: 12px;
  }

  body {
    overflow-y: hidden;
  }

  /* TopBar */

  .top-bar {
    height: var(--top-nav-height);
    padding: 0 20px;
  }

  .top-bar .menu {
    gap: 8px;
  }

  .top-bar .menu .menu-item {
    padding: 0 6px;
  }

  .top-bar .menu .menu-item .menu-icon {
    height: 25px;
  }

  .top-bar .menu .menu-item .text {
    padding-top: 3px;
    font-size: 0.65em;
    line-height: 1.1;
    white-space: nowrap;
  }

  .leaflet-container {
    height: calc(100vh - var(--top-nav-height) - var(--bottom-bar-height));
  }

  /* popup */

  .popup-area {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .popup-area .popup {
    max-height: calc(100vh - var(--top-nav-height) - var(--bottom-bar-height) - 60px);
    display: flex;
    flex-direction: column;
  }

  .popup-area .popup#active-layers {
    min-width: 340px;
    max-width: 381px;
  }

  .popup-area .popup .popup-body {
    max-height: calc(100vh - var(--top-nav-height) - var(--bottom-bar-height) - 130px);
    overflow-y: auto;
    padding-right: 10px;
  }

  .popup-area .popup .popup-body * {
    max-width: 109%;
  }

  .popup-area .popup .popup-header {
    padding: 5px 10px;
  }

  .popup-area .popup .popup-title {
    font-size: 0.8rem;
  }

  /* add layers */
  .add-layers .sub-menu {
    gap: 2px;
    margin-bottom: 4px;
  }

  .popup-area .popup#add-layers {
    max-width: 300px;

    width: auto;
    flex: 0 0 auto;
  }

  .add-layers .sub-menu .sub-menu-button {
    padding: 3px 5px;
    margin: 2px;
    font-size: 0.8rem;
  }

  .add-layers .sub-menu-content-container {
    padding:4px 14px;
    margin: 3px 3px 3px -12px;
    width: calc(100% + 20px);
  }

  .add-layers .gallery-content .gallery-item {
    padding: 3px 6px;
    min-width: 50px;
    min-height: 50px;
  }

  .add-layers .gallery-content .gallery-item .gallery-item-map {
    width: 64px;
    height: 42px;
  }

  .add-layers .gallery-content .gallery-item .gallery-item-icon {
    width: 30px;
    height: 30px;
  }



  .add-layers .pills-container .pill-type {
    padding: 3px 6px;
    
  }

  .add-layers .layers-titlebar {
    padding: 1px 35px 1px 4px;
  }

  .add-layers .layers .dataset {
    margin: 6px 0;
  }

  .add-layers .layers .dataset .layer {
    padding: 2px 0;
  }

  .add-layers .layers .layer .layer-label {
    font-size: 0.7rem;
    white-space: normal;
  }

  .no-layers-add-layers {
    font-size: 0.74rem;
    padding: 5px;
  }

  .add-layers .layers .layer .layer-icon,
  .add-layers .layers .layer .layer-info,
  .add-layers .layers .layer .layer-streamline,
  .add-layers .layers .layer .layer-historical {
    width: 12px;
    height: 12px;
  }

  .add-layers .layers .layer .layer-checkbox-plus-icon,
  .add-layers .layers .layer .layer-checkbox-minus-icon {
    margin-top: -3px;
    width: 12px;
    height: 12px;
  }

  /* Active layers */
  .active-layers .clear-layers .clear-layers-button {
    padding: 2px 4px;
    gap: 3px;
  }
.active-layer .active-layer-color-range .active-layer-color-range-auto {
    padding: 1px 4px;
    font-size: 6px;
  }
  .active-layer-slider-labels {
    font-size: 8px;
    margin-top: 4px;
  }

  .active-layer-legend-name {
    font-size: 9px;
  }

  .active-layers .clear-layers .clear-layers-button span {
    font-size: 9px;
  }

  .active-layer {
    padding: 5px 0;
    gap: 3px;
    flex-wrap: wrap;
  }

  .active-layer .active-layer-left-content {
    gap: 2px;
    max-width: 58%;
    flex-wrap: wrap;
  }

  .active-layer .active-layer-left-content span {
    white-space: normal;
  }

  .active-layer .active-layer-left-content-container .active-layer-dataset-content {
    font-size: 0.65rem;
  }

  .active-layer .active-layer-right-content {
    gap: 13px;
    flex-wrap: wrap;
  }

  .active-layer-color-icon {
    width: 13px;
    height: 7px;
    margin-top: -28px;
    margin-left: 80px;
  }

  .active-layer .active-layer-right-content .active-layer-legend-container .active-layer-legend-values .active-layer-legend-value {
    font-size: 8px;
    margin-inline: -6px;
  }

  .active-layer .active-layer-right-content .active-layer-legend-container .active-layer-legend-values {
    margin: -13px -12px 0px 0px;
  }

  /* Fix trajectory legend positioning - they don't need the negative margin */
  .active-layer .active-layer-right-content .active-layer-legend-container.trajectory-legend .active-layer-legend-values {
    margin: 0px -12px 0px 0px;
  }

  .active-layer .active-layer-details {
    padding: 10px;
    margin-right: 10px;
  }

  .active-layer .active-layer-details-content {
    padding-right: 8px;
  }

  .active-layer .active-layer-details-label {
    font-size: 0.7rem;
  }

 .active-layer .active-layer-tools .icon {
    width: 13px;
    height: 14px;
  }

  .active-layer .active-layer-color-range .active-layer-color-range-auto {
    padding: 1px 4px;
    font-size: 6px;
  }

  .active-layer .active-layer-palettes-label,
  .active-layer .active-layer-tool-label,
  .active-layer .active-layer-color-schemes .scheme-label {
    font-size: 0.5rem;
  }

  .active-layer .active-layer-color-schemes .scheme {
    padding: 1px 3px;
    font-size: 0.48rem;
  }

  .active-layer .active-layer-color-range .active-layer-color-range-input {
    width: 20px;
    font-size: 7px;
    padding: 1px 1px;
  }

  .active-layer .active-layer-legend-container .active-layer-legend-value {
    font-size: 6px;
  }

  .active-layer .active-layer-palettes-body {
    gap: 2px;
  }
  .active-layer-color-scheme .active-layer-color-scheme-part  {
    width: 13px;
    height: 10px;
  }

  .active-layer .active-layer-legend {
    padding: 1px 2px;
  }


  .active-layer .active-layer-legend img:not(.active-layer-palettes-icon) {
    height: 8px !important;
    max-width: 100%;
  }

  .active-layer .active-layer-legend .active-layer-palettes-icon {
    width: 15px;
    height: 6px;
    margin-left: 3px;
    margin-top: -1px;
  }

  .active-layer .active-layer-right-content .active-layer-legend-container .active-layer-legend-div {
    width: 85px;
  }

  .active-layer .toggle-switch {
    transform: scale(0.85);
    transform-origin: left center;
  }

  .active-layer .toggle-switch .slider {
    height: 10px;
  }

  .active-layer .toggle-switch .slider:before {
    width: 10px;
    height: 10px;
  }

  .leaflet-control.custom-control {
    padding: 3px;
    transform: scale(0.9);
    transform-origin: top right;
  }

  .leaflet-control.custom-control .leaflet-bar a,
  .leaflet-control.custom-control .leaflet-bar button {
    width: 20px;
    height: 20px;
    font-size: 11px;
  }

  .leaflet-control .zoom-control .leaflet-bar.leaflet-bar a {
    height: 16px;
    width: 16px;
    font-size: 13px;
    line-height: 16px;
  }

  .leaflet-control-scale-line {
    padding: 4px 3px 1px;
    font-size: 10px;
  }

  .js-plotly-plot .xtick text,
  .js-plotly-plot .ytick text,
  .js-plotly-plot .legendtext,
  .js-plotly-plot .colorbar text {
    font-size: 9px !important;
  }

  /* sideBar */
  #sidebar .date-input-img {
    width: 10px;
    height: 18px;
    margin-left: 4px; 
  }

  #sidebar {
    --sidebar-side-padding: 3px;
    font-size: 0.85rem;
  }

  #sidebar .sidebar-header {
    padding: 10px var(--sidebar-side-padding) 6px;
  }

  #sidebar .sidebar-header .sidebar-title {
    font-size: 15px;
  }

  #sidebar .sidebar-header .sidebar-subtitle {
    font-size: 12px;
  }

  #sidebar .sidebar-menu {
    gap: 6px;
    padding: 4px 6px;
    margin-left: var(--sidebar-side-padding);
  }

  #sidebar .sidebar-menu .sidebar-menu-button {
    font-size: 0.8rem;
    padding: 2px 7px;
  }

  #sidebar .sidebar-view-container .sidebar-legend-container {
    font-size: 10px;
  }

 
  #sidebar .input-group label {
    font-size: 0.8rem;
  }

  #sidebar .input-container {
    padding: 0px;
    gap: 0px;
  }

  #sidebar .elevation-input,
  #sidebar .input {
    height: 18px;
    font-size: 9px;
    width: 106px;
  }

  #sidebar .graph-content .download-button {
    padding: 4px 10px;
    font-size: 11px;
  }

  #sidebar .graph-content .stats {
    font-size: 0.7rem;
  }

  #sidebar .graph-content .attribution {
    font-size: 0.65rem;
  }

  #sidebar .modebar-btn svg {
    width: 14px;
    height: 14px;
  }

 
  #sidebar .loader,
  #sidebar .no-data {
    margin-top: 120px;
  }
  #sidebar .sidebar-close-btn {
    width: 18px;
    height: 18px;
  }

  #sidebar .sidebar-view-container .sidebar-info-content .info-element {
    font-size: 10px;
  }
  

  /* Bottom bar */

  .bottom-bar {
    height: var(--bottom-bar-height);
    padding: 0 20px;
  }

  .bottom-bar .player {
    gap: 8px;
  }

  .bottom-bar .player img {
    max-height: 9px;
  }

  .bottom-bar .player .player-button .player-text {
    font-size: 9px;
  }



  .bottom-bar .slider-container .slider-label output {
    width: 24px;
    font-size: 8px;
  }

  .bottom-bar .slider-container .slider-indicators {
    margin: -10px -6px 0 -5px;
  }

  .bottom-bar .slider-container .slider-indicators .slider-indicator {
    width: 13px;
    height: 8px;
    font-size: 8px;
  }

  .bottom-bar .calendar {
    gap: 6px;
    margin: 2px;
    font-size: 11px;
  }

  .bottom-bar .calendar .calendar-text {
    width: 150px;
  }

  .bottom-bar .location {
    margin: 2px;
    font-size: 9px;
    width: 160px;
  }

  .bottom-bar .location .current-location {
    width: 14px;
    height: 14px;
  }


  /* Collapse/Expand all button*/
  .add-layers .collapse-all-button {
    padding: 2px 6px;
    gap: 6px;
    font-size: 9px;
  }

  .add-layers .collapse-all-icon {
    width: 12px;
    height: 8px;
  }


  /* Popup*/
  .popup-area .popup .popup-close {
    width: 14px;
    height:14px;
  }

  .popup-area .popup#base-layers {
   max-width: 145px;
   min-width: 50px;
  }

  .popup-area .popup#base-layers .popup-body {
    padding: 0 18px 6px;
  }

  .popup-area .popup .popup-header .popup-title {
    font-size: 13px;
  }

  #base-layers .row.row-cols-2>.col-auto {
    padding: 3px 3px;
  }

  #base-layers .base-layer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  #base-layers .base-layer-item-minimap {
    width: 96px;
    height: 60px;
    margin: 4px auto 2px auto;
  }

 
  #base-layers .base-layer-item-text {
    font-size: 0.7rem;
    line-height: 1.2;
    padding: 0 4px 4px;
    white-space: normal;
  } }