html,
body {
  height: 100%;
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif;
  color: #13233d;
  background:
    radial-gradient(circle at top left, rgba(122, 181, 255, 0.32), transparent 28%),
    linear-gradient(180deg, #eff7ff 0%, #d9ebff 100%);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(460px, 700px);
  height: 100%;
}

#map {
  height: 100%;
  position: relative;
  background:
    radial-gradient(circle at 20% 20%, rgba(122, 190, 255, 0.26), transparent 34%),
    linear-gradient(180deg, #d9ecff 0%, #bfddf7 100%);
}

.panel {
  padding: 18px 20px;
  overflow: auto;
  border-left: 1px solid rgba(45, 88, 145, 0.12);
  background:
    linear-gradient(180deg, rgba(250, 253, 255, 0.98) 0%, rgba(238, 246, 255, 0.98) 100%);
  box-shadow: -18px 0 36px rgba(35, 70, 122, 0.10);
}

.panelHero {
  margin-bottom: 14px;
  padding: 18px 18px 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(79, 128, 198, 0.12);
  box-shadow: 0 14px 28px rgba(57, 98, 156, 0.08);
}

.title {
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: -0.025em;
  font-size: 25px;
  line-height: 1.05;
  color: #102c56;
}

.hint {
  color: #49627f;
  font-size: 13px;
  margin: 6px 0 12px;
  line-height: 1.45;
}

.section {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(79, 128, 198, 0.12);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: 0 14px 32px rgba(57, 98, 156, 0.08);
  backdrop-filter: blur(6px);
}

.section h3 {
  font-size: 13px;
  margin: 0 0 10px;
  color: #355781;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  align-items: end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

label {
  font-size: 12px;
  color: #23415f;
  font-weight: 650;
}

select,
input[type="range"],
button {
  font: inherit;
}

select {
  padding: 8px 11px;
  border: 1px solid rgba(114, 150, 201, 0.40);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  min-width: 0;
  max-width: 100%;
  color: #183250;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.inline {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.pill-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(114, 156, 218, 0.32);
  background: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  max-width: 100%;
  box-shadow: 0 8px 20px rgba(70, 115, 179, 0.08);
}

.pill-group label {
  font-weight: 700;
  margin-right: 6px;
}

.pill-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  cursor: pointer;
}

.pill-option input {
  accent-color: #2e66d0;
}

.pill-select {
  appearance: none;
  border: none;
  background: transparent;
  font: inherit;
  font-weight: 600;
  padding: 2px 16px 2px 4px;
  cursor: pointer;
  min-width: 0;
  max-width: 100%;
}

.pill-select-wrapper {
  position: relative;
}

.pill-select-wrapper::after {
  content: "▾";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  pointer-events: none;
  opacity: 0.7;
}

.sliderRow {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.sliderValue {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: #2a4d76;
  white-space: nowrap;
}

.chartTitle {
  font-size: 14px;
  font-weight: 800;
  margin: 0 0 8px;
  color: #173b73;
}

.chartCanvasWrap {
  position: relative;
  height: 380px;
}

.chartCanvasWrap-line {
  height: 340px;
}

#barChart,
#lineChart {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.chartActions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 6px 0 10px;
  flex-wrap: wrap;
}

button {
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(96, 138, 204, 0.36);
  background: linear-gradient(180deg, #ffffff 0%, #eaf3ff 100%);
  cursor: pointer;
  color: #163f78;
  font-weight: 650;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

button:hover {
  background: linear-gradient(180deg, #ffffff 0%, #dcecff 100%);
  box-shadow: 0 10px 22px rgba(71, 112, 176, 0.14);
  transform: translateY(-1px);
}

canvas {
  max-width: 100%;
}

a {
  color: #1d58b7;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.legend {
  background: rgba(255, 255, 255, 0.94);
  padding: 10px;
  border-radius: 14px;
  box-shadow: 0 18px 30px rgba(44, 86, 145, 0.16);
  font-size: 12px;
  line-height: 1.1;
  border: 1px solid rgba(90, 137, 209, 0.18);
}

.legend .bar {
  width: 220px;
  height: 12px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  margin: 6px 0;
}

.legend .labels {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-variant-numeric: tabular-nums;
}

.legend .title {
  margin: 0;
  font-weight: 800;
  font-size: 12px;
}

.legend .units {
  margin-top: 4px;
  color: #54719a;
}

.info-icon {
  display: inline-flex;
  align-items: center;
  position: relative;
  margin-left: 6px;
  cursor: help;
  user-select: none;
}

.tooltip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  z-index: 10;
  left: 0;
  top: 120%;
  width: 260px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(19, 46, 89, 0.94);
  color: #fff;
  font-size: 12px;
  line-height: 1.35;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  transition: opacity 0.15s ease;
}

.info-icon:hover .tooltip,
.info-icon:focus-within .tooltip {
  visibility: visible;
  opacity: 1;
}

@media (max-width: 920px) {
  .layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  #map {
    min-height: 52vh;
  }

  .panel {
    border-left: none;
    border-top: 1px solid rgba(45, 88, 145, 0.12);
    box-shadow: none;
  }
}

@media (max-width: 640px) {
  .grid {
    grid-template-columns: 1fr;
  }
}
