body {
  margin: 0;
  padding: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, Sans-serif;
}

#map {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
}

h1 {
  font-size: 20px;
  line-height: 30px;
}

h2 {
  font-size: 14px;
  line-height: 20px;
  margin-bottom: 10px;
}

a {
  text-decoration: none;
  color: #2dc4b2;
}

.legend {
  line-height: 30px;
  color: #555;
}

.legend i {
  width: 18px;
  height: 18px;
  float: left;
  margin-right: 20px;
  opacity: 0.7;
}

.info {
  padding: 6px 15px;
  font: 14px/16px Arial, Helvetica, sans-serif;
  background: rgba(255, 255, 255, 0.8);
  line-height: 20px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  border-radius: 5px;
}

.disclaimer {
  padding: 6px 15px;
  font: 14px Arial, Helvetica, sans-serif;
  background: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  border-radius: 5px;
  width: 35%;
  max-height: 300px;
  text-align: justify;
  overflow-y: auto;
}

.legend .circle {
  border-radius: 50%;
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border: 1px solid black;
}

.yearbox {
  padding: 6px 15px;
  font: 20px Arial, Helvetica, sans-serif;
  background: rgba(255, 255, 255, 0.8);
  line-height: 20px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  border-radius: 5px;
  width: 150px;
  text-align: center;
}

.secondary-right-panel {
  margin-bottom: 8px;
}

/* Mode 3 & 4: matched width per mode for stacked right panels */
.right-stack-panel-mode3 {
  width: 248px;
  box-sizing: border-box;
}

.right-stack-panel-mode4 {
  width: 240px;
  box-sizing: border-box;
}

.yearbox.right-stack-panel-mode3.secondary-right-panel,
.yearbox.right-stack-panel-mode4.secondary-right-panel {
  padding: 10px 14px;
  text-align: left;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

.leaflet-popup-content {
  max-width: 350px;
  max-height: 250px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.5;
}

.stats-panel {
  padding: 10px 14px;
  font: 14px/1.45 Arial, Helvetica, sans-serif;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  border-radius: 5px;
  min-width: 300px;
}

.stats-panel h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.stats-panel .bar-row {
  display: flex;
  align-items: center;
  margin: 3px 0;
  font-size: 12px;
}

.stats-panel .bar-label {
  width: 42px;
  text-align: right;
  margin-right: 6px;
  flex-shrink: 0;
}

.stats-panel .bar-track {
  flex: 1;
  height: 14px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 2px;
  overflow: hidden;
  display: flex;
}

.stats-panel .bar-geo {
  background: #2d8a4e;
  height: 100%;
}

.stats-panel .bar-nongeo {
  background: #bbb;
  height: 100%;
}

.stats-panel .bar-count {
  width: 28px;
  margin-left: 5px;
  font-size: 11px;
  flex-shrink: 0;
}

.stats-panel .section {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid #ddd;
}

.stats-panel label {
  display: block;
  font-size: 16px;
  line-height: 1.25;
  margin: 1px 0;
  cursor: pointer;
}

.stats-panel label input {
  margin-right: 4px;
}

.stats-panel select {
  font-size: 15px;
  line-height: 1.2;
  padding: 2px 4px;
}

.mode-box select {
  font-size: 19px;
  line-height: 1.15;
  padding: 1px 4px;
}

.mode-box {
  border: 2px solid #4a5a70;
  background: #eaf3ff;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.mode-box .mode-title {
  font-size: 14px;
  color: #223247;
  margin-bottom: 5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.controls-box {
  border-top: 1px solid #d9d9d9;
  padding-top: 8px;
}

.controls-box label {
  font-size: 20px;
  line-height: 1.2;
}

/* Top-left: stats panel with zoom/info stacked in the right column */
.leaflet-top.leaflet-left {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto;
  align-items: start;
  margin: 18px 0 0 18px !important;
  column-gap: 10px;
}

.leaflet-top.leaflet-left > .leaflet-control {
  margin: 0 !important;
}

.leaflet-top.leaflet-left > .leaflet-control:has(.stats-panel) {
  grid-column: 1;
  grid-row: 1;
}

.leaflet-top.leaflet-left > .leaflet-control-zoom,
.leaflet-top.leaflet-left > .leaflet-control.easy-button-container {
  grid-column: 2;
  grid-row: 1;
}

/* Stack info below zoom in the same cell (2×26px buttons + 20px gap) */
.leaflet-top.leaflet-left > .leaflet-control.easy-button-container {
  margin-top: 72px !important;
}

.leaflet-touch .leaflet-top.leaflet-left > .leaflet-control.easy-button-container {
  margin-top: 80px !important;
}


