  html, body {margin:0; padding:0; height:100%; overflow: hidden;box-sizing: border-box;}
  #header { display:flex; width:100%; height:100%;
  margin: 0;
  padding: 0;
  gap: 0;}

  /* Header*/
  #header {
  color: #fff;
  background-color: black;
  font-family: Copperplate, Roboto, Helvetica, Arial, serif;
  padding:0 0.75rem;
  display: flex;
  align-items: center;  /* vertical centering */
  width: 100%;
  margin: 0;
  height: 3rem;
  justify-content: space-between;  /* keep right-header at right edge */
  gap: 0.75rem;
  z-index: 10;   /* keep above map */
  box-sizing: border-box;
}

  #left-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;         /* helps text ellipsis when space is small */
  }

  /* logo */
  #logo {
    height: 2.1rem;                
    width: auto;
    display: block;
    flex: 0 0 auto;
    margin: 0;
  }

  #header #right-header .button {
  background: transparent;
  color: #fff;
  padding: 10px 14px;
  border: 0;
  border-radius: 0;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

  /* hover effect*/
    #header #right-header .button:hover {
      background: #6809c1;
      border-radius: 6px;
    }
  
  #right-header {
  display: flex;
  padding:0 0.75rem;
  align-items: center;
  gap: 0.25rem;  /* space between About/Github */
}

  #header-text {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1;
    white-space: nowrap;            /* keep in one line */
    overflow: hidden;
    text-overflow: ellipsis;
    color: inherit;
    min-width: 0;                   /* enables ellipsis in flex containers */
  }

  #right-header a, .dropdown .dropbtn {
  font-size: 16px; color: white; padding: 10px 14px; border: 0; background: transparent;
  }

  #right-header a{
    font-size: 16px;
    color: white;
    padding: 10px 14px;
    border: 0;
    background: transparent;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
  }

  #right-header a:hover {
    background: #6809c1;
    border-radius: 6px;
  }

  #container {
  position: relative;            
  height: calc(100vh - 3rem);    /* below the 3rem header */
  width: 100vw;
  --side-width: 39%;             /* keep the side width in one place so map + panel stay in sync */
}
  
  #map-wrap {
  position: absolute;
  inset: 0;                      /* top,right,bottom,left = 0 within #container */              
  z-index: 0;                     
  }

  /* default: map fills the whole area (behind the panel) */
  #map-plot {
  position: absolute;
  inset: 0;
  }
  
  .navbar {
  position: absolute;
  top: 8px; left: 8px;
  z-index: 3;       
  background: rgba(104,9,193,0.8);
  border-radius: 6px;
  overflow: visible;   /* allow dropdown extend outside the bar */
  display: flex;             
  font-family: Arial, Helvetica, sans-serif;
  }

  .navbar a, .dropdown .dropbtn {
  font-size: 16px; color: white; padding: 10px 14px; border: 0; background: transparent;
  border-style: solid;
  border-color: rgba(0,0,0,0.2);
  border-width: 1px;
  }

  .navbar a { text-decoration: none; display: inline-block; }
  .navbar a:hover, .dropdown:hover .dropbtn, .dropbtn:focus { background: #6EB7B8; border-radius: 6px;}

    #landcover-legend {
    position: absolute;
    bottom: 16px;             /* above .globe-map
    /* position to the left of the right panel using the CSS var --side-width */
    right: calc(var(--side-width) + 12px);
    z-index: 40;               /* above map layers,controls and right-container */
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    padding: 8px 10px;
    font-family: Roboto, Helvetica, Arial, sans-serif;
    font-size: 13px;
    color: #222;
    min-width: 130px;
    pointer-events: auto;
    box-sizing: border-box;
  }

  /* header row containing master checkbox and title */
#landcover-legend .legend-header {
  display: flex;
  align-items: center;
  gap: 8px;               /* space between checkbox and title */
  border-bottom: none;
  margin-bottom: 8px;
}

/* master checkbox styling (slightly larger click target) */
#landcover-legend .legend-master-cb {
  width: 14px;
  height: 14px;
  margin: 0;
  box-sizing: border-box;
  vertical-align: middle;
  cursor: pointer;
}

/* optional small "All" label beside the checkbox (if used) */
#landcover-legend .legend-master-label {
  font-size: 12px;
  color: #333;
  margin-right: 6px;
  user-select: none;
}

  /*#landcover-legend .legend-title {
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 13px;
  }*/

  /* legend title sits to the right of the checkbox (same row) */
#landcover-legend .legend-title {
  font-weight: 700;
  font-size: 14px;
  color: #111;
  margin: 0;
  white-space: nowrap;
}

  /* each legend item */
  #landcover-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    /*padding: 4px 0;*/
    padding: 6px 2px;
  cursor: default;
  }

  #landcover-legend .legend-item:hover {
  background: rgba(0,0,0,0.02);
}

/* small checkbox for each class (keeps consistent visual weight) */
#landcover-legend input.land-ckb {
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
}


  /* color swatch 
  #landcover-legend .legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
    flex-shrink: 0;
  }

#landcover-legend .legend-label {
  flex: 1;
  line-height: 1;
}*/

/* swatch square to the right of checkbox */
#landcover-legend .legend-swatch {
  width: 18px;
  height: 12px;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
}

/* label text for the class */
#landcover-legend .legend-label {
  font-size: 13px;
  color: #222;
  margin-left: 4px;
  user-select: none;
}

/* master row variant if you used an enclosing row for the master checkbox */
#landcover-legend .legend-item.legend-master {
  padding: 4px 2px;
}

/* responsive tweaks: avoid legend pushing layout on small screens */
@media (max-width: 420px) {
  #landcover-legend .legend-header { gap: 6px; }
  #landcover-legend .legend-title { font-size: 13px; }
  #landcover-legend .legend-swatch { width: 16px; height: 10px; }
}

  .dropdown { position: relative; }
  .dropdown-content {
  display: none;
  position: absolute;
  top: 100%; left: 0;
  background: #f9f9f9;
  min-width: 160px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  z-index: 1100;  /* above navbar and map */
  }
  .dropdown-content a { color:#000; padding:12px 16px; text-decoration:none; display:block; }
  .dropdown-content a:hover { background:#ddd; }
  .show { display:block; }

  /* move built-in mapbox controls below navbar */
  .mapboxgl-ctrl-top-left {
  top: 50px !important;  /* just under the navbar */
  left: 8px !important;
  z-index: 3;
  }

  /* center the home icon inside the control button */
    .mapboxgl-ctrl-home .mapboxgl-ctrl-icon {
      display: flex;                /* center children horizontally & vertically */
      align-items: center;
      justify-content: center;
      padding: 0;                   /* remove extra padding */
      background-image: none !important;  /* not stack default bg icon */
    }

    /* size the SVG to sit centered */
    .mapboxgl-ctrl-home .mapboxgl-ctrl-icon svg {
      width: 18px;                  
      height: 18px;
      display: block;               /* remove baseline gap */
      pointer-events: none;         /* click passes to the button */
      fill: currentColor;           /* match Mapbox control color */
    }

  .globe-map {
    position: absolute;
    bottom: 32px;
    left: 8px;
    z-index: 3;
    background: rgba(51,51,51,0.9);
    border-radius: 6px;
    overflow: visible;          /* allows popouts to extend */
    display: flex;              /* lay buttons out in a row */
    font-family: Arial, Helvetica, sans-serif;
  }

  .globe-map button.active {
  background: #6EB7B8;
  border-radius: 6px;
  }

  .globe-map button {
    font-size: 14px;
    color: white;
    padding: 10px 14px;
    border: 0;
    background: transparent;
    cursor: pointer;
  }

  .globe-map button:hover {
    background: #6EB7B8;
    border-radius: 6px;
  }

  #right-container {
  position: absolute;            
  inset: 0 0 0 auto;             /* top:0; right:0; bottom:0; left:auto */
  width: var(--side-width);
  max-width: var(--side-width);
  display: flex;
  flex-direction: column;
  background-color: rgba(138,138,136,.6);
  z-index: 2;                    /* above the map, below navbar */
  overflow: hidden;
}

  #scatter-plot {
  flex: 0 0 auto; 
  width: 100%;
  aspect-ratio: 1 / 1;   /* height = width */
  min-height: 0;    
  padding: 4px;
  box-sizing: border-box;
}

  #image-container {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
    margin: 0;
    box-sizing: border-box;
    overflow: hidden;
  }

  .thumb-card {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  /* default for S1/S2 */
  .thumb-img {
    display: block;
    border: 0;
  }

  .thumb-label {
    color: #fff;
    margin: 4px 0 0;
    font-size: 0.9em;
    text-align: center;
  }

  #footer {
      margin-top: 1rem;
      color: rgb(204,156,172);

  }
  #footer a {
      color: rgb(204,156,172);
      text-decoration: underline;
  }
